My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
polys
sbuckets.h
Go to the documentation of this file.
1
/****************************************
2
* Computer Algebra System SINGULAR *
3
****************************************/
4
/***************************************************************
5
* File: sbuckets.h
6
* Purpose: declaration of routines for sorting and adding up polys using
7
* a bucket sort
8
* Note: If you need to extract the leading momonial of a bucket,
9
* use kbuckets, instead.
10
* Author: obachman (Olaf Bachmann)
11
* Created: 9/00
12
*******************************************************************/
13
#ifndef S_BUCKETS_H
14
#define S_BUCKETS_H
15
#include "
polys/monomials/ring.h
"
16
class
sBucket
;
typedef
sBucket
*
sBucket_pt
;
17
18
//////////////////////////////////////////////////////////////////////////
19
// Creation/Destruction of buckets
20
//
21
sBucket_pt
sBucketCreate
(ring r);
22
void
sBucketDestroy
(
sBucket_pt
*bucket);
23
24
//////////////////////////////////////////////////////////////////////////
25
// New API:
26
//
27
28
/// Copy sBucket non-intrusive!!!
29
sBucket_pt
sBucketCopy
(
const
sBucket_pt
bucket);
30
31
/// Returns bucket ring
32
ring
sBucketGetRing
(
const
sBucket_pt
bucket);
33
34
/// Test whether bucket is empty!?
35
bool
sIsEmpty
(
const
sBucket_pt
bucket);
36
37
38
39
/////////////////////////////////////////////////////////////////////////////
40
// Conversion from/to SBpolys
41
//
42
43
// Converts p into a bucket poly (SBpoly) and destroys p
44
// Assumes length <= 0 || pLength(p) == length
45
// void sBucketInit(sBucket_pt bucket, poly p, int length);
46
47
// creates and returns new bucket, initializes it with p
48
// sBucket_pt sBucketInit( poly p, int length, ring r = currRing);
49
50
// Converts SBpoly into a poly and clears bucket
51
// i.e., afterwards SBpoly == 0
52
// assumes all monomials in bucket are different
53
void
sBucketClearMerge
(
sBucket_pt
bucket, poly *
p
,
int
*
length
);
54
55
// Converts SBpoly into a poly and clears bucket
56
// i.e., afterwards SBpoly == 0
57
// bucket may contain equal monials
58
void
sBucketClearAdd
(
sBucket_pt
bucket, poly *
p
,
int
*
length
);
59
60
// Converts SBpoly into a poly and destroys bucket
61
inline
void
sBucketDestroyMerge
(
sBucket_pt
bucket, poly *
p
,
int
*
length
)
62
{
63
sBucketClearMerge
(bucket,
p
,
length
);
64
sBucketDestroy
(&bucket);
65
}
66
67
// Converts SBpoly into a poly and destroys bucket
68
inline
void
sBucketDestroyAdd
(
sBucket_pt
bucket, poly *
p
,
int
*
length
)
69
{
70
sBucketClearAdd
(bucket,
p
,
length
);
71
sBucketDestroy
(&bucket);
72
}
73
74
void
sBucketDeleteAndDestroy
(
sBucket_pt
*bucket_pt);
75
76
poly
sBucketPeek
(
sBucket_pt
b
);
77
//////////////////////////////////////////////////////////////////////////
78
79
/// Merges p into Spoly: assumes Bpoly and p have no common monoms
80
/// destroys p!
81
void
sBucket_Merge_p
(
sBucket_pt
bucket, poly
p
,
int
lp);
82
void
sBucket_Merge_m
(
sBucket_pt
bucket, poly
p
);
83
84
/// adds poly p to bucket
85
/// destroys p!
86
void
sBucket_Add_p
(
sBucket_pt
bucket, poly
p
,
int
lp);
87
void
sBucket_Add_m
(
sBucket_pt
bucket, poly
p
);
88
89
90
//////////////////////////////////////////////////////////////////////////
91
///
92
/// Sorts p with bucketSort: assumes all monomials of p are different
93
///
94
poly
sBucketSortMerge
(poly
p
,
const
ring r);
95
96
//////////////////////////////////////////////////////////////////////////
97
///
98
/// Sorts p with bucketSort: p may have equal monomials
99
///
100
poly
sBucketSortAdd
(poly
p
,
const
ring r);
101
102
103
//////////////////////////////////////////////////////////////////////////
104
void
sBucketCanonicalize
(
sBucket_pt
bucket);
105
char
*
sBucketString
(
sBucket_pt
bucket);
106
void
sBucketPrint
(
sBucket_pt
bucket);
107
#endif
// P_BUCKET_SORT
p
int p
Definition
cfModGcd.cc:4086
b
CanonicalForm b
Definition
cfModGcd.cc:4111
length
static BOOLEAN length(leftv result, leftv arg)
Definition
interval.cc:257
ring.h
sBucket
Definition
sbuckets.cc:30
sBucketPrint
void sBucketPrint(sBucket_pt bucket)
Definition
sbuckets.cc:466
sBucketString
char * sBucketString(sBucket_pt bucket)
Definition
sbuckets.cc:461
sBucketDeleteAndDestroy
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
Definition
sbuckets.cc:110
sIsEmpty
bool sIsEmpty(const sBucket_pt bucket)
Test whether bucket is empty!?
Definition
sbuckets.cc:50
sBucketClearMerge
void sBucketClearMerge(sBucket_pt bucket, poly *p, int *length)
Definition
sbuckets.cc:237
sBucket_Merge_p
void sBucket_Merge_p(sBucket_pt bucket, poly p, int lp)
Merges p into Spoly: assumes Bpoly and p have no common monoms destroys p!
Definition
sbuckets.cc:148
sBucket_Add_p
void sBucket_Add_p(sBucket_pt bucket, poly p, int lp)
adds poly p to bucket destroys p!
Definition
sbuckets.cc:203
sBucketCopy
sBucket_pt sBucketCopy(const sBucket_pt bucket)
Copy sBucket non-intrusive!!!
Definition
sbuckets.cc:70
sBucket_pt
sBucket * sBucket_pt
Definition
sbuckets.h:16
sBucketDestroyAdd
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
Definition
sbuckets.h:68
sBucketCreate
sBucket_pt sBucketCreate(ring r)
Definition
sbuckets.cc:96
sBucketCanonicalize
void sBucketCanonicalize(sBucket_pt bucket)
Definition
sbuckets.cc:401
sBucketDestroy
void sBucketDestroy(sBucket_pt *bucket)
Definition
sbuckets.cc:103
sBucket_Add_m
void sBucket_Add_m(sBucket_pt bucket, poly p)
Definition
sbuckets.cc:173
sBucketSortMerge
poly sBucketSortMerge(poly p, const ring r)
Sorts p with bucketSort: assumes all monomials of p are different.
Definition
sbuckets.cc:332
sBucketClearAdd
void sBucketClearAdd(sBucket_pt bucket, poly *p, int *length)
Definition
sbuckets.cc:275
sBucketSortAdd
poly sBucketSortAdd(poly p, const ring r)
Sorts p with bucketSort: p may have equal monomials.
Definition
sbuckets.cc:368
sBucket_Merge_m
void sBucket_Merge_m(sBucket_pt bucket, poly p)
Definition
sbuckets.cc:127
sBucketPeek
poly sBucketPeek(sBucket_pt b)
Definition
sbuckets.cc:455
sBucketDestroyMerge
void sBucketDestroyMerge(sBucket_pt bucket, poly *p, int *length)
Definition
sbuckets.h:61
sBucketGetRing
ring sBucketGetRing(const sBucket_pt bucket)
Returns bucket ring.
Definition
sbuckets.cc:46
Generated on
for My Project by
doxygen 1.17.0
for
Singular