1 | #ifndef GRING_SUPER_COMMUTATIVE_ALGEBRA_H |
---|
2 | #define GRING_SUPER_COMMUTATIVE_ALGEBRA_H |
---|
3 | |
---|
4 | /**************************************** |
---|
5 | * Computer Algebra System SINGULAR * |
---|
6 | ****************************************/ |
---|
7 | /* $Id: sca.h,v 1.1 2007-01-03 00:04:00 motsak Exp $ */ |
---|
8 | |
---|
9 | #include <structs.h> |
---|
10 | // #include <polys-impl.h> |
---|
11 | // #include <ring.h> |
---|
12 | #include <gring.h> |
---|
13 | |
---|
14 | inline bool rIsSCA(ring r) |
---|
15 | { |
---|
16 | if(!rIsPluralRing(r)) |
---|
17 | return false; |
---|
18 | |
---|
19 | const bool result = (ncRingType(r) == nc_exterior); |
---|
20 | |
---|
21 | // if( result ) |
---|
22 | // assume( ((scaFirstAltVar(r) != 0) && (scaLastAltVar(r) != 0)) ); |
---|
23 | |
---|
24 | return(result); |
---|
25 | } |
---|
26 | |
---|
27 | |
---|
28 | inline unsigned int scaFirstAltVar(ring r) |
---|
29 | { |
---|
30 | assume(rIsSCA(r)); |
---|
31 | |
---|
32 | #ifdef HAVE_PLURAL |
---|
33 | return (r->nc->FirstAltVar()); |
---|
34 | #else |
---|
35 | return (0); // |
---|
36 | #endif |
---|
37 | }; |
---|
38 | |
---|
39 | inline unsigned int scaLastAltVar(ring r) |
---|
40 | { |
---|
41 | assume(rIsSCA(r)); |
---|
42 | |
---|
43 | #ifdef HAVE_PLURAL |
---|
44 | return (r->nc->LastAltVar()); |
---|
45 | #else |
---|
46 | return (0); // |
---|
47 | #endif |
---|
48 | }; |
---|
49 | |
---|
50 | inline void scaFirstAltVar(ring r, int n) |
---|
51 | { |
---|
52 | assume(rIsSCA(r)); |
---|
53 | |
---|
54 | #ifdef HAVE_PLURAL |
---|
55 | r->nc->FirstAltVar() = n; |
---|
56 | #endif |
---|
57 | }; |
---|
58 | |
---|
59 | inline void scaLastAltVar(ring r, int n) |
---|
60 | { |
---|
61 | assume(rIsSCA(r)); |
---|
62 | |
---|
63 | #ifdef HAVE_PLURAL |
---|
64 | r->nc->LastAltVar() = n; |
---|
65 | #endif |
---|
66 | }; |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | /////////////////////////////////////////////////////////////////////////////////////////// |
---|
73 | // fast procedures for for SuperCommutative Algebras: |
---|
74 | /////////////////////////////////////////////////////////////////////////////////////////// |
---|
75 | |
---|
76 | // this is not a basic operation... but it for efficiency we did it specially for SCA: |
---|
77 | // return x_i * pPoly; preserve pPoly. |
---|
78 | poly xi_Mult_pp(unsigned int i, const poly pPoly, const ring rRing); |
---|
79 | |
---|
80 | // set pProcs for r and the variable p_Procs |
---|
81 | // should be used by p_ProcsSet in "p_Procs_Set.h" |
---|
82 | void SetProcsSCA(ring& rGR, p_Procs_s* p_Procs); |
---|
83 | |
---|
84 | // is this an exterior algebra or a commutative polynomial ring \otimes exterior algebra? |
---|
85 | // we should check whether qr->qideal is of the form: y_i^2, y_{i+1}^2, \ldots, y_j^2 (j > i) |
---|
86 | // if yes, setup qr->nc->type, etc. |
---|
87 | // should be used inside QRing definition! |
---|
88 | // NOTE: (&TODO): Factors of SuperCommutative Algebras are not supported this way! |
---|
89 | bool SetupSCA(ring& rGR, const ring rG); |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | // tests whether p is sca(y)-homogeneous without respect to the actual weigths(=>all ones) |
---|
95 | BOOLEAN p_IsYHomogeneous(const poly p, const ring r); |
---|
96 | |
---|
97 | // returns true if id is sca(y)-homogenous without respect to the aktual weights(=> all ones) |
---|
98 | BOOLEAN id_IsYHomogeneous(const ideal id, const ring r); |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | // #define PLURAL_INTERNAL_DECLARATIONS |
---|
103 | |
---|
104 | #ifdef PLURAL_INTERNAL_DECLARATIONS |
---|
105 | // poly functions defined in p_Procs : |
---|
106 | |
---|
107 | // return pPoly * pMonom; preserve pPoly and pMonom. |
---|
108 | poly sca_pp_Mult_mm(const poly pPoly, const poly pMonom, const ring rRing, poly &); |
---|
109 | |
---|
110 | // return pMonom * pPoly; preserve pPoly and pMonom. |
---|
111 | poly sca_mm_Mult_pp(const poly pMonom, const poly pPoly, const ring rRing); |
---|
112 | |
---|
113 | // return pPoly * pMonom; preserve pMonom, destroy or reuse pPoly. |
---|
114 | poly sca_p_Mult_mm(poly pPoly, const poly pMonom, const ring rRing); |
---|
115 | |
---|
116 | // return pMonom * pPoly; preserve pMonom, destroy or reuse pPoly. |
---|
117 | poly sca_mm_Mult_p(const poly pMonom, poly pPoly, const ring rRing); |
---|
118 | |
---|
119 | |
---|
120 | // compute the spolynomial of p1 and p2 |
---|
121 | poly sca_SPoly(const poly p1, const poly p2, const ring r); |
---|
122 | poly sca_ReduceSpoly(const poly p1, poly p2, const ring r); |
---|
123 | |
---|
124 | // Modified Plural's Buchberger's algorithmus. |
---|
125 | ideal sca_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat); |
---|
126 | |
---|
127 | // Modified modern Sinuglar Buchberger's algorithm. |
---|
128 | ideal sca_bba(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat); |
---|
129 | |
---|
130 | // Modified modern Sinuglar Mora's algorithm. |
---|
131 | ideal sca_mora(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat); |
---|
132 | #endif |
---|
133 | |
---|
134 | |
---|
135 | #endif // #ifndef GRING_SUPER_COMMUTATIVE_ALGEBRA_H |
---|
136 | |
---|