Loading...
Searching...
No Matches
gms.h File Reference
`#include "kernel/mod2.h"`
`#include "polys/matpol.h"`
`#include "kernel/structs.h"`
`#include "kernel/ideals.h"`
`#include "Singular/lists.h"`

Go to the source code of this file.

## Functions

lists | gmsNF (ideal p, ideal g, matrix B, int D, int K)
BOOLEAN | gmsNF (leftv res, leftv h)

## Function Documentation

## gmsNF() [1/2]

lists gmsNF | ( | ideal | p,
|  | ideal | g,
|  | matrix | B,
|  | int | D,
|  | int | K )

Definition at line 22 of file gms.cc.

{
ideal r=idInit(IDELEMS(p),1);
ideal q=idInit(IDELEMS(p),1);
matrix B0=mpNew(MATROWS(B),MATCOLS(B));
for(int i=1;i<=MATROWS(B0);i++)
for(int j=1;j<=MATCOLS(B0);j++)
if(MATELEM(B,i,j)!=NULL)
MATELEM(B0,i,j)=pDiff(MATELEM(B,i,j),i+1);
for(int k=0;k<IDELEMS(p);k++)
{
while(p->m[k]!=NULL&&pGetExp(p->m[k],1)<=K)
{
int j=0;
while(j<IDELEMS(g)&&!pLmDivisibleBy(g->m[j],p->m[k]))
j++;
if(j<IDELEMS(g))
{
poly m=pDivideM(pHead(p->m[k]),pHead(g->m[j]));
p->m[k]=pSub(p->m[k],ppMult_mm(g->m[j],m));
pIncrExp(m,1);
pSetm(m);
for(int i=0;i<MATROWS(B);i++)
{
poly m0=pDiff(m,i+2);
if(MATELEM(B0,i+1,j+1)!=NULL)
p->m[k]=pAdd(p->m[k],ppMult_mm(MATELEM(B0,i+1,j+1),m));
if(MATELEM(B,i+1,j+1)!=NULL&&m0!=NULL)
p->m[k]=pAdd(p->m[k],ppMult_mm(MATELEM(B,i+1,j+1),m0));
pDelete(&m0);
}
pDelete(&m);
}
else
{
poly p0=p->m[k];
pIter(p->m[k]);
pNext(p0)=NULL;
r->m[k]=pAdd(r->m[k],p0);
}
while(p->m[k]!=NULL&&pGetExp(p->m[k],1)<=K&&pWTotaldegree(p->m[k])>D)
{
int i=pGetExp(p->m[k],1);
do
{
poly p0=p->m[k];
pIter(p->m[k]);
pNext(p0)=NULL;
q->m[k]=pAdd(q->m[k],p0);
}while(p->m[k]!=NULL&&pGetExp(p->m[k],1)==i);
}
pNormalize(p->m[k]);
}
q->m[k]=pAdd(q->m[k],p->m[k]);
p->m[k]=NULL;
}
idDelete(&p);
idDelete((ideal *)&B0);
id_Normalize(r, currRing);
id_Normalize(q, currRing);
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=r;
l->m[1].rtyp=IDEAL_CMD;
l->m[1].data=q;
return l;
}
l
int l
Definition cfEzgcd.cc:100
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
g
g
Definition cfModGcd.cc:4098
B
b *CanonicalForm B
Definition facBivar.cc:52
j
int j
Definition facHensel.cc:110
D
#define D(A)
Definition gentable.cc:128
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
matrix
ip_smatrix * matrix
Definition matpol.h:43
MATROWS
#define MATROWS(i)
Definition matpol.h:26
MATCOLS
#define MATCOLS(i)
Definition matpol.h:27
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36
lists
slists * lists
Definition mpr_numeric.h:146
omAllocBin
#define omAllocBin(bin)
Definition omAllocDecl.h:205
NULL
#define NULL
Definition omList.c:12
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
pDelete
#define pDelete(p_ptr)
Definition polys.h:187
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68
pSetm
#define pSetm(p)
Definition polys.h:272
ppMult_mm
#define ppMult_mm(p, m)
Definition polys.h:202
pDiff
#define pDiff(a, b)
Definition polys.h:297
pSub
#define pSub(a, b)
Definition polys.h:288
pDivideM
#define pDivideM(a, b)
Definition polys.h:295
pIncrExp
#define pIncrExp(p, i)
Definition polys.h:44
pLmDivisibleBy
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition polys.h:141
pGetExp
#define pGetExp(p, i)
Exponent.
Definition polys.h:42
pNormalize
#define pNormalize(p)
Definition polys.h:318
pWTotaldegree
#define pWTotaldegree(p)
Definition polys.h:284
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_Normalize
void id_Normalize(ideal I, const ring r)
normialize all polys in id
Definition simpleideals.cc:1983
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## gmsNF() [2/2]

BOOLEAN gmsNF | ( | leftv | res,
|  | leftv | h )

Definition at line 102 of file gms.cc.

{
if(currRingHdl)
{
if(h&&h->Typ()==IDEAL_CMD)
{
ideal p=(ideal)h->CopyD();
h=h->next;
if(h&&h->Typ()==IDEAL_CMD)
{
ideal g=(ideal)h->Data();
h=h->next;
if(h&&h->Typ()==MATRIX_CMD)
{
matrix B=(matrix)h->Data();
h=h->next;
if(h&&h->Typ()==INT_CMD)
{
int D=(int)(long)h->Data();
h=h->next;
if(h&&h->Typ()==INT_CMD)
{
int K=(int)(long)h->Data();
res->rtyp=LIST_CMD;
res->data=(void *)gmsNF(p,g,B,D,K);
return FALSE;
}
}
}
}
}
WerrorS("<ideal>,<ideal>,<matrix>,<int>,<int> expected");
return TRUE;
}
WerrorS("no ring active");
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
res
CanonicalForm res
Definition facAbsFact.cc:60
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
gmsNF
lists gmsNF(ideal p, ideal g, matrix B, int D, int K)
Definition gms.cc:22
MATRIX_CMD
@ MATRIX_CMD
Definition grammar.cc:287
currRingHdl
VAR idhdl currRingHdl
Definition ipid.cc:57
h
STATIC_VAR Poly * h
Definition janet.cc:971
LIST_CMD
@ LIST_CMD
Definition tok.h:118
INT_CMD
@ INT_CMD
Definition tok.h:96