source: git/kernel/sca.h @ 5a9e7b

spielwiese
Last change on this file since 5a9e7b was 6dbc96, checked in by Motsak Oleksandr <motsak@…>, 17 years ago
*motsak: adding suppercommutative algebras git-svn-id: file:///usr/local/Singular/svn/trunk@9619 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.7 KB
Line 
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
14inline 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
28inline 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
39inline 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
50inline 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
59inline 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.
78poly 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"
82void 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!
89bool 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)
95BOOLEAN 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)
98BOOLEAN 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.
108poly sca_pp_Mult_mm(const poly pPoly, const poly pMonom, const ring rRing, poly &);
109
110// return pMonom * pPoly; preserve pPoly and pMonom.
111poly sca_mm_Mult_pp(const poly pMonom, const poly pPoly, const ring rRing);
112
113// return pPoly * pMonom; preserve pMonom, destroy or reuse pPoly.
114poly sca_p_Mult_mm(poly pPoly, const poly pMonom, const ring rRing);
115
116// return pMonom * pPoly; preserve pMonom, destroy or reuse pPoly.
117poly sca_mm_Mult_p(const poly pMonom, poly pPoly, const ring rRing);
118
119
120// compute the spolynomial of p1 and p2
121poly sca_SPoly(const poly p1, const poly p2, const ring r);
122poly sca_ReduceSpoly(const poly p1, poly p2, const ring r);
123
124// Modified Plural's Buchberger's algorithmus.
125ideal sca_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat);
126
127// Modified modern Sinuglar Buchberger's algorithm.
128ideal sca_bba(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat);
129
130// Modified modern Sinuglar Mora's algorithm.
131ideal 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
Note: See TracBrowser for help on using the repository browser.