All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
units.h File Reference

Go to the source code of this file.

Functions

ideal redNF (ideal N, ideal M, matrix U=NULL, int d=-1, intvec *w=NULL)
 
poly redNF (ideal N, poly p, poly u=NULL, int d=-1, intvec *w=NULL)
 

Function Documentation

ideal redNF ( ideal  N,
ideal  M,
matrix  U = NULL,
int  d = -1,
intvec w = NULL 
)

Definition at line 21 of file units.cc.

22 {
23  matrix U0=NULL;
24  if(U!=NULL)
25  {
26  U0=mp_Copy(U,currRing);
27  number u0;
28  for(int i=IDELEMS(M)-1;i>=0;i--)
29  {
30  u0=nInvers(pGetCoeff(MATELEM(U0,i+1,i+1)));
31  MATELEM(U0,i+1,i+1)=pMult_nn(MATELEM(U0,i+1,i+1),u0);
32  M->m[i]=pMult_nn(M->m[i],u0);
33  }
34  }
35  ideal M0=idInit(IDELEMS(M),M->rank);
36  ideal M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
37  while(idElem(M1)>0&&(d==-1||id_MinDegW(M1,w,currRing)<=d))
38  {
39  for(int i=IDELEMS(M)-1;i>=0;i--)
40  {
41  M0->m[i]=pAdd(M0->m[i],pHead(pCopy(M1->m[i])));
42  if(U0!=NULL)
43  M->m[i]=pSub(M->m[i],pMult(pHead(pCopy(M1->m[i])),
44  pCopy(MATELEM(U0,i+1,i+1))));
45  else
46  M->m[i]=pSub(M->m[i],pHead(pCopy(M1->m[i])));
47  }
48  idDelete(&M1);
49  M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
50  }
51  idDelete(&M1);
52  idDelete(&N);
53  idDelete(&M);
54  if(U0!=NULL)
55  idDelete((ideal*)&U0);
56  return M0;
57 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define pAdd(p, q)
Definition: polys.h:186
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pSub(a, b)
Definition: polys.h:270
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
#define KSTD_NF_ECART
Definition: kstd1.h:19
#define pMult_nn(p, n)
Definition: polys.h:183
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define IDELEMS(i)
Definition: simpleideals.h:24
#define nInvers(a)
Definition: numbers.h:33
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
#define pMult(p, q)
Definition: polys.h:190
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
int idElem(const ideal F)
count non-zero elements
int id_MinDegW(ideal M, intvec *w, const ring r)
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define MATELEM(mat, i, j)
Definition: matpol.h:29
poly redNF ( ideal  N,
poly  p,
poly  u = NULL,
int  d = -1,
intvec w = NULL 
)

Definition at line 59 of file units.cc.

60 {
61  ideal M=idInit(1,pGetComp(p));
62  M->m[0]=p;
63  ideal M0;
64  if(u==NULL)
65  M0=redNF(N,M,NULL,d,w);
66  else
67  {
68  matrix U=mpNew(1,1);
69  MATELEM(U,1,1)=u;
70  M0=redNF(N,M,U,d,w);
71  idDelete((ideal*)&U);
72  }
73  poly p0=M0->m[0];
74  M0->m[0]=NULL;
75  idDelete(&M0);
76  return p0;
77 }
ideal redNF(ideal N, ideal M, matrix U, int d, intvec *w)
Definition: units.cc:21
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
return P p
Definition: myNF.cc:203
#define pGetComp(p)
Component.
Definition: polys.h:37
#define M
Definition: sirandom.c:24
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
#define MATELEM(mat, i, j)
Definition: matpol.h:29