Loading...
Searching...
No Matches
loctriv.cc
Go to the documentation of this file.
/*
*
*
* Module file for computing locally trivial vector fields
* by a Groebner basis computation similar to the syzygies
*
*/
#include "kernel/ideals.h"
#include "libpolys/polys/monomials/ring.h"
#include "kernel/GBEngine/kstd1.h"
#include "libpolys/polys/prCopy.h"
#include "Singular/tok.h"
#include "Singular/ipshell.h"
#include "Singular/mod_lib.h"
#include "Singular/ipid.h"
static BOOLEAN kstd(leftv res, leftv args)
{
const short t1[]={2,MODUL_CMD,INT_CMD};
if (iiCheckTypes(args,t1,1))
{
ideal h1=(ideal)args->CopyD();
int k=(int)(long)args->next->Data();
ideal s_h1;
ideal s_h3;
ring orig_ring;
ring syz_ring;
intvec *w=NULL;
assume(currRing != NULL);
orig_ring=currRing;
syz_ring=rAssure_SyzComp(orig_ring);
rSetSyzComp(k,syz_ring);
rChangeCurrRing(syz_ring);
if (orig_ring != syz_ring)
{
s_h1=idrCopyR_NoSort(h1,orig_ring,syz_ring);
}
else
{
s_h1 = h1;
}
s_h3=kStd2(s_h1,NULL,testHomog,&w,(bigintmat*)NULL,k);
if (orig_ring != syz_ring)
{
idDelete(&s_h1);
idSkipZeroes(s_h3);
rChangeCurrRing(orig_ring);
s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
rKill(syz_ring);
}
else
{
idSkipZeroes(s_h3);
}
res->data=(void *)s_h3;
res->rtyp=MODUL_CMD;
return FALSE;
}
else
return TRUE;
}
//------------------------------------------------------------------------
// initialisation of the module
extern "C" int SI_MOD_INIT(loctriv)(SModulFunctions* p)
{
p->iiAddCproc("loctriv.so","kstd",FALSE,kstd);
return (MAX_TOK);
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
intvec
Definition intvec.h:24
sleftv::CopyD
void * CopyD(int t)
Definition subexpr.cc:714
sleftv::Data
void * Data()
Definition subexpr.cc:1192
sleftv::next
leftv next
Definition subexpr.h:86
res
CanonicalForm res
Definition facAbsFact.cc:60
w
const CanonicalForm & w
Definition facAbsFact.cc:51
MODUL_CMD
@ MODUL_CMD
Definition grammar.cc:288
ideals.h
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
ipid.h
SModulFunctions
Definition ipid.h:69
rKill
void rKill(ring r)
Definition ipshell.cc:6181
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
ipshell.h
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
kstd1.h
kstd
static BOOLEAN kstd(leftv res, leftv args)
Definition loctriv.cc:17
loctriv
int SI_MOD_INIT loctriv(SModulFunctions *p)
Definition loctriv.cc:69
assume
#define assume(x)
Definition mod2.h:389
mod_lib.h
NULL
#define NULL
Definition omList.c:12
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
idrMoveR_NoSort
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:261
idrCopyR_NoSort
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition prCopy.cc:205
prCopy.h
rAssure_SyzComp
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition ring.cc:4527
rSetSyzComp
void rSetSyzComp(int k, const ring r)
Definition ring.cc:5230
ring.h
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201
leftv
sleftv * leftv
Definition structs.h:53
testHomog
@ testHomog
Definition structs.h:34
tok.h
INT_CMD
@ INT_CMD
Definition tok.h:96
MAX_TOK
@ MAX_TOK
Definition tok.h:220