source: git/kernel/sca.h @ dcbad6

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