freegb.cc
Go to the documentation of this file.
1 #include "Singular/libsingular.h"
2 
3 #ifdef HAVE_SHIFTBBA
4 static BOOLEAN freegb(leftv res, leftv args)
5 {
6  const short t1[]={2,RING_CMD,INT_CMD};
7  if (iiCheckTypes(args,t1,1))
8  {
9  ring r=(ring)args->Data();
10  int d=(int)(long)args->next->Data();
11  if (d<2)
12  {
13  WerrorS("degree must be >=2");
14  return TRUE;
15  }
16  int i=0;
17  while(r->order[i]!=0)
18  {
19  if ((r->order[i]==ringorder_c) ||(r->order[i]==ringorder_C)) i++;
20  else if ((r->block0[i]==1)&&(r->block1[i]==r->N)) i++;
21  else
22  {
23  WerrorS("only for rings with a global ordering of one block");
24  return TRUE;
25  }
26  }
27  if ((r->order[i]!=0)
29  {
30  //WerrorS("only for rings with a global ordering of one block");
31  Werror("only for rings with a global ordering of one block,i=%d, o=%d",i,r->order[i]);
32  return TRUE;
33  }
34  ring R=freeAlgebra(r,d);
35  res->rtyp=RING_CMD;
36  res->data=R;
37  return R==NULL;
38  }
39  return TRUE;
40 }
41 #endif
42 
43 //------------------------------------------------------------------------
44 // initialisation of the module
45 extern "C" int SI_MOD_INIT(freegb)(SModulFunctions* p)
46 {
47 #ifdef HAVE_SHIFTBBA
48  p->iiAddCproc("freegb.so","freeAlgebra",FALSE,freegb);
49 #endif
50  return (MAX_TOK);
51 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:755
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:96
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:216
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:88
CanonicalForm res
Definition: facAbsFact.cc:64
int i
Definition: cfEzgcd.cc:125
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:12
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:6551
#define R
Definition: sirandom.c:26
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1176
int p
Definition: cfModGcd.cc:4019
ring freeAlgebra(ring r, int d)
create the letterplace ring corresponding to r up to degree d
Definition: shiftop.cc:775
int BOOLEAN
Definition: auxiliary.h:85
static BOOLEAN freegb(leftv res, leftv args)
Definition: freegb.cc:4
void Werror(const char *fmt,...)
Definition: reporter.cc:189