Loading...
Searching...
No Matches
freealgebra.cc File Reference
`#include "Singular/libsingular.h"`
`#include "kernel/combinatorics/stairc.h"`
`#include <vector>`

Go to the source code of this file.

## Functions

static BOOLEAN | freeAlgebra (leftv res, leftv args)
static BOOLEAN | stest (leftv res, leftv args)
static BOOLEAN | btest (leftv res, leftv h)
static BOOLEAN | lpLmDivides (leftv res, leftv h)
static BOOLEAN | lpVarAt (leftv res, leftv h)
static BOOLEAN | lpUfnarovskiGraph (leftv res, leftv h)
int SI_MOD_INIT | freealgebra (SModulFunctions *p)

## Function Documentation

## btest()

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

static

Definition at line 81 of file freealgebra.cc.

{
const short t[]={1,POLY_CMD};
if (iiCheckTypes(h,t,1))
{
poly p=(poly)h->Data();
res->rtyp = INT_CMD;
res->data = (void*)(long)pLastVblock(p);
return FALSE;
}
else return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
p
int p
Definition cfModGcd.cc:4086
res
CanonicalForm res
Definition facAbsFact.cc:60
POLY_CMD
@ POLY_CMD
Definition grammar.cc:290
iiCheckTypes
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
Definition ipshell.cc:6576
h
STATIC_VAR Poly * h
Definition janet.cc:971
pLastVblock
#define pLastVblock(p)
Definition shiftop.h:32
INT_CMD
@ INT_CMD
Definition tok.h:96

## freeAlgebra()

BOOLEAN freeAlgebra | ( | leftv | res,
|  | leftv | args )

static

Definition at line 12 of file freealgebra.cc.

{
const short t1[]={2,RING_CMD,INT_CMD};
const short t2[]={3,RING_CMD,INT_CMD,INT_CMD};
if (iiCheckTypes(args, t2, 0) || iiCheckTypes(args, t1, 1))
{
ring r=(ring)args->Data();
int d=(int)(long)args->next->Data();
if (d<2)
{
WerrorS("degree must be >=2");
return TRUE;
}
int i=0;
while(r->order[i]!=0)
{
if ((r->order[i]==ringorder_c) ||(r->order[i]==ringorder_C)) i++;
else if ((r->block0[i]==1)&&(r->block1[i]==r->N)) i++;
else
{
WerrorS("only for rings with a global ordering of one block");
return TRUE;
}
}
if ((r->order[i]!=0)
|| (rHasLocalOrMixedOrdering(r)))
{
WerrorS("only for rings with a global ordering of one block");
//Werror("only for rings with a global ordering of one block,i=%d, o=%d",i,r->order[i]);
return TRUE;
}
int ncGenCount = 0;
if (iiCheckTypes(args,t2,0))
ncGenCount = (int)(long) args->next->next->Data();
ring R=freeAlgebra(r,d,ncGenCount);
res->rtyp=RING_CMD;
res->data=R;
return R==NULL;
}
return TRUE;
}
i
int i
Definition cfEzgcd.cc:132
sleftv::Data
void * Data()
Definition subexpr.cc:1192
sleftv::next
leftv next
Definition subexpr.h:86
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
freeAlgebra
static BOOLEAN freeAlgebra(leftv res, leftv args)
Definition freealgebra.cc:12
RING_CMD
@ RING_CMD
Definition grammar.cc:282
NULL
#define NULL
Definition omList.c:12
rHasLocalOrMixedOrdering
static BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:769
ringorder_C
@ ringorder_C
Definition ring.h:74
ringorder_c
@ ringorder_c
Definition ring.h:73
R
#define R
Definition sirandom.c:27

## freealgebra()

int SI_MOD_INIT freealgebra | ( | SModulFunctions * | p | ) |

Definition at line 160 of file freealgebra.cc.

{
#ifdef HAVE_SHIFTBBA
p->iiAddCproc("freealgebra.so","freeAlgebra",FALSE,freeAlgebra);
p->iiAddCproc("freealgebra.so","lpLmDivides",FALSE,lpLmDivides);
p->iiAddCproc("freealgebra.so","lpVarAt",FALSE,lpVarAt);
p->iiAddCproc("freealgebra.so","lpUfnarovskiGraph",FALSE,lpUfnarovskiGraph);
p->iiAddCproc("freealgebra.so","stest",TRUE,stest);
p->iiAddCproc("freealgebra.so","btest",TRUE,btest);
#endif
return (MAX_TOK);
}
lpUfnarovskiGraph
static BOOLEAN lpUfnarovskiGraph(leftv res, leftv h)
Definition freealgebra.cc:131
lpVarAt
static BOOLEAN lpVarAt(leftv res, leftv h)
Definition freealgebra.cc:117
btest
static BOOLEAN btest(leftv res, leftv h)
Definition freealgebra.cc:81
lpLmDivides
static BOOLEAN lpLmDivides(leftv res, leftv h)
Definition freealgebra.cc:94
stest
static BOOLEAN stest(leftv res, leftv args)
Definition freealgebra.cc:54
freeAlgebra
ring freeAlgebra(ring r, int d, int ncGenCount)
create the letterplace ring corresponding to r up to degree d
Definition shiftop.cc:942
MAX_TOK
@ MAX_TOK
Definition tok.h:220

## lpLmDivides()

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

static

Definition at line 94 of file freealgebra.cc.

{
const short t1[]={2,POLY_CMD,POLY_CMD};
const short t2[]={2,IDEAL_CMD,POLY_CMD};
if (iiCheckTypes(h,t1,0))
{
poly p=(poly)h->Data();
poly q=(poly)h->next->Data();
res->rtyp = INT_CMD;
res->data = (void*)(long)p_LPDivisibleBy(p, q, currRing);
return FALSE;
}
else if (iiCheckTypes(h,t2,1))
{
ideal I=(ideal)h->Data();
poly q=(poly)h->next->Data();
res->rtyp = INT_CMD;
res->data=(void*)(long) p_LPDivisibleBy(I, q, currRing);
return FALSE;
}
else return TRUE;
}
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
p_LPDivisibleBy
BOOLEAN p_LPDivisibleBy(poly a, poly b, const ring r)
Definition shiftop.cc:776

## lpUfnarovskiGraph()

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

static

Definition at line 131 of file freealgebra.cc.

{
const short t[]={1,IDEAL_CMD};
if (iiCheckTypes(h,t,1))
{
ideal I = (ideal) h->Data();
res->rtyp = LIST_CMD;
ideal standardWords;
intvec* graph = lp_ufnarovskiGraph(I, standardWords);
lists li=(lists)omAllocBin(slists_bin);
li->Init(2);
li->m[0].rtyp=INTMAT_CMD;
li->m[1].rtyp=IDEAL_CMD;
li->m[0].data=graph;
li->m[1].data=standardWords;
res->data = li;
if (errorreported) return TRUE;
return FALSE;
}
else return TRUE;
}
intvec
Definition intvec.h:24
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::data
void * data
Definition subexpr.h:88
slists::m
sleftv * m
Definition lists.h:46
slists::Init
INLINE_THIS void Init(int l=0)
errorreported
VAR short errorreported
Definition feFopen.cc:23
INTMAT_CMD
@ INTMAT_CMD
Definition grammar.cc:280
lp_ufnarovskiGraph
intvec * lp_ufnarovskiGraph(ideal G, ideal &standardWords)
Definition hdegree.cc:1766
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
lists
slists * lists
Definition mpr_numeric.h:146
omAllocBin
#define omAllocBin(bin)
Definition omAllocDecl.h:205
LIST_CMD
@ LIST_CMD
Definition tok.h:118

## lpVarAt()

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

static

Definition at line 117 of file freealgebra.cc.

{
const short t[]={2,POLY_CMD,INT_CMD};
if (iiCheckTypes(h,t,1))
{
poly p=(poly)h->Data();
int pos=(int)((long)(h->next->Data()));
res->rtyp = POLY_CMD;
res->data = p_LPVarAt(p, pos, currRing);
return FALSE;
}
else return TRUE;
}
p_LPVarAt
poly p_LPVarAt(poly p, int pos, const ring r)
Definition shiftop.cc:845

## stest()

BOOLEAN stest | ( | leftv | res,
|  | leftv | args )

static

Definition at line 54 of file freealgebra.cc.

{
const short t[]={2,POLY_CMD,INT_CMD};
if (iiCheckTypes(args,t,1))
{
poly p=(poly)args->CopyD();
args=args->next;
int sh=(int)((long)(args->Data()));
if (sh<0)
{
WerrorS("negative shift for pLPshift");
return TRUE;
}
int L = pLastVblock(p);
if (L+sh > currRing->N/currRing->isLPring)
{
WerrorS("pLPshift: too big shift requested\n");
return TRUE;
}
p_LPshift(p,sh,currRing);
res->data = p;
res->rtyp = POLY_CMD;
return FALSE;
}
else return TRUE;
}
sleftv::CopyD
void * CopyD(int t)
Definition subexpr.cc:714
p_LPshift
void p_LPshift(poly p, int sh, const ring ri)
Definition shiftop.cc:392