My Project
Loading...
Searching...
No Matches
loctriv.cc
Go to the documentation of this file.
1/*
2 *
3 *
4 * Module file for computing locally trivial vector fields
5 * by a Groebner basis computation similar to the syzygies
6 *
7 */
8#include "kernel/ideals.h"
12#include "Singular/tok.h"
13#include "Singular/ipshell.h"
14#include "Singular/mod_lib.h"
15#include "Singular/ipid.h"
16
17static BOOLEAN kstd(leftv res, leftv args)
18{
19 const short t1[]={2,MODUL_CMD,INT_CMD};
20 if (iiCheckTypes(args,t1,1))
21 {
22 ideal h1=(ideal)args->CopyD();
23 int k=(int)(long)args->next->Data();
24 ideal s_h1;
25 ideal s_h3;
26 ring orig_ring;
27 ring syz_ring;
28 intvec *w=NULL;
29
31 orig_ring=currRing;
32 syz_ring=rAssure_SyzComp(orig_ring);
33 rSetSyzComp(k,syz_ring);
34 rChangeCurrRing(syz_ring);
35
36 if (orig_ring != syz_ring)
37 {
38 s_h1=idrCopyR_NoSort(h1,orig_ring,syz_ring);
39 }
40 else
41 {
42 s_h1 = h1;
43 }
44
45 s_h3=kStd2(s_h1,NULL,testHomog,&w,(bigintmat*)NULL,k);
46
47 if (orig_ring != syz_ring)
48 {
49 idDelete(&s_h1);
50 idSkipZeroes(s_h3);
51 rChangeCurrRing(orig_ring);
52 s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
53 rKill(syz_ring);
54 }
55 else
56 {
57 idSkipZeroes(s_h3);
58 }
59 res->data=(void *)s_h3;
60 res->rtyp=MODUL_CMD;
61 return FALSE;
62 }
63 else
64 return TRUE;
65}
66
67//------------------------------------------------------------------------
68// initialisation of the module
69extern "C" int SI_MOD_INIT(loctriv)(SModulFunctions* p)
70{
71 p->iiAddCproc("loctriv.so","kstd",FALSE,kstd);
72 return (MAX_TOK);
73}
74
int BOOLEAN
Definition auxiliary.h:88
#define TRUE
Definition auxiliary.h:101
#define FALSE
Definition auxiliary.h:97
int k
Definition cfEzgcd.cc:99
int p
Definition cfModGcd.cc:4086
Matrices of numbers.
Definition bigintmat.h:51
void * CopyD(int t)
Definition subexpr.cc:714
void * Data()
Definition subexpr.cc:1192
leftv next
Definition subexpr.h:86
CanonicalForm res
Definition facAbsFact.cc:60
const CanonicalForm & w
Definition facAbsFact.cc:51
@ MODUL_CMD
Definition grammar.cc:288
#define idDelete(H)
delete an ideal
Definition ideals.h:29
void rKill(ring r)
Definition ipshell.cc:6174
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:6569
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:2602
static BOOLEAN kstd(leftv res, leftv args)
Definition loctriv.cc:17
int SI_MOD_INIT loctriv(SModulFunctions *p)
Definition loctriv.cc:69
#define assume(x)
Definition mod2.h:389
#define NULL
Definition omList.c:12
void rChangeCurrRing(ring r)
Definition polys.cc:16
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:261
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition prCopy.cc:205
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition ring.cc:4527
void rSetSyzComp(int k, const ring r)
Definition ring.cc:5230
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
sleftv * leftv
Definition structs.h:53
@ testHomog
Definition structs.h:34
@ INT_CMD
Definition tok.h:96
@ MAX_TOK
Definition tok.h:220