Loading...
Searching...
No Matches
units.cc File Reference
`#include "kernel/mod2.h"`
`#include "kernel/structs.h"`
`#include "coeffs/numbers.h"`
`#include "kernel/polys.h"`
`#include "kernel/ideals.h"`
`#include "misc/intvec.h"`
`#include "polys/matpol.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include "kernel/GBEngine/units.h"`

Go to the source code of this file.

## Functions

ideal | redNF (ideal N, ideal M, matrix U, int d, intvec *w)
poly | redNF (ideal N, poly p, poly u, int d, intvec *w)

## Function Documentation

## redNF() [1/2]

ideal redNF | ( | ideal | N,
|  | ideal | M,
|  | matrix | U,
|  | int | d,
|  | intvec * | w )

Definition at line 18 of file units.cc.

{
matrix U0=NULL;
if(U!=NULL)
{
U0=mp_Copy(U,currRing);
number u0;
for(int i=IDELEMS(M)-1;i>=0;i--)
{
u0=nInvers(pGetCoeff(MATELEM(U0,i+1,i+1)));
MATELEM(U0,i+1,i+1)=__p_Mult_nn(MATELEM(U0,i+1,i+1),u0,currRing);
M->m[i]=__p_Mult_nn(M->m[i],u0,currRing);
}
}
ideal M0=idInit(IDELEMS(M),M->rank);
ideal M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
while(idElem(M1)>0&&(d==-1||id_MinDegW(M1,w,currRing)<=d))
{
for(int i=IDELEMS(M)-1;i>=0;i--)
{
M0->m[i]=pAdd(M0->m[i],pHead(pCopy(M1->m[i])));
if(U0!=NULL)
M->m[i]=pSub(M->m[i],pMult(pHead(pCopy(M1->m[i])),
pCopy(MATELEM(U0,i+1,i+1))));
else
M->m[i]=pSub(M->m[i],pHead(pCopy(M1->m[i])));
}
idDelete(&M1);
M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
}
idDelete(&M1);
idDelete(&N);
idDelete(&M);
if(U0!=NULL)
idDelete((ideal*)&U0);
return M0;
}
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
i
int i
Definition cfEzgcd.cc:132
w
const CanonicalForm & w
Definition facAbsFact.cc:51
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
KSTD_NF_ECART
#define KSTD_NF_ECART
Definition kstd1.h:20
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition matpol.cc:57
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
matrix
ip_smatrix * matrix
Definition matpol.h:43
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
nInvers
#define nInvers(a)
Definition numbers.h:33
NULL
#define NULL
Definition omList.c:12
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition p_polys.h:973
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pAdd
#define pAdd(p, q)
Definition polys.h:204
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68
pSub
#define pSub(a, b)
Definition polys.h:288
pMult
#define pMult(p, q)
Definition polys.h:208
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_MinDegW
int id_MinDegW(ideal M, intvec *w, const ring r)
Definition simpleideals.cc:1994
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
idElem
static int idElem(const ideal F)
number of non-zero polys in F
Definition simpleideals.h:69
M
#define M
Definition sirandom.c:25

## redNF() [2/2]

poly redNF | ( | ideal | N,
|  | poly | p,
|  | poly | u,
|  | int | d,
|  | intvec * | w )

Definition at line 56 of file units.cc.

{
ideal M=idInit(1,pGetComp(p));
M->m[0]=p;
ideal M0;
if(u==NULL)
M0=redNF(N,M,NULL,d,w);
else
{
matrix U=mpNew(1,1);
MATELEM(U,1,1)=u;
M0=redNF(N,M,U,d,w);
idDelete((ideal*)&U);
}
poly p0=M0->m[0];
M0->m[0]=NULL;
idDelete(&M0);
return p0;
}
p
int p
Definition cfModGcd.cc:4086
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
redNF
ideal redNF(ideal N, ideal M, matrix U, int d, intvec *w)
Definition units.cc:18