Loading...
Searching...
No Matches
customstd.cc File Reference
`#include "Singular/libsingular.h"`
`#include "libpolys/polys/prCopy.h"`

Go to the source code of this file.

## Functions

static BOOLEAN | satstd (leftv res, leftv args)
static BOOLEAN | abort_if_monomial_sp (kStrategy strat)
static BOOLEAN | print_spoly (kStrategy strat)
static BOOLEAN | std_print_spoly (leftv res, leftv args)
static BOOLEAN | monomialabortstd (leftv res, leftv args)
int SI_MOD_INIT | customstd (SModulFunctions *p)

## Variables

STATIC_VAR char * | si_filename

## Function Documentation

## abort_if_monomial_sp()

BOOLEAN abort_if_monomial_sp | ( | kStrategy | strat | ) |

static

Definition at line 92 of file customstd.cc.

{
BOOLEAN b = FALSE; // set b to TRUE, if spoly was changed,
// let it remain FALSE otherwise
if (strat->P.t_p==NULL)
{
poly p=strat->P.p;
if (pNext(p)==NULL)
{
while ((strat->Ll >= 0))
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
return FALSE;
}
}
else
{
poly p=strat->P.t_p;
if (pNext(p)==NULL)
{
while ((strat->Ll >= 0))
deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
return FALSE;
}
}
return b; // return TRUE if sp was changed, FALSE if not
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
FALSE
#define FALSE
Definition auxiliary.h:97
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
skStrategy::Ll
int Ll
Definition kutil.h:350
skStrategy::P
LObject P
Definition kutil.h:301
skStrategy::L
LSet L
Definition kutil.h:326
deleteInL
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition kutil.cc:1208
pNext
#define pNext(p)
Definition monomials.h:36
NULL
#define NULL
Definition omList.c:12

## customstd()

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

Definition at line 662 of file customstd.cc.

{
// p->iiAddCproc("std_demo","std_with_display",FALSE,std_with_display);
p->iiAddCproc("customstd.lib","satstdInternal",FALSE,satstd);
// p->iiAddCproc("std_demo","satstdWithInitialCheck",FALSE,satstdWithInitialCheck);
p->iiAddCproc("customstd.lib","monomialabortstdInternal",FALSE,monomialabortstd);
// PrintS("init of std_demo - type `listvar(Std_demo);` to its contents\n");
p->iiAddCproc("customstd.lib","std_print_spoly",FALSE,std_print_spoly);
p->iiAddCproc("customstd.lib","syz_print_spoly",FALSE,std_print_spoly);
return (MAX_TOK);
}
satstd
static BOOLEAN satstd(leftv res, leftv args)
Definition customstd.cc:40
std_print_spoly
static BOOLEAN std_print_spoly(leftv res, leftv args)
Definition customstd.cc:170
monomialabortstd
static BOOLEAN monomialabortstd(leftv res, leftv args)
Definition customstd.cc:464
MAX_TOK
@ MAX_TOK
Definition tok.h:220

## monomialabortstd()

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

static

Definition at line 464 of file customstd.cc.

{
if (args!=NULL)
{
if ((args->Typ()==IDEAL_CMD) && (args->next==NULL))
{
ideal I=(ideal)args->Data();
I=kStd2(I,currRing->qideal,testHomog,NULL,(bigintmat*)NULL,0,0,NULL,abort_if_monomial_sp);
idSkipZeroes(I);
res->rtyp=IDEAL_CMD;
res->data=(char*)I;
return FALSE;
}
}
WerrorS("monomialabortstd: unexpected parameters");
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Data
void * Data()
Definition subexpr.cc:1192
sleftv::next
leftv next
Definition subexpr.h:86
abort_if_monomial_sp
static BOOLEAN abort_if_monomial_sp(kStrategy strat)
Definition customstd.cc:92
res
CanonicalForm res
Definition facAbsFact.cc:60
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
kStd2
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
Definition kstd1.cc:2607
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201
testHomog
@ testHomog
Definition structs.h:34

## print_spoly()

BOOLEAN print_spoly | ( | kStrategy | strat | ) |

static

Definition at line 120 of file customstd.cc.

{
char *s;
if (strat->P.t_p==NULL)
{
s=pString(strat->P.p);
}
else
{
poly p=strat->P.t_p;
s=p_String(p,strat->tailRing);
}
FILE *f=fopen(si_filename,"a");
fwrite(s,strlen(s),1,f);
fwrite("\n",1,1,f);
fflush(f);
fclose(f);
return FALSE; // return TRUE if sp was changed, FALSE if not
}
f
FILE * f
Definition checklibs.c:9
skStrategy::tailRing
ring tailRing
Definition kutil.h:342
si_filename
STATIC_VAR char * si_filename
Definition customstd.cc:119
s
const CanonicalForm int s
Definition facAbsFact.cc:51
p_String
char * p_String(poly p, ring lmRing, ring tailRing)
Definition polys0.cc:322
pString
char * pString(poly p)
Definition polys.h:307

## satstd()

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

static

Definition at line 40 of file customstd.cc.

{
leftv u = args;
if ((u!=NULL)
&& ((u->Typ()==IDEAL_CMD)||(u->Typ()==MODUL_CMD)))
{
ideal I=(ideal)u->Data();
leftv v = u->next;
res->rtyp=IDEAL_CMD;
ideal J;
if (v==NULL)
{
J=id_MaxIdeal(1,currRing);
}
else
{
if (v->Typ()==IDEAL_CMD)
{
J = (ideal) v->Data();
}
else
{
args->CleanUp();
WerrorS("satstd: unexpected parameters");
return TRUE;
}
}
I=id_Satstd(I,J,currRing);
#if 0 /* unused */
if (idealCache)
{
id_Delete(&I,currRing);
res->data = (char*) idealCache;
idealCache = NULL;
}
else
#endif
{
idSkipZeroes(I);
res->data=(char*)I;
}
if (v==NULL) id_Delete(&J,currRing);
args->CleanUp();
setFlag(res,FLAG_STD);
return (res->data==NULL);
}
WerrorS("satstd: unexpected parameters");
return TRUE;
}
sleftv::CleanUp
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
MODUL_CMD
@ MODUL_CMD
Definition grammar.cc:288
id_Satstd
ideal id_Satstd(const ideal I, ideal J, const ring r)
Definition ideals.cc:3363
setFlag
#define setFlag(A, F)
Definition ipid.h:113
FLAG_STD
#define FLAG_STD
Definition ipid.h:106
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
id_MaxIdeal
ideal id_MaxIdeal(const ring r)
initialise the maximal ideal (at 0)
Definition simpleideals.cc:98
leftv
sleftv * leftv
Definition structs.h:53

## std_print_spoly()

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

static

Definition at line 170 of file customstd.cc.

{
if (args!=NULL)
{
if ((args->Typ()==IDEAL_CMD) && (args->next!=NULL)
&& (args->next->Typ()==STRING_CMD))
{
si_filename=(char*)args->next->Data();
ideal I=(ideal)args->Data();
I=kStd2(I,currRing->qideal,testHomog,NULL,(bigintmat*)NULL,0,0,NULL,print_spoly);
idSkipZeroes(I);
res->rtyp=IDEAL_CMD;
res->data=(char*)I;
return FALSE;
}
}
WerrorS("std_print_spoly: unexpected parameters");
return TRUE;
}
print_spoly
static BOOLEAN print_spoly(kStrategy strat)
Definition customstd.cc:120
STRING_CMD
@ STRING_CMD
Definition tok.h:187

## Variable Documentation

## si_filename

STATIC_VAR char* si_filename

Definition at line 119 of file customstd.cc.