My Project
Loading...
Searching...
No Matches
Functions
partialgb.cc File Reference
#include "kernel/mod2.h"
#include "polys/prCopy.h"
#include "kernel/ideals.h"
#include "kernel/GBEngine/kstd1.h"
#include "Singular/ipshell.h"
#include "Singular/mod_lib.h"
#include "Singular/ipid.h"

Go to the source code of this file.

Functions

static ideal idPartialGB (ideal h1, int k)
 
static BOOLEAN partialStd (leftv res, leftv h)
 
int SI_MOD_INIT() partialgb (SModulFunctions *p)
 

Function Documentation

◆ idPartialGB()

static ideal idPartialGB ( ideal  h1,
int  k 
)
static

Definition at line 8 of file partialgb.cc.

9{
10 ideal s_h1;
11 intvec *w=NULL;
12
14 ring orig_ring=currRing;
15 ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
16 rSetSyzComp(k,syz_ring);
17 rChangeCurrRing(syz_ring);
18
19 if (orig_ring != syz_ring)
20 {
21 s_h1=idrCopyR_NoSort(h1,orig_ring, syz_ring);
22 }
23 else
24 {
25 s_h1 = h1;
26 }
27
28 ideal s_h3=kStd(s_h1,NULL,testHomog,&w,NULL,k);
29
30 if (s_h3==NULL)
31 {
32 return idFreeModule(IDELEMS(h1));
33 }
34
35 if (orig_ring != syz_ring)
36 {
37 idDelete(&s_h1);
38 idSkipZeroes(s_h3);
39 rChangeCurrRing(orig_ring);
40 s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
41 rDelete(syz_ring);
42 idTest(s_h3);
43 return s_h3;
44 }
45
46 idSkipZeroes(s_h3);
47 idTest(s_h3);
48 return s_h3;
49}
#define TRUE
Definition: auxiliary.h:100
int k
Definition: cfEzgcd.cc:99
Definition: intvec.h:23
const CanonicalForm & w
Definition: facAbsFact.cc:51
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define idTest(id)
Definition: ideals.h:47
ideal idFreeModule(int i)
Definition: ideals.h:111
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2447
#define assume(x)
Definition: mod2.h:389
#define NULL
Definition: omList.c:12
void rChangeCurrRing(ring r)
Definition: polys.cc:15
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:4435
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:450
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:5086
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define IDELEMS(i)
Definition: simpleideals.h:23
@ testHomog
Definition: structs.h:38

◆ partialgb()

int SI_MOD_INIT() partialgb ( SModulFunctions p)

Definition at line 66 of file partialgb.cc.

67{
68 p->iiAddCproc("partialgb.so","partialStd",FALSE,partialStd);
69 return (MAX_TOK);
70}
#define FALSE
Definition: auxiliary.h:96
int p
Definition: cfModGcd.cc:4078
static BOOLEAN partialStd(leftv res, leftv h)
Definition: partialgb.cc:51
@ MAX_TOK
Definition: tok.h:218

◆ partialStd()

static BOOLEAN partialStd ( leftv  res,
leftv  h 
)
static

Definition at line 51 of file partialgb.cc.

52{
53 const short t[]={2,MODUL_CMD,INT_CMD};
54 if (iiCheckTypes(h,t,1))
55 {
56 ideal i1=(ideal)h->CopyD();
57 int i2=(int)((long)h->next->Data());
58 res->rtyp=MODUL_CMD;
59 res->data=idPartialGB(i1,i2);
60 return FALSE;
61 }
62 return TRUE;
63}
CanonicalForm res
Definition: facAbsFact.cc:60
@ MODUL_CMD
Definition: grammar.cc:287
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:6572
STATIC_VAR Poly * h
Definition: janet.cc:971
static ideal idPartialGB(ideal h1, int k)
Definition: partialgb.cc:8
@ INT_CMD
Definition: tok.h:96