My Project
Loading...
Searching...
No Matches
ipshell.h File Reference
#include <stdio.h>
#include "kernel/ideals.h"
#include "Singular/lists.h"
#include "Singular/fevoices.h"

Go to the source code of this file.

Data Structures

struct  sValCmd1
 
struct  sValCmd2
 
struct  sValCmd3
 
struct  sValCmdM
 
struct  sValAssign_sys
 
struct  sValAssign
 

Typedefs

typedef BOOLEAN(* proc1) (leftv, leftv)
 
typedef BOOLEAN(* proc2) (leftv, leftv, leftv)
 
typedef BOOLEAN(* proc3) (leftv, leftv, leftv, leftv)
 
typedef BOOLEAN(* proci) (leftv, leftv, Subexpr)
 

Functions

BOOLEAN spectrumProc (leftv, leftv)
 
BOOLEAN spectrumfProc (leftv, leftv)
 
BOOLEAN spaddProc (leftv, leftv, leftv)
 
BOOLEAN spmulProc (leftv, leftv, leftv)
 
BOOLEAN semicProc (leftv, leftv, leftv)
 
BOOLEAN semicProc3 (leftv, leftv, leftv, leftv)
 
BOOLEAN iiAssignCR (leftv, leftv)
 
BOOLEAN iiARROW (leftv, char *, char *)
 
int IsCmd (const char *n, int &tok)
 
BOOLEAN iiPStart (idhdl pn, leftv sl)
 
BOOLEAN iiEStart (char *example, procinfo *pi)
 
BOOLEAN iiAllStart (procinfov pi, const char *p, feBufferTypes t, int l)
 
void type_cmd (leftv v)
 
void test_cmd (int i)
 
void list_cmd (int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname=FALSE)
 
void killlocals (int v)
 
int exprlist_length (leftv v)
 
const char * Tok2Cmdname (int i)
 
const char * iiTwoOps (int t)
 
int iiOpsTwoChar (const char *s)
 
BOOLEAN iiWRITE (leftv res, leftv exprlist)
 
BOOLEAN iiExport (leftv v, int toLev)
 
BOOLEAN iiExport (leftv v, int toLev, package pack)
 
BOOLEAN iiInternalExport (leftv v, int toLev, package pack)
 
static char * iiGetLibName (const procinfov pi)
 find the library of an proc
 
char * iiGetLibProcBuffer (procinfov pi, int part=1)
 
char * iiProcName (char *buf, char &ct, char *&e)
 
char * iiProcArgs (char *e, BOOLEAN withParenth)
 
BOOLEAN iiLibCmd (const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
 
BOOLEAN jjLOAD (const char *s, BOOLEAN autoexport=FALSE)
 load lib/module given in v
 
BOOLEAN jjLOAD_TRY (const char *s)
 
BOOLEAN iiLocateLib (const char *lib, char *where)
 
leftv iiMap (map theMap, const char *what)
 
void iiMakeResolv (resolvente r, int length, int rlen, char *name, int typ0, intvec **weights=NULL)
 
BOOLEAN jjMINRES (leftv res, leftv v)
 
BOOLEAN jjBETTI (leftv res, leftv v)
 
BOOLEAN jjBETTI2 (leftv res, leftv u, leftv v)
 
BOOLEAN jjBETTI2_ID (leftv res, leftv u, leftv v)
 
BOOLEAN jjIMPORTFROM (leftv res, leftv u, leftv v)
 
BOOLEAN jjLIST_PL (leftv res, leftv v)
 
BOOLEAN jjVARIABLES_P (leftv res, leftv u)
 
BOOLEAN jjVARIABLES_ID (leftv res, leftv u)
 
int iiRegularity (lists L)
 
leftv singular_system (sleftv h)
 
BOOLEAN jjSYSTEM (leftv res, leftv v)
 
void iiDebug ()
 
BOOLEAN iiCheckRing (int i)
 
poly iiHighCorner (ideal i, int ak)
 
char * iiConvName (const char *libname)
 
BOOLEAN iiGetLibStatus (const char *lib)
 
BOOLEAN iiLoadLIB (FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
 
lists syConvRes (syStrategy syzstr, BOOLEAN toDel=FALSE, int add_row_shift=0)
 
syStrategy syConvList (lists li)
 
BOOLEAN syBetti1 (leftv res, leftv u)
 
BOOLEAN syBetti2 (leftv res, leftv u, leftv w)
 
int siSetCpus (int cpu)
 
BOOLEAN iiExprArith1 (leftv res, sleftv *a, int op)
 
BOOLEAN iiExprArith2 (leftv res, sleftv *a, int op, sleftv *b, BOOLEAN proccall=FALSE)
 
BOOLEAN iiExprArith3 (leftv res, int op, leftv a, leftv b, leftv c)
 
BOOLEAN iiExprArithM (leftv res, sleftv *a, int op)
 
BOOLEAN iiApply (leftv res, leftv a, int op, leftv proc)
 
BOOLEAN iiAssign (leftv left, leftv right, BOOLEAN toplevel=TRUE)
 
coeffs jjSetMinpoly (coeffs cf, number a)
 
BOOLEAN iiParameter (leftv p)
 
BOOLEAN iiAlias (leftv p)
 
int iiTokType (int op)
 
int iiDeclCommand (leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring=FALSE, BOOLEAN init_b=TRUE)
 
BOOLEAN iiMake_proc (idhdl pn, package pack, leftv sl)
 
void * iiCallLibProc1 (const char *n, void *arg, int arg_type, BOOLEAN &err)
 
leftv ii_CallLibProcM (const char *n, void **args, int *arg_types, const ring R, BOOLEAN &err)
 args: NULL terminated array of arguments arg_types: 0 terminated array of corresponding types
 
ideal ii_CallProcId2Id (const char *lib, const char *proc, ideal arg, const ring R)
 
int ii_CallProcId2Int (const char *lib, const char *proc, ideal arg, const ring R)
 
char * showOption ()
 
BOOLEAN setOption (leftv res, leftv v)
 
char * versionString ()
 
void singular_example (char *str)
 
BOOLEAN iiTryLoadLib (leftv v, const char *id)
 
int iiAddCproc (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
 
void iiCheckPack (package &p)
 
void rSetHdl (idhdl h)
 
ring rInit (leftv pn, leftv rv, leftv ord)
 
idhdl rDefault (const char *s)
 
idhdl rFindHdl (ring r, idhdl n)
 
void rKill (idhdl h)
 
void rKill (ring r)
 
lists scIndIndset (ideal S, BOOLEAN all, ideal Q)
 
BOOLEAN mpKoszul (leftv res, leftv c, leftv b, leftv id)
 
BOOLEAN mpJacobi (leftv res, leftv a)
 
BOOLEAN jjRESULTANT (leftv res, leftv u, leftv v, leftv w)
 
BOOLEAN kQHWeight (leftv res, leftv v)
 
BOOLEAN kWeight (leftv res, leftv id)
 
BOOLEAN loSimplex (leftv res, leftv args)
 Implementation of the Simplex Algorithm.
 
BOOLEAN loNewtonP (leftv res, leftv arg1)
 compute Newton Polytopes of input polynomials
 
BOOLEAN nuMPResMat (leftv res, leftv arg1, leftv arg2)
 returns module representing the multipolynomial resultant matrix Arguments 2: ideal i, int k k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default)
 
BOOLEAN nuLagSolve (leftv res, leftv arg1, leftv arg2, leftv arg3)
 find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial using Laguerres' root-solver.
 
BOOLEAN nuVanderSys (leftv res, leftv arg1, leftv arg2, leftv arg3)
 COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consider p as point in K^n and v as N elements in K, let p1,..,pN be the points in K^n obtained by evaluating all monomials of degree 0,1,...,N at p in lexicographical order, then the procedure computes the polynomial f satisfying f(pi) = v[i] RETURN: polynomial f of degree d.
 
BOOLEAN nuUResSolve (leftv res, leftv args)
 solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing->N) == IDELEMS(ideal).
 
BOOLEAN jjCHARSERIES (leftv res, leftv u)
 
void paPrint (const char *n, package p)
 
BOOLEAN iiTestAssume (leftv a, leftv b)
 
BOOLEAN iiExprArith1Tab (leftv res, leftv a, int op, const struct sValCmd1 *dA1, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to an argument a return TRUE on failure
 
BOOLEAN iiExprArith2Tab (leftv res, leftv a, int op, const struct sValCmd2 *dA2, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a and a->next return TRUE on failure
 
BOOLEAN iiExprArith3Tab (leftv res, leftv a, int op, const struct sValCmd3 *dA3, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a, a->next and a->next->next return TRUE on failure
 
BOOLEAN iiCheckTypes (leftv args, const short *type_list, int report=0)
 check a list of arguemys against a given field of types return TRUE if the types match return FALSE (and, if report) report an error via Werror otherwise
 
BOOLEAN iiBranchTo (leftv r, leftv args)
 
lists rDecompose (const ring r)
 
lists rDecompose_list_cf (const ring r)
 
BOOLEAN rDecompose_CF (leftv res, const coeffs C)
 
ring rCompose (const lists L, const BOOLEAN check_comp=TRUE, const long bitmask=0x7fff, const int isLetterplace=FALSE)
 
void iiSetReturn (const leftv h)
 

Variables

EXTERN_VAR leftv iiCurrArgs
 
EXTERN_VAR idhdl iiCurrProc
 
EXTERN_VAR int iiOp
 
const char * currid
 
EXTERN_VAR int iiRETURNEXPR_len
 
EXTERN_INST_VAR sleftv iiRETURNEXPR
 
EXTERN_VAR ring * iiLocalRing
 
const char * lastreserved
 
EXTERN_VAR int myynest
 
EXTERN_VAR int printlevel
 
EXTERN_VAR int si_echo
 
EXTERN_VAR BOOLEAN yyInRingConstruction
 
const struct sValCmd2 dArith2 []
 
const struct sValCmd1 dArith1 []
 
const struct sValCmd3 dArith3 []
 
const struct sValCmdM dArithM []
 

Data Structure Documentation

◆ sValCmd1

struct sValCmd1

Definition at line 75 of file gentable.cc.

Data Fields
short arg
short cmd
int p
proc1 p
short res
short valid_for

◆ sValCmd2

struct sValCmd2

Definition at line 66 of file gentable.cc.

Data Fields
short arg1
short arg2
short cmd
int p
proc2 p
short res
short valid_for

◆ sValCmd3

struct sValCmd3

Definition at line 83 of file gentable.cc.

Data Fields
short arg1
short arg2
short arg3
short cmd
int p
proc3 p
short res
short valid_for

◆ sValCmdM

struct sValCmdM

Definition at line 93 of file gentable.cc.

Data Fields
short cmd
short number_of_args
int p
proc1 p
short res
short valid_for

◆ sValAssign_sys

struct sValAssign_sys

Definition at line 101 of file gentable.cc.

Data Fields
short arg
int p
proc1 p
short res

◆ sValAssign

struct sValAssign

Definition at line 108 of file gentable.cc.

Data Fields
short arg
int p
proci p
short res

Typedef Documentation

◆ proc1

typedef BOOLEAN(* proc1) (leftv, leftv)

Definition at line 124 of file ipshell.h.

◆ proc2

typedef BOOLEAN(* proc2) (leftv, leftv, leftv)

Definition at line 136 of file ipshell.h.

◆ proc3

typedef BOOLEAN(* proc3) (leftv, leftv, leftv, leftv)

Definition at line 147 of file ipshell.h.

◆ proci

typedef BOOLEAN(* proci) (leftv, leftv, Subexpr)

Definition at line 177 of file ipshell.h.

Function Documentation

◆ exprlist_length()

int exprlist_length ( leftv v)

Definition at line 551 of file ipshell.cc.

552{
553 int rc = 0;
554 while (v!=NULL)
555 {
556 switch (v->Typ())
557 {
558 case INT_CMD:
559 case POLY_CMD:
560 case VECTOR_CMD:
561 case NUMBER_CMD:
562 rc++;
563 break;
564 case INTVEC_CMD:
565 case INTMAT_CMD:
566 rc += ((intvec *)(v->Data()))->length();
567 break;
568 case MATRIX_CMD:
569 case IDEAL_CMD:
570 case MODUL_CMD:
571 {
572 matrix mm = (matrix)(v->Data());
573 rc += mm->rows() * mm->cols();
574 }
575 break;
576 case LIST_CMD:
577 rc+=((lists)v->Data())->nr+1;
578 break;
579 default:
580 rc++;
581 }
582 v = v->next;
583 }
584 return rc;
585}
int & cols()
Definition matpol.h:24
int & rows()
Definition matpol.h:23
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
@ IDEAL_CMD
Definition grammar.cc:285
@ MATRIX_CMD
Definition grammar.cc:287
@ INTMAT_CMD
Definition grammar.cc:280
@ MODUL_CMD
Definition grammar.cc:288
@ VECTOR_CMD
Definition grammar.cc:293
@ NUMBER_CMD
Definition grammar.cc:289
@ POLY_CMD
Definition grammar.cc:290
ip_smatrix * matrix
Definition matpol.h:43
slists * lists
#define NULL
Definition omList.c:12
@ LIST_CMD
Definition tok.h:118
@ INTVEC_CMD
Definition tok.h:101
@ INT_CMD
Definition tok.h:96

◆ ii_CallLibProcM()

leftv ii_CallLibProcM ( const char * n,
void ** args,
int * arg_types,
const ring R,
BOOLEAN & err )

args: NULL terminated array of arguments arg_types: 0 terminated array of corresponding types

Definition at line 710 of file iplib.cc.

711{
712 idhdl h=ggetid(n);
713 if ((h==NULL)
714 || (IDTYP(h)!=PROC_CMD))
715 {
716 err=2;
717 return NULL;
718 }
719 // ring handling
720 idhdl save_ringhdl=currRingHdl;
721 ring save_ring=currRing;
724 // argument:
725 if (arg_types[0]!=0)
726 {
727 sleftv tmp;
728 leftv tt=&tmp;
729 int i=1;
730 tmp.Init();
731 tmp.data=args[0];
732 tmp.rtyp=arg_types[0];
733 while(arg_types[i]!=0)
734 {
736 tt=tt->next;
737 tt->rtyp=arg_types[i];
738 tt->data=args[i];
739 i++;
740 }
741 // call proc
742 err=iiMake_proc(h,currPack,&tmp);
743 }
744 else
745 // call proc
747 // clean up ring
748 iiCallLibProcEnd(save_ringhdl,save_ring);
749 // return
750 if (err==FALSE)
751 {
753 memcpy(h,&iiRETURNEXPR,sizeof(sleftv));
754 iiRETURNEXPR.Init();
755 return h;
756 }
757 return NULL;
758}
#define FALSE
Definition auxiliary.h:97
int i
Definition cfEzgcd.cc:132
Class used for (list of) interpreter objects.
Definition subexpr.h:83
int rtyp
Definition subexpr.h:91
void Init()
Definition subexpr.h:107
leftv next
Definition subexpr.h:86
void * data
Definition subexpr.h:88
@ PROC_CMD
Definition grammar.cc:281
idhdl ggetid(const char *n)
Definition ipid.cc:558
VAR idhdl currRingHdl
Definition ipid.cc:57
VAR package currPack
Definition ipid.cc:55
EXTERN_VAR omBin sleftv_bin
Definition ipid.h:145
#define IDTYP(a)
Definition ipid.h:119
static void iiCallLibProcEnd(idhdl save_ringhdl, ring save_ring)
Definition iplib.cc:615
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv args)
Definition iplib.cc:513
INST_VAR sleftv iiRETURNEXPR
Definition iplib.cc:483
static void iiCallLibProcBegin()
Definition iplib.cc:598
STATIC_VAR Poly * h
Definition janet.cc:971
#define omAllocBin(bin)
#define omAlloc0Bin(bin)
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
idrec * idhdl
Definition ring.h:22
#define R
Definition sirandom.c:27
sleftv * leftv
Definition structs.h:53

◆ ii_CallProcId2Id()

ideal ii_CallProcId2Id ( const char * lib,
const char * proc,
ideal arg,
const ring R )

Definition at line 670 of file iplib.cc.

671{
672 char *plib = iiConvName(lib);
673 idhdl h=ggetid(plib);
674 omFreeBinAddr(plib);
675 if (h==NULL)
676 {
678 if (bo) return NULL;
679 }
680 ring oldR=currRing;
682 BOOLEAN err;
683 ideal I=(ideal)iiCallLibProc1(proc,idCopy(arg),IDEAL_CMD,err);
684 rChangeCurrRing(oldR);
685 if (err) return NULL;
686 return I;
687}
int BOOLEAN
Definition auxiliary.h:88
#define TRUE
Definition auxiliary.h:101
unsigned char * proc[NUM_PROC]
Definition checklibs.c:16
ideal idCopy(ideal A)
Definition ideals.h:60
char * iiConvName(const char *libname)
Definition iplib.cc:1439
BOOLEAN iiLibCmd(const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition iplib.cc:894
void * iiCallLibProc1(const char *n, void *arg, int arg_type, BOOLEAN &err)
Definition iplib.cc:636
#define omFreeBinAddr(addr)

◆ ii_CallProcId2Int()

int ii_CallProcId2Int ( const char * lib,
const char * proc,
ideal arg,
const ring R )

Definition at line 689 of file iplib.cc.

690{
691 char *plib = iiConvName(lib);
692 idhdl h=ggetid(plib);
693 omFreeBinAddr(plib);
694 if (h==NULL)
695 {
697 if (bo) return 0;
698 }
699 BOOLEAN err;
700 ring oldR=currRing;
702 int I=(int)(long)iiCallLibProc1(proc,idCopy(arg),IDEAL_CMD,err);
703 rChangeCurrRing(oldR);
704 if (err) return 0;
705 return I;
706}

◆ iiAddCproc()

int iiAddCproc ( const char * libname,
const char * procname,
BOOLEAN pstatic,
BOOLEAN(* func )(leftv res, leftv v) )

Definition at line 1073 of file iplib.cc.

1075{
1076 procinfov pi;
1077 idhdl h;
1078
1079 #ifndef SING_NDEBUG
1080 int dummy;
1081 if (IsCmd(procname,dummy))
1082 {
1083 Werror(">>%s< is a reserved name",procname);
1084 return 0;
1085 }
1086 #endif
1087
1088 h=IDROOT->get(procname,0);
1089 if ((h!=NULL)
1090 && (IDTYP(h)==PROC_CMD))
1091 {
1092 pi = IDPROC(h);
1093 #if 0
1094 if ((pi->language == LANG_SINGULAR)
1095 &&(BVERBOSE(V_REDEFINE)))
1096 Warn("extend `%s`",procname);
1097 #endif
1098 }
1099 else
1100 {
1101 h = enterid(procname,0, PROC_CMD, &IDROOT, TRUE);
1102 }
1103 if ( h!= NULL )
1104 {
1105 pi = IDPROC(h);
1106 if((pi->language == LANG_SINGULAR)
1107 ||(pi->language == LANG_NONE))
1108 {
1109 omfree(pi->libname);
1110 pi->libname = omStrDup(libname);
1111 omfree(pi->procname);
1112 pi->procname = omStrDup(procname);
1113 pi->language = LANG_C;
1114 pi->ref = 1;
1115 pi->is_static = pstatic;
1116 pi->data.o.function = func;
1117 }
1118 else if(pi->language == LANG_C)
1119 {
1120 if(pi->data.o.function == func)
1121 {
1122 pi->ref++;
1123 }
1124 else
1125 {
1126 omfree(pi->libname);
1127 pi->libname = omStrDup(libname);
1128 omfree(pi->procname);
1129 pi->procname = omStrDup(procname);
1130 pi->language = LANG_C;
1131 pi->ref = 1;
1132 pi->is_static = pstatic;
1133 pi->data.o.function = func;
1134 }
1135 }
1136 else
1137 Warn("internal error: unknown procedure type %d",pi->language);
1138 if (currPack->language==LANG_SINGULAR) currPack->language=LANG_MIX;
1139 return(1);
1140 }
1141 else
1142 {
1143 WarnS("iiAddCproc: failed.");
1144 }
1145 return(0);
1146}
#define Warn
Definition emacs.cc:77
#define WarnS
Definition emacs.cc:78
int IsCmd(const char *n, int &tok)
Definition iparith.cc:9738
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:256
#define IDPROC(a)
Definition ipid.h:140
#define IDROOT
Definition ipid.h:19
#define pi
Definition libparse.cc:1145
#define omStrDup(s)
#define omfree(addr)
#define BVERBOSE(a)
Definition options.h:35
#define V_REDEFINE
Definition options.h:45
void Werror(const char *fmt,...)
Definition reporter.cc:189
procinfo * procinfov
Definition structs.h:56
@ LANG_SINGULAR
Definition subexpr.h:22
@ LANG_NONE
Definition subexpr.h:22
@ LANG_MIX
Definition subexpr.h:22
@ LANG_C
Definition subexpr.h:22

◆ iiAlias()

BOOLEAN iiAlias ( leftv p)

Definition at line 821 of file ipid.cc.

822{
823 if (iiCurrArgs==NULL)
824 {
825 Werror("not enough arguments for proc %s",VoiceName());
826 p->CleanUp();
827 return TRUE;
828 }
830 iiCurrArgs=h->next;
831 h->next=NULL;
832 if (h->rtyp!=IDHDL)
833 {
835 h->CleanUp();
837 return res;
838 }
839 if ((h->Typ()!=p->Typ()) &&(p->Typ()!=DEF_CMD))
840 {
841 WerrorS("type mismatch");
842 return TRUE;
843 }
844 idhdl pp=(idhdl)p->data;
845 switch(pp->typ)
846 {
847 case CRING_CMD:
849 break;
850 case DEF_CMD:
851 case INT_CMD:
852 break;
853 case INTVEC_CMD:
854 case INTMAT_CMD:
855 delete IDINTVEC(pp);
856 break;
857 case NUMBER_CMD:
859 break;
860 case BIGINT_CMD:
862 break;
863 case MAP_CMD:
864 {
865 map im = IDMAP(pp);
866 omFreeBinAddr((ADDRESS)im->preimage);
867 im->preimage=NULL;// and continue
868 }
869 // continue as ideal:
870 case IDEAL_CMD:
871 case MODUL_CMD:
872 case MATRIX_CMD:
874 break;
875 case PROC_CMD:
876 case RESOLUTION_CMD:
877 case STRING_CMD:
879 break;
880 case LIST_CMD:
881 IDLIST(pp)->Clean();
882 break;
883 case LINK_CMD:
885 break;
886 // case ring: cannot happen
887 default:
888 {
889 int t=p->Typ();
890 if (t<MAX_TOK)
891 {
892 Werror("unknown type %d(%s)",t,Tok2Cmdname(t));
893 return TRUE;
894 }
895 /*else: blackbox type, not yet set*/
896 break;
897 }
898 }
899 pp->typ=ALIAS_CMD;
900 IDDATA(pp)=(char*)h->data;
901 int eff_typ=h->Typ();
902 if ((RingDependend(eff_typ))
903 || ((eff_typ==LIST_CMD) && (lRingDependend((lists)h->Data()))))
904 {
905 ipSwapId(pp,IDROOT,currRing->idroot);
906 }
907 h->CleanUp();
909 return FALSE;
910}
void * ADDRESS
Definition auxiliary.h:120
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition cf_gcd.cc:676
int p
Definition cfModGcd.cc:4086
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:459
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:556
CanonicalForm res
Definition facAbsFact.cc:60
void WerrorS(const char *s)
Definition feFopen.cc:24
const char * VoiceName()
Definition fevoices.cc:58
const char * Tok2Cmdname(int tok)
Definition gentable.cc:137
static int RingDependend(int t)
Definition gentable.cc:23
@ MAP_CMD
Definition grammar.cc:286
@ RESOLUTION_CMD
Definition grammar.cc:291
#define idDelete(H)
delete an ideal
Definition ideals.h:29
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition ipassign.cc:2097
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc:656
#define IDMAP(a)
Definition ipid.h:135
#define IDSTRING(a)
Definition ipid.h:136
#define IDDATA(a)
Definition ipid.h:126
#define IDINTVEC(a)
Definition ipid.h:128
#define IDLINK(a)
Definition ipid.h:138
#define IDIDEAL(a)
Definition ipid.h:133
#define IDNUMBER(a)
Definition ipid.h:132
#define IDLIST(a)
Definition ipid.h:137
VAR leftv iiCurrArgs
Definition ipshell.cc:81
BOOLEAN lRingDependend(lists L)
Definition lists.cc:222
The main handler for Singular numbers which are suitable for Singular polynomials.
#define nDelete(n)
Definition numbers.h:16
#define omFree(addr)
#define omFreeBin(addr, bin)
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
#define IDHDL
Definition tok.h:31
@ ALIAS_CMD
Definition tok.h:34
@ BIGINT_CMD
Definition tok.h:38
@ CRING_CMD
Definition tok.h:56
@ DEF_CMD
Definition tok.h:58
@ LINK_CMD
Definition tok.h:117
@ STRING_CMD
Definition tok.h:187
@ MAX_TOK
Definition tok.h:220

◆ iiAllStart()

BOOLEAN iiAllStart ( procinfov pi,
const char * p,
feBufferTypes t,
int l )

Definition at line 306 of file iplib.cc.

307{
308 int save_trace=traceit;
309 int restore_traceit=0;
310 if (traceit_stop
312 {
314 traceit_stop=0;
315 restore_traceit=1;
316 }
317 // see below:
318 BITSET save1=si_opt_1;
319 BITSET save2=si_opt_2;
320 newBuffer( omStrDup(p /*pi->data.s.body*/), t /*BT_proc*/,
321 pi, l );
322 BOOLEAN err=yyparse();
323
324 if (sLastPrinted.rtyp!=0)
325 {
326 sLastPrinted.CleanUp();
327 }
328
329 if (restore_traceit) traceit=save_trace;
330
331 // the access to optionStruct and verboseStruct do not work
332 // on x86_64-Linux for pic-code
333 if ((TEST_V_ALLWARN) &&
334 (t==BT_proc) &&
335 ((save1!=si_opt_1)||(save2!=si_opt_2)) &&
336 (pi->libname!=NULL) && (pi->libname[0]!='\0'))
337 {
338 if ((pi->libname!=NULL) && (pi->libname[0]!='\0'))
339 Warn("option changed in proc %s from %s",pi->procname,pi->libname);
340 else
341 Warn("option changed in proc %s",pi->procname);
342 int i;
343 for (i=0; optionStruct[i].setval!=0; i++)
344 {
345 if ((optionStruct[i].setval & si_opt_1)
346 && (!(optionStruct[i].setval & save1)))
347 {
348 Print(" +%s",optionStruct[i].name);
349 }
350 if (!(optionStruct[i].setval & si_opt_1)
351 && ((optionStruct[i].setval & save1)))
352 {
353 Print(" -%s",optionStruct[i].name);
354 }
355 }
356 for (i=0; verboseStruct[i].setval!=0; i++)
357 {
358 if ((verboseStruct[i].setval & si_opt_2)
359 && (!(verboseStruct[i].setval & save2)))
360 {
361 Print(" +%s",verboseStruct[i].name);
362 }
363 if (!(verboseStruct[i].setval & si_opt_2)
364 && ((verboseStruct[i].setval & save2)))
365 {
366 Print(" -%s",verboseStruct[i].name);
367 }
368 }
369 PrintLn();
370 }
371 return err;
372}
#define BITSET
Definition auxiliary.h:85
int l
Definition cfEzgcd.cc:100
#define Print
Definition emacs.cc:80
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition fevoices.cc:166
@ BT_proc
Definition fevoices.h:20
int yyparse(void)
Definition grammar.cc:2149
const struct soptionStruct verboseStruct[]
Definition misc_ip.cc:539
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:508
VAR unsigned si_opt_2
Definition options.c:6
VAR unsigned si_opt_1
Definition options.c:5
#define TEST_V_ALLWARN
Definition options.h:145
void PrintLn()
Definition reporter.cc:310
#define TRACE_SHOW_LINE
Definition reporter.h:33
EXTERN_VAR int traceit
Definition reporter.h:24
EXTERN_VAR int traceit_stop
Definition reporter.h:25
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46
int name
New type name for int.

◆ iiApply()

BOOLEAN iiApply ( leftv res,
leftv a,
int op,
leftv proc )

Definition at line 6424 of file ipshell.cc.

6425{
6426 res->Init();
6427 res->rtyp=a->Typ();
6428 switch (res->rtyp /*a->Typ()*/)
6429 {
6430 case INTVEC_CMD:
6431 case INTMAT_CMD:
6432 return iiApplyINTVEC(res,a,op,proc);
6433 case BIGINTMAT_CMD:
6434 return iiApplyBIGINTMAT(res,a,op,proc);
6435 case IDEAL_CMD:
6436 case MODUL_CMD:
6437 case MATRIX_CMD:
6438 return iiApplyIDEAL(res,a,op,proc);
6439 case LIST_CMD:
6440 return iiApplyLIST(res,a,op,proc);
6441 }
6442 WerrorS("first argument to `apply` must allow an index");
6443 return TRUE;
6444}
int Typ()
Definition subexpr.cc:1048
@ BIGINTMAT_CMD
Definition grammar.cc:278
BOOLEAN iiApplyINTVEC(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6343
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6385
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
Definition ipshell.cc:6380
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
Definition ipshell.cc:6375

◆ iiARROW()

BOOLEAN iiARROW ( leftv r,
char * a,
char * s )

Definition at line 6473 of file ipshell.cc.

6474{
6475 size_t len=strlen(a)+strlen(s)+30; /* max. 27 currently */
6476 char *ss=(char*)omAlloc(len);
6477 // find end of s:
6478 int end_s=strlen(s);
6479 while ((end_s>0) && ((s[end_s]<=' ')||(s[end_s]==';'))) end_s--;
6480 s[end_s+1]='\0';
6481 char *name=(char *)omAlloc(len);
6482 snprintf(name,len,"%s->%s",a,s);
6483 // find start of last expression
6484 int start_s=end_s-1;
6485 while ((start_s>=0) && (s[start_s]!=';')) start_s--;
6486 if (start_s<0) // ';' not found
6487 {
6488 snprintf(ss,len,"parameter def %s;return(%s);\n",a,s);
6489 }
6490 else // s[start_s] is ';'
6491 {
6492 s[start_s]='\0';
6493 snprintf(ss,len,"parameter def %s;%s;return(%s);\n",a,s,s+start_s+1);
6494 }
6495 r->Init();
6496 // now produce procinfo for PROC_CMD:
6497 r->data = (void *)omAlloc0Bin(procinfo_bin);
6498 ((procinfo *)(r->data))->language=LANG_NONE;
6500 ((procinfo *)r->data)->data.s.body=ss;
6501 omFree(name);
6502 r->rtyp=PROC_CMD;
6503 //r->rtyp=STRING_CMD;
6504 //r->data=ss;
6505 return FALSE;
6506}
const CanonicalForm int s
Definition facAbsFact.cc:51
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
Definition iplib.cc:1059
#define omAlloc(size)
VAR omBin procinfo_bin
Definition subexpr.cc:42

◆ iiAssign()

BOOLEAN iiAssign ( leftv left,
leftv right,
BOOLEAN toplevel = TRUE )

Definition at line 2097 of file ipassign.cc.

2098{
2099 if (errorreported) return TRUE;
2100 int ll=l->listLength();
2101 int rl;
2102 int lt=l->Typ();
2103 int rt=NONE;
2104 int is_qring=FALSE;
2105 BOOLEAN b=FALSE;
2106 if (l->rtyp==ALIAS_CMD)
2107 {
2108 Werror("`%s` is read-only",l->Name());
2109 }
2110
2111 if (l->rtyp==IDHDL)
2112 {
2113 atKillAll((idhdl)l->data);
2114 is_qring=hasFlag((idhdl)l->data,FLAG_QRING_DEF);
2115 IDFLAG((idhdl)l->data)=0;
2116 l->attribute=NULL;
2117 toplevel=FALSE;
2118 }
2119 else if (l->attribute!=NULL)
2120 atKillAll((idhdl)l);
2121 if (ll==1)
2122 {
2123 /* l[..] = ... */
2124 if(l->e!=NULL)
2125 {
2126 BOOLEAN like_lists=0;
2127 blackbox *bb=NULL;
2128 int bt;
2129 if (((bt=l->rtyp)>MAX_TOK)
2130 || ((l->rtyp==IDHDL) && ((bt=IDTYP((idhdl)l->data))>MAX_TOK)))
2131 {
2132 bb=getBlackboxStuff(bt);
2133 like_lists=BB_LIKE_LIST(bb); // bb like a list
2134 }
2135 else if (((l->rtyp==IDHDL) && (IDTYP((idhdl)l->data)==LIST_CMD))
2136 || (l->rtyp==LIST_CMD))
2137 {
2138 like_lists=2; // bb in a list
2139 }
2140 if(like_lists)
2141 {
2142 if (traceit&TRACE_ASSIGN) PrintS("assign list[..]=...or similar\n");
2143 if (like_lists==1)
2144 {
2145 // check blackbox/newtype type:
2146 if(bb->blackbox_CheckAssign(bb,l,r)) return TRUE;
2147 }
2148 b=jiAssign_list(l,r);
2149 if((!b) && (like_lists==2))
2150 {
2151 //Print("jjA_L_LIST: - 2 \n");
2152 if((l->rtyp==IDHDL) && (l->data!=NULL))
2153 {
2154 ipMoveId((idhdl)l->data);
2155 l->attribute=IDATTR((idhdl)l->data);
2156 l->flag=IDFLAG((idhdl)l->data);
2157 }
2158 }
2159 r->CleanUp();
2160 Subexpr h;
2161 while (l->e!=NULL)
2162 {
2163 h=l->e->next;
2165 l->e=h;
2166 }
2167 return b;
2168 }
2169 }
2170 if (lt>MAX_TOK)
2171 {
2172 blackbox *bb=getBlackboxStuff(lt);
2173#ifdef BLACKBOX_DEVEL
2174 Print("bb-assign: bb=%lx\n",bb);
2175#endif
2176 return (bb==NULL) || bb->blackbox_Assign(l,r);
2177 }
2178 // end of handling elems of list and similar
2179 rl=r->listLength();
2180 if (rl==1)
2181 {
2182 /* system variables = ... */
2183 if(((l->rtyp>=VECHO)&&(l->rtyp<=VPRINTLEVEL))
2184 ||((l->rtyp>=VALTVARS)&&(l->rtyp<=VMINPOLY)))
2185 {
2186 b=iiAssign_sys(l,r);
2187 r->CleanUp();
2188 //l->CleanUp();
2189 return b;
2190 }
2191 rt=r->Typ();
2192 /* a = ... */
2193 if ((lt!=MATRIX_CMD)
2194 &&(lt!=BIGINTMAT_CMD)
2195 &&(lt!=BIGINTVEC_CMD)
2196 &&(lt!=CMATRIX_CMD)
2197 &&(lt!=INTMAT_CMD)
2198 &&((lt==rt)||(lt!=LIST_CMD)))
2199 {
2200 b=jiAssign_1(l,r,rt,toplevel,is_qring);
2201 if (l->rtyp==IDHDL)
2202 {
2203 if ((lt==DEF_CMD)||(lt==LIST_CMD))
2204 {
2205 ipMoveId((idhdl)l->data);
2206 }
2207 l->attribute=IDATTR((idhdl)l->data);
2208 l->flag=IDFLAG((idhdl)l->data);
2209 l->CleanUp();
2210 }
2211 r->CleanUp();
2212 return b;
2213 }
2214 if (((lt!=LIST_CMD)
2215 &&((rt==MATRIX_CMD)
2216 ||(rt==BIGINTMAT_CMD)
2217 ||(rt==BIGINTVEC_CMD)
2218 ||(rt==CMATRIX_CMD)
2219 ||(rt==INTMAT_CMD)
2220 ||(rt==INTVEC_CMD)
2221 ||(rt==MODUL_CMD)))
2222 ||((lt==LIST_CMD)
2223 &&(rt==RESOLUTION_CMD))
2224 )
2225 {
2226 b=jiAssign_1(l,r,rt,toplevel);
2227 if((l->rtyp==IDHDL)&&(l->data!=NULL))
2228 {
2229 if ((lt==DEF_CMD) || (lt==LIST_CMD))
2230 {
2231 //Print("ipAssign - 3.0\n");
2232 ipMoveId((idhdl)l->data);
2233 }
2234 l->attribute=IDATTR((idhdl)l->data);
2235 l->flag=IDFLAG((idhdl)l->data);
2236 }
2237 r->CleanUp();
2238 Subexpr h;
2239 while (l->e!=NULL)
2240 {
2241 h=l->e->next;
2243 l->e=h;
2244 }
2245 return b;
2246 }
2247 }
2248 if (rt==NONE) rt=r->Typ();
2249 }
2250 else if (ll==(rl=r->listLength()))
2251 {
2252 b=jiAssign_rec(l,r);
2253 return b;
2254 }
2255 else
2256 {
2257 if (rt==NONE) rt=r->Typ();
2258 if (rt==INTVEC_CMD)
2259 return jiA_INTVEC_L(l,r);
2260 else if (rt==VECTOR_CMD)
2261 return jiA_VECTOR_L(l,r);
2262 else if ((rt==IDEAL_CMD)||(rt==MATRIX_CMD))
2263 return jiA_MATRIX_L(l,r);
2264 else if ((rt==STRING_CMD)&&(rl==1))
2265 return jiA_STRING_L(l,r);
2266 Werror("length of lists in assignment does not match (l:%d,r:%d)",
2267 ll,rl);
2268 return TRUE;
2269 }
2270
2271 leftv hh=r;
2272 BOOLEAN map_assign=FALSE;
2273 switch (lt)
2274 {
2275 case INTVEC_CMD:
2277 break;
2278 case INTMAT_CMD:
2279 {
2280 b=jjA_L_INTVEC(l,r,new intvec(IDINTVEC((idhdl)l->data)));
2281 break;
2282 }
2283 case BIGINTVEC_CMD:
2284 {
2285 b=jjA_L_BIGINTVEC(l, r, new bigintmat(IDBIMAT((idhdl)l->data)));
2286 break;
2287 }
2288 case BIGINTMAT_CMD:
2289 {
2290 b=jjA_L_BIGINTMAT(l, r, new bigintmat(IDBIMAT((idhdl)l->data)));
2291 break;
2292 }
2293 case MAP_CMD:
2294 {
2295 // first element in the list sl (r) must be a ring
2296 if ((rt == RING_CMD)&&(r->e==NULL))
2297 {
2298 omFreeBinAddr((ADDRESS)IDMAP((idhdl)l->data)->preimage);
2299 IDMAP((idhdl)l->data)->preimage = omStrDup (r->Fullname());
2300 /* advance the expressionlist to get the next element after the ring */
2301 hh = r->next;
2302 }
2303 else
2304 {
2305 WerrorS("expected ring-name");
2306 b=TRUE;
2307 break;
2308 }
2309 if (hh==NULL) /* map-assign: map f=r; */
2310 {
2311 WerrorS("expected image ideal");
2312 b=TRUE;
2313 break;
2314 }
2315 if ((hh->next==NULL)&&(hh->Typ()==IDEAL_CMD))
2316 {
2317 b=jiAssign_1(l,hh,IDEAL_CMD,toplevel); /* map-assign: map f=r,i; */
2319 return b;
2320 }
2321 //no break, handle the rest like an ideal:
2322 map_assign=TRUE; // and continue
2323 }
2324 case MATRIX_CMD:
2325 case IDEAL_CMD:
2326 case MODUL_CMD:
2327 {
2328 sleftv t;
2329 matrix olm = (matrix)l->Data();
2330 long rk;
2331 char *pr=((map)olm)->preimage;
2332 BOOLEAN module_assign=(/*l->Typ()*/ lt==MODUL_CMD);
2333 matrix lm ;
2334 long num;
2335 int j,k;
2336 int i=0;
2337 int mtyp=MATRIX_CMD; /*Type of left side object*/
2338 int etyp=POLY_CMD; /*Type of elements of left side object*/
2339
2340 if (lt /*l->Typ()*/==MATRIX_CMD)
2341 {
2342 rk=olm->rows();
2343 num=olm->cols()*rk /*olm->rows()*/;
2344 lm=mpNew(olm->rows(),olm->cols());
2345 int el;
2346 if ((traceit&TRACE_ASSIGN) && (num!=(el=exprlist_length(hh))))
2347 {
2348 Warn("expression list length(%d) does not match matrix size(%d)",el,num);
2349 }
2350 }
2351 else /* IDEAL_CMD or MODUL_CMD */
2352 {
2353 num=exprlist_length(hh);
2354 lm=(matrix)idInit(num,1);
2355 if (module_assign)
2356 {
2357 rk=0;
2358 mtyp=MODUL_CMD;
2359 etyp=VECTOR_CMD;
2360 }
2361 else
2362 rk=1;
2363 }
2364
2365 int ht;
2366 loop
2367 {
2368 if (hh==NULL)
2369 break;
2370 else
2371 {
2372 matrix rm;
2373 ht=hh->Typ();
2374 if ((j=iiTestConvert(ht,etyp))!=0)
2375 {
2376 b=iiConvert(ht,etyp,j,hh,&t);
2377 hh->next=t.next;
2378 if (b)
2379 { Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(etyp));
2380 break;
2381 }
2382 lm->m[i]=(poly)t.CopyD(etyp);
2383 pNormalize(lm->m[i]);
2384 if (module_assign) rk=si_max(rk,pMaxComp(lm->m[i]));
2385 i++;
2386 }
2387 else
2388 if ((j=iiTestConvert(ht,mtyp))!=0)
2389 {
2390 b=iiConvert(ht,mtyp,j,hh,&t);
2391 hh->next=t.next;
2392 if (b)
2393 { Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(mtyp));
2394 break;
2395 }
2396 rm = (matrix)t.CopyD(mtyp);
2397 if (module_assign)
2398 {
2399 j = si_min((int)num,rm->cols());
2400 rk=si_max(rk,rm->rank);
2401 }
2402 else
2403 j = si_min(num-i,(long)rm->rows() * (long)rm->cols());
2404 for(k=0;k<j;k++,i++)
2405 {
2406 lm->m[i]=rm->m[k];
2407 pNormalize(lm->m[i]);
2408 rm->m[k]=NULL;
2409 }
2410 idDelete((ideal *)&rm);
2411 }
2412 else
2413 {
2414 b=TRUE;
2415 Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(mtyp));
2416 break;
2417 }
2418 t.next=NULL;t.CleanUp();
2419 if (i==num) break;
2420 hh=hh->next;
2421 }
2422 }
2423 if (b)
2424 idDelete((ideal *)&lm);
2425 else
2426 {
2427 idDelete((ideal *)&olm);
2428 if (module_assign) lm->rank=rk;
2429 else if (map_assign) ((map)lm)->preimage=pr;
2430 l=l->LData();
2431 if (l->rtyp==IDHDL)
2432 IDMATRIX((idhdl)l->data)=lm;
2433 else
2434 l->data=(char *)lm;
2435 }
2436 break;
2437 }
2438 case STRING_CMD:
2439 b=jjA_L_STRING(l,r);
2440 break;
2441 //case DEF_CMD:
2442 case LIST_CMD:
2443 b=jjA_L_LIST(l,r);
2444 break;
2445 case NONE:
2446 case 0:
2447 Werror("cannot assign to %s",l->Fullname());
2448 b=TRUE;
2449 break;
2450 default:
2451 WerrorS("assign not impl.");
2452 b=TRUE;
2453 break;
2454 } /* end switch: typ */
2455 if (b && (!errorreported)) WerrorS("incompatible type in list assignment");
2456 r->CleanUp();
2457 return b;
2458}
#define atKillAll(H)
Definition attrib.h:47
static int si_max(const int a, const int b)
Definition auxiliary.h:125
static int si_min(const int a, const int b)
Definition auxiliary.h:126
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
#define BB_LIKE_LIST(B)
Definition blackbox.h:53
CanonicalForm num(const CanonicalForm &f)
int k
Definition cfEzgcd.cc:99
CanonicalForm b
Definition cfModGcd.cc:4111
Matrices of numbers.
Definition bigintmat.h:51
long rank
Definition matpol.h:19
poly * m
Definition matpol.h:18
void * CopyD(int t)
Definition subexpr.cc:714
const char * Name()
Definition subexpr.h:120
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
int j
Definition facHensel.cc:110
VAR short errorreported
Definition feFopen.cc:23
int iiTestConvert(int inputType, int outputType)
Definition gentable.cc:298
@ VALTVARS
Definition grammar.cc:306
@ BIGINTVEC_CMD
Definition grammar.cc:279
@ VMINPOLY
Definition grammar.cc:310
@ RING_CMD
Definition grammar.cc:282
static BOOLEAN jjA_L_BIGINTVEC(leftv l, leftv r, bigintmat *bim)
Definition ipassign.cc:1817
static BOOLEAN jiA_MATRIX_L(leftv l, leftv r)
Definition ipassign.cc:1890
static BOOLEAN jiA_VECTOR_L(leftv l, leftv r)
Definition ipassign.cc:1613
static BOOLEAN iiAssign_sys(leftv l, leftv r)
Definition ipassign.cc:1513
static BOOLEAN jiAssign_rec(leftv l, leftv r)
Definition ipassign.cc:2074
static BOOLEAN jiAssign_1(leftv l, leftv r, int rt, BOOLEAN toplevel, BOOLEAN is_qring=FALSE)
Definition ipassign.cc:1330
static BOOLEAN jjA_L_LIST(leftv l, leftv r)
Definition ipassign.cc:1654
static BOOLEAN jiA_STRING_L(leftv l, leftv r)
Definition ipassign.cc:1966
static BOOLEAN jjA_L_BIGINTMAT(leftv l, leftv r, bigintmat *bim)
Definition ipassign.cc:1768
static BOOLEAN jiAssign_list(leftv l, leftv r)
Definition ipassign.cc:2002
static BOOLEAN jjA_L_STRING(leftv l, leftv r)
Definition ipassign.cc:1856
static BOOLEAN jiA_INTVEC_L(leftv l, leftv r)
Definition ipassign.cc:1587
static BOOLEAN jjA_L_INTVEC(leftv l, leftv r, intvec *iv)
Definition ipassign.cc:1719
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition ipconv.cc:450
void ipMoveId(idhdl tomove)
Definition ipid.cc:681
#define IDMATRIX(a)
Definition ipid.h:134
#define hasFlag(A, F)
Definition ipid.h:112
#define IDBIMAT(a)
Definition ipid.h:129
#define IDFLAG(a)
Definition ipid.h:120
#define FLAG_QRING_DEF
Definition ipid.h:109
#define IDATTR(a)
Definition ipid.h:123
int exprlist_length(leftv v)
Definition ipshell.cc:551
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
#define pMaxComp(p)
Definition polys.h:300
#define pNormalize(p)
Definition polys.h:318
void PrintS(const char *s)
Definition reporter.cc:284
#define TRACE_ASSIGN
Definition reporter.h:46
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define loop
Definition structs.h:71
VAR omBin sSubexpr_bin
Definition subexpr.cc:40
@ VPRINTLEVEL
Definition tok.h:217
@ CMATRIX_CMD
Definition tok.h:46
@ VECHO
Definition tok.h:210
#define NONE
Definition tok.h:223

◆ iiAssignCR()

BOOLEAN iiAssignCR ( leftv r,
leftv arg )

Definition at line 6508 of file ipshell.cc.

6509{
6510 char* ring_name=omStrDup((char*)r->Name());
6511 int t=arg->Typ();
6512 if (t==RING_CMD)
6513 {
6514 sleftv tmp;
6515 tmp.Init();
6516 tmp.rtyp=IDHDL;
6517 idhdl h=enterid(ring_name, myynest, RING_CMD, &IDROOT);
6518 IDRING(h)=NULL;
6519 tmp.data=(char*)h;
6520 if (h!=NULL)
6521 {
6522 tmp.name=h->id;
6523 BOOLEAN b=iiAssign(&tmp,arg);
6524 if (b) return TRUE;
6525 rSetHdl(ggetid(ring_name));
6526 omFree(ring_name);
6527 return FALSE;
6528 }
6529 else
6530 return TRUE;
6531 }
6532 else if (t==CRING_CMD)
6533 {
6534 sleftv tmp;
6535 sleftv n;
6536 n.Init();
6537 n.name=ring_name;
6538 if (iiDeclCommand(&tmp,&n,myynest,CRING_CMD,&IDROOT)) return TRUE;
6539 if (iiAssign(&tmp,arg)) return TRUE;
6540 //Print("create %s\n",r->Name());
6541 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6542 return FALSE;
6543 }
6544 //Print("create %s\n",r->Name());
6545 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6546 return TRUE;// not handled -> error for now
6547}
const char * name
Definition subexpr.h:87
VAR int myynest
Definition febase.cc:41
#define IDRING(a)
Definition ipid.h:127
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
Definition ipshell.cc:1202
void rSetHdl(idhdl h)
Definition ipshell.cc:5122

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv r,
leftv args )

Definition at line 1277 of file ipshell.cc.

1278{
1279 // must be inside a proc, as we simultae an proc_end at the end
1280 if (myynest==0)
1281 {
1282 WerrorS("branchTo can only occur in a proc");
1283 return TRUE;
1284 }
1285 // <string1...stringN>,<proc>
1286 // known: args!=NULL, l>=1
1287 int l=args->listLength();
1288 int ll=0;
1289 if (iiCurrArgs!=NULL) ll=iiCurrArgs->listLength();
1290 if (ll!=(l-1)) return FALSE;
1291 leftv h=args;
1292 // set up the table for type test:
1293 short *t=(short*)omAlloc(l*sizeof(short));
1294 t[0]=l-1;
1295 int b;
1296 int i;
1297 for(i=1;i<l;i++,h=h->next)
1298 {
1299 if (h->Typ()!=STRING_CMD)
1300 {
1301 omFreeBinAddr(t);
1302 Werror("arg %d is not a string",i);
1303 return TRUE;
1304 }
1305 int tt;
1306 b=IsCmd((char *)h->Data(),tt);
1307 if(b) t[i]=tt;
1308 else
1309 {
1310 omFreeBinAddr(t);
1311 Werror("arg %d is not a type name",i);
1312 return TRUE;
1313 }
1314 }
1315 if (h->Typ()!=PROC_CMD)
1316 {
1317 omFreeBinAddr(t);
1318 Werror("last(%d.) arg.(%s) is not a proc(but %s(%d)), nesting=%d",
1319 i,h->name,Tok2Cmdname(h->Typ()),h->Typ(),myynest);
1320 return TRUE;
1321 }
1323 omFreeBinAddr(t);
1324 if (b && (h->rtyp==IDHDL) && (h->e==NULL))
1325 {
1326 // get the proc:
1327 iiCurrProc=(idhdl)h->data;
1328 idhdl currProc=iiCurrProc; /*iiCurrProc may be changed after yyparse*/
1329 procinfo * pi=IDPROC(currProc);
1330 // already loaded ?
1331 if( pi->data.s.body==NULL )
1332 {
1334 if (pi->data.s.body==NULL) return TRUE;
1335 }
1336 // set currPackHdl/currPack
1337 if ((pi->pack!=NULL)&&(currPack!=pi->pack))
1338 {
1339 currPack=pi->pack;
1342 //Print("set pack=%s\n",IDID(currPackHdl));
1343 }
1344 // see iiAllStart:
1345 BITSET save1=si_opt_1;
1346 BITSET save2=si_opt_2;
1347 newBuffer( omStrDup(pi->data.s.body), BT_proc,
1348 pi, pi->data.s.body_lineno-(iiCurrArgs==NULL) );
1349 BOOLEAN err=yyparse();
1351 si_opt_1=save1;
1352 si_opt_2=save2;
1353 // now save the return-expr.
1354 sLastPrinted.CleanUp(currRing);
1355 memcpy(&sLastPrinted,&iiRETURNEXPR,sizeof(sleftv));
1356 iiRETURNEXPR.Init();
1357 // warning about args.:
1358 if (iiCurrArgs!=NULL)
1359 {
1360 if (err==0) Warn("too many arguments for %s",IDID(currProc));
1361 iiCurrArgs->CleanUp();
1364 }
1365 // similate proc_end:
1366 // - leave input
1367 void myychangebuffer();
1369 // - set the current buffer to its end (this is a pointer in a buffer,
1370 // not a file ptr) "branchTo" is only valid in proc)
1371 currentVoice->fptr=strlen(currentVoice->buffer);
1372 // - kill local vars
1374 // - return
1375 newBuffer(omStrDup("\n;return(_);\n"),BT_execute);
1376 return (err!=0);
1377 }
1378 return FALSE;
1379}
int listLength()
Definition subexpr.cc:51
VAR Voice * currentVoice
Definition fevoices.cc:49
@ BT_execute
Definition fevoices.h:23
VAR idhdl currPackHdl
Definition ipid.cc:53
idhdl packFindHdl(package r)
Definition ipid.cc:808
#define IDID(a)
Definition ipid.h:122
char * iiGetLibProcBuffer(procinfo *pi, int part)
Definition iplib.cc:197
VAR idhdl iiCurrProc
Definition ipshell.cc:82
void iiCheckPack(package &p)
Definition ipshell.cc:1625
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
void killlocals(int v)
Definition ipshell.cc:387
void myychangebuffer()
Definition scanner.cc:2311

◆ iiCallLibProc1()

void * iiCallLibProc1 ( const char * n,
void * arg,
int arg_type,
BOOLEAN & err )

Definition at line 636 of file iplib.cc.

637{
638 idhdl h=ggetid(n);
639 if ((h==NULL)
640 || (IDTYP(h)!=PROC_CMD))
641 {
642 err=2;
643 return NULL;
644 }
645 // ring handling
646 idhdl save_ringhdl=currRingHdl;
647 ring save_ring=currRing;
649 // argument:
650 sleftv tmp;
651 tmp.Init();
652 tmp.data=arg;
653 tmp.rtyp=arg_type;
654 // call proc
655 err=iiMake_proc(h,currPack,&tmp);
656 // clean up ring
657 iiCallLibProcEnd(save_ringhdl,save_ring);
658 // return
659 if (err==FALSE)
660 {
661 void*r=iiRETURNEXPR.data;
662 iiRETURNEXPR.data=NULL;
663 iiRETURNEXPR.CleanUp();
664 return r;
665 }
666 return NULL;
667}

◆ iiCheckPack()

void iiCheckPack ( package & p)

Definition at line 1625 of file ipshell.cc.

1626{
1627 if (p!=basePack)
1628 {
1629 idhdl t=basePack->idroot;
1630 while ((t!=NULL) && (IDTYP(t)!=PACKAGE_CMD) && (IDPACKAGE(t)!=p)) t=t->next;
1631 if (t==NULL)
1632 {
1633 WarnS("package not found\n");
1634 p=basePack;
1635 }
1636 }
1637}
idhdl next
Definition idrec.h:38
VAR package basePack
Definition ipid.cc:56
#define IDPACKAGE(a)
Definition ipid.h:139
@ PACKAGE_CMD
Definition tok.h:150

◆ iiCheckRing()

BOOLEAN iiCheckRing ( int i)

Definition at line 1581 of file ipshell.cc.

1582{
1583 if (currRing==NULL)
1584 {
1585 #ifdef SIQ
1586 if (siq<=0)
1587 {
1588 #endif
1589 if (RingDependend(i))
1590 {
1591 WerrorS("no ring active (9)");
1592 return TRUE;
1593 }
1594 #ifdef SIQ
1595 }
1596 #endif
1597 }
1598 return FALSE;
1599}
VAR BOOLEAN siq
Definition subexpr.cc:48

◆ iiCheckTypes()

BOOLEAN iiCheckTypes ( leftv args,
const short * type_list,
int report = 0 )

check a list of arguemys against a given field of types return TRUE if the types match return FALSE (and, if report) report an error via Werror otherwise

Parameters
type_list< [in] argument list (may be NULL) [in] field of types len, t1,t2,...
report;in] report error?

Definition at line 6569 of file ipshell.cc.

6570{
6571 int l=0;
6572 if (args==NULL)
6573 {
6574 if (type_list[0]==0) return TRUE;
6575 }
6576 else l=args->listLength();
6577 if (l!=(int)type_list[0])
6578 {
6579 if (report) iiReportTypes(0,l,type_list);
6580 return FALSE;
6581 }
6582 for(int i=1;i<=l;i++,args=args->next)
6583 {
6584 short t=type_list[i];
6585 if (t!=ANY_TYPE)
6586 {
6587 if (((t==IDHDL)&&(args->rtyp!=IDHDL))
6588 || (t!=args->Typ()))
6589 {
6590 if (report) iiReportTypes(i,args->Typ(),type_list);
6591 return FALSE;
6592 }
6593 }
6594 }
6595 return TRUE;
6596}
static void iiReportTypes(int nr, int t, const short *T)
Definition ipshell.cc:6549
#define ANY_TYPE
Definition tok.h:30

◆ iiConvName()

char * iiConvName ( const char * libname)

Definition at line 1439 of file iplib.cc.

1440{
1441 char *tmpname = omStrDup(libname);
1442 char *p = strrchr(tmpname, DIR_SEP);
1443 char *r;
1444 if(p==NULL) p = tmpname; else p++;
1445 // p is now the start of the file name (without path)
1446 r=p;
1447 while(isalnum(*r)||(*r=='_')) r++;
1448 // r point the the end of the main part of the filename
1449 *r = '\0';
1450 r = omStrDup(p);
1451 *r = mytoupper(*r);
1452 // printf("iiConvName: '%s' '%s' => '%s'\n", libname, tmpname, r);
1453 omFree((ADDRESS)tmpname);
1454
1455 return(r);
1456}
#define DIR_SEP
Definition feResource.h:6
static char mytoupper(char c)
Definition iplib.cc:1420

◆ iiDebug()

void iiDebug ( )

Definition at line 1069 of file ipshell.cc.

1070{
1071#ifdef HAVE_SDB
1072 sdb_flags=1;
1073#endif
1074 Print("\n-- break point in %s --\n",VoiceName());
1076 char * s;
1078 s = (char *)omAlloc(BREAK_LINE_LENGTH+4);
1079 loop
1080 {
1081 memset(s,0,BREAK_LINE_LENGTH+4);
1083 if (s[BREAK_LINE_LENGTH-1]!='\0')
1084 {
1085 Print("line too long, max is %d chars\n",BREAK_LINE_LENGTH);
1086 }
1087 else
1088 break;
1089 }
1090 if (*s=='\n')
1091 {
1093 }
1094#if MDEBUG
1095 else if(strncmp(s,"cont;",5)==0)
1096 {
1098 }
1099#endif /* MDEBUG */
1100 else
1101 {
1102 strcat( s, "\n;~\n");
1104 }
1105}
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
Definition feread.cc:32
void VoiceBackTrack()
Definition fevoices.cc:77
VAR BOOLEAN iiDebugMarker
Definition ipshell.cc:1067
#define BREAK_LINE_LENGTH
Definition ipshell.cc:1068
VAR int sdb_flags
Definition sdb.cc:31

◆ iiDeclCommand()

int iiDeclCommand ( leftv sy,
leftv name,
int lev,
int t,
idhdl * root,
BOOLEAN isring = FALSE,
BOOLEAN init_b = TRUE )

Definition at line 1202 of file ipshell.cc.

1203{
1205 BOOLEAN is_qring=FALSE;
1206 const char *id = name->name;
1207
1208 sy->Init();
1209 if ((name->name==NULL)||(isdigit(name->name[0])))
1210 {
1211 WerrorS("object to declare is not a name");
1212 res=TRUE;
1213 }
1214 else
1215 {
1216 if (root==NULL) return TRUE;
1217 if (*root!=IDROOT)
1218 {
1219 if ((currRing==NULL) || (*root!=currRing->idroot))
1220 {
1221 Werror("can not define `%s` in other package",name->name);
1222 return TRUE;
1223 }
1224 }
1225 if (t==QRING_CMD)
1226 {
1227 t=RING_CMD; // qring is always RING_CMD
1228 is_qring=TRUE;
1229 }
1230
1231 if (TEST_V_ALLWARN
1232 && (name->rtyp!=0)
1233 && (name->rtyp!=IDHDL)
1235 {
1236 Warn("`%s` is %s in %s:%d:%s",name->name,Tok2Cmdname(name->rtyp),
1238 }
1239 {
1240 sy->data = (char *)enterid(id,lev,t,root,init_b);
1241 }
1242 if (sy->data!=NULL)
1243 {
1244 sy->rtyp=IDHDL;
1245 currid=sy->name=IDID((idhdl)sy->data);
1246 if (is_qring)
1247 {
1249 }
1250 // name->name=NULL; /* used in enterid */
1251 //sy->e = NULL;
1252 if (name->next!=NULL)
1253 {
1255 res=iiDeclCommand(sy->next,name->next,lev,t,root, isring);
1256 }
1257 }
1258 else res=TRUE;
1259 }
1260 name->CleanUp();
1261 return res;
1262}
BITSET flag
Definition subexpr.h:90
VAR int yylineno
Definition febase.cc:40
VAR char my_yylinebuf[80]
Definition febase.cc:44
const char * currid
Definition grammar.cc:171
#define IDLEV(a)
Definition ipid.h:121
#define Sy_bit(x)
Definition options.h:31
@ QRING_CMD
Definition tok.h:160

◆ iiEStart()

BOOLEAN iiEStart ( char * example,
procinfo * pi )

Definition at line 763 of file iplib.cc.

764{
765 BOOLEAN err;
766 int old_echo=si_echo;
767
768 iiCheckNest();
769 procstack->push(example);
772 {
773 if (traceit&TRACE_SHOW_LINENO) printf("\n");
774 printf("entering example (level %d)\n",myynest);
775 }
776 myynest++;
777
778 err=iiAllStart(pi,example,BT_example,(pi != NULL ? pi->data.s.example_lineno: 0));
779
781 myynest--;
782 si_echo=old_echo;
784 {
785 if (traceit&TRACE_SHOW_LINENO) printf("\n");
786 printf("leaving -example- (level %d)\n",myynest);
787 }
789 {
791 {
794 }
795 else
796 {
799 }
800 }
801 procstack->pop();
802 return err;
803}
VAR int si_echo
Definition febase.cc:35
@ BT_example
Definition fevoices.h:21
VAR proclevel * procstack
Definition ipid.cc:50
static void iiCheckNest()
Definition iplib.cc:502
VAR ring * iiLocalRing
Definition iplib.cc:482
BOOLEAN iiAllStart(procinfov pi, const char *p, feBufferTypes t, int l)
Definition iplib.cc:306
idhdl rFindHdl(ring r, idhdl n)
Definition ipshell.cc:1695
#define TRACE_SHOW_LINENO
Definition reporter.h:31
#define TRACE_SHOW_PROC
Definition reporter.h:29

◆ iiExport() [1/2]

BOOLEAN iiExport ( leftv v,
int toLev )

Definition at line 1506 of file ipshell.cc.

1507{
1508 BOOLEAN nok=FALSE;
1509 leftv r=v;
1510 while (v!=NULL)
1511 {
1512 if ((v->name==NULL)||(v->rtyp==0)||(v->e!=NULL))
1513 {
1514 Werror("cannot export:%s of internal type %d",v->name,v->rtyp);
1515 nok=TRUE;
1516 }
1517 else
1518 {
1519 if(iiInternalExport(v, toLev))
1520 nok=TRUE;
1521 }
1522 v=v->next;
1523 }
1524 r->CleanUp();
1525 return nok;
1526}
static BOOLEAN iiInternalExport(leftv v, int toLev)
Definition ipshell.cc:1407

◆ iiExport() [2/2]

BOOLEAN iiExport ( leftv v,
int toLev,
package pack )

Definition at line 1529 of file ipshell.cc.

1530{
1531// if ((pack==basePack)&&(pack!=currPack))
1532// { Warn("'exportto' to Top is depreciated in >>%s<<",my_yylinebuf);}
1533 BOOLEAN nok=FALSE;
1534 leftv rv=v;
1535 while (v!=NULL)
1536 {
1537 if ((v->name==NULL)||(v->rtyp==0)||(v->e!=NULL)
1538 )
1539 {
1540 Werror("cannot export:%s of internal type %d",v->name,v->rtyp);
1541 nok=TRUE;
1542 }
1543 else
1544 {
1545 idhdl old=pack->idroot->get( v->name,toLev);
1546 if (old!=NULL)
1547 {
1548 if ((pack==currPack) && (old==(idhdl)v->data))
1549 {
1550 if (BVERBOSE(V_REDEFINE)) Warn("`%s` is already global",IDID(old));
1551 break;
1552 }
1553 else if (IDTYP(old)==v->Typ())
1554 {
1555 if (BVERBOSE(V_REDEFINE))
1556 {
1557 Warn("redefining %s (%s)",IDID(old),my_yylinebuf);
1558 }
1559 v->name=omStrDup(v->name);
1560 killhdl2(old,&(pack->idroot),currRing);
1561 }
1562 else
1563 {
1564 rv->CleanUp();
1565 return TRUE;
1566 }
1567 }
1568 //Print("iiExport: pack=%s\n",IDID(root));
1569 if(iiInternalExport(v, toLev, pack))
1570 {
1571 rv->CleanUp();
1572 return TRUE;
1573 }
1574 }
1575 v=v->next;
1576 }
1577 rv->CleanUp();
1578 return nok;
1579}
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition ipid.cc:422

◆ iiExprArith1()

BOOLEAN iiExprArith1 ( leftv res,
sleftv * a,
int op )

◆ iiExprArith1Tab()

BOOLEAN iiExprArith1Tab ( leftv res,
leftv a,
int op,
const struct sValCmd1 * dA1,
int at,
const struct sConvertTypes * dConvertTypes )

apply an operation 'op' to an argument a return TRUE on failure

Parameters
[out]respre-allocated result
[in]aargument
[in]opoperation
[in]dA1table of possible proc assumes dArith1[0].cmd==op
[in]ata->Typ()
[in]dConvertTypestable of type conversions

Definition at line 9200 of file iparith.cc.

9201{
9202 res->Init();
9203 BOOLEAN call_failed=FALSE;
9204
9205 if (!errorreported)
9206 {
9207 BOOLEAN failed=FALSE;
9208 iiOp=op;
9209 int i = 0;
9210 while (dA1[i].cmd==op)
9211 {
9212 if (at==dA1[i].arg)
9213 {
9214 if (currRing!=NULL)
9215 {
9216 if (check_valid(dA1[i].valid_for,op)) break;
9217 }
9218 else
9219 {
9220 if (RingDependend(dA1[i].res))
9221 {
9222 WerrorS("no ring active (5)");
9223 break;
9224 }
9225 }
9226 if (traceit&TRACE_CALL)
9227 Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
9228 res->rtyp=dA1[i].res;
9229 if ((call_failed=dA1[i].p(res,a)))
9230 {
9231 break;// leave loop, goto error handling
9232 }
9233 if (a->Next()!=NULL)
9234 {
9236 failed=iiExprArith1(res->next,a->next,op);
9237 }
9238 a->CleanUp();
9239 return failed;
9240 }
9241 i++;
9242 }
9243 // implicite type conversion --------------------------------------------
9244 if (dA1[i].cmd!=op)
9245 {
9247 i=0;
9248 //Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
9249 while (dA1[i].cmd==op)
9250 {
9251 int ai;
9252 //Print("test %s\n",Tok2Cmdname(dA1[i].arg));
9253 if ((dA1[i].valid_for & NO_CONVERSION)==0)
9254 {
9255 if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
9256 {
9257 if (currRing!=NULL)
9258 {
9259 if (check_valid(dA1[i].valid_for,op)) break;
9260 }
9261 else
9262 {
9263 if (RingDependend(dA1[i].res))
9264 {
9265 WerrorS("no ring active (6)");
9266 break;
9267 }
9268 }
9269 if (traceit&TRACE_CALL)
9270 Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
9271 res->rtyp=dA1[i].res;
9272 failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
9273 || (call_failed=dA1[i].p(res,an)));
9274 // everything done, clean up temp. variables
9275 if (failed)
9276 {
9277 // leave loop, goto error handling
9278 break;
9279 }
9280 else
9281 {
9282 if (an->Next() != NULL)
9283 {
9284 res->next = (leftv)omAllocBin(sleftv_bin);
9285 failed=iiExprArith1(res->next,an->next,op);
9286 }
9287 // everything ok, clean up and return
9288 an->CleanUp();
9290 return failed;
9291 }
9292 }
9293 }
9294 i++;
9295 }
9296 an->CleanUp();
9298 }
9299 // error handling
9300 if (!errorreported)
9301 {
9302 if ((at==0) && (a->Fullname()!=sNoName_fe))
9303 {
9304 Werror("`%s` is not defined",a->Fullname());
9305 }
9306 else
9307 {
9308 i=0;
9309 const char *s = iiTwoOps(op);
9310 Werror("%s(`%s`) failed"
9311 ,s,Tok2Cmdname(at));
9312 if ((!call_failed) && BVERBOSE(V_SHOW_USE))
9313 {
9314 while (dA1[i].cmd==op)
9315 {
9316 if ((dA1[i].res!=0)
9317 && (dA1[i].p!=jjWRONG))
9318 Werror("expected %s(`%s`)"
9319 ,s,Tok2Cmdname(dA1[i].arg));
9320 i++;
9321 }
9322 }
9323 }
9324 }
9325 res->rtyp = UNKNOWN;
9326 }
9327 a->CleanUp();
9328 return TRUE;
9329}
leftv Next()
Definition subexpr.h:136
const char * Fullname()
Definition subexpr.h:125
const char sNoName_fe[]
Definition fevoices.cc:57
#define NO_CONVERSION
Definition gentable.cc:51
const char * iiTwoOps(int t)
Definition gentable.cc:258
#define jjWRONG
Definition gentable.cc:124
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition iparith.cc:9330
static BOOLEAN check_valid(const int p, const int op)
Definition iparith.cc:10142
VAR int iiOp
Definition iparith.cc:218
const char * Tok2Cmdname(int tok)
Definition iparith.cc:9862
const struct sConvertTypes dConvertTypes[]
Definition table.h:1321
short res
Definition gentable.cc:79
#define V_SHOW_USE
Definition options.h:52
#define TRACE_CALL
Definition reporter.h:44
#define UNKNOWN
Definition tok.h:224

◆ iiExprArith2()

BOOLEAN iiExprArith2 ( leftv res,
sleftv * a,
int op,
sleftv * b,
BOOLEAN proccall = FALSE )

◆ iiExprArith2Tab()

BOOLEAN iiExprArith2Tab ( leftv res,
leftv a,
int op,
const struct sValCmd2 * dA2,
int at,
const struct sConvertTypes * dConvertTypes )

apply an operation 'op' to arguments a and a->next return TRUE on failure

Parameters
[out]respre-allocated result
[in]a2 arguments
[in]opoperation
[in]dA2table of possible proc assumes dA2[0].cmd==op
[in]ata->Typ()
[in]dConvertTypestable of type conversions

Definition at line 9127 of file iparith.cc.

9131{
9132 res->Init();
9133 leftv b=a->next;
9134 a->next=NULL;
9135 int bt=b->Typ();
9137 a->next=b;
9138 a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
9139 return bo;
9140}
static BOOLEAN iiExprArith2TabIntern(leftv res, leftv a, int op, leftv b, BOOLEAN proccall, const struct sValCmd2 *dA2, int at, int bt, const struct sConvertTypes *dConvertTypes)
Definition iparith.cc:8968

◆ iiExprArith3()

BOOLEAN iiExprArith3 ( leftv res,
int op,
leftv a,
leftv b,
leftv c )

Definition at line 9540 of file iparith.cc.

9541{
9542 res->Init();
9543
9544 if (!errorreported)
9545 {
9546#ifdef SIQ
9547 if (siq>0)
9548 {
9549 //Print("siq:%d\n",siq);
9551 memcpy(&d->arg1,a,sizeof(sleftv));
9552 a->Init();
9553 memcpy(&d->arg2,b,sizeof(sleftv));
9554 b->Init();
9555 memcpy(&d->arg3,c,sizeof(sleftv));
9556 c->Init();
9557 d->op=op;
9558 d->argc=3;
9559 res->data=(char *)d;
9560 res->rtyp=COMMAND;
9561 return FALSE;
9562 }
9563#endif
9564 int at=a->Typ();
9565 // handling bb-objects ----------------------------------------------
9566 if (at>MAX_TOK)
9567 {
9568 blackbox *bb=getBlackboxStuff(at);
9569 if (bb!=NULL)
9570 {
9571 if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
9572 // otherwise, try defaul (attrib,..)
9573 }
9574 else
9575 return TRUE;
9576 if (errorreported) return TRUE;
9577 }
9578 int bt=b->Typ();
9579 int ct=c->Typ();
9580
9581 iiOp=op;
9582 int i=0;
9583 while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
9584 return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
9585 }
9586 a->CleanUp();
9587 b->CleanUp();
9588 c->CleanUp();
9589 //Print("op: %d,result typ:%d\n",op,res->rtyp);
9590 return TRUE;
9591}
static BOOLEAN iiExprArith3TabIntern(leftv res, int op, leftv a, leftv b, leftv c, const struct sValCmd3 *dA3, int at, int bt, int ct, const struct sConvertTypes *dConvertTypes)
Definition iparith.cc:9387
VAR omBin sip_command_bin
Definition ipid.cc:45
ip_command * command
Definition ipid.h:23
const struct sValCmd3 dArith3[]
Definition table.h:801
#define COMMAND
Definition tok.h:29

◆ iiExprArith3Tab()

BOOLEAN iiExprArith3Tab ( leftv res,
leftv a,
int op,
const struct sValCmd3 * dA3,
int at,
const struct sConvertTypes * dConvertTypes )

apply an operation 'op' to arguments a, a->next and a->next->next return TRUE on failure

Parameters
[out]respre-allocated result
[in]a3 arguments
[in]opoperation
[in]dA3table of possible proc assumes dA3[0].cmd==op
[in]ata->Typ()
[in]dConvertTypestable of type conversions

Definition at line 9592 of file iparith.cc.

9596{
9597 res->Init();
9598 leftv b=a->next;
9599 a->next=NULL;
9600 int bt=b->Typ();
9601 leftv c=b->next;
9602 b->next=NULL;
9603 int ct=c->Typ();
9604 BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
9605 b->next=c;
9606 a->next=b;
9607 a->CleanUp(); // to cleanup the chain, content already done
9608 return bo;
9609}

◆ iiExprArithM()

BOOLEAN iiExprArithM ( leftv res,
sleftv * a,
int op )

◆ iiGetLibName()

static char * iiGetLibName ( const procinfov pi)
inlinestatic

find the library of an proc

Definition at line 66 of file ipshell.h.

66{ return pi->libname; }

◆ iiGetLibProcBuffer()

char * iiGetLibProcBuffer ( procinfov pi,
int part = 1 )

◆ iiGetLibStatus()

BOOLEAN iiGetLibStatus ( const char * lib)

Definition at line 77 of file iplib.cc.

78{
79 idhdl hl;
80
81 char *plib = iiConvName(lib);
82 hl = basePack->idroot->get(plib,0);
83 omFreeBinAddr(plib);
84 if((hl==NULL) ||(IDTYP(hl)!=PACKAGE_CMD))
85 {
86 return FALSE;
87 }
88 if ((IDPACKAGE(hl)->language!=LANG_C)&&(IDPACKAGE(hl)->libname!=NULL))
89 return (strcmp(lib,IDPACKAGE(hl)->libname)==0);
90 return FALSE;
91}

◆ iiHighCorner()

poly iiHighCorner ( ideal i,
int ak )

Definition at line 1601 of file ipshell.cc.

1602{
1603 int i;
1604 if(!idIsZeroDim(I)) return NULL; // not zero-dim.
1605 poly po=NULL;
1607 {
1608 scComputeHC(I,currRing->qideal,ak,po);
1609 if (po!=NULL)
1610 {
1611 pGetCoeff(po)=nInit(1);
1612 for (i=rVar(currRing); i>0; i--)
1613 {
1614 if (pGetExp(po, i) > 0) pDecrExp(po,i);
1615 }
1616 pSetComp(po,ak);
1617 pSetm(po);
1618 }
1619 }
1620 else
1621 po=pOne();
1622 return po;
1623}
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
Definition hdegree.cc:1074
static BOOLEAN idIsZeroDim(ideal i)
Definition ideals.h:180
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
#define nInit(i)
Definition numbers.h:24
#define pSetm(p)
Definition polys.h:272
#define pSetComp(p, v)
Definition polys.h:39
#define pGetExp(p, i)
Exponent.
Definition polys.h:42
#define pOne()
Definition polys.h:316
#define pDecrExp(p, i)
Definition polys.h:45
static BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:769
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition ring.h:598

◆ iiInternalExport()

BOOLEAN iiInternalExport ( leftv v,
int toLev,
package pack )

Definition at line 1460 of file ipshell.cc.

1461{
1462 idhdl h=(idhdl)v->data;
1463 if(h==NULL)
1464 {
1465 Warn("'%s': no such identifier\n", v->name);
1466 return FALSE;
1467 }
1468 package frompack=v->req_packhdl;
1469 if (frompack==NULL) frompack=currPack;
1470 if ((RingDependend(IDTYP(h)))
1471 || ((IDTYP(h)==LIST_CMD)
1472 && (lRingDependend(IDLIST(h)))
1473 )
1474 )
1475 {
1476 //Print("// ==> Ringdependent set nesting to 0\n");
1477 return (iiInternalExport(v, toLev));
1478 }
1479 else
1480 {
1481 IDLEV(h)=toLev;
1482 v->req_packhdl=rootpack;
1483 if (h==frompack->idroot)
1484 {
1485 frompack->idroot=h->next;
1486 }
1487 else
1488 {
1489 idhdl hh=frompack->idroot;
1490 while ((hh!=NULL) && (hh->next!=h))
1491 hh=hh->next;
1492 if ((hh!=NULL) && (hh->next==h))
1493 hh->next=h->next;
1494 else
1495 {
1496 Werror("`%s` not found",v->Name());
1497 return TRUE;
1498 }
1499 }
1500 h->next=rootpack->idroot;
1501 rootpack->idroot=h;
1502 }
1503 return FALSE;
1504}

◆ iiLibCmd()

BOOLEAN iiLibCmd ( const char * newlib,
BOOLEAN autoexport,
BOOLEAN tellerror,
BOOLEAN force )

Definition at line 894 of file iplib.cc.

895{
896 if (strcmp(newlib,"Singular")==0) return FALSE;
897 char libnamebuf[1024];
898 idhdl pl;
899 char *plib = iiConvName(newlib);
900 FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
901 // int lines = 1;
902 BOOLEAN LoadResult = TRUE;
903
904 if (fp==NULL)
905 {
906 return TRUE;
907 }
908 pl = basePack->idroot->get(plib,0);
909 if (pl==NULL)
910 {
911 pl = enterid( plib,0, PACKAGE_CMD,
912 &(basePack->idroot), TRUE );
913 IDPACKAGE(pl)->language = LANG_SINGULAR;
914 IDPACKAGE(pl)->libname=omStrDup(newlib);
915 }
916 else
917 {
918 if(IDTYP(pl)!=PACKAGE_CMD)
919 {
920 omFreeBinAddr(plib);
921 WarnS("not of type package.");
922 fclose(fp);
923 return TRUE;
924 }
925 if (!force)
926 {
927 omFreeBinAddr(plib);
928 return FALSE;
929 }
930 }
931 LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, autoexport, tellerror);
932
933 if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
934 omFree((ADDRESS)plib);
935 return LoadResult;
936}
CanonicalForm fp
Definition cfModGcd.cc:4110
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition feFopen.cc:47
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
Definition iplib.cc:983
VAR char libnamebuf[1024]
Definition libparse.cc:1098

◆ iiLoadLIB()

BOOLEAN iiLoadLIB ( FILE * fp,
const char * libnamebuf,
const char * newlib,
idhdl pl,
BOOLEAN autoexport,
BOOLEAN tellerror )

Definition at line 983 of file iplib.cc.

985{
986 EXTERN_VAR FILE *yylpin;
987 libstackv ls_start = library_stack;
988 lib_style_types lib_style;
989
990 yylpin = fp;
991 #if YYLPDEBUG > 1
992 print_init();
993 #endif
996 else lpverbose=0;
997 // yylplex sets also text_buffer
998 if (text_buffer!=NULL) *text_buffer='\0';
999 yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
1000 if(yylp_errno)
1001 {
1002 Werror("Library %s: ERROR occurred: in line %d, %d.", newlib, yylplineno,
1003 current_pos(0));
1005 {
1009 }
1010 else
1012 WerrorS("Cannot load library,... aborting.");
1013 reinit_yylp();
1014 fclose( yylpin );
1016 return TRUE;
1017 }
1018 if (BVERBOSE(V_LOAD_LIB))
1019 Print( "// ** loaded %s %s\n", libnamebuf, text_buffer);
1020 if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB)))
1021 {
1022 Warn( "library %s has old format. This format is still accepted,", newlib);
1023 WarnS( "but for functionality you may wish to change to the new");
1024 WarnS( "format. Please refer to the manual for further information.");
1025 }
1026 reinit_yylp();
1027 fclose( yylpin );
1028 fp = NULL;
1029 iiRunInit(IDPACKAGE(pl));
1030
1031 {
1032 libstackv ls;
1033 for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
1034 {
1035 if(ls->to_be_done)
1036 {
1037 ls->to_be_done=FALSE;
1038 iiLibCmd(ls->get(),autoexport,tellerror,FALSE);
1039 ls = ls->pop(newlib);
1040 }
1041 }
1042#if 0
1043 PrintS("--------------------\n");
1044 for(ls = library_stack; ls != NULL; ls = ls->next)
1045 {
1046 Print("%s: LIB-stack:(%d), %s %s\n", newlib, ls->cnt, ls->get(),
1047 ls->to_be_done ? "not loaded" : "loaded");
1048 }
1049 PrintS("--------------------\n");
1050#endif
1051 }
1052
1053 if(fp != NULL) fclose(fp);
1054 return FALSE;
1055}
char * get()
Definition subexpr.h:170
libstackv next
Definition subexpr.h:164
libstackv pop(const char *p)
Definition iplib.cc:1531
int cnt
Definition subexpr.h:167
BOOLEAN to_be_done
Definition subexpr.h:166
#define EXTERN_VAR
Definition globaldefs.h:6
int current_pos(int i=0)
Definition libparse.cc:3346
void print_init()
Definition libparse.cc:3482
static void iiCleanProcs(idhdl &root)
Definition iplib.cc:938
VAR libstackv library_stack
Definition iplib.cc:68
const char * yylp_errlist[]
Definition libparse.cc:1114
EXTERN_VAR int yylplineno
Definition iplib.cc:65
static void iiRunInit(package p)
Definition iplib.cc:967
EXTERN_VAR int yylp_errno
Definition iplib.cc:64
void reinit_yylp()
Definition libparse.cc:3376
VAR char * text_buffer
Definition libparse.cc:1099
VAR int lpverbose
Definition libparse.cc:1106
lib_style_types
Definition libparse.h:9
@ OLD_LIBSTYLE
Definition libparse.h:9
#define YYLP_BAD_CHAR
Definition libparse.h:93
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
#define V_DEBUG_LIB
Definition options.h:48
#define V_LOAD_LIB
Definition options.h:47
libstack * libstackv
Definition subexpr.h:159

◆ iiLocateLib()

BOOLEAN iiLocateLib ( const char * lib,
char * where )

Definition at line 880 of file iplib.cc.

881{
882 char *plib = iiConvName(lib);
883 idhdl pl = basePack->idroot->get(plib,0);
884 if( (pl!=NULL) && (IDTYP(pl)==PACKAGE_CMD) &&
885 (IDPACKAGE(pl)->language == LANG_SINGULAR))
886 {
887 strncpy(where,IDPACKAGE(pl)->libname,127);
888 return TRUE;
889 }
890 else
891 return FALSE;;
892}

◆ iiMake_proc()

BOOLEAN iiMake_proc ( idhdl pn,
package pack,
leftv sl )

Definition at line 513 of file iplib.cc.

514{
515 int err;
516 procinfov pi = IDPROC(pn);
517 if(pi->is_static && myynest==0)
518 {
519 Werror("'%s::%s()' is a local procedure and cannot be accessed by an user.",
520 pi->libname, pi->procname);
521 return TRUE;
522 }
523 iiCheckNest();
525 //Print("currRing(%d):%s(%x) in %s\n",myynest,IDID(currRingHdl),currRing,IDID(pn));
526 iiRETURNEXPR.Init();
527 procstack->push(pi->procname);
529 || (pi->trace_flag&TRACE_SHOW_PROC))
530 {
532 Print("entering%-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
533 }
534#ifdef RDEBUG
536#endif
537 switch (pi->language)
538 {
539 default:
540 case LANG_NONE:
541 WerrorS("undefined proc");
542 err=TRUE;
543 break;
544
545 case LANG_SINGULAR:
546 if ((pi->pack!=NULL)&&(currPack!=pi->pack))
547 {
548 currPack=pi->pack;
551 //Print("set pack=%s\n",IDID(currPackHdl));
552 }
553 else if ((pack!=NULL)&&(currPack!=pack))
554 {
555 currPack=pack;
558 //Print("set pack=%s\n",IDID(currPackHdl));
559 }
560 err=iiPStart(pn,args);
561 break;
562 case LANG_C:
564 err = (pi->data.o.function)(res, args);
565 memcpy(&iiRETURNEXPR,res,sizeof(iiRETURNEXPR));
567 break;
568 }
570 || (pi->trace_flag&TRACE_SHOW_PROC))
571 {
573 Print("leaving %-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
574 }
575 //const char *n="NULL";
576 //if (currRingHdl!=NULL) n=IDID(currRingHdl);
577 //Print("currRing(%d):%s(%x) after %s\n",myynest,n,currRing,IDID(pn));
578#ifdef RDEBUG
580#endif
581 if (err)
582 {
583 iiRETURNEXPR.CleanUp();
584 //iiRETURNEXPR.Init(); //done by CleanUp
585 }
586 if (iiCurrArgs!=NULL)
587 {
588 if (!err) Warn("too many arguments for %s",IDID(pn));
589 iiCurrArgs->CleanUp();
592 }
593 procstack->pop();
594 if (err)
595 return TRUE;
596 return FALSE;
597}
static void iiShowLevRings()
Definition iplib.cc:487
BOOLEAN iiPStart(idhdl pn, leftv v)
Definition iplib.cc:379
#define TRACE_SHOW_RINGS
Definition reporter.h:36

◆ iiMakeResolv()

void iiMakeResolv ( resolvente r,
int length,
int rlen,
char * name,
int typ0,
intvec ** weights = NULL )

Definition at line 850 of file ipshell.cc.

852{
853 lists L=liMakeResolv(r,length,rlen,typ0,weights);
854 int i=0;
855 idhdl h;
856 size_t len=strlen(name)+5;
857 char * s=(char *)omAlloc(len);
858
859 while (i<=L->nr)
860 {
861 snprintf(s,len,"%s(%d)",name,i+1);
862 if (i==0)
863 h=enterid(s,myynest,typ0,&(currRing->idroot), FALSE);
864 else
866 if (h!=NULL)
867 {
868 h->data.uideal=(ideal)L->m[i].data;
869 h->attribute=L->m[i].attribute;
870 if (BVERBOSE(V_DEF_RES))
871 Print("//defining: %s as %d-th syzygy module\n",s,i+1);
872 }
873 else
874 {
875 idDelete((ideal *)&(L->m[i].data));
876 Warn("cannot define %s",s);
877 }
878 //L->m[i].data=NULL;
879 //L->m[i].rtyp=0;
880 //L->m[i].attribute=NULL;
881 i++;
882 }
883 omFreeSize((ADDRESS)L->m,(L->nr+1)*sizeof(sleftv));
885 omFreeSize((ADDRESS)s,strlen(name)+5);
886}
attr attribute
Definition subexpr.h:89
sleftv * m
Definition lists.h:46
int nr
Definition lists.h:44
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
VAR omBin slists_bin
Definition lists.cc:23
lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec **weights, int add_row_shift)
Definition lists.cc:239
#define omFreeSize(addr, size)
#define V_DEF_RES
Definition options.h:50

◆ iiMap()

leftv iiMap ( map theMap,
const char * what )

Definition at line 614 of file ipshell.cc.

615{
616 idhdl w,r;
617 leftv v;
618 int i;
619 nMapFunc nMap;
620
621 r=IDROOT->get(theMap->preimage,myynest);
622 if ((currPack!=basePack)
623 &&((r==NULL) || ((r->typ != RING_CMD) )))
624 r=basePack->idroot->get(theMap->preimage,myynest);
625 if ((r==NULL) && (currRingHdl!=NULL)
626 && (strcmp(theMap->preimage,IDID(currRingHdl))==0))
627 {
628 r=currRingHdl;
629 }
630 if ((r!=NULL) && (r->typ == RING_CMD))
631 {
632 ring src_ring=IDRING(r);
633 if ((nMap=n_SetMap(src_ring->cf, currRing->cf))==NULL)
634 {
635 Werror("can not map from ground field of %s to current ground field",
636 theMap->preimage);
637 return NULL;
638 }
639 if (IDELEMS(theMap)<src_ring->N)
640 {
641 theMap->m=(polyset)omReallocSize((ADDRESS)theMap->m,
642 IDELEMS(theMap)*sizeof(poly),
643 (src_ring->N)*sizeof(poly));
644#ifdef HAVE_SHIFTBBA
645 if (rIsLPRing(src_ring))
646 {
647 // src_ring [x,y,z,...]
648 // curr_ring [a,b,c,...]
649 //
650 // map=[a,b,c,d] -> [a,b,c,...]
651 // map=[a,b] -> [a,b,0,...]
652
653 short src_lV = src_ring->isLPring;
654 short src_ncGenCount = src_ring->LPncGenCount;
655 short src_nVars = src_lV - src_ncGenCount;
656 int src_nblocks = src_ring->N / src_lV;
657
658 short dest_nVars = currRing->isLPring - currRing->LPncGenCount;
659 short dest_ncGenCount = currRing->LPncGenCount;
660
661 // add missing NULL generators
662 for(i=IDELEMS(theMap); i < src_lV - src_ncGenCount; i++)
663 {
664 theMap->m[i]=NULL;
665 }
666
667 // remove superfluous generators
668 for(i = src_nVars; i < IDELEMS(theMap); i++)
669 {
670 if (theMap->m[i] != NULL)
671 {
672 p_Delete(&(theMap->m[i]), currRing);
673 theMap->m[i] = NULL;
674 }
675 }
676
677 // add ncgen mappings
678 for(i = src_nVars; i < src_lV; i++)
679 {
680 short ncGenIndex = i - src_nVars;
681 if (ncGenIndex < dest_ncGenCount)
682 {
683 poly p = p_One(currRing);
684 p_SetExp(p, dest_nVars + ncGenIndex + 1, 1, currRing);
685 p_Setm(p, currRing);
686 theMap->m[i] = p;
687 }
688 else
689 {
690 theMap->m[i] = NULL;
691 }
692 }
693
694 // copy the first block to all other blocks
695 for(i = 1; i < src_nblocks; i++)
696 {
697 for(int j = 0; j < src_lV; j++)
698 {
699 theMap->m[(i * src_lV) + j] = p_Copy(theMap->m[j], currRing);
700 }
701 }
702 }
703 else
704 {
705#endif
706 for(i=IDELEMS(theMap);i<src_ring->N;i++)
707 theMap->m[i]=NULL;
708#ifdef HAVE_SHIFTBBA
709 }
710#endif
711 IDELEMS(theMap)=src_ring->N;
712 }
713 if (what==NULL)
714 {
715 WerrorS("argument of a map must have a name");
716 }
717 else if ((w=src_ring->idroot->get(what,myynest))!=NULL)
718 {
719 char *save_r=NULL;
721 sleftv tmpW;
722 tmpW.Init();
723 tmpW.rtyp=IDTYP(w);
724 if (tmpW.rtyp==MAP_CMD)
725 {
726 tmpW.rtyp=IDEAL_CMD;
727 save_r=IDMAP(w)->preimage;
728 IDMAP(w)->preimage=0;
729 }
730 tmpW.data=IDDATA(w);
731 // check overflow
732 BOOLEAN overflow=FALSE;
733 if ((tmpW.rtyp==IDEAL_CMD)
734 || (tmpW.rtyp==MODUL_CMD)
735 || (tmpW.rtyp==SMATRIX_CMD)
736 || (tmpW.rtyp==MAP_CMD))
737 {
738 ideal id=(ideal)tmpW.data;
739 long *degs=NULL;
740 if (IDELEMS(id)>0) degs=(long*)omAlloc(IDELEMS(id)*sizeof(long));
741 for(int i=IDELEMS(id)-1;i>=0;i--)
742 {
743 poly p=id->m[i];
744 if (p!=NULL) degs[i]=p_Totaldegree(p,src_ring);
745 else degs[i]=0;
746 }
747 for(int j=IDELEMS(theMap)-1;j>=0 && !overflow;j--)
748 {
749 if (theMap->m[j]!=NULL)
750 {
751 long deg_monexp=pTotaldegree(theMap->m[j]);
752
753 for(int i=IDELEMS(id)-1;i>=0;i--)
754 {
755 poly p=id->m[i];
756 if ((p!=NULL) && (degs[i]!=0) &&
757 ((unsigned long)deg_monexp > (currRing->bitmask / ((unsigned long)degs[i])/2)))
758 {
759 overflow=TRUE;
760 break;
761 }
762 }
763 }
764 }
765 if (degs!=NULL) omFreeSize(degs,IDELEMS(id)*sizeof(long));
766 }
767 else if ((tmpW.rtyp==POLY_CMD)
768 || (tmpW.rtyp==VECTOR_CMD))
769 {
770 for(int j=IDELEMS(theMap)-1;j>=0 && !overflow;j--)
771 {
772 if (theMap->m[j]!=NULL)
773 {
774 long deg_monexp=pTotaldegree(theMap->m[j]);
775 poly p=(poly)tmpW.data;
776 long deg=0;
777 if ((p!=NULL) && ((deg=p_Totaldegree(p,src_ring))!=0) &&
778 ((unsigned long)deg_monexp > (currRing->bitmask / ((unsigned long)deg)/2)))
779 {
780 overflow=TRUE;
781 break;
782 }
783 }
784 }
785 }
786 if (overflow)
787#ifdef HAVE_SHIFTBBA
788 // in Letterplace rings the exponent is always 0 or 1! ignore this warning.
789 if (!rIsLPRing(currRing))
790 {
791#endif
792 Warn("possible OVERFLOW in map, max exponent is %ld",currRing->bitmask/2);
793#ifdef HAVE_SHIFTBBA
794 }
795#endif
796#if 0
797 if (((tmpW.rtyp==IDEAL_CMD)||(tmpW.rtyp==MODUL_CMD)) && idIs0(IDIDEAL(w)))
798 {
799 v->rtyp=tmpW.rtyp;
800 v->data=idInit(IDELEMS(IDIDEAL(w)),IDIDEAL(w)->rank);
801 }
802 else
803#endif
804 {
805 if ((tmpW.rtyp==IDEAL_CMD)
806 ||(tmpW.rtyp==MODUL_CMD)
807 ||(tmpW.rtyp==MATRIX_CMD)
808 ||(tmpW.rtyp==SMATRIX_CMD)
809 ||(tmpW.rtyp==MAP_CMD))
810 {
811 v->rtyp=tmpW.rtyp;
812 char *tmp = theMap->preimage;
813 theMap->preimage=(char*)1L;
814 // map gets 1 as its rank (as an ideal)
815 v->data=maMapIdeal(IDIDEAL(w), src_ring, (ideal)theMap, currRing,nMap);
816 theMap->preimage=tmp; // map gets its preimage back
817 }
818 if (v->data==NULL) /*i.e. not IDEAL/MODUL/SMATRIX/MATRIX/MAP */
819 {
820 if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,src_ring,NULL,NULL,0,nMap))
821 {
822 Werror("cannot map %s(%d)",Tok2Cmdname(w->typ),w->typ);
824 if (save_r!=NULL) IDMAP(w)->preimage=save_r;
825 return NULL;
826 }
827 }
828 }
829 if (save_r!=NULL)
830 {
831 IDMAP(w)->preimage=save_r;
832 IDMAP((idhdl)v)->preimage=omStrDup(save_r);
833 v->rtyp=MAP_CMD;
834 }
835 return v;
836 }
837 else
838 {
839 Werror("%s undefined in %s",what,theMap->preimage);
840 }
841 }
842 else
843 {
844 Werror("cannot find preimage %s",theMap->preimage);
845 }
846 return NULL;
847}
int typ
Definition idrec.h:43
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:701
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
const CanonicalForm & w
Definition facAbsFact.cc:51
ideal maMapIdeal(const ideal map_id, const ring preimage_r, const ideal image_id, const ring image_r, const nMapFunc nMap)
polynomial map for ideals/module/matrix map_id: the ideal to map map_r: the base ring for map_id imag...
Definition gen_maps.cc:88
@ SMATRIX_CMD
Definition grammar.cc:292
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN maApplyFetch(int what, map theMap, leftv res, leftv w, ring preimage_r, int *perm, int *par_perm, int P, nMapFunc nMap)
Definition maps_ip.cc:45
#define omReallocSize(addr, o_size, size)
poly p_One(const ring r)
Definition p_polys.cc:1314
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition p_polys.h:490
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1523
static long pTotaldegree(poly p)
Definition polys.h:283
poly * polyset
Definition polys.h:260
static BOOLEAN rIsLPRing(const ring r)
Definition ring.h:417
#define IDELEMS(i)

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char * s)

Definition at line 122 of file ipshell.cc.

123{
124/* not handling: &&, ||, ** */
125 if (s[1]=='\0') return s[0];
126 else if (s[2]!='\0') return 0;
127 switch(s[0])
128 {
129 case '.': if (s[1]=='.') return DOTDOT;
130 else return 0;
131 case ':': if (s[1]==':') return COLONCOLON;
132 else return 0;
133 case '-': if (s[1]=='-') return MINUSMINUS;
134 else return 0;
135 case '+': if (s[1]=='+') return PLUSPLUS;
136 else return 0;
137 case '=': if (s[1]=='=') return EQUAL_EQUAL;
138 else return 0;
139 case '<': if (s[1]=='=') return LE;
140 else if (s[1]=='>') return NOTEQUAL;
141 else return 0;
142 case '>': if (s[1]=='=') return GE;
143 else return 0;
144 case '!': if (s[1]=='=') return NOTEQUAL;
145 else return 0;
146 }
147 return 0;
148}
@ PLUSPLUS
Definition grammar.cc:274
@ MINUSMINUS
Definition grammar.cc:271
@ GE
Definition grammar.cc:269
@ EQUAL_EQUAL
Definition grammar.cc:268
@ LE
Definition grammar.cc:270
@ NOTEQUAL
Definition grammar.cc:273
@ DOTDOT
Definition grammar.cc:267
@ COLONCOLON
Definition grammar.cc:275

◆ iiParameter()

BOOLEAN iiParameter ( leftv p)

Definition at line 1380 of file ipshell.cc.

1381{
1382 if (iiCurrArgs==NULL)
1383 {
1384 if (strcmp(p->name,"#")==0)
1385 return iiDefaultParameter(p);
1386 Werror("not enough arguments for proc %s",VoiceName());
1387 p->CleanUp();
1388 return TRUE;
1389 }
1391 leftv rest=h->next; /*iiCurrArgs is not NULL here*/
1392 if (strcmp(p->name,"#")==0)
1393 {
1394 rest=NULL;
1395 }
1396 else
1397 {
1398 h->next=NULL;
1399 }
1401 iiCurrArgs=rest; // may be NULL
1402 h->CleanUp();
1404 return res;
1405}
BOOLEAN iiDefaultParameter(leftv p)
Definition ipshell.cc:1264

◆ iiProcArgs()

char * iiProcArgs ( char * e,
BOOLEAN withParenth )

Definition at line 114 of file iplib.cc.

115{
116 while ((*e==' ') || (*e=='\t') || (*e=='(')) e++;
117 if (*e<' ')
118 {
119 if (withParenth)
120 {
121 // no argument list, allow list #
122 return omStrDup("parameter list #;");
123 }
124 else
125 {
126 // empty list
127 return omStrDup("");
128 }
129 }
130 BOOLEAN in_args;
131 BOOLEAN args_found;
132 char *s;
133 char *argstr=(char *)omAlloc(127); // see ../omalloc/omTables.inc
134 int argstrlen=127;
135 *argstr='\0';
136 int par=0;
137 do
138 {
139 args_found=FALSE;
140 s=e; // set s to the starting point of the arg
141 // and search for the end
142 // skip leading spaces:
143 loop
144 {
145 if ((*s==' ')||(*s=='\t'))
146 s++;
147 else if ((*s=='\n')&&(*(s+1)==' '))
148 s+=2;
149 else // start of new arg or \0 or )
150 break;
151 }
152 e=s;
153 while ((*e!=',')
154 &&((par!=0) || (*e!=')'))
155 &&(*e!='\0'))
156 {
157 if (*e=='(') par++;
158 else if (*e==')') par--;
159 args_found=args_found || (*e>' ');
160 e++;
161 }
162 in_args=(*e==',');
163 if (args_found)
164 {
165 *e='\0';
166 // check for space:
167 if ((int)strlen(argstr)+12 /* parameter + ;*/ +(int)strlen(s)>= argstrlen)
168 {
169 argstrlen*=2;
170 char *a=(char *)omAlloc( argstrlen);
171 strcpy(a,argstr);
172 omFree((ADDRESS)argstr);
173 argstr=a;
174 }
175 // copy the result to argstr
176 if(strncmp(s,"alias ",6)!=0)
177 {
178 strcat(argstr,"parameter ");
179 }
180 strcat(argstr,s);
181 strcat(argstr,"; ");
182 e++; // e was pointing to ','
183 }
184 } while (in_args);
185 return argstr;
186}

◆ iiProcName()

char * iiProcName ( char * buf,
char & ct,
char *& e )

Definition at line 100 of file iplib.cc.

101{
102 char *s=buf+5;
103 while (*s==' ') s++;
104 e=s+1;
105 while ((*e>' ') && (*e!='(')) e++;
106 ct=*e;
107 *e='\0';
108 return s;
109}
int status int void * buf
Definition si_signals.h:69

◆ iiPStart()

BOOLEAN iiPStart ( idhdl pn,
leftv sl )

Definition at line 379 of file iplib.cc.

380{
382 int old_echo=si_echo;
383 BOOLEAN err=FALSE;
384 char save_flags=0;
385
386 /* init febase ======================================== */
387 /* we do not enter this case if filename != NULL !! */
388 if (pn!=NULL)
389 {
390 pi = IDPROC(pn);
391 if(pi!=NULL)
392 {
393 save_flags=pi->trace_flag;
394 if( pi->data.s.body==NULL )
395 {
397 if (pi->data.s.body==NULL) return TRUE;
398 }
399// omUpdateInfo();
400// int m=om_Info.UsedBytes;
401// Print("proc %s, mem=%d\n",IDID(pn),m);
402 }
403 }
404 else return TRUE;
405 /* generate argument list ======================================*/
406 //iiCurrArgs should be NULL here, as the assignment for the parameters
407 // of the prevouis call are already done befor calling another routine
408 if (v!=NULL)
409 {
411 memcpy(iiCurrArgs,v,sizeof(sleftv)); // keeps track of v->next etc.
412 v->Init();
413 }
414 else
415 {
418 }
419 /* start interpreter ======================================*/
420 myynest++;
421 if (myynest > SI_MAX_NEST)
422 {
423 WerrorS("nesting too deep");
424 err=TRUE;
425 }
426 else
427 {
428 iiCurrProc=pn;
429 err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(v!=NULL));
431
432 if (iiLocalRing[myynest-1] != currRing)
433 {
434 if (iiRETURNEXPR.RingDependend())
435 {
436 //idhdl hn;
437 const char *n;
438 const char *o;
439 idhdl nh=NULL, oh=NULL;
440 if (iiLocalRing[myynest-1]!=NULL)
442 if (oh!=NULL) o=oh->id;
443 else o="none";
444 if (currRing!=NULL)
446 if (nh!=NULL) n=nh->id;
447 else n="none";
448 Werror("ring change during procedure call %s: %s -> %s (level %d)",pi->procname,o,n,myynest);
449 iiRETURNEXPR.CleanUp();
450 err=TRUE;
451 }
453 }
454 if ((currRing==NULL)
455 && (currRingHdl!=NULL))
457 else
458 if ((currRing!=NULL) &&
460 ||(IDLEV(currRingHdl)>=myynest-1)))
461 {
464 }
465 //Print("kill locals for %s (level %d)\n",IDID(pn),myynest);
467#ifndef SING_NDEBUG
468 checkall();
469#endif
470 //Print("end kill locals for %s (%d)\n",IDID(pn),myynest);
471 }
472 myynest--;
473 si_echo=old_echo;
474 if (pi!=NULL)
475 pi->trace_flag=save_flags;
476// omUpdateInfo();
477// int m=om_Info.UsedBytes;
478// Print("exit %s, mem=%d\n",IDID(pn),m);
479 return err;
480}
const char * id
Definition idrec.h:39
#define SI_MAX_NEST
Definition iplib.cc:27

◆ iiRegularity()

int iiRegularity ( lists L)

Definition at line 1041 of file ipshell.cc.

1042{
1043 int len,reg,typ0;
1044
1045 resolvente r=liFindRes(L,&len,&typ0);
1046
1047 if (r==NULL)
1048 return -2;
1049 intvec *weights=NULL;
1050 int add_row_shift=0;
1051 intvec *ww=(intvec *)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
1052 if (ww!=NULL)
1053 {
1054 weights=ivCopy(ww);
1055 add_row_shift = ww->min_in();
1056 (*weights) -= add_row_shift;
1057 }
1058 //Print("attr:%x\n",weights);
1059
1060 intvec *dummy=syBetti(r,len,&reg,weights);
1061 if (weights!=NULL) delete weights;
1062 delete dummy;
1063 omFreeSize((ADDRESS)r,len*sizeof(ideal));
1064 return reg+1+add_row_shift;
1065}
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition attrib.cc:132
int min_in()
Definition intvec.h:122
ideal * resolvente
Definition ideals.h:18
intvec * ivCopy(const intvec *o)
Definition intvec.h:146
resolvente liFindRes(lists L, int *len, int *typ0, intvec ***weights)
Definition lists.cc:338
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition syz.cc:783

◆ iiSetReturn()

void iiSetReturn ( const leftv h)

Definition at line 6627 of file ipshell.cc.

6628{
6629 if ((source->next==NULL)&&(source->e==NULL))
6630 {
6631 if ((source->rtyp!=IDHDL)&&(source->rtyp!=ALIAS_CMD))
6632 {
6633 memcpy(&iiRETURNEXPR,source,sizeof(sleftv));
6634 source->Init();
6635 return;
6636 }
6637 if (source->rtyp==IDHDL)
6638 {
6639 if ((IDLEV((idhdl)source->data)==myynest)
6640 &&(IDTYP((idhdl)source->data)!=RING_CMD))
6641 {
6642 iiRETURNEXPR.Init();
6643 iiRETURNEXPR.rtyp=IDTYP((idhdl)source->data);
6644 iiRETURNEXPR.data=IDDATA((idhdl)source->data);
6645 iiRETURNEXPR.flag=IDFLAG((idhdl)source->data);
6646 iiRETURNEXPR.attribute=IDATTR((idhdl)source->data);
6647 IDATTR((idhdl)source->data)=NULL;
6648 IDDATA((idhdl)source->data)=NULL;
6649 source->name=NULL;
6650 source->attribute=NULL;
6651 return;
6652 }
6653 }
6654 }
6655 iiRETURNEXPR.Copy(source);
6656}

◆ iiTestAssume()

BOOLEAN iiTestAssume ( leftv a,
leftv b )

Definition at line 6446 of file ipshell.cc.

6447{
6448 // assume a: level
6449 if ((a->Typ()==INT_CMD)&&((long)a->Data()>=0))
6450 {
6451 if ((TEST_V_ALLWARN) && (myynest==0)) WarnS("ASSUME at top level is of no use: see documentation");
6452 char assume_yylinebuf[80];
6453 strncpy(assume_yylinebuf,my_yylinebuf,79);
6454 int lev=(long)a->Data();
6455 int startlev=0;
6456 idhdl h=ggetid("assumeLevel");
6457 if ((h!=NULL)&&(IDTYP(h)==INT_CMD)) startlev=(long)IDINT(h);
6458 if(lev <=startlev)
6459 {
6460 BOOLEAN bo=b->Eval();
6461 if (bo) { WerrorS("syntax error in ASSUME");return TRUE;}
6462 if (b->Typ()!=INT_CMD) { WerrorS("ASUMME(<level>,<int expr>)");return TRUE; }
6463 if (b->Data()==NULL) { Werror("ASSUME failed:%s",assume_yylinebuf);return TRUE;}
6464 }
6465 }
6466 b->CleanUp();
6467 a->CleanUp();
6468 return FALSE;
6469}
void * Data()
Definition subexpr.cc:1192
#define IDINT(a)
Definition ipid.h:125

◆ iiTokType()

int iiTokType ( int op)

Definition at line 229 of file iparith.cc.

230{
231 for (unsigned i=0;i<sArithBase.nCmdUsed;i++)
232 {
233 if (sArithBase.sCmds[i].tokval==op)
234 return sArithBase.sCmds[i].toktype;
235 }
236 return 0;
237}
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
Definition iparith.cc:197

◆ iiTryLoadLib()

BOOLEAN iiTryLoadLib ( leftv v,
const char * id )

Definition at line 832 of file iplib.cc.

833{
834 BOOLEAN LoadResult = TRUE;
835 char libnamebuf[1024];
836 size_t len=strlen(id)+5;
837 char *libname = (char *)omAlloc(len);
838 const char *suffix[] = { "", ".lib", ".so", ".sl", NULL };
839 int i = 0;
840 // FILE *fp;
841 // package pack;
842 // idhdl packhdl;
843 lib_types LT;
844 for(i=0; suffix[i] != NULL; i++)
845 {
846 snprintf(libname,len, "%s%s", id, suffix[i]);
847 *libname = mytolower(*libname);
848 if((LT = type_of_LIB(libname, libnamebuf)) > LT_NOTFOUND)
849 {
850 #ifdef HAVE_DYNAMIC_LOADING
851 char libnamebuf[1024];
852 #endif
853
854 if (LT==LT_SINGULAR)
855 LoadResult = iiLibCmd(libname, FALSE, FALSE,TRUE);
856 #ifdef HAVE_DYNAMIC_LOADING
857 else if ((LT==LT_ELF) || (LT==LT_HPUX))
858 LoadResult = load_modules(libname,libnamebuf,FALSE);
859 #endif
860 else if (LT==LT_BUILTIN)
861 {
862 LoadResult=load_builtin(libname,FALSE, iiGetBuiltinModInit(libname));
863 }
864 if(!LoadResult )
865 {
866 v->name = iiConvName(libname);
867 break;
868 }
869 }
870 }
871 omFree(libname);
872 return LoadResult;
873}
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition iplib.cc:1294
static char mytolower(char c)
Definition iplib.cc:1426
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition iplib.cc:1304
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition iplib.cc:816
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
Definition mod_lib.cc:27
lib_types
Definition mod_raw.h:16
@ LT_HPUX
Definition mod_raw.h:16
@ LT_SINGULAR
Definition mod_raw.h:16
@ LT_BUILTIN
Definition mod_raw.h:16
@ LT_ELF
Definition mod_raw.h:16
@ LT_NOTFOUND
Definition mod_raw.h:16

◆ iiTwoOps()

const char * iiTwoOps ( int t)

Definition at line 258 of file gentable.cc.

259{
260 if (t<127)
261 {
262 STATIC_VAR char ch[2];
263 switch (t)
264 {
265 case '&':
266 return "and";
267 case '|':
268 return "or";
269 default:
270 ch[0]=t;
271 ch[1]='\0';
272 return ch;
273 }
274 }
275 switch (t)
276 {
277 case COLONCOLON: return "::";
278 case DOTDOT: return "..";
279 //case PLUSEQUAL: return "+=";
280 //case MINUSEQUAL: return "-=";
281 case MINUSMINUS: return "--";
282 case PLUSPLUS: return "++";
283 case EQUAL_EQUAL: return "==";
284 case LE: return "<=";
285 case GE: return ">=";
286 case NOTEQUAL: return "<>";
287 default: return Tok2Cmdname(t);
288 }
289}
#define STATIC_VAR
Definition globaldefs.h:7

◆ iiWRITE()

BOOLEAN iiWRITE ( leftv res,
leftv exprlist )

Definition at line 587 of file ipshell.cc.

588{
589 sleftv vf;
590 if (iiConvert(v->Typ(),LINK_CMD,iiTestConvert(v->Typ(),LINK_CMD),v,&vf))
591 {
592 WerrorS("link expected");
593 return TRUE;
594 }
595 si_link l=(si_link)vf.Data();
596 if (vf.next == NULL)
597 {
598 WerrorS("write: need at least two arguments");
599 return TRUE;
600 }
601
602 BOOLEAN b=slWrite(l,vf.next); /* iiConvert preserves next */
603 if (b)
604 {
605 const char *s;
606 if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
607 else s=sNoName_fe;
608 Werror("cannot write to %s",s);
609 }
610 vf.CleanUp();
611 return b;
612}

◆ IsCmd()

int IsCmd ( const char * n,
int & tok )

Definition at line 9738 of file iparith.cc.

9739{
9740 int i;
9741 int an=1;
9742 int en=sArithBase.nLastIdentifier;
9743
9744 loop
9745 //for(an=0; an<sArithBase.nCmdUsed; )
9746 {
9747 if(an>=en-1)
9748 {
9749 if (strcmp(n, sArithBase.sCmds[an].name) == 0)
9750 {
9751 i=an;
9752 break;
9753 }
9754 else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
9755 {
9756 i=en;
9757 break;
9758 }
9759 else
9760 {
9761 // -- blackbox extensions:
9762 // return 0;
9763 return blackboxIsCmd(n,tok);
9764 }
9765 }
9766 i=(an+en)/2;
9767 if (*n < *(sArithBase.sCmds[i].name))
9768 {
9769 en=i-1;
9770 }
9771 else if (*n > *(sArithBase.sCmds[i].name))
9772 {
9773 an=i+1;
9774 }
9775 else
9776 {
9777 int v=strcmp(n,sArithBase.sCmds[i].name);
9778 if(v<0)
9779 {
9780 en=i-1;
9781 }
9782 else if(v>0)
9783 {
9784 an=i+1;
9785 }
9786 else /*v==0*/
9787 {
9788 break;
9789 }
9790 }
9791 }
9792 lastreserved=sArithBase.sCmds[i].name;
9793 tok=sArithBase.sCmds[i].tokval;
9794 if(sArithBase.sCmds[i].alias==2)
9795 {
9796 Warn("outdated identifier `%s` used - please change your code",
9797 sArithBase.sCmds[i].name);
9798 sArithBase.sCmds[i].alias=1;
9799 }
9800 #if 0
9801 if (currRingHdl==NULL)
9802 {
9803 #ifdef SIQ
9804 if (siq<=0)
9805 {
9806 #endif
9807 if ((tok>=BEGIN_RING) && (tok<=END_RING))
9808 {
9809 WerrorS("no ring active");
9810 return 0;
9811 }
9812 #ifdef SIQ
9813 }
9814 #endif
9815 }
9816 #endif
9817 if (!expected_parms)
9818 {
9819 switch (tok)
9820 {
9821 case IDEAL_CMD:
9822 case INT_CMD:
9823 case INTVEC_CMD:
9824 case MAP_CMD:
9825 case MATRIX_CMD:
9826 case MODUL_CMD:
9827 case POLY_CMD:
9828 case PROC_CMD:
9829 case RING_CMD:
9830 case STRING_CMD:
9831 cmdtok = tok;
9832 break;
9833 }
9834 }
9835 return sArithBase.sCmds[i].toktype;
9836}
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition blackbox.cc:219
@ END_RING
Definition grammar.cc:311
@ BEGIN_RING
Definition grammar.cc:283
int cmdtok
Definition grammar.cc:174
BOOLEAN expected_parms
Definition grammar.cc:173
const char * lastreserved
Definition ipshell.cc:83

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv res,
leftv v )

Definition at line 971 of file ipshell.cc.

972{
973 sleftv tmp;
974 tmp.Init();
975 tmp.rtyp=INT_CMD;
976 tmp.data=(void *)1;
977 if ((u->Typ()==IDEAL_CMD)
978 || (u->Typ()==MODUL_CMD))
979 return jjBETTI2_ID(res,u,&tmp);
980 else
981 return jjBETTI2(res,u,&tmp);
982}
BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v)
Definition ipshell.cc:984
BOOLEAN jjBETTI2(leftv res, leftv u, leftv v)
Definition ipshell.cc:1005

◆ jjBETTI2()

BOOLEAN jjBETTI2 ( leftv res,
leftv u,
leftv v )

Definition at line 1005 of file ipshell.cc.

1006{
1007 resolvente r;
1008 int len;
1009 int reg,typ0;
1010 lists l=(lists)u->Data();
1011
1012 intvec *weights=NULL;
1013 int add_row_shift=0;
1014 intvec *ww=NULL;
1015 if (l->nr>=0) ww=(intvec *)atGet(&(l->m[0]),"isHomog",INTVEC_CMD);
1016 if (ww!=NULL)
1017 {
1018 weights=ivCopy(ww);
1019 add_row_shift = ww->min_in();
1020 (*weights) -= add_row_shift;
1021 }
1022 //Print("attr:%x\n",weights);
1023
1024 r=liFindRes(l,&len,&typ0);
1025 if (r==NULL) return TRUE;
1026 intvec* res_im=syBetti(r,len,&reg,weights,(int)(long)v->Data());
1027 res->data=(void*)res_im;
1028 omFreeSize((ADDRESS)r,(len)*sizeof(ideal));
1029 //Print("rowShift: %d ",add_row_shift);
1030 for(int i=1;i<=res_im->rows();i++)
1031 {
1032 if (IMATELEM(*res_im,1,i)==0) { add_row_shift--; }
1033 else break;
1034 }
1035 //Print(" %d\n",add_row_shift);
1036 atSet(res,omStrDup("rowShift"),(void*)(long)add_row_shift,INT_CMD);
1037 if (weights!=NULL) delete weights;
1038 return FALSE;
1039}
void atSet(idhdl root, char *name, void *data, int typ)
Definition attrib.cc:153
int rows() const
Definition intvec.h:97
#define IMATELEM(M, I, J)
Definition intvec.h:86

◆ jjBETTI2_ID()

BOOLEAN jjBETTI2_ID ( leftv res,
leftv u,
leftv v )

Definition at line 984 of file ipshell.cc.

985{
987 l->Init(1);
988 l->m[0].rtyp=u->Typ();
989 l->m[0].data=u->Data();
990 attr *a=u->Attribute();
991 if (a!=NULL)
992 l->m[0].attribute=*a;
993 sleftv tmp2;
994 tmp2.Init();
995 tmp2.rtyp=LIST_CMD;
996 tmp2.data=(void *)l;
998 l->m[0].data=NULL;
999 l->m[0].attribute=NULL;
1000 l->m[0].rtyp=DEF_CMD;
1001 l->Clean();
1002 return r;
1003}
sattr * attr
Definition attrib.h:16
attr * Attribute()
Definition subexpr.cc:1505
CFList tmp2
Definition facFqBivar.cc:75

◆ jjCHARSERIES()

BOOLEAN jjCHARSERIES ( leftv res,
leftv u )

Definition at line 3343 of file ipshell.cc.

3344{
3345 res->data=singclap_irrCharSeries((ideal)u->Data(), currRing);
3346 return (res->data==NULL);
3347}
matrix singclap_irrCharSeries(ideal I, const ring r)
Definition clapsing.cc:1571

◆ jjIMPORTFROM()

BOOLEAN jjIMPORTFROM ( leftv res,
leftv u,
leftv v )

Definition at line 2510 of file ipassign.cc.

2511{
2512 //Print("importfrom %s::%s ->.\n",v->Name(),u->Name() );
2513 assume(u->Typ()==PACKAGE_CMD);
2514 char *vn=(char *)v->Name();
2515 idhdl h=((package)(u->Data()))->idroot->get(vn /*v->Name()*/, myynest);
2516 if (h!=NULL)
2517 {
2518 //check for existence
2519 if (((package)(u->Data()))==basePack)
2520 {
2521 WarnS("source and destination packages are identical");
2522 return FALSE;
2523 }
2524 idhdl t=basePack->idroot->get(vn /*v->Name()*/, myynest);
2525 if (t!=NULL)
2526 {
2527 if (BVERBOSE(V_REDEFINE)) Warn("redefining %s (%s)",vn,my_yylinebuf);
2528 killhdl(t);
2529 }
2530 sleftv tmp_expr;
2531 if (iiDeclCommand(&tmp_expr,v,myynest,DEF_CMD,&IDROOT)) return TRUE;
2532 sleftv h_expr;
2533 memset(&h_expr,0,sizeof(h_expr));
2534 h_expr.rtyp=IDHDL;
2535 h_expr.data=h;
2536 h_expr.name=vn;
2537 return iiAssign(&tmp_expr,&h_expr);
2538 }
2539 else
2540 {
2541 Werror("`%s` not found in `%s`",v->Name(), u->Name());
2542 return TRUE;
2543 }
2544 return FALSE;
2545}
void killhdl(idhdl h, package proot)
Definition ipid.cc:391
#define assume(x)
Definition mod2.h:389
ip_package * package
Definition structs.h:39

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv res,
leftv v )

Definition at line 8216 of file iparith.cc.

8217{
8218 int sl=0;
8219 if (v!=NULL) sl = v->listLength();
8220 lists L;
8221 if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
8222 {
8223 int add_row_shift = 0;
8224 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
8225 if (weights!=NULL) add_row_shift=weights->min_in();
8226 L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
8227 }
8228 else
8229 {
8231 leftv h=NULL;
8232 int i;
8233 int rt;
8234
8235 L->Init(sl);
8236 for (i=0;i<sl;i++)
8237 {
8238 if (h!=NULL)
8239 { /* e.g. not in the first step:
8240 * h is the pointer to the old sleftv,
8241 * v is the pointer to the next sleftv
8242 * (in this moment) */
8243 h->next=v;
8244 }
8245 h=v;
8246 v=v->next;
8247 h->next=NULL;
8248 rt=h->Typ();
8249 if (rt==0)
8250 {
8251 L->Clean();
8252 Werror("`%s` is undefined",h->Fullname());
8253 return TRUE;
8254 }
8255 if (rt==RING_CMD)
8256 {
8257 L->m[i].rtyp=rt;
8258 L->m[i].data=rIncRefCnt(((ring)h->Data()));
8259 }
8260 else
8261 L->m[i].Copy(h);
8262 }
8263 }
8264 res->data=(char *)L;
8265 return FALSE;
8266}
void Copy(leftv e)
Definition subexpr.cc:689
void Clean(ring r=currRing)
Definition lists.h:26
INLINE_THIS void Init(int l=0)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition ipshell.cc:3172
static ring rIncRefCnt(ring r)
Definition ring.h:849
ssyStrategy * syStrategy
Definition syz.h:36

◆ jjLOAD()

BOOLEAN jjLOAD ( const char * s,
BOOLEAN autoexport = FALSE )

load lib/module given in v

Definition at line 5567 of file iparith.cc.

5568{
5569 char libnamebuf[1024];
5571
5572#ifdef HAVE_DYNAMIC_LOADING
5573 extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
5574#endif /* HAVE_DYNAMIC_LOADING */
5575 switch(LT)
5576 {
5577 default:
5578 case LT_NONE:
5579 Werror("%s: unknown type", s);
5580 break;
5581 case LT_NOTFOUND:
5582 Werror("cannot open %s", s);
5583 break;
5584
5585 case LT_SINGULAR:
5586 {
5587 char *plib = iiConvName(s);
5588 idhdl pl = IDROOT->get_level(plib,0);
5589 if (pl==NULL)
5590 {
5591 pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
5592 IDPACKAGE(pl)->language = LANG_SINGULAR;
5593 IDPACKAGE(pl)->libname=omStrDup(s);
5594 }
5595 else if (IDTYP(pl)!=PACKAGE_CMD)
5596 {
5597 Werror("can not create package `%s`",plib);
5598 omFreeBinAddr(plib);
5599 return TRUE;
5600 }
5601 else /* package */
5602 {
5603 package pa=IDPACKAGE(pl);
5604 if ((pa->language==LANG_C)
5605 || (pa->language==LANG_MIX))
5606 {
5607 Werror("can not create package `%s` - binaries exists",plib);
5608 omFreeBinAddr(plib);
5609 return TRUE;
5610 }
5611 }
5612 omFreeBinAddr(plib);
5613 package savepack=currPack;
5614 currPack=IDPACKAGE(pl);
5615 IDPACKAGE(pl)->loaded=TRUE;
5616 char libnamebuf[1024];
5617 FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
5618 BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
5619 currPack=savepack;
5620 IDPACKAGE(pl)->loaded=(!bo);
5621 return bo;
5622 }
5623 case LT_BUILTIN:
5624 SModulFunc_t iiGetBuiltinModInit(const char*);
5625 return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
5626 case LT_MACH_O:
5627 case LT_ELF:
5628 case LT_HPUX:
5629#ifdef HAVE_DYNAMIC_LOADING
5630 return load_modules(s, libnamebuf, autoexport);
5631#else /* HAVE_DYNAMIC_LOADING */
5632 WerrorS("Dynamic modules are not supported by this version of Singular");
5633 break;
5634#endif /* HAVE_DYNAMIC_LOADING */
5635 }
5636 return TRUE;
5637}
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition iplib.cc:1304
int(* SModulFunc_t)(SModulFunctions *)
Definition ipid.h:81
@ LT_MACH_O
Definition mod_raw.h:16
@ LT_NONE
Definition mod_raw.h:16

◆ jjLOAD_TRY()

BOOLEAN jjLOAD_TRY ( const char * s)

Definition at line 5643 of file iparith.cc.

5644{
5645 if (!iiGetLibStatus(s))
5646 {
5647 void (*WerrorS_save)(const char *s) = WerrorS_callback;
5650 BOOLEAN bo=jjLOAD(s,TRUE);
5651 if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5652 Print("loading of >%s< failed\n",s);
5653 WerrorS_callback=WerrorS_save;
5654 errorreported=0;
5655 }
5656 return FALSE;
5657}
VAR void(* WerrorS_callback)(const char *s)
Definition feFopen.cc:21
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition iparith.cc:5567
STATIC_VAR int WerrorS_dummy_cnt
Definition iparith.cc:5638
static void WerrorS_dummy(const char *)
Definition iparith.cc:5639
BOOLEAN iiGetLibStatus(const char *lib)
Definition iplib.cc:77
#define TEST_OPT_PROT
Definition options.h:105

◆ jjMINRES()

BOOLEAN jjMINRES ( leftv res,
leftv v )

Definition at line 950 of file ipshell.cc.

951{
952 int len=0;
953 int typ0;
954 lists L=(lists)v->Data();
955 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
956 int add_row_shift = 0;
957 if (weights==NULL)
958 weights=(intvec*)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
959 if (weights!=NULL) add_row_shift=weights->min_in();
960 resolvente rr=liFindRes(L,&len,&typ0);
961 if (rr==NULL) return TRUE;
962 resolvente r=iiCopyRes(rr,len);
963
964 syMinimizeResolvente(r,len,0);
965 omFreeSize((ADDRESS)rr,len*sizeof(ideal));
966 len++;
967 res->data=(char *)liMakeResolv(r,len,-1,typ0,NULL,add_row_shift);
968 return FALSE;
969}
static resolvente iiCopyRes(resolvente r, int l)
Definition ipshell.cc:940
void syMinimizeResolvente(resolvente res, int length, int first)
Definition syz.cc:367

◆ jjRESULTANT()

BOOLEAN jjRESULTANT ( leftv res,
leftv u,
leftv v,
leftv w )

Definition at line 3336 of file ipshell.cc.

3337{
3338 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(),
3339 (poly)w->CopyD(), currRing);
3340 return errorreported;
3341}
poly singclap_resultant(poly f, poly g, poly x, const ring r)
Definition clapsing.cc:345

◆ jjSetMinpoly()

coeffs jjSetMinpoly ( coeffs cf,
number a )

Definition at line 176 of file ipassign.cc.

177{
178 if ( !nCoeff_is_transExt(cf) )
179 {
180 if(!nCoeff_is_algExt(cf) )
181 {
182 WerrorS("cannot set minpoly for these coeffients");
183 return NULL;
184 }
185 }
186 if (rVar(cf->extRing)!=1)
187 {
188 WerrorS("only univariate minpoly allowed");
189 return NULL;
190 }
191
192 number p = n_Copy(a,cf);
193 n_Normalize(p, cf);
194
195 if (n_IsZero(p, cf))
196 {
197 n_Delete(&p, cf);
198 return cf;
199 }
200
202
203 A.r = rCopy(cf->extRing); // Copy ground field!
204 // if minpoly was already set:
205 if( cf->extRing->qideal != NULL ) id_Delete(&(A.r->qideal),A.r);
206 ideal q = idInit(1,1);
207 if ((p==NULL) ||(NUM((fraction)p)==NULL))
208 {
209 WerrorS("Could not construct the alg. extension: minpoly==0");
210 // cleanup A: TODO
211 rDelete( A.r );
212 return NULL;
213 }
214 if (DEN((fraction)(p)) != NULL) // minpoly must be a fraction with poly numerator...!!
215 {
216 poly n=DEN((fraction)(p));
217 if(!p_IsConstant(n,cf->extRing))
218 {
219 WarnS("denominator must be constant - ignoring it");
220 }
221 p_Delete(&n,cf->extRing);
222 DEN((fraction)(p))=NULL;
223 }
224
225 q->m[0] = NUM((fraction)p);
226 A.r->qideal = q;
227
229 NUM((fractionObject *)p) = NULL; // not necessary, but still...
231
232 coeffs new_cf = nInitChar(n_algExt, &A);
233 if (new_cf==NULL)
234 {
235 WerrorS("Could not construct the alg. extension: illegal minpoly?");
236 // cleanup A: TODO
237 rDelete( A.r );
238 return NULL;
239 }
240 return new_cf;
241}
struct for passing initialization parameters to naInitChar
Definition algext.h:37
CanonicalForm cf
Definition cfModGcd.cc:4091
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:455
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
Definition coeffs.h:35
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:406
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:468
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition coeffs.h:903
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition coeffs.h:579
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition coeffs.h:911
omBin_t * omBin
Definition omStructs.h:12
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition p_polys.h:1980
#define NUM
Definition readcf.cc:180
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
ring rCopy(ring r)
Definition ring.cc:1736
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define A
Definition sirandom.c:24
VAR omBin fractionObjectBin
Definition transext.cc:89

◆ jjSYSTEM()

BOOLEAN jjSYSTEM ( leftv res,
leftv v )

Definition at line 231 of file extra.cc.

232{
233 if(args->Typ() == STRING_CMD)
234 {
235 const char *sys_cmd=(char *)(args->Data());
236 leftv h=args->next;
237// ONLY documented system calls go here
238// Undocumented system calls go down into jjEXTENDED_SYSTEM (#ifdef HAVE_EXTENDED_SYSTEM)
239/*==================== nblocks ==================================*/
240 if (strcmp(sys_cmd, "nblocks") == 0)
241 {
242 ring r;
243 if (h == NULL)
244 {
245 if (currRingHdl != NULL)
246 {
247 r = IDRING(currRingHdl);
248 }
249 else
250 {
251 WerrorS("no ring active");
252 return TRUE;
253 }
254 }
255 else
256 {
257 if (h->Typ() != RING_CMD)
258 {
259 WerrorS("ring expected");
260 return TRUE;
261 }
262 r = (ring) h->Data();
263 }
264 res->rtyp = INT_CMD;
265 res->data = (void*) (long)(rBlocks(r) - 1);
266 return FALSE;
267 }
268/*==================== version ==================================*/
269 if(strcmp(sys_cmd,"version")==0)
270 {
271 res->rtyp=INT_CMD;
272 res->data=(void *)SINGULAR_VERSION;
273 return FALSE;
274 }
275 else
276/*==================== alarm ==================================*/
277 if(strcmp(sys_cmd,"alarm")==0)
278 {
279 if ((h!=NULL) &&(h->Typ()==INT_CMD))
280 {
281 // standard variant -> SIGALARM (standard: abort)
282 //alarm((unsigned)h->next->Data());
283 // process time (user +system): SIGVTALARM
284 struct itimerval t,o;
285 memset(&t,0,sizeof(t));
286 t.it_value.tv_sec =(unsigned)((unsigned long)h->Data());
287 setitimer(ITIMER_VIRTUAL,&t,&o);
288 return FALSE;
289 }
290 else
291 WerrorS("int expected");
292 }
293 else
294/*==================== content ==================================*/
295 if(strcmp(sys_cmd,"content")==0)
296 {
297 if ((h!=NULL) && ((h->Typ()==POLY_CMD)||(h->Typ()==VECTOR_CMD)))
298 {
299 int t=h->Typ();
300 poly p=(poly)h->CopyD();
301 if (p!=NULL)
302 {
305 }
306 res->data=(void *)p;
307 res->rtyp=t;
308 return FALSE;
309 }
310 return TRUE;
311 }
312 else
313/*==================== cpu ==================================*/
314 if(strcmp(sys_cmd,"cpu")==0)
315 {
316 #if 0
317 long cpu=1;
318 #ifdef _SC_NPROCESSORS_ONLN
319 cpu=sysconf(_SC_NPROCESSORS_ONLN);
320 #elif defined(_SC_NPROCESSORS_CONF)
321 cpu=sysconf(_SC_NPROCESSORS_CONF);
322 #endif
323 res->data=(void *)cpu;
324 #else
325 res->data=(void *)feOptValue(FE_OPT_CPUS);
326 #endif
327 res->rtyp=INT_CMD;
328 return FALSE;
329 }
330 else
331/*==================== executable ==================================*/
332 if(strcmp(sys_cmd,"executable")==0)
333 {
334 if ((h!=NULL) && (h->Typ()==STRING_CMD))
335 {
336 char tbuf[MAXPATHLEN];
337 char *s=omFindExec((char*)h->Data(),tbuf);
338 if(s==NULL) s=(char*)"";
339 res->data=(void *)omStrDup(s);
340 res->rtyp=STRING_CMD;
341 return FALSE;
342 }
343 return TRUE;
344 }
345 else
346 /*==================== flatten =============================*/
347 if(strcmp(sys_cmd,"flatten")==0)
348 {
349 if ((h!=NULL) &&(h->Typ()==SMATRIX_CMD))
350 {
351 res->data=(char*)sm_Flatten((ideal)h->Data(),currRing);
352 res->rtyp=SMATRIX_CMD;
353 return FALSE;
354 }
355 else
356 WerrorS("smatrix expected");
357 }
358 else
359 /*==================== unflatten =============================*/
360 if(strcmp(sys_cmd,"unflatten")==0)
361 {
362 const short t1[]={2,SMATRIX_CMD,INT_CMD};
363 if (iiCheckTypes(h,t1,1))
364 {
365 res->data=(char*)sm_UnFlatten((ideal)h->Data(),(int)(long)h->next->Data(),currRing);
366 res->rtyp=SMATRIX_CMD;
367 return res->data==NULL;
368 }
369 else return TRUE;
370 }
371 else
372 /*==================== neworder =============================*/
373 if(strcmp(sys_cmd,"neworder")==0)
374 {
375 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
376 {
377 res->rtyp=STRING_CMD;
378 res->data=(void *)singclap_neworder((ideal)h->Data(), currRing);
379 return FALSE;
380 }
381 else
382 WerrorS("ideal expected");
383 }
384 else
385/*===== nc_hilb ===============================================*/
386 // Hilbert series of non-commutative monomial algebras
387 if(strcmp(sys_cmd,"nc_hilb") == 0)
388 {
389 ideal i; int lV;
390 bool ig = FALSE;
391 bool mgrad = FALSE;
392 bool autop = FALSE;
393 int trunDegHs=0;
394 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
395 i = (ideal)h->Data();
396 else
397 {
398 WerrorS("nc_Hilb:ideal expected");
399 return TRUE;
400 }
401 h = h->next;
402 if((h != NULL)&&(h->Typ() == INT_CMD))
403 lV = (int)(long)h->Data();
404 else
405 {
406 WerrorS("nc_Hilb:int expected");
407 return TRUE;
408 }
409 h = h->next;
410 while(h != NULL)
411 {
412 if((int)(long)h->Data() == 1)
413 ig = TRUE;
414 else if((int)(long)h->Data() == 2)
415 mgrad = TRUE;
416 else if(h->Typ()==STRING_CMD)
417 autop = TRUE;
418 else if(h->Typ() == INT_CMD)
419 trunDegHs = (int)(long)h->Data();
420 h = h->next;
421 }
422 if(h != NULL)
423 {
424 WerrorS("nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
425 return TRUE;
426 }
427
428 HilbertSeries_OrbitData(i, lV, ig, mgrad, autop, trunDegHs);
429 return(FALSE);
430 }
431 else
432/* ====== verify ============================*/
433 if(strcmp(sys_cmd,"verifyGB")==0)
434 {
435 if (rIsNCRing(currRing))
436 {
437 WerrorS("system(\"verifyGB\",<ideal>,..) expects a commutative ring");
438 return TRUE;
439 }
440 if (((h->Typ()!=IDEAL_CMD)&&(h->Typ()!=MODUL_CMD))
441 || (h->next!=NULL))
442 {
443 Werror("expected system(\"verifyGB\",<ideal/module>), found <%s>",Tok2Cmdname(h->Typ()));
444 return TRUE;
445 }
446 ideal F=(ideal)h->Data();
447 #ifdef HAVE_VSPACE
448 int cpus = (long) feOptValue(FE_OPT_CPUS);
449 if (cpus>1)
450 res->data=(char*)(long) kVerify2(F,currRing->qideal);
451 else
452 #endif
453 res->data=(char*)(long) kVerify1(F,currRing->qideal);
454 res->rtyp=INT_CMD;
455 return FALSE;
456 }
457 else
458/*===== rcolon ===============================================*/
459 if(strcmp(sys_cmd,"rcolon") == 0)
460 {
461 const short t1[]={3,IDEAL_CMD,POLY_CMD,INT_CMD};
462 if (iiCheckTypes(h,t1,1))
463 {
464 ideal i = (ideal)h->Data();
465 h = h->next;
466 poly w=(poly)h->Data();
467 h = h->next;
468 int lV = (int)(long)h->Data();
469 res->rtyp = IDEAL_CMD;
470 res->data = RightColonOperation(i, w, lV);
471 return(FALSE);
472 }
473 else
474 return TRUE;
475 }
476 else
477
478/*==================== sh ==================================*/
479 if(strcmp(sys_cmd,"sh")==0)
480 {
482 {
483 WerrorS("shell execution is disallowed in restricted mode");
484 return TRUE;
485 }
486 res->rtyp=INT_CMD;
487 if (h==NULL) res->data = (void *)(long) system("sh");
488 else if (h->Typ()==STRING_CMD)
489 res->data = (void*)(long) system((char*)(h->Data()));
490 else
491 WerrorS("string expected");
492 if (errno==ECHILD) res->data=NULL;
493 return FALSE;
494 }
495 else
496/*========reduce procedure like the global one but with jet bounds=======*/
497 if(strcmp(sys_cmd,"reduce_bound")==0)
498 {
499 poly p=NULL;
500 ideal pid=NULL;
501 const short t1[]={3,POLY_CMD,IDEAL_CMD,INT_CMD};
502 const short t2[]={3,IDEAL_CMD,IDEAL_CMD,INT_CMD};
503 const short t3[]={3,VECTOR_CMD,MODUL_CMD,INT_CMD};
504 const short t4[]={3,MODUL_CMD,MODUL_CMD,INT_CMD};
505 if ((iiCheckTypes(h,t1,0))||((iiCheckTypes(h,t3,0))))
506 {
507 p = (poly)h->CopyD();
508 }
509 else if ((iiCheckTypes(h,t2,0))||(iiCheckTypes(h,t4,1)))
510 {
511 pid = (ideal)h->CopyD();
512 }
513 else return TRUE;
514 //int htype;
515 res->rtyp= h->Typ(); /*htype*/
516 ideal q = (ideal)h->next->CopyD();
517 int bound = (int)(long)h->next->next->Data();
518 if (pid==NULL) /*(htype == POLY_CMD || htype == VECTOR_CMD)*/
519 res->data = (char *)kNFBound(q,currRing->qideal,p,bound);
520 else /*(htype == IDEAL_CMD || htype == MODUL_CMD)*/
521 res->data = (char *)kNFBound(q,currRing->qideal,pid,bound);
522 return FALSE;
523 }
524 else
525/*==================== uname ==================================*/
526 if(strcmp(sys_cmd,"uname")==0)
527 {
528 res->rtyp=STRING_CMD;
529 res->data = omStrDup(S_UNAME);
530 return FALSE;
531 }
532 else
533/*==================== with ==================================*/
534 if(strcmp(sys_cmd,"with")==0)
535 {
536 if (h==NULL)
537 {
538 res->rtyp=STRING_CMD;
539 res->data=(void *)versionString();
540 return FALSE;
541 }
542 else if (h->Typ()==STRING_CMD)
543 {
544 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
545 char *s=(char *)h->Data();
546 res->rtyp=INT_CMD;
547 #ifdef HAVE_DBM
548 TEST_FOR("DBM")
549 #endif
550 #ifdef HAVE_DLD
551 TEST_FOR("DLD")
552 #endif
553 //TEST_FOR("factory")
554 //TEST_FOR("libfac")
555 #ifdef HAVE_READLINE
556 TEST_FOR("readline")
557 #endif
558 #ifdef TEST_MAC_ORDER
559 TEST_FOR("MAC_ORDER")
560 #endif
561 // unconditional since 3-1-0-6
562 TEST_FOR("Namespaces")
563 #ifdef HAVE_DYNAMIC_LOADING
564 TEST_FOR("DynamicLoading")
565 #endif
566 #ifdef HAVE_EIGENVAL
567 TEST_FOR("eigenval")
568 #endif
569 #ifdef HAVE_GMS
570 TEST_FOR("gms")
571 #endif
572 #ifdef OM_NDEBUG
573 TEST_FOR("om_ndebug")
574 #endif
575 #ifdef SING_NDEBUG
576 TEST_FOR("ndebug")
577 #endif
578 {};
579 return FALSE;
580 #undef TEST_FOR
581 }
582 return TRUE;
583 }
584 else
585 /*==================== browsers ==================================*/
586 if (strcmp(sys_cmd,"browsers")==0)
587 {
588 res->rtyp = STRING_CMD;
589 StringSetS("");
591 res->data = StringEndS();
592 return FALSE;
593 }
594 else
595 /*==================== pid ==================================*/
596 if (strcmp(sys_cmd,"pid")==0)
597 {
598 res->rtyp=INT_CMD;
599 res->data=(void *)(long) getpid();
600 return FALSE;
601 }
602 else
603 /*==================== getenv ==================================*/
604 if (strcmp(sys_cmd,"getenv")==0)
605 {
606 if ((h!=NULL) && (h->Typ()==STRING_CMD))
607 {
608 res->rtyp=STRING_CMD;
609 const char *r=getenv((char *)h->Data());
610 if (r==NULL) r="";
611 res->data=(void *)omStrDup(r);
612 return FALSE;
613 }
614 else
615 {
616 WerrorS("string expected");
617 return TRUE;
618 }
619 }
620 else
621 /*==================== setenv ==================================*/
622 if (strcmp(sys_cmd,"setenv")==0)
623 {
624 #ifdef HAVE_SETENV
625 const short t[]={2,STRING_CMD,STRING_CMD};
626 if (iiCheckTypes(h,t,1))
627 {
628 res->rtyp=STRING_CMD;
629 setenv((char *)h->Data(), (char *)h->next->Data(), 1);
630 res->data=(void *)omStrDup((char *)h->next->Data());
632 return FALSE;
633 }
634 else
635 {
636 return TRUE;
637 }
638 #else
639 WerrorS("setenv not supported on this platform");
640 return TRUE;
641 #endif
642 }
643 else
644 /*==================== Singular ==================================*/
645 if (strcmp(sys_cmd, "Singular") == 0)
646 {
647 res->rtyp=STRING_CMD;
648 const char *r=feResource("Singular");
649 if (r == NULL) r="";
650 res->data = (void*) omStrDup( r );
651 return FALSE;
652 }
653 else
654 if (strcmp(sys_cmd, "SingularLib") == 0)
655 {
656 res->rtyp=STRING_CMD;
657 const char *r=feResource("SearchPath");
658 if (r == NULL) r="";
659 res->data = (void*) omStrDup( r );
660 return FALSE;
661 }
662 else
663 if (strcmp(sys_cmd, "SingularBin") == 0)
664 {
665 res->rtyp=STRING_CMD;
666 const char *r=feResource('r');
667 if (r == NULL) r="/usr/local";
668 int l=strlen(r);
669 /* where to find Singular's programs: */
670 #define SINGULAR_PROCS_DIR "/libexec/singular/MOD"
671 int ll=si_max((int)strlen(SINGULAR_PROCS_DIR),(int)strlen(LIBEXEC_DIR));
672 char *s=(char*)omAlloc(l+ll+2);
673 if ((strstr(r,".libs/..")==NULL) /*not installed Singular (libtool)*/
674 &&(strstr(r,"Singular/..")==NULL)) /*not installed Singular (static)*/
675 {
676 strcpy(s,r);
677 strcat(s,SINGULAR_PROCS_DIR);
678 if (access(s,X_OK)==0)
679 {
680 strcat(s,"/");
681 }
682 else
683 {
684 /*second try: LIBEXEC_DIR*/
685 strcpy(s,LIBEXEC_DIR);
686 if (access(s,X_OK)==0)
687 {
688 strcat(s,"/");
689 }
690 else
691 {
692 s[0]='\0';
693 }
694 }
695 }
696 else
697 {
698 const char *r=feResource('b');
699 if (r == NULL)
700 {
701 s[0]='\0';
702 }
703 else
704 {
705 strcpy(s,r);
706 strcat(s,"/");
707 }
708 }
709 res->data = (void*)s;
710 return FALSE;
711 }
712 else
713 /*==================== options ==================================*/
714 if (strstr(sys_cmd, "--") == sys_cmd)
715 {
716 if (strcmp(sys_cmd, "--") == 0)
717 {
719 return FALSE;
720 }
721 feOptIndex opt = feGetOptIndex(&sys_cmd[2]);
722 if (opt == FE_OPT_UNDEF)
723 {
724 Werror("Unknown option %s", sys_cmd);
725 WerrorS("Use 'system(\"--\");' for listing of available options");
726 return TRUE;
727 }
728 // for Untyped Options (help version),
729 // setting it just triggers action
730 if (feOptSpec[opt].type == feOptUntyped)
731 {
732 feSetOptValue(opt,0);
733 return FALSE;
734 }
735 if (h == NULL)
736 {
737 if (feOptSpec[opt].type == feOptString)
738 {
739 res->rtyp = STRING_CMD;
740 const char *r=(const char*)feOptSpec[opt].value;
741 if (r == NULL) r="";
742 res->data = omStrDup(r);
743 }
744 else
745 {
746 res->rtyp = INT_CMD;
747 res->data = feOptSpec[opt].value;
748 }
749 return FALSE;
750 }
751 const char* errormsg=NULL;
752 if (h->Typ() == INT_CMD)
753 {
754 if (feOptSpec[opt].type == feOptString)
755 {
756 Werror("Need string argument to set value of option %s", sys_cmd);
757 return TRUE;
758 }
759 errormsg = feSetOptValue(opt, (int)((long) h->Data()));
760 if (errormsg != NULL)
761 Werror("Option '--%s=%d' %s", sys_cmd, (int) ((long)h->Data()), errormsg);
762 }
763 else if (h->Typ()==STRING_CMD)
764 {
765 errormsg = feSetOptValue(opt, (char*) h->Data());
766 if (errormsg != NULL)
767 Werror("Option '--%s=%s' %s", sys_cmd, (char*) h->Data(), errormsg);
768 }
769 else
770 {
771 WerrorS("Need string or int argument to set option value");
772 return TRUE;
773 }
774 if (errormsg != NULL) return TRUE;
775 return FALSE;
776 }
777 else
778 /*==================== HC ==================================*/
779 if (strcmp(sys_cmd,"HC")==0)
780 {
781 res->rtyp=INT_CMD;
782 res->data=(void *)(long) HCord;
783 return FALSE;
784 }
785 else
786 /*==================== random ==================================*/
787 if(strcmp(sys_cmd,"random")==0)
788 {
789 const short t[]={1,INT_CMD};
790 if (h!=NULL)
791 {
792 if (iiCheckTypes(h,t,1))
793 {
794 siRandomStart=(int)((long)h->Data());
797 return FALSE;
798 }
799 else
800 {
801 return TRUE;
802 }
803 }
804 res->rtyp=INT_CMD;
805 res->data=(void*)(long) siSeed;
806 return FALSE;
807 }
808 else
809 /*======================= demon_list =====================*/
810 if (strcmp(sys_cmd,"denom_list")==0)
811 {
812 res->rtyp=LIST_CMD;
813 extern lists get_denom_list();
814 res->data=(lists)get_denom_list();
815 return FALSE;
816 }
817 else
818 /*==================== complexNearZero ======================*/
819 if(strcmp(sys_cmd,"complexNearZero")==0)
820 {
821 const short t[]={2,NUMBER_CMD,INT_CMD};
822 if (iiCheckTypes(h,t,1))
823 {
825 {
826 WerrorS( "unsupported ground field!");
827 return TRUE;
828 }
829 else
830 {
831 res->rtyp=INT_CMD;
832 res->data=(void*)complexNearZero((gmp_complex*)h->Data(),
833 (int)((long)(h->next->Data())));
834 return FALSE;
835 }
836 }
837 else
838 {
839 return TRUE;
840 }
841 }
842 else
843 /*==================== getPrecDigits ======================*/
844 if(strcmp(sys_cmd,"getPrecDigits")==0)
845 {
846 if ( (currRing==NULL)
848 {
849 WerrorS( "unsupported ground field!");
850 return TRUE;
851 }
852 res->rtyp=INT_CMD;
853 res->data=(void*)(long)gmp_output_digits;
854 //if (gmp_output_digits!=getGMPFloatDigits())
855 //{ Print("%d, %d\n",getGMPFloatDigits(),gmp_output_digits);}
856 return FALSE;
857 }
858 else
859 /*==================== lduDecomp ======================*/
860 if(strcmp(sys_cmd, "lduDecomp")==0)
861 {
862 const short t[]={1,MATRIX_CMD};
863 if (iiCheckTypes(h,t,1))
864 {
865 matrix aMat = (matrix)h->Data();
866 matrix pMat; matrix lMat; matrix dMat; matrix uMat;
867 poly l; poly u; poly prodLU;
868 lduDecomp(aMat, pMat, lMat, dMat, uMat, l, u, prodLU);
870 L->Init(7);
871 L->m[0].rtyp = MATRIX_CMD; L->m[0].data=(void*)pMat;
872 L->m[1].rtyp = MATRIX_CMD; L->m[1].data=(void*)lMat;
873 L->m[2].rtyp = MATRIX_CMD; L->m[2].data=(void*)dMat;
874 L->m[3].rtyp = MATRIX_CMD; L->m[3].data=(void*)uMat;
875 L->m[4].rtyp = POLY_CMD; L->m[4].data=(void*)l;
876 L->m[5].rtyp = POLY_CMD; L->m[5].data=(void*)u;
877 L->m[6].rtyp = POLY_CMD; L->m[6].data=(void*)prodLU;
878 res->rtyp = LIST_CMD;
879 res->data = (char *)L;
880 return FALSE;
881 }
882 else
883 {
884 return TRUE;
885 }
886 }
887 else
888 /*==================== lduSolve ======================*/
889 if(strcmp(sys_cmd, "lduSolve")==0)
890 {
891 /* for solving a linear equation system A * x = b, via the
892 given LDU-decomposition of the matrix A;
893 There is one valid parametrisation:
894 1) exactly eight arguments P, L, D, U, l, u, lTimesU, b;
895 P, L, D, and U realise the LDU-decomposition of A, that is,
896 P * A = L * D^(-1) * U, and P, L, D, and U satisfy the
897 properties decribed in method 'luSolveViaLDUDecomp' in
898 linearAlgebra.h; see there;
899 l, u, and lTimesU are as described in the same location;
900 b is the right-hand side vector of the linear equation system;
901 The method will return a list of either 1 entry or three entries:
902 1) [0] if there is no solution to the system;
903 2) [1, x, H] if there is at least one solution;
904 x is any solution of the given linear system,
905 H is the matrix with column vectors spanning the homogeneous
906 solution space.
907 The method produces an error if matrix and vector sizes do not
908 fit. */
910 if (!iiCheckTypes(h,t,1))
911 {
912 return TRUE;
913 }
915 {
916 WerrorS("field required");
917 return TRUE;
918 }
919 matrix pMat = (matrix)h->Data();
920 matrix lMat = (matrix)h->next->Data();
921 matrix dMat = (matrix)h->next->next->Data();
922 matrix uMat = (matrix)h->next->next->next->Data();
923 poly l = (poly) h->next->next->next->next->Data();
924 poly u = (poly) h->next->next->next->next->next->Data();
925 poly lTimesU = (poly) h->next->next->next->next->next->next->Data();
926 matrix bVec = (matrix)h->next->next->next->next->next->next->next->Data();
927 matrix xVec; int solvable; matrix homogSolSpace;
928 if (pMat->rows() != pMat->cols())
929 {
930 Werror("first matrix (%d x %d) is not quadratic",
931 pMat->rows(), pMat->cols());
932 return TRUE;
933 }
934 if (lMat->rows() != lMat->cols())
935 {
936 Werror("second matrix (%d x %d) is not quadratic",
937 lMat->rows(), lMat->cols());
938 return TRUE;
939 }
940 if (dMat->rows() != dMat->cols())
941 {
942 Werror("third matrix (%d x %d) is not quadratic",
943 dMat->rows(), dMat->cols());
944 return TRUE;
945 }
946 if (dMat->cols() != uMat->rows())
947 {
948 Werror("third matrix (%d x %d) and fourth matrix (%d x %d) %s",
949 dMat->rows(), dMat->cols(), uMat->rows(), uMat->cols(),
950 "do not t");
951 return TRUE;
952 }
953 if (uMat->rows() != bVec->rows())
954 {
955 Werror("fourth matrix (%d x %d) and vector (%d x 1) do not fit",
956 uMat->rows(), uMat->cols(), bVec->rows());
957 return TRUE;
958 }
959 solvable = luSolveViaLDUDecomp(pMat, lMat, dMat, uMat, l, u, lTimesU,
960 bVec, xVec, homogSolSpace);
961
962 /* build the return structure; a list with either one or
963 three entries */
965 if (solvable)
966 {
967 ll->Init(3);
968 ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
969 ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
970 ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
971 }
972 else
973 {
974 ll->Init(1);
975 ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
976 }
977 res->rtyp = LIST_CMD;
978 res->data=(char*)ll;
979 return FALSE;
980 }
981 else
982 /*==== countedref: reference and shared ====*/
983 if (strcmp(sys_cmd, "shared") == 0)
984 {
985 #ifndef SI_COUNTEDREF_AUTOLOAD
988 #endif
989 res->rtyp = NONE;
990 return FALSE;
991 }
992 else if (strcmp(sys_cmd, "reference") == 0)
993 {
994 #ifndef SI_COUNTEDREF_AUTOLOAD
997 #endif
998 res->rtyp = NONE;
999 return FALSE;
1000 }
1001 else
1002/*==================== semaphore =================*/
1003#ifdef HAVE_SIMPLEIPC
1004 if (strcmp(sys_cmd,"semaphore")==0)
1005 {
1006 if((h!=NULL) && (h->Typ()==STRING_CMD) && (h->next!=NULL) && (h->next->Typ()==INT_CMD))
1007 {
1008 int v=1;
1009 if ((h->next->next!=NULL)&& (h->next->next->Typ()==INT_CMD))
1010 v=(int)(long)h->next->next->Data();
1011 res->data=(char *)(long)simpleipc_cmd((char *)h->Data(),(int)(long)h->next->Data(),v);
1012 res->rtyp=INT_CMD;
1013 return FALSE;
1014 }
1015 else
1016 {
1017 WerrorS("Usage: system(\"semaphore\",<cmd>,int)");
1018 return TRUE;
1019 }
1020 }
1021 else
1022#endif
1023/*==================== reserved port =================*/
1024 if (strcmp(sys_cmd,"reserve")==0)
1025 {
1026 const short t[]={1,INT_CMD};
1027 if (iiCheckTypes(h,t,1))
1028 {
1029 res->rtyp=INT_CMD;
1030 int p=ssiReservePort((int)(long)h->Data());
1031 res->data=(void*)(long)p;
1032 return (p==0);
1033 }
1034 return TRUE;
1035 }
1036 else
1037/*==================== reserved link =================*/
1038 if (strcmp(sys_cmd,"reservedLink")==0)
1039 {
1040 res->rtyp=LINK_CMD;
1042 res->data=(void*)p;
1043 return (p==NULL);
1044 }
1045 else
1046/*==================== install newstruct =================*/
1047 if (strcmp(sys_cmd,"install")==0)
1048 {
1049 const short t[]={4,STRING_CMD,STRING_CMD,PROC_CMD,INT_CMD};
1050 if (iiCheckTypes(h,t,1))
1051 {
1052 return newstruct_set_proc((char*)h->Data(),(char*)h->next->Data(),
1053 (int)(long)h->next->next->next->Data(),
1054 (procinfov)h->next->next->Data());
1055 }
1056 return TRUE;
1057 }
1058 else
1059/*==================== newstruct =================*/
1060 if (strcmp(sys_cmd,"newstruct")==0)
1061 {
1062 const short t[]={1,STRING_CMD};
1063 if (iiCheckTypes(h,t,1))
1064 {
1065 int id=0;
1066 char *n=(char*)h->Data();
1067 blackboxIsCmd(n,id);
1068 if (id>0)
1069 {
1070 blackbox *bb=getBlackboxStuff(id);
1071 if (BB_LIKE_LIST(bb))
1072 {
1073 newstruct_desc desc=(newstruct_desc)bb->data;
1074 newstructShow(desc);
1075 return FALSE;
1076 }
1077 else Werror("'%s' is not a newstruct",n);
1078 }
1079 else Werror("'%s' is not a blackbox object",n);
1080 }
1081 return TRUE;
1082 }
1083 else
1084/*==================== blackbox =================*/
1085 if (strcmp(sys_cmd,"blackbox")==0)
1086 {
1088 return FALSE;
1089 }
1090 else
1091 /*================= absBiFact ======================*/
1092 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1093 if (strcmp(sys_cmd, "absFact") == 0)
1094 {
1095 const short t[]={1,POLY_CMD};
1096 if (iiCheckTypes(h,t,1)
1097 && (currRing!=NULL)
1098 && (getCoeffType(currRing->cf)==n_transExt))
1099 {
1100 res->rtyp=LIST_CMD;
1101 intvec *v=NULL;
1102 ideal mipos= NULL;
1103 int n= 0;
1104 ideal f=singclap_absFactorize((poly)(h->Data()), mipos, &v, n, currRing);
1105 if (f==NULL) return TRUE;
1106 ivTest(v);
1108 l->Init(4);
1109 l->m[0].rtyp=IDEAL_CMD;
1110 l->m[0].data=(void *)f;
1111 l->m[1].rtyp=INTVEC_CMD;
1112 l->m[1].data=(void *)v;
1113 l->m[2].rtyp=IDEAL_CMD;
1114 l->m[2].data=(void*) mipos;
1115 l->m[3].rtyp=INT_CMD;
1116 l->m[3].data=(void*) (long) n;
1117 res->data=(void *)l;
1118 return FALSE;
1119 }
1120 else return TRUE;
1121 }
1122 else
1123 #endif
1124 /* =================== LLL via NTL ==============================*/
1125 #ifdef HAVE_NTL
1126 if (strcmp(sys_cmd, "LLL") == 0)
1127 {
1128 if (h!=NULL)
1129 {
1130 res->rtyp=h->Typ();
1131 if (h->Typ()==MATRIX_CMD)
1132 {
1133 res->data=(char *)singntl_LLL((matrix)h->Data(), currRing);
1134 return FALSE;
1135 }
1136 else if (h->Typ()==INTMAT_CMD)
1137 {
1138 res->data=(char *)singntl_LLL((intvec*)h->Data());
1139 return FALSE;
1140 }
1141 else return TRUE;
1142 }
1143 else return TRUE;
1144 }
1145 else
1146 #endif
1147 /* =================== LLL via Flint ==============================*/
1148 #ifdef HAVE_FLINT
1149 #if __FLINT_RELEASE >= 20500
1150 if (strcmp(sys_cmd, "LLL_Flint") == 0)
1151 {
1152 if (h!=NULL)
1153 {
1154 if(h->next == NULL)
1155 {
1156 res->rtyp=h->Typ();
1157 if (h->Typ()==BIGINTMAT_CMD)
1158 {
1159 res->data=(char *)singflint_LLL((bigintmat*)h->Data(), NULL);
1160 return FALSE;
1161 }
1162 else if (h->Typ()==INTMAT_CMD)
1163 {
1164 res->data=(char *)singflint_LLL((intvec*)h->Data(), NULL);
1165 return FALSE;
1166 }
1167 else return TRUE;
1168 }
1169 if(h->next->Typ()!= INT_CMD)
1170 {
1171 WerrorS("matrix,int or bigint,int expected");
1172 return TRUE;
1173 }
1174 if(h->next->Typ()== INT_CMD)
1175 {
1176 if(((int)((long)(h->next->Data())) != 0) && (int)((long)(h->next->Data()) != 1))
1177 {
1178 WerrorS("int is different from 0, 1");
1179 return TRUE;
1180 }
1181 res->rtyp=h->Typ();
1182 if((long)(h->next->Data()) == 0)
1183 {
1184 if (h->Typ()==BIGINTMAT_CMD)
1185 {
1186 res->data=(char *)singflint_LLL((bigintmat*)h->Data(), NULL);
1187 return FALSE;
1188 }
1189 else if (h->Typ()==INTMAT_CMD)
1190 {
1191 res->data=(char *)singflint_LLL((intvec*)h->Data(), NULL);
1192 return FALSE;
1193 }
1194 else return TRUE;
1195 }
1196 // This will give also the transformation matrix U s.t. res = U * m
1197 if((long)(h->next->Data()) == 1)
1198 {
1199 if (h->Typ()==BIGINTMAT_CMD)
1200 {
1201 bigintmat* m = (bigintmat*)h->Data();
1202 bigintmat* T = new bigintmat(m->rows(),m->rows(),m->basecoeffs());
1203 for(int i = 1; i<=m->rows(); i++)
1204 {
1205 n_Delete(&(BIMATELEM(*T,i,i)),T->basecoeffs());
1206 BIMATELEM(*T,i,i)=n_Init(1, T->basecoeffs());
1207 }
1208 m = singflint_LLL(m,T);
1210 L->Init(2);
1211 L->m[0].rtyp = BIGINTMAT_CMD; L->m[0].data = (void*)m;
1212 L->m[1].rtyp = BIGINTMAT_CMD; L->m[1].data = (void*)T;
1213 res->data=L;
1214 res->rtyp=LIST_CMD;
1215 return FALSE;
1216 }
1217 else if (h->Typ()==INTMAT_CMD)
1218 {
1219 intvec* m = (intvec*)h->Data();
1220 intvec* T = new intvec(m->rows(),m->rows(),(int)0);
1221 for(int i = 1; i<=m->rows(); i++)
1222 IMATELEM(*T,i,i)=1;
1223 m = singflint_LLL(m,T);
1225 L->Init(2);
1226 L->m[0].rtyp = INTMAT_CMD; L->m[0].data = (void*)m;
1227 L->m[1].rtyp = INTMAT_CMD; L->m[1].data = (void*)T;
1228 res->data=L;
1229 res->rtyp=LIST_CMD;
1230 return FALSE;
1231 }
1232 else return TRUE;
1233 }
1234 }
1235
1236 }
1237 else return TRUE;
1238 }
1239 else
1240 #endif
1241 #endif
1242/* ====== rref ============================*/
1243 #if defined(HAVE_FLINT) || defined(HAVE_NTL)
1244 if(strcmp(sys_cmd,"rref")==0)
1245 {
1246 const short t1[]={1,MATRIX_CMD};
1247 const short t2[]={1,SMATRIX_CMD};
1248 if (iiCheckTypes(h,t1,0))
1249 {
1250 matrix M=(matrix)h->Data();
1251 #if defined(HAVE_FLINT)
1252 res->data=(void*)singflint_rref(M,currRing);
1253 #elif defined(HAVE_NTL)
1254 res->data=(void*)singntl_rref(M,currRing);
1255 #endif
1256 res->rtyp=MATRIX_CMD;
1257 return FALSE;
1258 }
1259 else if (iiCheckTypes(h,t2,1))
1260 {
1261 ideal M=(ideal)h->Data();
1262 #if defined(HAVE_FLINT)
1263 res->data=(void*)singflint_rref(M,currRing);
1264 #elif defined(HAVE_NTL)
1265 res->data=(void*)singntl_rref(M,currRing);
1266 #endif
1267 res->rtyp=SMATRIX_CMD;
1268 return FALSE;
1269 }
1270 else
1271 {
1272 WerrorS("expected system(\"rref\",<matrix>/<smatrix>)");
1273 return TRUE;
1274 }
1275 }
1276 else
1277 #endif
1278 /*==================== pcv ==================================*/
1279 #ifdef HAVE_PCV
1280 if(strcmp(sys_cmd,"pcvLAddL")==0)
1281 {
1282 return pcvLAddL(res,h);
1283 }
1284 else
1285 if(strcmp(sys_cmd,"pcvPMulL")==0)
1286 {
1287 return pcvPMulL(res,h);
1288 }
1289 else
1290 if(strcmp(sys_cmd,"pcvMinDeg")==0)
1291 {
1292 return pcvMinDeg(res,h);
1293 }
1294 else
1295 if(strcmp(sys_cmd,"pcvP2CV")==0)
1296 {
1297 return pcvP2CV(res,h);
1298 }
1299 else
1300 if(strcmp(sys_cmd,"pcvCV2P")==0)
1301 {
1302 return pcvCV2P(res,h);
1303 }
1304 else
1305 if(strcmp(sys_cmd,"pcvDim")==0)
1306 {
1307 return pcvDim(res,h);
1308 }
1309 else
1310 if(strcmp(sys_cmd,"pcvBasis")==0)
1311 {
1312 return pcvBasis(res,h);
1313 }
1314 else
1315 #endif
1316 /*==================== hessenberg/eigenvalues ==================================*/
1317 #ifdef HAVE_EIGENVAL
1318 if(strcmp(sys_cmd,"hessenberg")==0)
1319 {
1320 return evHessenberg(res,h);
1321 }
1322 else
1323 #endif
1324 /*==================== eigenvalues ==================================*/
1325 #ifdef HAVE_EIGENVAL
1326 if(strcmp(sys_cmd,"eigenvals")==0)
1327 {
1328 return evEigenvals(res,h);
1329 }
1330 else
1331 #endif
1332 /*==================== rowelim ==================================*/
1333 #ifdef HAVE_EIGENVAL
1334 if(strcmp(sys_cmd,"rowelim")==0)
1335 {
1336 return evRowElim(res,h);
1337 }
1338 else
1339 #endif
1340 /*==================== rowcolswap ==================================*/
1341 #ifdef HAVE_EIGENVAL
1342 if(strcmp(sys_cmd,"rowcolswap")==0)
1343 {
1344 return evSwap(res,h);
1345 }
1346 else
1347 #endif
1348 /*==================== Gauss-Manin system ==================================*/
1349 #ifdef HAVE_GMS
1350 if(strcmp(sys_cmd,"gmsnf")==0)
1351 {
1352 return gmsNF(res,h);
1353 }
1354 else
1355 #endif
1356 /*==================== contributors =============================*/
1357 if(strcmp(sys_cmd,"contributors") == 0)
1358 {
1359 res->rtyp=STRING_CMD;
1360 res->data=(void *)omStrDup(
1361 "Olaf Bachmann, Michael Brickenstein, Hubert Grassmann, Kai Krueger, Victor Levandovskyy, Wolfgang Neumann, Thomas Nuessler, Wilfred Pohl, Jens Schmidt, Mathias Schulze, Thomas Siebert, Ruediger Stobbe, Moritz Wenk, Tim Wichmann");
1362 return FALSE;
1363 }
1364 else
1365 /*==================== spectrum =============================*/
1366 #ifdef HAVE_SPECTRUM
1367 if(strcmp(sys_cmd,"spectrum") == 0)
1368 {
1369 if ((h==NULL) || (h->Typ()!=POLY_CMD))
1370 {
1371 WerrorS("poly expected");
1372 return TRUE;
1373 }
1374 if (h->next==NULL)
1375 return spectrumProc(res,h);
1376 if (h->next->Typ()!=INT_CMD)
1377 {
1378 WerrorS("poly,int expected");
1379 return TRUE;
1380 }
1381 if(((long)h->next->Data())==1L)
1382 return spectrumfProc(res,h);
1383 return spectrumProc(res,h);
1384 }
1385 else
1386 /*==================== semic =============================*/
1387 if(strcmp(sys_cmd,"semic") == 0)
1388 {
1389 if ((h->next!=NULL)
1390 && (h->Typ()==LIST_CMD)
1391 && (h->next->Typ()==LIST_CMD))
1392 {
1393 if (h->next->next==NULL)
1394 return semicProc(res,h,h->next);
1395 else if (h->next->next->Typ()==INT_CMD)
1396 return semicProc3(res,h,h->next,h->next->next);
1397 }
1398 return TRUE;
1399 }
1400 else
1401 /*==================== spadd =============================*/
1402 if(strcmp(sys_cmd,"spadd") == 0)
1403 {
1404 const short t[]={2,LIST_CMD,LIST_CMD};
1405 if (iiCheckTypes(h,t,1))
1406 {
1407 return spaddProc(res,h,h->next);
1408 }
1409 return TRUE;
1410 }
1411 else
1412 /*==================== spmul =============================*/
1413 if(strcmp(sys_cmd,"spmul") == 0)
1414 {
1415 const short t[]={2,LIST_CMD,INT_CMD};
1416 if (iiCheckTypes(h,t,1))
1417 {
1418 return spmulProc(res,h,h->next);
1419 }
1420 return TRUE;
1421 }
1422 else
1423 #endif
1424/*==================== tensorModuleMult ========================= */
1425 #define HAVE_SHEAFCOH_TRICKS 1
1426
1427 #ifdef HAVE_SHEAFCOH_TRICKS
1428 if(strcmp(sys_cmd,"tensorModuleMult")==0)
1429 {
1430 const short t[]={2,INT_CMD,MODUL_CMD};
1431 // WarnS("tensorModuleMult!");
1432 if (iiCheckTypes(h,t,1))
1433 {
1434 int m = (int)( (long)h->Data() );
1435 ideal M = (ideal)h->next->Data();
1436 res->rtyp=MODUL_CMD;
1437 res->data=(void *)id_TensorModuleMult(m, M, currRing);
1438 return FALSE;
1439 }
1440 return TRUE;
1441 }
1442 else
1443 #endif
1444 /*==================== twostd =================*/
1445 #ifdef HAVE_PLURAL
1446 if (strcmp(sys_cmd, "twostd") == 0)
1447 {
1448 ideal I;
1449 if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
1450 {
1451 I=(ideal)h->CopyD();
1452 res->rtyp=IDEAL_CMD;
1453 if (rIsPluralRing(currRing)) res->data=twostd(I);
1454 else res->data=I;
1457 }
1458 else return TRUE;
1459 return FALSE;
1460 }
1461 else
1462 #endif
1463 /*==================== lie bracket =================*/
1464 #ifdef HAVE_PLURAL
1465 if (strcmp(sys_cmd, "bracket") == 0)
1466 {
1467 const short t[]={2,POLY_CMD,POLY_CMD};
1468 if (iiCheckTypes(h,t,1))
1469 {
1470 poly p=(poly)h->CopyD();
1471 h=h->next;
1472 poly q=(poly)h->Data();
1473 res->rtyp=POLY_CMD;
1475 return FALSE;
1476 }
1477 return TRUE;
1478 }
1479 else
1480 #endif
1481 /*==================== env ==================================*/
1482 #ifdef HAVE_PLURAL
1483 if (strcmp(sys_cmd, "env")==0)
1484 {
1485 if ((h!=NULL) && (h->Typ()==RING_CMD))
1486 {
1487 ring r = (ring)h->Data();
1488 res->data = rEnvelope(r);
1489 res->rtyp = RING_CMD;
1490 return FALSE;
1491 }
1492 else
1493 {
1494 WerrorS("`system(\"env\",<ring>)` expected");
1495 return TRUE;
1496 }
1497 }
1498 else
1499 #endif
1500/* ============ opp ======================== */
1501 #ifdef HAVE_PLURAL
1502 if (strcmp(sys_cmd, "opp")==0)
1503 {
1504 if ((h!=NULL) && (h->Typ()==RING_CMD))
1505 {
1506 ring r=(ring)h->Data();
1507 res->data=rOpposite(r);
1508 res->rtyp=RING_CMD;
1509 return FALSE;
1510 }
1511 else
1512 {
1513 WerrorS("`system(\"opp\",<ring>)` expected");
1514 return TRUE;
1515 }
1516 }
1517 else
1518 #endif
1519 /*==================== oppose ==================================*/
1520 #ifdef HAVE_PLURAL
1521 if (strcmp(sys_cmd, "oppose")==0)
1522 {
1523 if ((h!=NULL) && (h->Typ()==RING_CMD)
1524 && (h->next!= NULL))
1525 {
1526 ring Rop = (ring)h->Data();
1527 h = h->next;
1528 idhdl w;
1529 if ((w=Rop->idroot->get(h->Name(),myynest))!=NULL)
1530 {
1531 poly p = (poly)IDDATA(w);
1532 res->data = pOppose(Rop, p, currRing); // into CurrRing?
1533 res->rtyp = POLY_CMD;
1534 return FALSE;
1535 }
1536 }
1537 else
1538 {
1539 WerrorS("`system(\"oppose\",<ring>,<poly>)` expected");
1540 return TRUE;
1541 }
1542 }
1543 else
1544 #endif
1545/*==================== sat =================*/
1546 if(strcmp(sys_cmd,"sat")==0)
1547 {
1548 ideal I= (ideal)h->Data();
1549 ideal J=(ideal)h->next->Data();
1550 int k;
1551 ideal S=idSaturate_intern(I,J,k,h->Typ()==IDEAL_CMD,hasFlag(h,FLAG_STD));
1552 res->rtyp=h->Typ();
1553 res->data=(void*)S;
1555 return FALSE;
1556 }
1557 else
1558 /*==================== walk stuff =================*/
1559 /*==================== walkNextWeight =================*/
1560 #ifdef HAVE_WALK
1561 #ifdef OWNW
1562 if (strcmp(sys_cmd, "walkNextWeight") == 0)
1563 {
1564 const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1565 if (!iiCheckTypes(h,t,1)) return TRUE;
1566 if (((intvec*) h->Data())->length() != currRing->N ||
1567 ((intvec*) h->next->Data())->length() != currRing->N)
1568 {
1569 Werror("system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1570 currRing->N);
1571 return TRUE;
1572 }
1573 res->data = (void*) walkNextWeight(((intvec*) h->Data()),
1574 ((intvec*) h->next->Data()),
1575 (ideal) h->next->next->Data());
1576 if (res->data == NULL || res->data == (void*) 1L)
1577 {
1578 res->rtyp = INT_CMD;
1579 }
1580 else
1581 {
1582 res->rtyp = INTVEC_CMD;
1583 }
1584 return FALSE;
1585 }
1586 else
1587 #endif
1588 #endif
1589 /*==================== walkNextWeight =================*/
1590 #ifdef HAVE_WALK
1591 #ifdef OWNW
1592 if (strcmp(sys_cmd, "walkInitials") == 0)
1593 {
1594 if (h == NULL || h->Typ() != IDEAL_CMD)
1595 {
1596 WerrorS("system(\"walkInitials\", ideal) expected");
1597 return TRUE;
1598 }
1599 res->data = (void*) walkInitials((ideal) h->Data());
1600 res->rtyp = IDEAL_CMD;
1601 return FALSE;
1602 }
1603 else
1604 #endif
1605 #endif
1606 /*==================== walkAddIntVec =================*/
1607 #ifdef HAVE_WALK
1608 #ifdef WAIV
1609 if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1610 {
1611 const short t[]={2,INTVEC_CMD,INTVEC_CMD};
1612 if (!iiCheckTypes(h,t,1)) return TRUE;
1613 intvec* arg1 = (intvec*) h->Data();
1614 intvec* arg2 = (intvec*) h->next->Data();
1615 res->data = (intvec*) walkAddIntVec(arg1, arg2);
1616 res->rtyp = INTVEC_CMD;
1617 return FALSE;
1618 }
1619 else
1620 #endif
1621 #endif
1622 /*==================== MwalkNextWeight =================*/
1623 #ifdef HAVE_WALK
1624 #ifdef MwaklNextWeight
1625 if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1626 {
1627 const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1628 if (!iiCheckTypes(h,t,1)) return TRUE;
1629 if (((intvec*) h->Data())->length() != currRing->N ||
1630 ((intvec*) h->next->Data())->length() != currRing->N)
1631 {
1632 Werror("system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1633 currRing->N);
1634 return TRUE;
1635 }
1636 intvec* arg1 = (intvec*) h->Data();
1637 intvec* arg2 = (intvec*) h->next->Data();
1638 ideal arg3 = (ideal) h->next->next->Data();
1639 intvec* result = (intvec*) MwalkNextWeight(arg1, arg2, arg3);
1640 res->rtyp = INTVEC_CMD;
1641 res->data = result;
1642 return FALSE;
1643 }
1644 else
1645 #endif //MWalkNextWeight
1646 #endif
1647 /*==================== Mivdp =================*/
1648 #ifdef HAVE_WALK
1649 if(strcmp(sys_cmd, "Mivdp") == 0)
1650 {
1651 if (h == NULL || h->Typ() != INT_CMD)
1652 {
1653 WerrorS("system(\"Mivdp\", int) expected");
1654 return TRUE;
1655 }
1656 if ((int) ((long)(h->Data())) != currRing->N)
1657 {
1658 Werror("system(\"Mivdp\" ...) intvecs not of length %d\n",
1659 currRing->N);
1660 return TRUE;
1661 }
1662 int arg1 = (int) ((long)(h->Data()));
1663 intvec* result = (intvec*) Mivdp(arg1);
1664 res->rtyp = INTVEC_CMD;
1665 res->data = result;
1666 return FALSE;
1667 }
1668 else
1669 #endif
1670 /*==================== Mivlp =================*/
1671 #ifdef HAVE_WALK
1672 if(strcmp(sys_cmd, "Mivlp") == 0)
1673 {
1674 if (h == NULL || h->Typ() != INT_CMD)
1675 {
1676 WerrorS("system(\"Mivlp\", int) expected");
1677 return TRUE;
1678 }
1679 if ((int) ((long)(h->Data())) != currRing->N)
1680 {
1681 Werror("system(\"Mivlp\" ...) intvecs not of length %d\n",
1682 currRing->N);
1683 return TRUE;
1684 }
1685 int arg1 = (int) ((long)(h->Data()));
1686 intvec* result = (intvec*) Mivlp(arg1);
1687 res->rtyp = INTVEC_CMD;
1688 res->data = result;
1689 return FALSE;
1690 }
1691 else
1692 #endif
1693 /*==================== MpDiv =================*/
1694 #ifdef HAVE_WALK
1695 #ifdef MpDiv
1696 if(strcmp(sys_cmd, "MpDiv") == 0)
1697 {
1698 const short t[]={2,POLY_CMD,POLY_CMD};
1699 if (!iiCheckTypes(h,t,1)) return TRUE;
1700 poly arg1 = (poly) h->Data();
1701 poly arg2 = (poly) h->next->Data();
1702 poly result = MpDiv(arg1, arg2);
1703 res->rtyp = POLY_CMD;
1704 res->data = result;
1705 return FALSE;
1706 }
1707 else
1708 #endif
1709 #endif
1710 /*==================== MpMult =================*/
1711 #ifdef HAVE_WALK
1712 #ifdef MpMult
1713 if(strcmp(sys_cmd, "MpMult") == 0)
1714 {
1715 const short t[]={2,POLY_CMD,POLY_CMD};
1716 if (!iiCheckTypes(h,t,1)) return TRUE;
1717 poly arg1 = (poly) h->Data();
1718 poly arg2 = (poly) h->next->Data();
1719 poly result = MpMult(arg1, arg2);
1720 res->rtyp = POLY_CMD;
1721 res->data = result;
1722 return FALSE;
1723 }
1724 else
1725 #endif
1726 #endif
1727 /*==================== MivSame =================*/
1728 #ifdef HAVE_WALK
1729 if (strcmp(sys_cmd, "MivSame") == 0)
1730 {
1731 const short t[]={2,INTVEC_CMD,INTVEC_CMD};
1732 if (!iiCheckTypes(h,t,1)) return TRUE;
1733 /*
1734 if (((intvec*) h->Data())->length() != currRing->N ||
1735 ((intvec*) h->next->Data())->length() != currRing->N)
1736 {
1737 Werror("system(\"MivSame\" ...) intvecs not of length %d\n",
1738 currRing->N);
1739 return TRUE;
1740 }
1741 */
1742 intvec* arg1 = (intvec*) h->Data();
1743 intvec* arg2 = (intvec*) h->next->Data();
1744 /*
1745 poly result = (poly) MivSame(arg1, arg2);
1746 res->rtyp = POLY_CMD;
1747 res->data = (poly) result;
1748 */
1749 res->rtyp = INT_CMD;
1750 res->data = (void*)(long) MivSame(arg1, arg2);
1751 return FALSE;
1752 }
1753 else
1754 #endif
1755 /*==================== M3ivSame =================*/
1756 #ifdef HAVE_WALK
1757 if (strcmp(sys_cmd, "M3ivSame") == 0)
1758 {
1759 const short t[]={3,INTVEC_CMD,INTVEC_CMD,INTVEC_CMD};
1760 if (!iiCheckTypes(h,t,1)) return TRUE;
1761 /*
1762 if (((intvec*) h->Data())->length() != currRing->N ||
1763 ((intvec*) h->next->Data())->length() != currRing->N ||
1764 ((intvec*) h->next->next->Data())->length() != currRing->N )
1765 {
1766 Werror("system(\"M3ivSame\" ...) intvecs not of length %d\n",
1767 currRing->N);
1768 return TRUE;
1769 }
1770 */
1771 intvec* arg1 = (intvec*) h->Data();
1772 intvec* arg2 = (intvec*) h->next->Data();
1773 intvec* arg3 = (intvec*) h->next->next->Data();
1774 /*
1775 poly result = (poly) M3ivSame(arg1, arg2, arg3);
1776 res->rtyp = POLY_CMD;
1777 res->data = (poly) result;
1778 */
1779 res->rtyp = INT_CMD;
1780 res->data = (void*)(long) M3ivSame(arg1, arg2, arg3);
1781 return FALSE;
1782 }
1783 else
1784 #endif
1785 /*==================== MwalkInitialForm =================*/
1786 #ifdef HAVE_WALK
1787 if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1788 {
1789 const short t[]={2,IDEAL_CMD,INTVEC_CMD};
1790 if (!iiCheckTypes(h,t,1)) return TRUE;
1791 if(((intvec*) h->next->Data())->length() != currRing->N)
1792 {
1793 Werror("system \"MwalkInitialForm\"...) intvec not of length %d\n",
1794 currRing->N);
1795 return TRUE;
1796 }
1797 ideal id = (ideal) h->Data();
1798 intvec* int_w = (intvec*) h->next->Data();
1799 ideal result = (ideal) MwalkInitialForm(id, int_w);
1800 res->rtyp = IDEAL_CMD;
1801 res->data = result;
1802 return FALSE;
1803 }
1804 else
1805 #endif
1806 /*==================== MivMatrixOrder =================*/
1807 #ifdef HAVE_WALK
1808 /************** Perturbation walk **********/
1809 if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1810 {
1811 if(h==NULL || h->Typ() != INTVEC_CMD)
1812 {
1813 WerrorS("system(\"MivMatrixOrder\",intvec) expected");
1814 return TRUE;
1815 }
1816 intvec* arg1 = (intvec*) h->Data();
1817 intvec* result = MivMatrixOrder(arg1);
1818 res->rtyp = INTVEC_CMD;
1819 res->data = result;
1820 return FALSE;
1821 }
1822 else
1823 #endif
1824 /*==================== MivMatrixOrderdp =================*/
1825 #ifdef HAVE_WALK
1826 if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1827 {
1828 if(h==NULL || h->Typ() != INT_CMD)
1829 {
1830 WerrorS("system(\"MivMatrixOrderdp\",intvec) expected");
1831 return TRUE;
1832 }
1833 int arg1 = (int) ((long)(h->Data()));
1835 res->rtyp = INTVEC_CMD;
1836 res->data = result;
1837 return FALSE;
1838 }
1839 else
1840 #endif
1841 /*==================== MPertVectors =================*/
1842 #ifdef HAVE_WALK
1843 if(strcmp(sys_cmd, "MPertVectors") == 0)
1844 {
1845 const short t[]={3,IDEAL_CMD,INTVEC_CMD,INT_CMD};
1846 if (!iiCheckTypes(h,t,1)) return TRUE;
1847 ideal arg1 = (ideal) h->Data();
1848 intvec* arg2 = (intvec*) h->next->Data();
1849 int arg3 = (int) ((long)(h->next->next->Data()));
1850 intvec* result = (intvec*) MPertVectors(arg1, arg2, arg3);
1851 res->rtyp = INTVEC_CMD;
1852 res->data = result;
1853 return FALSE;
1854 }
1855 else
1856 #endif
1857 /*==================== MPertVectorslp =================*/
1858 #ifdef HAVE_WALK
1859 if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1860 {
1861 const short t[]={3,IDEAL_CMD,INTVEC_CMD,INT_CMD};
1862 if (!iiCheckTypes(h,t,1)) return TRUE;
1863 ideal arg1 = (ideal) h->Data();
1864 intvec* arg2 = (intvec*) h->next->Data();
1865 int arg3 = (int) ((long)(h->next->next->Data()));
1866 intvec* result = (intvec*) MPertVectorslp(arg1, arg2, arg3);
1867 res->rtyp = INTVEC_CMD;
1868 res->data = result;
1869 return FALSE;
1870 }
1871 else
1872 #endif
1873 /************** fractal walk **********/
1874 #ifdef HAVE_WALK
1875 if(strcmp(sys_cmd, "Mfpertvector") == 0)
1876 {
1877 const short t[]={2,IDEAL_CMD,INTVEC_CMD};
1878 if (!iiCheckTypes(h,t,1)) return TRUE;
1879 ideal arg1 = (ideal) h->Data();
1880 intvec* arg2 = (intvec*) h->next->Data();
1881 intvec* result = Mfpertvector(arg1, arg2);
1882 res->rtyp = INTVEC_CMD;
1883 res->data = result;
1884 return FALSE;
1885 }
1886 else
1887 #endif
1888 /*==================== MivUnit =================*/
1889 #ifdef HAVE_WALK
1890 if(strcmp(sys_cmd, "MivUnit") == 0)
1891 {
1892 const short t[]={1,INT_CMD};
1893 if (!iiCheckTypes(h,t,1)) return TRUE;
1894 int arg1 = (int) ((long)(h->Data()));
1895 intvec* result = (intvec*) MivUnit(arg1);
1896 res->rtyp = INTVEC_CMD;
1897 res->data = result;
1898 return FALSE;
1899 }
1900 else
1901 #endif
1902 /*==================== MivWeightOrderlp =================*/
1903 #ifdef HAVE_WALK
1904 if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1905 {
1906 const short t[]={1,INTVEC_CMD};
1907 if (!iiCheckTypes(h,t,1)) return TRUE;
1908 intvec* arg1 = (intvec*) h->Data();
1910 res->rtyp = INTVEC_CMD;
1911 res->data = result;
1912 return FALSE;
1913 }
1914 else
1915 #endif
1916 /*==================== MivWeightOrderdp =================*/
1917 #ifdef HAVE_WALK
1918 if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1919 {
1920 if(h==NULL || h->Typ() != INTVEC_CMD)
1921 {
1922 WerrorS("system(\"MivWeightOrderdp\",intvec) expected");
1923 return TRUE;
1924 }
1925 intvec* arg1 = (intvec*) h->Data();
1926 //int arg2 = (int) h->next->Data();
1928 res->rtyp = INTVEC_CMD;
1929 res->data = result;
1930 return FALSE;
1931 }
1932 else
1933 #endif
1934 /*==================== MivMatrixOrderlp =================*/
1935 #ifdef HAVE_WALK
1936 if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1937 {
1938 if(h==NULL || h->Typ() != INT_CMD)
1939 {
1940 WerrorS("system(\"MivMatrixOrderlp\",int) expected");
1941 return TRUE;
1942 }
1943 int arg1 = (int) ((long)(h->Data()));
1945 res->rtyp = INTVEC_CMD;
1946 res->data = result;
1947 return FALSE;
1948 }
1949 else
1950 #endif
1951 /*==================== MkInterRedNextWeight =================*/
1952 #ifdef HAVE_WALK
1953 if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1954 {
1955 const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1956 if (!iiCheckTypes(h,t,1)) return TRUE;
1957 if (((intvec*) h->Data())->length() != currRing->N ||
1958 ((intvec*) h->next->Data())->length() != currRing->N)
1959 {
1960 Werror("system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1961 currRing->N);
1962 return TRUE;
1963 }
1964 intvec* arg1 = (intvec*) h->Data();
1965 intvec* arg2 = (intvec*) h->next->Data();
1966 ideal arg3 = (ideal) h->next->next->Data();
1967 intvec* result = (intvec*) MkInterRedNextWeight(arg1, arg2, arg3);
1968 res->rtyp = INTVEC_CMD;
1969 res->data = result;
1970 return FALSE;
1971 }
1972 else
1973 #endif
1974 /*==================== MPertNextWeight =================*/
1975 #ifdef HAVE_WALK
1976 #ifdef MPertNextWeight
1977 if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1978 {
1979 const short t[]={3,INTVEC_CMD,IDEAL_CMD,INT_CMD};
1980 if (!iiCheckTypes(h,t,1)) return TRUE;
1981 if (((intvec*) h->Data())->length() != currRing->N)
1982 {
1983 Werror("system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1984 currRing->N);
1985 return TRUE;
1986 }
1987 intvec* arg1 = (intvec*) h->Data();
1988 ideal arg2 = (ideal) h->next->Data();
1989 int arg3 = (int) h->next->next->Data();
1990 intvec* result = (intvec*) MPertNextWeight(arg1, arg2, arg3);
1991 res->rtyp = INTVEC_CMD;
1992 res->data = result;
1993 return FALSE;
1994 }
1995 else
1996 #endif //MPertNextWeight
1997 #endif
1998 /*==================== Mivperttarget =================*/
1999 #ifdef HAVE_WALK
2000 #ifdef Mivperttarget
2001 if (strcmp(sys_cmd, "Mivperttarget") == 0)
2002 {
2003 const short t[]={2,IDEAL_CMD,INT_CMD};
2004 if (!iiCheckTypes(h,t,1)) return TRUE;
2005 ideal arg1 = (ideal) h->Data();
2006 int arg2 = (int) h->next->Data();
2007 intvec* result = (intvec*) Mivperttarget(arg1, arg2);
2008 res->rtyp = INTVEC_CMD;
2009 res->data = result;
2010 return FALSE;
2011 }
2012 else
2013 #endif //Mivperttarget
2014 #endif
2015 /*==================== Mwalk =================*/
2016 #ifdef HAVE_WALK
2017 if (strcmp(sys_cmd, "Mwalk") == 0)
2018 {
2020 if (!iiCheckTypes(h,t,1)) return TRUE;
2021 if (((intvec*) h->next->Data())->length() != currRing->N &&
2022 ((intvec*) h->next->next->Data())->length() != currRing->N )
2023 {
2024 Werror("system(\"Mwalk\" ...) intvecs not of length %d\n",
2025 currRing->N);
2026 return TRUE;
2027 }
2028 ideal arg1 = (ideal) h->CopyD();
2029 intvec* arg2 = (intvec*) h->next->Data();
2030 intvec* arg3 = (intvec*) h->next->next->Data();
2031 ring arg4 = (ring) h->next->next->next->Data();
2032 int arg5 = (int) (long) h->next->next->next->next->Data();
2033 int arg6 = (int) (long) h->next->next->next->next->next->Data();
2034 ideal result = (ideal) Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2035 res->rtyp = IDEAL_CMD;
2036 res->data = result;
2037 return FALSE;
2038 }
2039 else
2040 #endif
2041 /*==================== Mpwalk =================*/
2042 #ifdef HAVE_WALK
2043 #ifdef MPWALK_ORIG
2044 if (strcmp(sys_cmd, "Mwalk") == 0)
2045 {
2046 const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,RING_CMD};
2047 if (!iiCheckTypes(h,t,1)) return TRUE;
2048 if ((((intvec*) h->next->Data())->length() != currRing->N &&
2049 ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2050 (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2051 ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N)))
2052 {
2053 Werror("system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2054 currRing->N,(currRing->N)*(currRing->N));
2055 return TRUE;
2056 }
2057 ideal arg1 = (ideal) h->Data();
2058 intvec* arg2 = (intvec*) h->next->Data();
2059 intvec* arg3 = (intvec*) h->next->next->Data();
2060 ring arg4 = (ring) h->next->next->next->Data();
2061 ideal result = (ideal) Mwalk(arg1, arg2, arg3,arg4);
2062 res->rtyp = IDEAL_CMD;
2063 res->data = result;
2064 return FALSE;
2065 }
2066 else
2067 #else
2068 if (strcmp(sys_cmd, "Mpwalk") == 0)
2069 {
2071 if (!iiCheckTypes(h,t,1)) return TRUE;
2072 if(((intvec*) h->next->next->next->Data())->length() != currRing->N &&
2073 ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
2074 {
2075 Werror("system(\"Mpwalk\" ...) intvecs not of length %d\n",currRing->N);
2076 return TRUE;
2077 }
2078 ideal arg1 = (ideal) h->Data();
2079 int arg2 = (int) (long) h->next->Data();
2080 int arg3 = (int) (long) h->next->next->Data();
2081 intvec* arg4 = (intvec*) h->next->next->next->Data();
2082 intvec* arg5 = (intvec*) h->next->next->next->next->Data();
2083 int arg6 = (int) (long) h->next->next->next->next->next->Data();
2084 int arg7 = (int) (long) h->next->next->next->next->next->next->Data();
2085 int arg8 = (int) (long) h->next->next->next->next->next->next->next->Data();
2086 ideal result = (ideal) Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2087 res->rtyp = IDEAL_CMD;
2088 res->data = result;
2089 return FALSE;
2090 }
2091 else
2092 #endif
2093 #endif
2094 /*==================== Mrwalk =================*/
2095 #ifdef HAVE_WALK
2096 if (strcmp(sys_cmd, "Mrwalk") == 0)
2097 {
2099 if (!iiCheckTypes(h,t,1)) return TRUE;
2100 if(((intvec*) h->next->Data())->length() != currRing->N &&
2101 ((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2102 ((intvec*) h->next->next->Data())->length() != currRing->N &&
2103 ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) )
2104 {
2105 Werror("system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2106 currRing->N,(currRing->N)*(currRing->N));
2107 return TRUE;
2108 }
2109 ideal arg1 = (ideal) h->Data();
2110 intvec* arg2 = (intvec*) h->next->Data();
2111 intvec* arg3 = (intvec*) h->next->next->Data();
2112 int arg4 = (int)(long) h->next->next->next->Data();
2113 int arg5 = (int)(long) h->next->next->next->next->Data();
2114 int arg6 = (int)(long) h->next->next->next->next->next->Data();
2115 int arg7 = (int)(long) h->next->next->next->next->next->next->Data();
2116 ideal result = (ideal) Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2117 res->rtyp = IDEAL_CMD;
2118 res->data = result;
2119 return FALSE;
2120 }
2121 else
2122 #endif
2123 /*==================== MAltwalk1 =================*/
2124 #ifdef HAVE_WALK
2125 if (strcmp(sys_cmd, "MAltwalk1") == 0)
2126 {
2127 const short t[]={5,IDEAL_CMD,INT_CMD,INT_CMD,INTVEC_CMD,INTVEC_CMD};
2128 if (!iiCheckTypes(h,t,1)) return TRUE;
2129 if (((intvec*) h->next->next->next->Data())->length() != currRing->N &&
2130 ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
2131 {
2132 Werror("system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2133 currRing->N);
2134 return TRUE;
2135 }
2136 ideal arg1 = (ideal) h->Data();
2137 int arg2 = (int) ((long)(h->next->Data()));
2138 int arg3 = (int) ((long)(h->next->next->Data()));
2139 intvec* arg4 = (intvec*) h->next->next->next->Data();
2140 intvec* arg5 = (intvec*) h->next->next->next->next->Data();
2141 ideal result = (ideal) MAltwalk1(arg1, arg2, arg3, arg4, arg5);
2142 res->rtyp = IDEAL_CMD;
2143 res->data = result;
2144 return FALSE;
2145 }
2146 else
2147 #endif
2148 /*==================== MAltwalk1 =================*/
2149 #ifdef HAVE_WALK
2150 #ifdef MFWALK_ALT
2151 if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2152 {
2153 const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD};
2154 if (!iiCheckTypes(h,t,1)) return TRUE;
2155 if (((intvec*) h->next->Data())->length() != currRing->N &&
2156 ((intvec*) h->next->next->Data())->length() != currRing->N )
2157 {
2158 Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
2159 currRing->N);
2160 return TRUE;
2161 }
2162 ideal arg1 = (ideal) h->Data();
2163 intvec* arg2 = (intvec*) h->next->Data();
2164 intvec* arg3 = (intvec*) h->next->next->Data();
2165 int arg4 = (int) h->next->next->next->Data();
2166 ideal result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2167 res->rtyp = IDEAL_CMD;
2168 res->data = result;
2169 return FALSE;
2170 }
2171 else
2172 #endif
2173 #endif
2174 /*==================== Mfwalk =================*/
2175 #ifdef HAVE_WALK
2176 if (strcmp(sys_cmd, "Mfwalk") == 0)
2177 {
2178 const short t[]={5,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD,INT_CMD};
2179 if (!iiCheckTypes(h,t,1)) return TRUE;
2180 if (((intvec*) h->next->Data())->length() != currRing->N &&
2181 ((intvec*) h->next->next->Data())->length() != currRing->N )
2182 {
2183 Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
2184 currRing->N);
2185 return TRUE;
2186 }
2187 ideal arg1 = (ideal) h->Data();
2188 intvec* arg2 = (intvec*) h->next->Data();
2189 intvec* arg3 = (intvec*) h->next->next->Data();
2190 int arg4 = (int)(long) h->next->next->next->Data();
2191 int arg5 = (int)(long) h->next->next->next->next->Data();
2192 ideal result = (ideal) Mfwalk(arg1, arg2, arg3, arg4, arg5);
2193 res->rtyp = IDEAL_CMD;
2194 res->data = result;
2195 return FALSE;
2196 }
2197 else
2198 #endif
2199 /*==================== Mfrwalk =================*/
2200 #ifdef HAVE_WALK
2201 if (strcmp(sys_cmd, "Mfrwalk") == 0)
2202 {
2204 if (!iiCheckTypes(h,t,1)) return TRUE;
2205/*
2206 if (((intvec*) h->next->Data())->length() != currRing->N &&
2207 ((intvec*) h->next->next->Data())->length() != currRing->N)
2208 {
2209 Werror("system(\"Mfrwalk\" ...) intvecs not of length %d\n",currRing->N);
2210 return TRUE;
2211 }
2212*/
2213 if((((intvec*) h->next->Data())->length() != currRing->N &&
2214 ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2215 (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2216 ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) ))
2217 {
2218 Werror("system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2219 currRing->N,(currRing->N)*(currRing->N));
2220 return TRUE;
2221 }
2222
2223 ideal arg1 = (ideal) h->Data();
2224 intvec* arg2 = (intvec*) h->next->Data();
2225 intvec* arg3 = (intvec*) h->next->next->Data();
2226 int arg4 = (int)(long) h->next->next->next->Data();
2227 int arg5 = (int)(long) h->next->next->next->next->Data();
2228 int arg6 = (int)(long) h->next->next->next->next->next->Data();
2229 ideal result = (ideal) Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2230 res->rtyp = IDEAL_CMD;
2231 res->data = result;
2232 return FALSE;
2233 }
2234 else
2235 /*==================== Mprwalk =================*/
2236 if (strcmp(sys_cmd, "Mprwalk") == 0)
2237 {
2239 if (!iiCheckTypes(h,t,1)) return TRUE;
2240 if((((intvec*) h->next->Data())->length() != currRing->N &&
2241 ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2242 (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2243 ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) ))
2244 {
2245 Werror("system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2246 currRing->N,(currRing->N)*(currRing->N));
2247 return TRUE;
2248 }
2249 ideal arg1 = (ideal) h->Data();
2250 intvec* arg2 = (intvec*) h->next->Data();
2251 intvec* arg3 = (intvec*) h->next->next->Data();
2252 int arg4 = (int)(long) h->next->next->next->Data();
2253 int arg5 = (int)(long) h->next->next->next->next->Data();
2254 int arg6 = (int)(long) h->next->next->next->next->next->Data();
2255 int arg7 = (int)(long) h->next->next->next->next->next->next->Data();
2256 int arg8 = (int)(long) h->next->next->next->next->next->next->next->Data();
2257 int arg9 = (int)(long) h->next->next->next->next->next->next->next->next->Data();
2258 ideal result = (ideal) Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2259 res->rtyp = IDEAL_CMD;
2260 res->data = result;
2261 return FALSE;
2262 }
2263 else
2264 #endif
2265 /*==================== TranMImprovwalk =================*/
2266 #ifdef HAVE_WALK
2267 #ifdef TRAN_Orig
2268 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2269 {
2270 const short t[]={3,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD};
2271 if (!iiCheckTypes(h,t,1)) return TRUE;
2272 if (((intvec*) h->next->Data())->length() != currRing->N &&
2273 ((intvec*) h->next->next->Data())->length() != currRing->N )
2274 {
2275 Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2276 currRing->N);
2277 return TRUE;
2278 }
2279 ideal arg1 = (ideal) h->Data();
2280 intvec* arg2 = (intvec*) h->next->Data();
2281 intvec* arg3 = (intvec*) h->next->next->Data();
2282 ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3);
2283 res->rtyp = IDEAL_CMD;
2284 res->data = result;
2285 return FALSE;
2286 }
2287 else
2288 #endif
2289 #endif
2290 /*==================== MAltwalk2 =================*/
2291 #ifdef HAVE_WALK
2292 if (strcmp(sys_cmd, "MAltwalk2") == 0)
2293 {
2294 const short t[]={3,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD};
2295 if (!iiCheckTypes(h,t,1)) return TRUE;
2296 if (((intvec*) h->next->Data())->length() != currRing->N &&
2297 ((intvec*) h->next->next->Data())->length() != currRing->N )
2298 {
2299 Werror("system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2300 currRing->N);
2301 return TRUE;
2302 }
2303 ideal arg1 = (ideal) h->Data();
2304 intvec* arg2 = (intvec*) h->next->Data();
2305 intvec* arg3 = (intvec*) h->next->next->Data();
2306 ideal result = (ideal) MAltwalk2(arg1, arg2, arg3);
2307 res->rtyp = IDEAL_CMD;
2308 res->data = result;
2309 return FALSE;
2310 }
2311 else
2312 #endif
2313 /*==================== MAltwalk2 =================*/
2314 #ifdef HAVE_WALK
2315 if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2316 {
2317 const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD};
2318 if (!iiCheckTypes(h,t,1)) return TRUE;
2319 if (((intvec*) h->next->Data())->length() != currRing->N &&
2320 ((intvec*) h->next->next->Data())->length() != currRing->N )
2321 {
2322 Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2323 currRing->N);
2324 return TRUE;
2325 }
2326 ideal arg1 = (ideal) h->Data();
2327 intvec* arg2 = (intvec*) h->next->Data();
2328 intvec* arg3 = (intvec*) h->next->next->Data();
2329 int arg4 = (int) ((long)(h->next->next->next->Data()));
2330 ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3, arg4);
2331 res->rtyp = IDEAL_CMD;
2332 res->data = result;
2333 return FALSE;
2334 }
2335 else
2336 #endif
2337 /*==================== TranMrImprovwalk =================*/
2338 #if 0
2339 #ifdef HAVE_WALK
2340 if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2341 {
2342 if (h == NULL || h->Typ() != IDEAL_CMD ||
2343 h->next == NULL || h->next->Typ() != INTVEC_CMD ||
2344 h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD ||
2345 h->next->next->next == NULL || h->next->next->next->Typ() != INT_CMD ||
2346 h->next->next->next == NULL || h->next->next->next->next->Typ() != INT_CMD ||
2347 h->next->next->next == NULL || h->next->next->next->next->next->Typ() != INT_CMD)
2348 {
2349 WerrorS("system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2350 return TRUE;
2351 }
2352 if (((intvec*) h->next->Data())->length() != currRing->N &&
2353 ((intvec*) h->next->next->Data())->length() != currRing->N )
2354 {
2355 Werror("system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n", currRing->N);
2356 return TRUE;
2357 }
2358 ideal arg1 = (ideal) h->Data();
2359 intvec* arg2 = (intvec*) h->next->Data();
2360 intvec* arg3 = (intvec*) h->next->next->Data();
2361 int arg4 = (int)(long) h->next->next->next->Data();
2362 int arg5 = (int)(long) h->next->next->next->next->Data();
2363 int arg6 = (int)(long) h->next->next->next->next->next->Data();
2364 ideal result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2365 res->rtyp = IDEAL_CMD;
2366 res->data = result;
2367 return FALSE;
2368 }
2369 else
2370 #endif
2371 #endif
2372 /*================= Extended system call ========================*/
2373 {
2374 #ifndef MAKE_DISTRIBUTION
2375 return(jjEXTENDED_SYSTEM(res, args));
2376 #else
2377 Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented );
2378 #endif
2379 }
2380 } /* typ==string */
2381 return TRUE;
2382}
#define BIMATELEM(M, I, J)
Definition bigintmat.h:133
void printBlackboxTypes()
list all defined type (for debugging)
Definition blackbox.cc:236
int m
Definition cfEzgcd.cc:128
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
void factoryseed(int s)
random seed initializer
Definition cf_random.cc:189
FILE * f
Definition checklibs.c:9
matrix singntl_rref(matrix m, const ring R)
Definition clapsing.cc:2000
matrix singntl_LLL(matrix m, const ring s)
Definition clapsing.cc:1918
ideal singclap_absFactorize(poly f, ideal &mipos, intvec **exps, int &numFactors, const ring r)
Definition clapsing.cc:2106
char * singclap_neworder(ideal I, const ring r)
Definition clapsing.cc:1664
gmp_complex numbers based on
VAR int siRandomStart
Definition cntrlc.cc:99
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition coeffs.h:38
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition coeffs.h:730
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:429
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:539
void countedref_reference_load()
Initialize blackbox types 'reference' and 'shared', or both.
void countedref_shared_load()
lists get_denom_list()
Definition denom_list.cc:8
matrix evRowElim(matrix M, int i, int j, int k)
Definition eigenval.cc:47
matrix evHessenberg(matrix M)
Definition eigenval.cc:100
matrix evSwap(matrix M, int i, int j)
Definition eigenval.cc:25
lists evEigenvals(matrix M)
EXTERN_VAR BOOLEAN FE_OPT_NO_SHELL_FLAG
Definition extra.cc:170
#define SINGULAR_PROCS_DIR
#define TEST_FOR(A)
static BOOLEAN jjEXTENDED_SYSTEM(leftv res, leftv h)
Definition extra.cc:2392
return result
feOptIndex
Definition feOptGen.h:15
@ FE_OPT_UNDEF
Definition feOptGen.h:15
void fePrintOptValues()
Definition feOpt.cc:344
feOptIndex feGetOptIndex(const char *name)
Definition feOpt.cc:104
const char * feSetOptValue(feOptIndex opt, char *optarg)
Definition feOpt.cc:154
static void * feOptValue(feOptIndex opt)
Definition feOpt.h:40
EXTERN_VAR struct fe_option feOptSpec[]
Definition feOpt.h:17
void feReInitResources()
static char * feResource(feResourceConfig config, int warn)
char * getenv()
@ feOptUntyped
Definition fegetopt.h:77
@ feOptString
Definition fegetopt.h:77
void feStringAppendBrowsers(int warn)
Definition fehelp.cc:341
matrix singflint_rref(matrix m, const ring R)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
lists gmsNF(ideal p, ideal g, matrix B, int D, int K)
Definition gms.cc:22
void HilbertSeries_OrbitData(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
Definition hilb.cc:1406
ideal RightColonOperation(ideal S, poly w, int lV)
Definition hilb.cc:1753
ideal idSaturate_intern(ideal I, ideal J, int &k, BOOLEAN isIdeal, BOOLEAN isSB)
Definition ideals.cc:3466
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
#define ivTest(v)
Definition intvec.h:172
#define setFlag(A, F)
Definition ipid.h:113
#define FLAG_TWOSTD
Definition ipid.h:107
#define FLAG_STD
Definition ipid.h:106
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
Definition ipshell.cc:4424
BOOLEAN semicProc3(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:4507
BOOLEAN spectrumfProc(leftv result, leftv first)
Definition ipshell.cc:4180
BOOLEAN spmulProc(leftv result, leftv first, leftv second)
Definition ipshell.cc:4466
BOOLEAN spectrumProc(leftv result, leftv first)
Definition ipshell.cc:4129
BOOLEAN semicProc(leftv res, leftv u, leftv v)
Definition ipshell.cc:4547
char * versionString()
Definition misc_ip.cc:772
STATIC_VAR jList * T
Definition janet.cc:30
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
Definition kstd1.cc:3280
VAR int HCord
Definition kutil.cc:239
BOOLEAN kVerify2(ideal F, ideal Q)
Definition kverify.cc:141
BOOLEAN kVerify1(ideal F, ideal Q)
Definition kverify.cc:24
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
bool luSolveViaLDUDecomp(const matrix pMat, const matrix lMat, const matrix dMat, const matrix uMat, const poly l, const poly u, const poly lTimesU, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LDU-decomposit...
void lduDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &dMat, matrix &uMat, poly &l, poly &u, poly &lTimesU)
LU-decomposition of a given (m x n)-matrix with performing only those divisions that yield zero remai...
ideal sm_UnFlatten(ideal a, int col, const ring R)
Definition matpol.cc:1942
ideal sm_Flatten(ideal a, const ring R)
Definition matpol.cc:1922
#define SINGULAR_VERSION
Definition mod2.h:87
EXTERN_VAR size_t gmp_output_digits
Definition mpr_base.h:115
bool complexNearZero(gmp_complex *c, int digits)
ideal twostd(ideal I)
Compute two-sided GB:
Definition nc.cc:18
void newstructShow(newstruct_desc d)
Definition newstruct.cc:837
BOOLEAN newstruct_set_proc(const char *bbname, const char *func, int args, procinfov pr)
Definition newstruct.cc:857
char * omFindExec(const char *name, char *exec)
Definition omFindExec.c:315
#define MAXPATHLEN
Definition omRet2Info.c:22
void p_Content(poly ph, const ring r)
Definition p_polys.cc:2299
poly p_Cleardenom(poly p, const ring r)
Definition p_polys.cc:2849
poly pcvP2CV(poly p, int d0, int d1)
Definition pcv.cc:280
int pcvBasis(lists b, int i, poly m, int d, int n)
Definition pcv.cc:430
int pcvMinDeg(poly p)
Definition pcv.cc:135
int pcvDim(int d0, int d1)
Definition pcv.cc:400
lists pcvPMulL(poly p, lists l1)
Definition pcv.cc:76
poly pcvCV2P(poly cv, int d0, int d1)
Definition pcv.cc:297
lists pcvLAddL(lists l1, lists l2)
Definition pcv.cc:31
void StringSetS(const char *st)
Definition reporter.cc:128
const char feNotImplemented[]
Definition reporter.cc:54
char * StringEndS()
Definition reporter.cc:151
ring rOpposite(ring src)
Definition ring.cc:5425
ring rEnvelope(ring R)
Definition ring.cc:5819
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
static BOOLEAN rField_is_long_C(const ring r)
Definition ring.h:551
static int rBlocks(const ring r)
Definition ring.h:574
static BOOLEAN rIsNCRing(const ring r)
Definition ring.h:427
static BOOLEAN rField_is_long_R(const ring r)
Definition ring.h:548
#define rField_is_Ring(R)
Definition ring.h:491
int simpleipc_cmd(char *cmd, int id, int v)
Definition semaphore.c:167
VAR int siSeed
Definition sirandom.c:30
#define M
Definition sirandom.c:25
int M3ivSame(intvec *temp, intvec *u, intvec *v)
Definition walk.cc:915
intvec * MivWeightOrderdp(intvec *ivstart)
Definition walk.cc:1457
intvec * MivUnit(int nV)
Definition walk.cc:1497
ideal TranMImprovwalk(ideal G, intvec *curr_weight, intvec *target_tmp, int nP)
Definition walk.cc:8397
intvec * MivMatrixOrderdp(int nV)
Definition walk.cc:1418
ideal Mfwalk(ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout)
Definition walk.cc:8032
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
Definition walk.cc:1089
intvec * MivWeightOrderlp(intvec *ivstart)
Definition walk.cc:1437
ideal Mprwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int op_deg, int tp_deg, int nP, int reduction, int printout)
Definition walk.cc:6389
intvec * MivMatrixOrder(intvec *iv)
Definition walk.cc:964
ideal MAltwalk2(ideal Go, intvec *curr_weight, intvec *target_weight)
Definition walk.cc:4281
ideal MAltwalk1(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight)
Definition walk.cc:9672
ideal Mrwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int pert_deg, int reduction, int printout)
Definition walk.cc:5604
ideal Mfrwalk(ideal G, intvec *ivstart, intvec *ivtarget, int weight_rad, int reduction, int printout)
Definition walk.cc:8213
ideal Mwalk(ideal Go, intvec *orig_M, intvec *target_M, ring baseRing, int reduction, int printout)
Definition walk.cc:5303
ideal Mpwalk(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight, int nP, int reduction, int printout)
Definition walk.cc:5948
int MivSame(intvec *u, intvec *v)
Definition walk.cc:894
intvec * Mivlp(int nR)
Definition walk.cc:1023
ideal MwalkInitialForm(ideal G, intvec *ivw)
Definition walk.cc:762
intvec * MivMatrixOrderlp(int nV)
Definition walk.cc:1402
intvec * Mfpertvector(ideal G, intvec *ivtarget)
Definition walk.cc:1513
intvec * MPertVectorslp(ideal G, intvec *ivtarget, int pdeg)
Definition walk.cc:1300
intvec * Mivdp(int nR)
Definition walk.cc:1008
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
Definition walk.cc:2571
intvec * MwalkNextWeight(intvec *curr_weight, intvec *target_weight, ideal G)
intvec * Mivperttarget(ideal G, int ndeg)
intvec * MPertNextWeight(intvec *iva, ideal G, int deg)

◆ jjVARIABLES_ID()

BOOLEAN jjVARIABLES_ID ( leftv res,
leftv u )

Definition at line 6311 of file ipshell.cc.

6312{
6313 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6314 ideal I=(ideal)u->Data();
6315 int i;
6316 int n=0;
6317 for(i=I->nrows*I->ncols-1;i>=0;i--)
6318 {
6319 int n0=pGetVariables(I->m[i],e);
6320 if (n0>n) n=n0;
6321 }
6322 jjINT_S_TO_ID(n,e,res);
6323 return FALSE;
6324}
static void jjINT_S_TO_ID(int n, int *e, leftv res)
Definition ipshell.cc:6281
#define omAlloc0(size)
#define pGetVariables(p, e)
Definition polys.h:252

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv res,
leftv u )

Definition at line 6303 of file ipshell.cc.

6304{
6305 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6306 int n=pGetVariables((poly)u->Data(),e);
6307 jjINT_S_TO_ID(n,e,res);
6308 return FALSE;
6309}

◆ killlocals()

void killlocals ( int v)

Definition at line 387 of file ipshell.cc.

388{
389 BOOLEAN changed=FALSE;
391 ring cr=currRing;
392 if (sh!=NULL) changed=((IDLEV(sh)<v) || (IDRING(sh)->ref>0));
393 //if (changed) Print("currRing=%s(%x), lev=%d,ref=%d\n",IDID(sh),IDRING(sh),IDLEV(sh),IDRING(sh)->ref);
394
395 killlocals_rec(&(basePack->idroot),v,currRing);
396
398 {
399 int t=iiRETURNEXPR.Typ();
400 if (/*iiRETURNEXPR.Typ()*/ t==RING_CMD)
401 {
403 if (((ring)h->data)->idroot!=NULL)
404 killlocals0(v,&(((ring)h->data)->idroot),(ring)h->data);
405 }
406 else if (/*iiRETURNEXPR.Typ()*/ t==LIST_CMD)
407 {
409 changed |=killlocals_list(v,(lists)h->data);
410 }
411 }
412 if (changed)
413 {
415 if (currRingHdl==NULL)
417 else if(cr!=currRing)
418 rChangeCurrRing(cr);
419 }
420
421 if (myynest<=1) iiNoKeepRing=TRUE;
422 //Print("end killlocals >= %d\n",v);
423 //listall();
424}
VAR int iiRETURNEXPR_len
Definition iplib.cc:484
BOOLEAN killlocals_list(int v, lists L)
Definition ipshell.cc:367
STATIC_VAR BOOLEAN iiNoKeepRing
Definition ipshell.cc:85
void killlocals_rec(idhdl *root, int v, ring r)
Definition ipshell.cc:331
static void killlocals0(int v, idhdl *localhdl, const ring r)
Definition ipshell.cc:296

◆ kQHWeight()

BOOLEAN kQHWeight ( leftv res,
leftv v )

Definition at line 3319 of file ipshell.cc.

3320{
3321 res->data=(char *)id_QHomWeight((ideal)v->Data(), currRing);
3322 if (res->data==NULL)
3323 res->data=(char *)new intvec(rVar(currRing));
3324 return FALSE;
3325}
intvec * id_QHomWeight(ideal id, const ring r)

◆ kWeight()

BOOLEAN kWeight ( leftv res,
leftv id )

Definition at line 3291 of file ipshell.cc.

3292{
3293 ideal F=(ideal)id->Data();
3294 intvec * iv = new intvec(rVar(currRing));
3295 polyset s;
3296 int sl, n, i;
3297 int *x;
3298
3299 res->data=(char *)iv;
3300 s = F->m;
3301 sl = IDELEMS(F) - 1;
3302 n = rVar(currRing);
3303 if (sl==-1)
3304 {
3305 for(int i=0;i<n;i++) (*iv)[i]=1;
3306 return FALSE;
3307 }
3308
3309 double wNsqr = (double)2.0 / (double)n;
3311 x = (int * )omAlloc(2 * (n + 1) * sizeof(int));
3312 wCall(s, sl, x, wNsqr, currRing);
3313 for (i = n; i!=0; i--)
3314 (*iv)[i-1] = x[i + n + 1];
3315 omFreeSize((ADDRESS)x, 2 * (n + 1) * sizeof(int));
3316 return FALSE;
3317}
Variable x
Definition cfModGcd.cc:4090
THREAD_VAR double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
Definition weight.cc:20
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
Definition weight.cc:108
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
Definition weight0.cc:78

◆ list_cmd()

void list_cmd ( int typ,
const char * what,
const char * prefix,
BOOLEAN iterate,
BOOLEAN fullname = FALSE )

Definition at line 426 of file ipshell.cc.

427{
428 package savePack=currPack;
429 idhdl h,start;
430 BOOLEAN all = typ<0;
431 BOOLEAN really_all=FALSE;
432
433 if ( typ==0 )
434 {
435 if (strcmp(what,"all")==0)
436 {
437 if (currPack!=basePack)
438 list_cmd(-1,NULL,prefix,iterate,fullname); // list current package
439 really_all=TRUE;
440 h=basePack->idroot;
441 }
442 else
443 {
444 h = ggetid(what);
445 if (h!=NULL)
446 {
447 if (iterate) list1(prefix,h,TRUE,fullname);
448 if (IDTYP(h)==ALIAS_CMD) PrintS("A");
449 if (IDTYP(h)==RING_CMD)
450 {
451 h=IDRING(h)->idroot;
452 }
453 else if(IDTYP(h)==PACKAGE_CMD)
454 {
456 //Print("list_cmd:package\n");
457 all=TRUE;typ=PROC_CMD;fullname=TRUE;really_all=TRUE;
458 h=IDPACKAGE(h)->idroot;
459 }
460 else
461 {
462 currPack=savePack;
463 return;
464 }
465 }
466 else
467 {
468 Werror("%s is undefined",what);
469 currPack=savePack;
470 return;
471 }
472 }
473 all=TRUE;
474 }
475 else if (RingDependend(typ))
476 {
477 h = currRing->idroot;
478 }
479 else
480 h = IDROOT;
481 start=h;
482 while (h!=NULL)
483 {
484 if ((all
485 && (IDTYP(h)!=PROC_CMD)
486 &&(IDTYP(h)!=PACKAGE_CMD)
487 &&(IDTYP(h)!=CRING_CMD)
488 )
489 || (typ == IDTYP(h))
490 || ((IDTYP(h)==CRING_CMD) && (typ==RING_CMD))
491 )
492 {
493 list1(prefix,h,start==currRingHdl, fullname);
494 if ((IDTYP(h)==RING_CMD)
495 && (really_all || (all && (h==currRingHdl)))
496 && ((IDLEV(h)==0)||(IDLEV(h)==myynest)))
497 {
498 list_cmd(0,IDID(h),"// ",FALSE);
499 }
500 if (IDTYP(h)==PACKAGE_CMD && really_all)
501 {
502 package save_p=currPack;
504 list_cmd(0,IDID(h),"// ",FALSE);
505 currPack=save_p;
506 }
507 }
508 h = IDNEXT(h);
509 }
510 currPack=savePack;
511}
#define IDNEXT(a)
Definition ipid.h:118
void list_cmd(int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname)
Definition ipshell.cc:426
static void list1(const char *s, idhdl h, BOOLEAN c, BOOLEAN fullname)
Definition ipshell.cc:150

◆ loNewtonP()

BOOLEAN loNewtonP ( leftv res,
leftv arg1 )

compute Newton Polytopes of input polynomials

Definition at line 4559 of file ipshell.cc.

4560{
4561 res->data= (void*)loNewtonPolytope( (ideal)arg1->Data() );
4562 return FALSE;
4563}
ideal loNewtonPolytope(const ideal id)
Definition mpr_base.cc:3191

◆ loSimplex()

BOOLEAN loSimplex ( leftv res,
leftv args )

Implementation of the Simplex Algorithm.

For args, see class simplex.

Definition at line 4565 of file ipshell.cc.

4566{
4567 if ( !(rField_is_long_R(currRing)) )
4568 {
4569 WerrorS("Ground field not implemented!");
4570 return TRUE;
4571 }
4572
4573 simplex * LP;
4574 matrix m;
4575
4576 leftv v= args;
4577 if ( v->Typ() != MATRIX_CMD ) // 1: matrix
4578 return TRUE;
4579 else
4580 m= (matrix)(v->CopyD());
4581
4582 LP = new simplex(MATROWS(m),MATCOLS(m));
4583 LP->mapFromMatrix(m);
4584
4585 v= v->next;
4586 if ( v->Typ() != INT_CMD ) // 2: m = number of constraints
4587 return TRUE;
4588 else
4589 LP->m= (int)(long)(v->Data());
4590
4591 v= v->next;
4592 if ( v->Typ() != INT_CMD ) // 3: n = number of variables
4593 return TRUE;
4594 else
4595 LP->n= (int)(long)(v->Data());
4596
4597 v= v->next;
4598 if ( v->Typ() != INT_CMD ) // 4: m1 = number of <= constraints
4599 return TRUE;
4600 else
4601 LP->m1= (int)(long)(v->Data());
4602
4603 v= v->next;
4604 if ( v->Typ() != INT_CMD ) // 5: m2 = number of >= constraints
4605 return TRUE;
4606 else
4607 LP->m2= (int)(long)(v->Data());
4608
4609 v= v->next;
4610 if ( v->Typ() != INT_CMD ) // 6: m3 = number of == constraints
4611 return TRUE;
4612 else
4613 LP->m3= (int)(long)(v->Data());
4614
4615#ifdef mprDEBUG_PROT
4616 Print("m (constraints) %d\n",LP->m);
4617 Print("n (columns) %d\n",LP->n);
4618 Print("m1 (<=) %d\n",LP->m1);
4619 Print("m2 (>=) %d\n",LP->m2);
4620 Print("m3 (==) %d\n",LP->m3);
4621#endif
4622
4623 LP->compute();
4624
4625 lists lres= (lists)omAlloc( sizeof(slists) );
4626 lres->Init( 6 );
4627
4628 lres->m[0].rtyp= MATRIX_CMD; // output matrix
4629 lres->m[0].data=(void*)LP->mapToMatrix(m);
4630
4631 lres->m[1].rtyp= INT_CMD; // found a solution?
4632 lres->m[1].data=(void*)(long)LP->icase;
4633
4634 lres->m[2].rtyp= INTVEC_CMD;
4635 lres->m[2].data=(void*)LP->posvToIV();
4636
4637 lres->m[3].rtyp= INTVEC_CMD;
4638 lres->m[3].data=(void*)LP->zrovToIV();
4639
4640 lres->m[4].rtyp= INT_CMD;
4641 lres->m[4].data=(void*)(long)LP->m;
4642
4643 lres->m[5].rtyp= INT_CMD;
4644 lres->m[5].data=(void*)(long)LP->n;
4645
4646 res->data= (void*)lres;
4647
4648 return FALSE;
4649}
Linear Programming / Linear Optimization using Simplex - Algorithm.
intvec * zrovToIV()
BOOLEAN mapFromMatrix(matrix m)
void compute()
matrix mapToMatrix(matrix m)
intvec * posvToIV()
Definition lists.h:24
#define MATROWS(i)
Definition matpol.h:26
#define MATCOLS(i)
Definition matpol.h:27

◆ mpJacobi()

BOOLEAN mpJacobi ( leftv res,
leftv a )

Definition at line 3058 of file ipshell.cc.

3059{
3060 int i,j;
3061 matrix result;
3062 ideal id=(ideal)a->Data();
3063
3065 for (i=1; i<=IDELEMS(id); i++)
3066 {
3067 for (j=1; j<=rVar(currRing); j++)
3068 {
3069 MATELEM(result,i,j) = pDiff(id->m[i-1],j);
3070 }
3071 }
3072 res->data=(char *)result;
3073 return FALSE;
3074}
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
#define pDiff(a, b)
Definition polys.h:297

◆ mpKoszul()

BOOLEAN mpKoszul ( leftv res,
leftv c,
leftv b,
leftv id )

Definition at line 3080 of file ipshell.cc.

3081{
3082 int n=(int)(long)b->Data();
3083 int d=(int)(long)c->Data();
3084 int k,l,sign,row,col;
3085 matrix result;
3086 ideal temp;
3087 BOOLEAN bo;
3088 poly p;
3089
3090 if ((d>n) || (d<1) || (n<1))
3091 {
3092 res->data=(char *)mpNew(1,1);
3093 return FALSE;
3094 }
3095 int *choise = (int*)omAlloc(d*sizeof(int));
3096 if (id==NULL)
3097 temp=idMaxIdeal(1);
3098 else
3099 temp=(ideal)id->Data();
3100
3101 k = binom(n,d);
3102 l = k*d;
3103 l /= n-d+1;
3104 result =mpNew(l,k);
3105 col = 1;
3106 idInitChoise(d,1,n,&bo,choise);
3107 while (!bo)
3108 {
3109 sign = 1;
3110 for (l=1;l<=d;l++)
3111 {
3112 if (choise[l-1]<=IDELEMS(temp))
3113 {
3114 p = pCopy(temp->m[choise[l-1]-1]);
3115 if (sign == -1) p = pNeg(p);
3116 sign *= -1;
3117 row = idGetNumberOfChoise(l-1,d,1,n,choise);
3118 MATELEM(result,row,col) = p;
3119 }
3120 }
3121 col++;
3122 idGetNextChoise(d,n,&bo,choise);
3123 }
3124 omFreeSize(choise,d*sizeof(int));
3125 if (id==NULL) idDelete(&temp);
3126
3127 res->data=(char *)result;
3128 return FALSE;
3129}
int binom(int n, int r)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition ideals.h:33
int idGetNumberOfChoise(int t, int d, int begin, int end, int *choise)
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
#define pNeg(p)
Definition polys.h:199
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
static int sign(int x)
Definition ring.cc:3503

◆ nuLagSolve()

BOOLEAN nuLagSolve ( leftv res,
leftv arg1,
leftv arg2,
leftv arg3 )

find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial using Laguerres' root-solver.

Good for polynomials with low and middle degree (<40). Arguments 3: poly arg1 , int arg2 , int arg3 arg2>0: defines precision of fractional part if ground field is Q arg3: number of iterations for approximation of roots (default=2) Returns a list of all (complex) roots of the polynomial arg1

Definition at line 4674 of file ipshell.cc.

4675{
4676 poly gls;
4677 gls= (poly)(arg1->Data());
4678 int howclean= (int)(long)arg3->Data();
4679
4680 if ( gls == NULL || pIsConstant( gls ) )
4681 {
4682 WerrorS("Input polynomial is constant!");
4683 return TRUE;
4684 }
4685
4687 {
4688 int* r=Zp_roots(gls, currRing);
4689 lists rlist;
4690 rlist= (lists)omAlloc( sizeof(slists) );
4691 rlist->Init( r[0] );
4692 for(int i=r[0];i>0;i--)
4693 {
4694 rlist->m[i-1].data=n_Init(r[i],currRing->cf);
4695 rlist->m[i-1].rtyp=NUMBER_CMD;
4696 }
4697 omFree(r);
4698 res->data=rlist;
4699 res->rtyp= LIST_CMD;
4700 return FALSE;
4701 }
4702 if ( !(rField_is_R(currRing) ||
4706 {
4707 WerrorS("Ground field not implemented!");
4708 return TRUE;
4709 }
4710
4713 {
4714 unsigned long int ii = (unsigned long int)arg2->Data();
4715 setGMPFloatDigits( ii, ii );
4716 }
4717
4718 int ldummy;
4719 int deg= currRing->pLDeg( gls, &ldummy, currRing );
4720 int i,vpos=0;
4721 poly piter;
4722 lists elist;
4723
4724 elist= (lists)omAlloc( sizeof(slists) );
4725 elist->Init( 0 );
4726
4727 if ( rVar(currRing) > 1 )
4728 {
4729 piter= gls;
4730 for ( i= 1; i <= rVar(currRing); i++ )
4731 if ( pGetExp( piter, i ) )
4732 {
4733 vpos= i;
4734 break;
4735 }
4736 while ( piter )
4737 {
4738 for ( i= 1; i <= rVar(currRing); i++ )
4739 if ( (vpos != i) && (pGetExp( piter, i ) != 0) )
4740 {
4741 WerrorS("The input polynomial must be univariate!");
4742 return TRUE;
4743 }
4744 pIter( piter );
4745 }
4746 }
4747
4748 rootContainer * roots= new rootContainer();
4749 number * pcoeffs= (number *)omAlloc( (deg+1) * sizeof( number ) );
4750 piter= gls;
4751 for ( i= deg; i >= 0; i-- )
4752 {
4753 if ( piter && pTotaldegree(piter) == i )
4754 {
4755 pcoeffs[i]= nCopy( pGetCoeff( piter ) );
4756 //nPrint( pcoeffs[i] );PrintS(" ");
4757 pIter( piter );
4758 }
4759 else
4760 {
4761 pcoeffs[i]= nInit(0);
4762 }
4763 }
4764
4765#ifdef mprDEBUG_PROT
4766 for (i=deg; i >= 0; i--)
4767 {
4768 nPrint( pcoeffs[i] );PrintS(" ");
4769 }
4770 PrintLn();
4771#endif
4772
4773 roots->fillContainer( pcoeffs, NULL, 1, deg, rootContainer::onepoly, 1 );
4774 roots->solver( howclean );
4775
4776 int elem= roots->getAnzRoots();
4777 char *dummy;
4778 int j;
4779
4780 lists rlist;
4781 rlist= (lists)omAlloc( sizeof(slists) );
4782 rlist->Init( elem );
4783
4785 {
4786 for ( j= 0; j < elem; j++ )
4787 {
4788 rlist->m[j].rtyp=NUMBER_CMD;
4789 rlist->m[j].data=(void *)nCopy((number)(roots->getRoot(j)));
4790 //rlist->m[j].data=(void *)(number)(roots->getRoot(j));
4791 }
4792 }
4793 else
4794 {
4795 for ( j= 0; j < elem; j++ )
4796 {
4797 dummy = complexToStr( (*roots)[j], gmp_output_digits, currRing->cf );
4798 rlist->m[j].rtyp=STRING_CMD;
4799 rlist->m[j].data=(void *)dummy;
4800 }
4801 }
4802
4803 elist->Clean();
4804 //omFreeSize( (ADDRESS) elist, sizeof(slists) );
4805
4806 // this is (via fillContainer) the same data as in root
4807 //for ( i= deg; i >= 0; i-- ) nDelete( &pcoeffs[i] );
4808 //omFreeSize( (ADDRESS) pcoeffs, (deg+1) * sizeof( number ) );
4809
4810 delete roots;
4811
4812 res->data= (void*)rlist;
4813
4814 return FALSE;
4815}
int * Zp_roots(poly p, const ring r)
Definition clapsing.cc:2191
complex root finder for univariate polynomials based on laguers algorithm
Definition mpr_numeric.h:66
gmp_complex * getRoot(const int i)
Definition mpr_numeric.h:88
void fillContainer(number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
int getAnzRoots()
Definition mpr_numeric.h:97
bool solver(const int polishmode=PM_NONE)
#define pIter(p)
Definition monomials.h:37
char * complexToStr(gmp_complex &c, const unsigned int oprec, const coeffs src)
void setGMPFloatDigits(size_t digits, size_t rest)
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of...
#define nCopy(n)
Definition numbers.h:15
#define nPrint(a)
only for debug, over any initialized currRing
Definition numbers.h:46
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:239
static BOOLEAN rField_is_R(const ring r)
Definition ring.h:524
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:506
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:512

◆ nuMPResMat()

BOOLEAN nuMPResMat ( leftv res,
leftv arg1,
leftv arg2 )

returns module representing the multipolynomial resultant matrix Arguments 2: ideal i, int k k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default)

Definition at line 4651 of file ipshell.cc.

4652{
4653 ideal gls = (ideal)(arg1->Data());
4654 int imtype= (int)(long)arg2->Data();
4655
4656 uResultant::resMatType mtype= determineMType( imtype );
4657
4658 // check input ideal ( = polynomial system )
4659 if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
4660 {
4661 return TRUE;
4662 }
4663
4664 uResultant *resMat= new uResultant( gls, mtype, false );
4665 if (resMat!=NULL)
4666 {
4667 res->rtyp = MODUL_CMD;
4668 res->data= (void*)resMat->accessResMat()->getMatrix();
4669 if (!errorreported) delete resMat;
4670 }
4671 return errorreported;
4672}
virtual ideal getMatrix()
Definition mpr_base.h:31
Base class for solving 0-dim poly systems using u-resultant.
Definition mpr_base.h:63
resMatrixBase * accessResMat()
Definition mpr_base.h:78
@ mprOk
Definition mpr_base.h:98
uResultant::resMatType determineMType(int imtype)
mprState mprIdealCheck(const ideal theIdeal, const char *name, uResultant::resMatType mtype, BOOLEAN rmatrix=false)

◆ nuUResSolve()

BOOLEAN nuUResSolve ( leftv res,
leftv args )

solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing->N) == IDELEMS(ideal).

Resultant method can be MPR_DENSE, which uses Macaulay Resultant (good for dense homogeneous polynoms) or MPR_SPARSE, which uses Sparse Resultant (Gelfand, Kapranov, Zelevinsky). Arguments 4: ideal i, int k, int l, int m k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default) l>0: defines precision of fractional part if ground field is Q m=0,1,2: number of iterations for approximation of roots (default=2) Returns a list containing the roots of the system.

Definition at line 4918 of file ipshell.cc.

4919{
4920 leftv v= args;
4921
4922 ideal gls;
4923 int imtype;
4924 int howclean;
4925
4926 // get ideal
4927 if ( v->Typ() != IDEAL_CMD )
4928 return TRUE;
4929 else gls= (ideal)(v->Data());
4930 v= v->next;
4931
4932 // get resultant matrix type to use (0,1)
4933 if ( v->Typ() != INT_CMD )
4934 return TRUE;
4935 else imtype= (int)(long)v->Data();
4936 v= v->next;
4937
4938 if (imtype==0)
4939 {
4940 ideal test_id=idInit(1,1);
4941 int j;
4942 for(j=IDELEMS(gls)-1;j>=0;j--)
4943 {
4944 if (gls->m[j]!=NULL)
4945 {
4946 test_id->m[0]=gls->m[j];
4947 intvec *dummy_w=id_QHomWeight(test_id, currRing);
4948 if (dummy_w!=NULL)
4949 {
4950 WerrorS("Newton polytope not of expected dimension");
4951 delete dummy_w;
4952 return TRUE;
4953 }
4954 }
4955 }
4956 }
4957
4958 // get and set precision in digits ( > 0 )
4959 if ( v->Typ() != INT_CMD )
4960 return TRUE;
4961 else if ( !(rField_is_R(currRing) || rField_is_long_R(currRing) || \
4963 {
4964 unsigned long int ii=(unsigned long int)v->Data();
4965 setGMPFloatDigits( ii, ii );
4966 }
4967 v= v->next;
4968
4969 // get interpolation steps (0,1,2)
4970 if ( v->Typ() != INT_CMD )
4971 return TRUE;
4972 else howclean= (int)(long)v->Data();
4973
4974 uResultant::resMatType mtype= determineMType( imtype );
4975 int i,count;
4976 lists listofroots= NULL;
4977 number smv= NULL;
4978 BOOLEAN interpolate_det= (mtype==uResultant::denseResMat)?TRUE:FALSE;
4979
4980 //emptylist= (lists)omAlloc( sizeof(slists) );
4981 //emptylist->Init( 0 );
4982
4983 //res->rtyp = LIST_CMD;
4984 //res->data= (void *)emptylist;
4985
4986 // check input ideal ( = polynomial system )
4987 if ( mprIdealCheck( gls, args->Name(), mtype ) != mprOk )
4988 {
4989 return TRUE;
4990 }
4991
4992 uResultant * ures;
4993 rootContainer ** iproots;
4994 rootContainer ** muiproots;
4995 rootArranger * arranger;
4996
4997 // main task 1: setup of resultant matrix
4998 ures= new uResultant( gls, mtype );
4999 if ( ures->accessResMat()->initState() != resMatrixBase::ready )
5000 {
5001 WerrorS("Error occurred during matrix setup!");
5002 return TRUE;
5003 }
5004
5005 // if dense resultant, check if minor nonsingular
5006 if ( mtype == uResultant::denseResMat )
5007 {
5008 smv= ures->accessResMat()->getSubDet();
5009#ifdef mprDEBUG_PROT
5010 PrintS("// Determinant of submatrix: ");nPrint(smv);PrintLn();
5011#endif
5012 if ( nIsZero(smv) )
5013 {
5014 WerrorS("Unsuitable input ideal: Minor of resultant matrix is singular!");
5015 return TRUE;
5016 }
5017 }
5018
5019 // main task 2: Interpolate specialized resultant polynomials
5020 if ( interpolate_det )
5021 iproots= ures->interpolateDenseSP( false, smv );
5022 else
5023 iproots= ures->specializeInU( false, smv );
5024
5025 // main task 3: Interpolate specialized resultant polynomials
5026 if ( interpolate_det )
5027 muiproots= ures->interpolateDenseSP( true, smv );
5028 else
5029 muiproots= ures->specializeInU( true, smv );
5030
5031#ifdef mprDEBUG_PROT
5032 int c= iproots[0]->getAnzElems();
5033 for (i=0; i < c; i++) pWrite(iproots[i]->getPoly());
5034 c= muiproots[0]->getAnzElems();
5035 for (i=0; i < c; i++) pWrite(muiproots[i]->getPoly());
5036#endif
5037
5038 // main task 4: Compute roots of specialized polys and match them up
5039 arranger= new rootArranger( iproots, muiproots, howclean );
5040 arranger->solve_all();
5041
5042 // get list of roots
5043 if ( arranger->success() )
5044 {
5045 arranger->arrange();
5046 listofroots= listOfRoots(arranger, gmp_output_digits );
5047 }
5048 else
5049 {
5050 WerrorS("Solver was unable to find any roots!");
5051 return TRUE;
5052 }
5053
5054 // free everything
5055 count= iproots[0]->getAnzElems();
5056 for (i=0; i < count; i++) delete iproots[i];
5057 omFreeSize( (ADDRESS) iproots, count * sizeof(rootContainer*) );
5058 count= muiproots[0]->getAnzElems();
5059 for (i=0; i < count; i++) delete muiproots[i];
5060 omFreeSize( (ADDRESS) muiproots, count * sizeof(rootContainer*) );
5061
5062 delete ures;
5063 delete arranger;
5064 if (smv!=NULL) nDelete( &smv );
5065
5066 res->data= (void *)listofroots;
5067
5068 //emptylist->Clean();
5069 // omFreeSize( (ADDRESS) emptylist, sizeof(slists) );
5070
5071 return FALSE;
5072}
virtual number getSubDet()
Definition mpr_base.h:37
virtual IStateType initState() const
Definition mpr_base.h:41
int getAnzElems()
Definition mpr_numeric.h:95
rootContainer ** specializeInU(BOOLEAN matchUp=false, const number subDetVal=NULL)
Definition mpr_base.cc:3060
rootContainer ** interpolateDenseSP(BOOLEAN matchUp=false, const number subDetVal=NULL)
Definition mpr_base.cc:2922
@ denseResMat
Definition mpr_base.h:65
lists listOfRoots(rootArranger *self, const unsigned int oprec)
Definition ipshell.cc:5075
#define nIsZero(n)
Definition numbers.h:19
void pWrite(poly p)
Definition polys.h:309
int status int void size_t count
Definition si_signals.h:69

◆ nuVanderSys()

BOOLEAN nuVanderSys ( leftv res,
leftv arg1,
leftv arg2,
leftv arg3 )

COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consider p as point in K^n and v as N elements in K, let p1,..,pN be the points in K^n obtained by evaluating all monomials of degree 0,1,...,N at p in lexicographical order, then the procedure computes the polynomial f satisfying f(pi) = v[i] RETURN: polynomial f of degree d.

Definition at line 4817 of file ipshell.cc.

4818{
4819 int i;
4820 ideal p,w;
4821 p= (ideal)arg1->Data();
4822 w= (ideal)arg2->Data();
4823
4824 // w[0] = f(p^0)
4825 // w[1] = f(p^1)
4826 // ...
4827 // p can be a vector of numbers (multivariate polynom)
4828 // or one number (univariate polynom)
4829 // tdg = deg(f)
4830
4831 int n= IDELEMS( p );
4832 int m= IDELEMS( w );
4833 int tdg= (int)(long)arg3->Data();
4834
4835 res->data= (void*)NULL;
4836
4837 // check the input
4838 if ( tdg < 1 )
4839 {
4840 WerrorS("Last input parameter must be > 0!");
4841 return TRUE;
4842 }
4843 if ( n != rVar(currRing) )
4844 {
4845 Werror("Size of first input ideal must be equal to %d!",rVar(currRing));
4846 return TRUE;
4847 }
4848 if ( m != (int)pow((double)tdg+1,(double)n) )
4849 {
4850 Werror("Size of second input ideal must be equal to %d!",
4851 (int)pow((double)tdg+1,(double)n));
4852 return TRUE;
4853 }
4854 if ( !(rField_is_Q(currRing) /* ||
4855 rField_is_R() || rField_is_long_R() ||
4856 rField_is_long_C()*/ ) )
4857 {
4858 WerrorS("Ground field not implemented!");
4859 return TRUE;
4860 }
4861
4862 number tmp;
4863 number *pevpoint= (number *)omAlloc( n * sizeof( number ) );
4864 for ( i= 0; i < n; i++ )
4865 {
4866 pevpoint[i]=nInit(0);
4867 if ( (p->m)[i] )
4868 {
4869 tmp = pGetCoeff( (p->m)[i] );
4870 if ( nIsZero(tmp) || nIsOne(tmp) || nIsMOne(tmp) )
4871 {
4872 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4873 WerrorS("Elements of first input ideal must not be equal to -1, 0, 1!");
4874 return TRUE;
4875 }
4876 } else tmp= NULL;
4877 if ( !nIsZero(tmp) )
4878 {
4879 if ( !pIsConstant((p->m)[i]))
4880 {
4881 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4882 WerrorS("Elements of first input ideal must be numbers!");
4883 return TRUE;
4884 }
4885 pevpoint[i]= nCopy( tmp );
4886 }
4887 }
4888
4889 number *wresults= (number *)omAlloc( m * sizeof( number ) );
4890 for ( i= 0; i < m; i++ )
4891 {
4892 wresults[i]= nInit(0);
4893 if ( (w->m)[i] && !nIsZero(pGetCoeff((w->m)[i])) )
4894 {
4895 if ( !pIsConstant((w->m)[i]))
4896 {
4897 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4898 omFreeSize( (ADDRESS)wresults, m * sizeof( number ) );
4899 WerrorS("Elements of second input ideal must be numbers!");
4900 return TRUE;
4901 }
4902 wresults[i]= nCopy(pGetCoeff((w->m)[i]));
4903 }
4904 }
4905
4906 vandermonde vm( m, n, tdg, pevpoint, FALSE );
4907 number *ncpoly= vm.interpolateDense( wresults );
4908 // do not free ncpoly[]!!
4909 poly rpoly= vm.numvec2poly( ncpoly );
4910
4911 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4912 omFreeSize( (ADDRESS)wresults, m * sizeof( number ) );
4913
4914 res->data= (void*)rpoly;
4915 return FALSE;
4916}
Rational pow(const Rational &a, int e)
Definition GMPrat.cc:411
vandermonde system solver for interpolating polynomials from their values
Definition mpr_numeric.h:29
#define nIsMOne(n)
Definition numbers.h:26
#define nIsOne(n)
Definition numbers.h:25

◆ paPrint()

void paPrint ( const char * n,
package p )

Definition at line 6326 of file ipshell.cc.

6327{
6328 Print(" %s (",n);
6329 switch (p->language)
6330 {
6331 case LANG_SINGULAR: PrintS("S"); break;
6332 case LANG_C: PrintS("C"); break;
6333 case LANG_TOP: PrintS("T"); break;
6334 case LANG_MAX: PrintS("M"); break;
6335 case LANG_NONE: PrintS("N"); break;
6336 default: PrintS("U");
6337 }
6338 if(p->libname!=NULL)
6339 Print(",%s", p->libname);
6340 PrintS(")");
6341}
@ LANG_MAX
Definition subexpr.h:22
@ LANG_TOP
Definition subexpr.h:22

◆ rCompose()

ring rCompose ( const lists L,
const BOOLEAN check_comp = TRUE,
const long bitmask = 0x7fff,
const int isLetterplace = FALSE )

Definition at line 2776 of file ipshell.cc.

2777{
2778 if ((L->nr!=3)
2779#ifdef HAVE_PLURAL
2780 &&(L->nr!=5)
2781#endif
2782 )
2783 return NULL;
2784 int is_gf_char=0;
2785 // 0: char/ cf - ring
2786 // 1: list (var)
2787 // 2: list (ord)
2788 // 3: qideal
2789 // possibly:
2790 // 4: C
2791 // 5: D
2792
2793 ring R = (ring) omAlloc0Bin(sip_sring_bin);
2794
2795 // ------------------------------------------------------------------
2796 // 0: char:
2797 if (L->m[0].Typ()==CRING_CMD)
2798 {
2799 R->cf=(coeffs)L->m[0].Data();
2800 R->cf->ref++;
2801 }
2802 else if (L->m[0].Typ()==INT_CMD)
2803 {
2804 int ch = (int)(long)L->m[0].Data();
2805 assume( ch >= 0 );
2806
2807 if (ch == 0) // Q?
2808 R->cf = nInitChar(n_Q, NULL);
2809 else
2810 {
2811 int l = IsPrime(ch); // Zp?
2812 if( l != ch )
2813 {
2814 Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
2815 ch = l;
2816 }
2817 #ifndef TEST_ZN_AS_ZP
2818 R->cf = nInitChar(n_Zp, (void*)(long)ch);
2819 #else
2820 mpz_t modBase;
2821 mpz_init_set_ui(modBase,(long) ch);
2822 ZnmInfo info;
2823 info.base= modBase;
2824 info.exp= 1;
2825 R->cf=nInitChar(n_Zn,(void*) &info); //exponent is missing
2826 R->cf->is_field=1;
2827 R->cf->is_domain=1;
2828 R->cf->has_simple_Inverse=1;
2829 #endif
2830 }
2831 }
2832 else if (L->m[0].Typ()==LIST_CMD) // something complicated...
2833 {
2834 lists LL=(lists)L->m[0].Data();
2835
2836 if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
2837 {
2838 rComposeRing(LL, R); // Ring!?
2839 }
2840 else
2841 if (LL->nr < 3)
2842 rComposeC(LL,R); // R, long_R, long_C
2843 else
2844 {
2845 if (LL->m[0].Typ()==INT_CMD)
2846 {
2847 int ch = (int)(long)LL->m[0].Data();
2848 while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
2849 if (fftable[is_gf_char]==0) is_gf_char=-1;
2850
2851 if(is_gf_char!= -1)
2852 {
2853 GFInfo param;
2854
2855 param.GFChar = ch;
2856 param.GFDegree = 1;
2857 param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
2858
2859 // nfInitChar should be able to handle the case when ch is in fftables!
2860 R->cf = nInitChar(n_GF, (void*)&param);
2861 }
2862 }
2863
2864 if( R->cf == NULL )
2865 {
2866 ring extRing = rCompose((lists)L->m[0].Data(),FALSE,0x7fff);
2867
2868 if (extRing==NULL)
2869 {
2870 WerrorS("could not create the specified coefficient field");
2871 goto rCompose_err;
2872 }
2873
2874 if( extRing->qideal != NULL ) // Algebraic extension
2875 {
2876 AlgExtInfo extParam;
2877 extParam.r = extRing;
2878 R->cf = nInitChar(n_algExt, (void*)&extParam);
2879 }
2880 else // Transcendental extension
2881 {
2882 TransExtInfo extParam;
2883 extParam.r = extRing;
2884 R->cf = nInitChar(n_transExt, &extParam);
2885 }
2886 //rDecRefCnt(R);
2887 }
2888 }
2889 }
2890 else
2891 {
2892 WerrorS("coefficient field must be described by `int` or `list`");
2893 goto rCompose_err;
2894 }
2895
2896 if( R->cf == NULL )
2897 {
2898 WerrorS("could not create coefficient field described by the input!");
2899 goto rCompose_err;
2900 }
2901
2902 // ------------------------- VARS ---------------------------
2903 if (rComposeVar(L,R)) goto rCompose_err;
2904 // ------------------------ ORDER ------------------------------
2905 if (rComposeOrder(L,check_comp,R)) goto rCompose_err;
2906
2907 // ------------------------ ??????? --------------------
2908
2909 if (!isLetterplace) rRenameVars(R);
2910 #ifdef HAVE_SHIFTBBA
2911 else
2912 {
2913 R->isLPring=isLetterplace;
2914 R->ShortOut=FALSE;
2915 R->CanShortOut=FALSE;
2916 }
2917 #endif
2918 if ((bitmask!=0)&&(R->wanted_maxExp==0)) R->wanted_maxExp=bitmask;
2919 rComplete(R);
2920
2921 // ------------------------ Q-IDEAL ------------------------
2922
2923 if (L->m[3].Typ()==IDEAL_CMD)
2924 {
2925 ideal q=(ideal)L->m[3].Data();
2926 if ((q!=NULL) && (q->m!=NULL) && (q->m[0]!=NULL))
2927 {
2928 if (R->cf != currRing->cf) //->cf->ch!=currRing->cf->ch)
2929 {
2930 #if 0
2931 WerrorS("coefficient fields must be equal if q-ideal !=0");
2932 goto rCompose_err;
2933 #else
2934 ring orig_ring=currRing;
2936 int *perm=NULL;
2937 int *par_perm=NULL;
2938 int par_perm_size=0;
2939 nMapFunc nMap;
2940
2941 if ((nMap=nSetMap(orig_ring->cf))==NULL)
2942 {
2943 if (rEqual(orig_ring,currRing))
2944 {
2945 nMap=n_SetMap(currRing->cf, currRing->cf);
2946 }
2947 else
2948 // Allow imap/fetch to be make an exception only for:
2949 if ( (rField_is_Q_a(orig_ring) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2953 ||
2954 (rField_is_Zp_a(orig_ring) && // Zp(a..) -> Zp(a..) || Zp
2955 (rField_is_Zp(currRing, rInternalChar(orig_ring)) ||
2956 rField_is_Zp_a(currRing, rInternalChar(orig_ring)))) )
2957 {
2958 par_perm_size=rPar(orig_ring);
2959
2960// if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
2961// naSetChar(rInternalChar(orig_ring),orig_ring);
2962// else ntSetChar(rInternalChar(orig_ring),orig_ring);
2963
2964 nSetChar(currRing->cf);
2965 }
2966 else
2967 {
2968 WerrorS("coefficient fields must be equal if q-ideal !=0");
2969 goto rCompose_err;
2970 }
2971 }
2972 perm=(int *)omAlloc0((orig_ring->N+1)*sizeof(int));
2973 if (par_perm_size!=0)
2974 par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2975 int i;
2976 #if 0
2977 // use imap:
2978 maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2979 currRing->names,currRing->N,currRing->parameter, currRing->P,
2980 perm,par_perm, currRing->ch);
2981 #else
2982 // use fetch
2983 if ((rPar(orig_ring)>0) && (rPar(currRing)==0))
2984 {
2985 for(i=si_min(rPar(orig_ring),rVar(currRing))-1;i>=0;i--) par_perm[i]=i+1;
2986 }
2987 else if (par_perm_size!=0)
2988 for(i=si_min(rPar(orig_ring),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2989 for(i=si_min(orig_ring->N,rVar(currRing));i>0;i--) perm[i]=i;
2990 #endif
2991 ideal dest_id=idInit(IDELEMS(q),1);
2992 for(i=IDELEMS(q)-1; i>=0; i--)
2993 {
2994 dest_id->m[i]=p_PermPoly(q->m[i],perm,orig_ring, currRing,nMap,
2995 par_perm,par_perm_size);
2996 // PrintS("map:");pWrite(dest_id->m[i]);PrintLn();
2997 pTest(dest_id->m[i]);
2998 }
2999 R->qideal=dest_id;
3000 if (perm!=NULL)
3001 omFreeSize((ADDRESS)perm,(orig_ring->N+1)*sizeof(int));
3002 if (par_perm!=NULL)
3003 omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
3004 rChangeCurrRing(orig_ring);
3005 #endif
3006 }
3007 else
3008 R->qideal=idrCopyR(q,currRing,R);
3009 }
3010 }
3011 else
3012 {
3013 WerrorS("q-ideal must be given as `ideal`");
3014 goto rCompose_err;
3015 }
3016
3017
3018 // ---------------------------------------------------------------
3019 #ifdef HAVE_PLURAL
3020 if (L->nr==5)
3021 {
3022 if (nc_CallPlural((matrix)L->m[4].Data(),
3023 (matrix)L->m[5].Data(),
3024 NULL,NULL,
3025 R,
3026 true, // !!!
3027 true, false,
3028 currRing, FALSE)) goto rCompose_err;
3029 // takes care about non-comm. quotient! i.e. calls "nc_SetupQuotient" due to last true
3030 }
3031 #endif
3032 return R;
3033
3034rCompose_err:
3035 if (R->N>0)
3036 {
3037 int i;
3038 if (R->names!=NULL)
3039 {
3040 i=R->N-1;
3041 while (i>=0) { omfree(R->names[i]); i--; }
3042 omFree(R->names);
3043 }
3044 }
3045 omfree(R->order);
3046 omfree(R->block0);
3047 omfree(R->block1);
3048 omfree(R->wvhdl);
3049 omFree(R);
3050 return NULL;
3051}
ring r
Definition algext.h:37
int GFDegree
Definition coeffs.h:102
@ n_GF
\GF{p^n < 2^16}
Definition coeffs.h:32
@ n_Q
rational (GMP) numbers
Definition coeffs.h:30
@ n_Zn
only used if HAVE_RINGS is defined
Definition coeffs.h:44
@ n_Zp
\F{p < 2^31}
Definition coeffs.h:29
const unsigned short fftable[]
Definition ffields.cc:27
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition coeffs.h:444
const char * GFPar_name
Definition coeffs.h:103
int GFChar
Definition coeffs.h:101
Creation data needed for finite fields.
Definition coeffs.h:100
static void rRenameVars(ring R)
Definition ipshell.cc:2389
void rComposeC(lists L, ring R)
Definition ipshell.cc:2246
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
Definition ipshell.cc:2476
ring rCompose(const lists L, const BOOLEAN check_comp, const long bitmask, const int isLetterplace)
Definition ipshell.cc:2776
void rComposeRing(lists L, ring R)
Definition ipshell.cc:2297
static BOOLEAN rComposeVar(const lists L, ring R)
Definition ipshell.cc:2431
#define info
Definition libparse.cc:1256
BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring=false)
returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type,...
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition maps.cc:163
#define nSetMap(R)
Definition numbers.h:43
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition p_polys.cc:4211
#define pTest(p)
Definition polys.h:415
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition prCopy.cc:192
int IsPrime(int p)
Definition prime.cc:61
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition ring.cc:3526
VAR omBin sip_sring_bin
Definition ring.cc:43
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise,...
Definition ring.cc:1751
static BOOLEAN rField_is_Zp_a(const ring r)
Definition ring.h:535
static BOOLEAN rField_is_Zn(const ring r)
Definition ring.h:518
static int rPar(const ring r)
(r->cf->P)
Definition ring.h:605
static int rInternalChar(const ring r)
Definition ring.h:695
static BOOLEAN rField_is_Q_a(const ring r)
Definition ring.h:545
struct for passing initialization parameters to naInitChar
Definition transext.h:88

◆ rDecompose()

lists rDecompose ( const ring r)

Definition at line 2147 of file ipshell.cc.

2148{
2149 assume( r != NULL );
2150 const coeffs C = r->cf;
2151 assume( C != NULL );
2152
2153 // sanity check: require currRing==r for rings with polynomial data
2154 if ( (r!=currRing) && (
2155 (nCoeff_is_algExt(C) && (C != currRing->cf))
2156 || (r->qideal != NULL)
2157#ifdef HAVE_PLURAL
2158 || (rIsPluralRing(r))
2159#endif
2160 )
2161 )
2162 {
2163 WerrorS("ring with polynomial data must be the base ring or compatible");
2164 return NULL;
2165 }
2166 // 0: char/ cf - ring
2167 // 1: list (var)
2168 // 2: list (ord)
2169 // 3: qideal
2170 // possibly:
2171 // 4: C
2172 // 5: D
2174 if (rIsPluralRing(r))
2175 L->Init(6);
2176 else
2177 L->Init(4);
2178 // ----------------------------------------
2179 // 0: char/ cf - ring
2180 if (rField_is_numeric(r))
2181 {
2182 rDecomposeC(&(L->m[0]),r);
2183 }
2184 else if (rField_is_Ring(r))
2185 {
2186 rDecomposeRing(&(L->m[0]),r);
2187 }
2188 else if ( r->cf->extRing!=NULL )// nCoeff_is_algExt(r->cf))
2189 {
2190 rDecomposeCF(&(L->m[0]), r->cf->extRing, r);
2191 }
2192 else if(rField_is_GF(r))
2193 {
2195 Lc->Init(4);
2196 // char:
2197 Lc->m[0].rtyp=INT_CMD;
2198 Lc->m[0].data=(void*)(long)r->cf->m_nfCharQ;
2199 // var:
2201 Lv->Init(1);
2202 Lv->m[0].rtyp=STRING_CMD;
2203 Lv->m[0].data=(void *)omStrDup(*rParameter(r));
2204 Lc->m[1].rtyp=LIST_CMD;
2205 Lc->m[1].data=(void*)Lv;
2206 // ord:
2208 Lo->Init(1);
2210 Loo->Init(2);
2211 Loo->m[0].rtyp=STRING_CMD;
2212 Loo->m[0].data=(void *)omStrDup(rSimpleOrdStr(ringorder_lp));
2213
2214 intvec *iv=new intvec(1); (*iv)[0]=1;
2215 Loo->m[1].rtyp=INTVEC_CMD;
2216 Loo->m[1].data=(void *)iv;
2217
2218 Lo->m[0].rtyp=LIST_CMD;
2219 Lo->m[0].data=(void*)Loo;
2220
2221 Lc->m[2].rtyp=LIST_CMD;
2222 Lc->m[2].data=(void*)Lo;
2223 // q-ideal:
2224 Lc->m[3].rtyp=IDEAL_CMD;
2225 Lc->m[3].data=(void *)idInit(1,1);
2226 // ----------------------
2227 L->m[0].rtyp=LIST_CMD;
2228 L->m[0].data=(void*)Lc;
2229 }
2230 else if (rField_is_Zp(r) || rField_is_Q(r))
2231 {
2232 L->m[0].rtyp=INT_CMD;
2233 L->m[0].data=(void *)(long)r->cf->ch;
2234 }
2235 else
2236 {
2237 L->m[0].rtyp=CRING_CMD;
2238 L->m[0].data=(void *)r->cf;
2239 r->cf->ref++;
2240 }
2241 // ----------------------------------------
2242 rDecompose_23456(r,L);
2243 return L;
2244}
CanonicalForm Lc(const CanonicalForm &f)
static void rDecomposeC(leftv h, const ring R)
Definition ipshell.cc:1847
void rDecomposeCF(leftv h, const ring r, const ring R)
Definition ipshell.cc:1723
void rDecomposeRing(leftv h, const ring R)
Definition ipshell.cc:1909
static void rDecompose_23456(const ring r, lists L)
Definition ipshell.cc:2007
const char * rSimpleOrdStr(int ord)
Definition ring.cc:78
@ ringorder_lp
Definition ring.h:78
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition ring.h:631
static BOOLEAN rField_is_numeric(const ring r)
Definition ring.h:521
static BOOLEAN rField_is_GF(const ring r)
Definition ring.h:527

◆ rDecompose_CF()

BOOLEAN rDecompose_CF ( leftv res,
const coeffs C )

Definition at line 1937 of file ipshell.cc.

1938{
1939 assume( C != NULL );
1940
1941 // sanity check: require currRing==r for rings with polynomial data
1942 if ( nCoeff_is_algExt(C) && (C != currRing->cf))
1943 {
1944 WerrorS("ring with polynomial data must be the base ring or compatible");
1945 return TRUE;
1946 }
1947 if (nCoeff_is_numeric(C))
1948 {
1950 }
1951 else if (nCoeff_is_Ring(C))
1952 {
1954 }
1955 else if ( C->extRing!=NULL )// nCoeff_is_algExt(r->cf))
1956 {
1957 rDecomposeCF(res, C->extRing, currRing);
1958 }
1959 else if(nCoeff_is_GF(C))
1960 {
1962 Lc->Init(4);
1963 // char:
1964 Lc->m[0].rtyp=INT_CMD;
1965 Lc->m[0].data=(void*)(long)C->m_nfCharQ;
1966 // var:
1968 Lv->Init(1);
1969 Lv->m[0].rtyp=STRING_CMD;
1970 Lv->m[0].data=(void *)omStrDup(*n_ParameterNames(C));
1971 Lc->m[1].rtyp=LIST_CMD;
1972 Lc->m[1].data=(void*)Lv;
1973 // ord:
1975 Lo->Init(1);
1977 Loo->Init(2);
1978 Loo->m[0].rtyp=STRING_CMD;
1979 Loo->m[0].data=(void *)omStrDup(rSimpleOrdStr(ringorder_lp));
1980
1981 intvec *iv=new intvec(1); (*iv)[0]=1;
1982 Loo->m[1].rtyp=INTVEC_CMD;
1983 Loo->m[1].data=(void *)iv;
1984
1985 Lo->m[0].rtyp=LIST_CMD;
1986 Lo->m[0].data=(void*)Loo;
1987
1988 Lc->m[2].rtyp=LIST_CMD;
1989 Lc->m[2].data=(void*)Lo;
1990 // q-ideal:
1991 Lc->m[3].rtyp=IDEAL_CMD;
1992 Lc->m[3].data=(void *)idInit(1,1);
1993 // ----------------------
1994 res->rtyp=LIST_CMD;
1995 res->data=(void*)Lc;
1996 }
1997 else
1998 {
1999 res->rtyp=INT_CMD;
2000 res->data=(void *)(long)C->ch;
2001 }
2002 // ----------------------------------------
2003 return FALSE;
2004}
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition coeffs.h:832
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition coeffs.h:825
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition coeffs.h:771
static void rDecomposeC_41(leftv h, const coeffs C)
Definition ipshell.cc:1813
static void rDecomposeRing_41(leftv h, const coeffs C)
Definition ipshell.cc:1882

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring r)

Definition at line 2108 of file ipshell.cc.

2109{
2110 assume( r != NULL );
2111 const coeffs C = r->cf;
2112 assume( C != NULL );
2113
2114 // sanity check: require currRing==r for rings with polynomial data
2115 if ( (r!=currRing) && (
2116 (r->qideal != NULL)
2117#ifdef HAVE_PLURAL
2118 || (rIsPluralRing(r))
2119#endif
2120 )
2121 )
2122 {
2123 WerrorS("ring with polynomial data must be the base ring or compatible");
2124 return NULL;
2125 }
2126 // 0: char/ cf - ring
2127 // 1: list (var)
2128 // 2: list (ord)
2129 // 3: qideal
2130 // possibly:
2131 // 4: C
2132 // 5: D
2134 if (rIsPluralRing(r))
2135 L->Init(6);
2136 else
2137 L->Init(4);
2138 // ----------------------------------------
2139 // 0: char/ cf - ring
2140 L->m[0].rtyp=CRING_CMD;
2141 L->m[0].data=(char*)r->cf; r->cf->ref++;
2142 // ----------------------------------------
2143 rDecompose_23456(r,L);
2144 return L;
2145}

◆ rDefault()

idhdl rDefault ( const char * s)

Definition at line 1639 of file ipshell.cc.

1640{
1641 idhdl tmp=NULL;
1642
1643 if (s!=NULL) tmp = enterid(s, myynest, RING_CMD, &IDROOT);
1644 if (tmp==NULL) return NULL;
1645
1646 if (sLastPrinted.RingDependend())
1647 {
1648 sLastPrinted.CleanUp();
1649 }
1650
1651 ring r = IDRING(tmp) = (ring) omAlloc0Bin(sip_sring_bin);
1652
1653 #ifndef TEST_ZN_AS_ZP
1654 r->cf = nInitChar(n_Zp, (void*)32003); // r->cf->ch = 32003;
1655 #else
1656 mpz_t modBase;
1657 mpz_init_set_ui(modBase, (long)32003);
1658 ZnmInfo info;
1659 info.base= modBase;
1660 info.exp= 1;
1661 r->cf=nInitChar(n_Zn,(void*) &info);
1662 r->cf->is_field=1;
1663 r->cf->is_domain=1;
1664 r->cf->has_simple_Inverse=1;
1665 #endif
1666 r->N = 3;
1667 /*r->P = 0; Alloc0 in idhdl::set, ipid.cc*/
1668 /*names*/
1669 r->names = (char **) omAlloc0(3 * sizeof(char_ptr));
1670 r->names[0] = omStrDup("x");
1671 r->names[1] = omStrDup("y");
1672 r->names[2] = omStrDup("z");
1673 /*weights: entries for 3 blocks: NULL*/
1674 r->wvhdl = (int **)omAlloc0(3 * sizeof(int_ptr));
1675 /*order: dp,C,0*/
1676 r->order = (rRingOrder_t *) omAlloc(3 * sizeof(rRingOrder_t *));
1677 r->block0 = (int *)omAlloc0(3 * sizeof(int *));
1678 r->block1 = (int *)omAlloc0(3 * sizeof(int *));
1679 /* ringorder dp for the first block: var 1..3 */
1680 r->order[0] = ringorder_dp;
1681 r->block0[0] = 1;
1682 r->block1[0] = 3;
1683 /* ringorder C for the second block: no vars */
1684 r->order[1] = ringorder_C;
1685 /* the last block: everything is 0 */
1686 r->order[2] = (rRingOrder_t)0;
1687
1688 /* complete ring intializations */
1689 rComplete(r);
1690 rSetHdl(tmp);
1691 return currRingHdl;
1692}
rRingOrder_t
order stuff
Definition ring.h:69
@ ringorder_C
Definition ring.h:74
@ ringorder_dp
Definition ring.h:79
char * char_ptr
Definition structs.h:49
int * int_ptr
Definition structs.h:50

◆ rFindHdl()

idhdl rFindHdl ( ring r,
idhdl n )

Definition at line 1695 of file ipshell.cc.

1696{
1697 if ((r==NULL)||(r->VarOffset==NULL))
1698 return NULL;
1700 if (h!=NULL) return h;
1701 if (IDROOT!=basePack->idroot) h=rSimpleFindHdl(r,basePack->idroot,n);
1702 if (h!=NULL) return h;
1704 while(p!=NULL)
1705 {
1706 if ((p->cPack!=basePack)
1707 && (p->cPack!=currPack))
1708 h=rSimpleFindHdl(r,p->cPack->idroot,n);
1709 if (h!=NULL) return h;
1710 p=p->next;
1711 }
1712 idhdl tmp=basePack->idroot;
1713 while (tmp!=NULL)
1714 {
1715 if (IDTYP(tmp)==PACKAGE_CMD)
1716 h=rSimpleFindHdl(r,IDPACKAGE(tmp)->idroot,n);
1717 if (h!=NULL) return h;
1718 tmp=IDNEXT(tmp);
1719 }
1720 return NULL;
1721}
static idhdl rSimpleFindHdl(const ring r, const idhdl root, const idhdl n)
Definition ipshell.cc:6262

◆ rInit()

ring rInit ( leftv pn,
leftv rv,
leftv ord )

Definition at line 5621 of file ipshell.cc.

5622{
5623 int float_len=0;
5624 int float_len2=0;
5625 ring R = NULL;
5626 //BOOLEAN ffChar=FALSE;
5627
5628 /* ch -------------------------------------------------------*/
5629 // get ch of ground field
5630
5631 // allocated ring
5632 R = (ring) omAlloc0Bin(sip_sring_bin);
5633
5634 coeffs cf = NULL;
5635
5636 assume( pn != NULL );
5637 const int P = pn->listLength();
5638
5639 if (pn->Typ()==CRING_CMD)
5640 {
5641 cf=(coeffs)pn->CopyD();
5642 leftv pnn=pn;
5643 if(P>1) /*parameter*/
5644 {
5645 pnn = pnn->next;
5646 const int pars = pnn->listLength();
5647 assume( pars > 0 );
5648 char ** names = (char**)omAlloc0(pars * sizeof(char_ptr));
5649
5650 if (rSleftvList2StringArray(pnn, names))
5651 {
5652 WerrorS("parameter expected");
5653 goto rInitError;
5654 }
5655
5656 TransExtInfo extParam;
5657
5658 extParam.r = rDefault( cf, pars, names); // Q/Zp [ p_1, ... p_pars ]
5659 for(int i=pars-1; i>=0;i--)
5660 {
5661 omFree(names[i]);
5662 }
5663 omFree(names);
5664
5665 cf = nInitChar(n_transExt, &extParam);
5666 }
5667 assume( cf != NULL );
5668 }
5669 else if (pn->Typ()==INT_CMD)
5670 {
5671 int ch = (int)(long)pn->Data();
5672 leftv pnn=pn;
5673
5674 /* parameter? -------------------------------------------------------*/
5675 pnn = pnn->next;
5676
5677 if (pnn == NULL) // no params!?
5678 {
5679 if (ch!=0)
5680 {
5681 int ch2=IsPrime(ch);
5682 if ((ch<2)||(ch!=ch2))
5683 {
5684 Warn("%d is invalid as characteristic of the ground field. 32003 is used.", ch);
5685 ch=32003;
5686 }
5687 #ifndef TEST_ZN_AS_ZP
5688 cf = nInitChar(n_Zp, (void*)(long)ch);
5689 #else
5690 mpz_t modBase;
5691 mpz_init_set_ui(modBase, (long)ch);
5692 ZnmInfo info;
5693 info.base= modBase;
5694 info.exp= 1;
5695 cf=nInitChar(n_Zn,(void*) &info);
5696 cf->is_field=1;
5697 cf->is_domain=1;
5698 cf->has_simple_Inverse=1;
5699 #endif
5700 }
5701 else
5702 cf = nInitChar(n_Q, (void*)(long)ch);
5703 }
5704 else
5705 {
5706 const int pars = pnn->listLength();
5707
5708 assume( pars > 0 );
5709
5710 // predefined finite field: (p^k, a)
5711 if ((ch!=0) && (ch!=IsPrime(ch)) && (pars == 1))
5712 {
5713 GFInfo param;
5714
5715 param.GFChar = ch;
5716 param.GFDegree = 1;
5717 param.GFPar_name = pnn->name;
5718
5719 cf = nInitChar(n_GF, &param);
5720 }
5721 else // (0/p, a, b, ..., z)
5722 {
5723 if ((ch!=0) && (ch!=IsPrime(ch)))
5724 {
5725 WerrorS("too many parameters");
5726 goto rInitError;
5727 }
5728
5729 char ** names = (char**)omAlloc0(pars * sizeof(char_ptr));
5730
5731 if (rSleftvList2StringArray(pnn, names))
5732 {
5733 WerrorS("parameter expected");
5734 goto rInitError;
5735 }
5736
5737 TransExtInfo extParam;
5738
5739 extParam.r = rDefault( ch, pars, names); // Q/Zp [ p_1, ... p_pars ]
5740 for(int i=pars-1; i>=0;i--)
5741 {
5742 omFree(names[i]);
5743 }
5744 omFree(names);
5745
5746 cf = nInitChar(n_transExt, &extParam);
5747 }
5748 }
5749
5750 //if (cf==NULL) ->Error: Invalid ground field specification
5751 }
5752 else if ((pn->name != NULL)
5753 && ((strcmp(pn->name,"real")==0) || (strcmp(pn->name,"complex")==0)))
5754 {
5755 leftv pnn=pn->next;
5756 BOOLEAN complex_flag=(strcmp(pn->name,"complex")==0);
5757 if ((pnn!=NULL) && (pnn->Typ()==INT_CMD))
5758 {
5759 float_len=(int)(long)pnn->Data();
5760 float_len2=float_len;
5761 pnn=pnn->next;
5762 if ((pnn!=NULL) && (pnn->Typ()==INT_CMD))
5763 {
5764 float_len2=(int)(long)pnn->Data();
5765 pnn=pnn->next;
5766 }
5767 }
5768
5769 if (!complex_flag)
5770 complex_flag= (pnn!=NULL) && (pnn->name!=NULL);
5771 if( !complex_flag && (float_len2 <= (short)SHORT_REAL_LENGTH))
5772 cf=nInitChar(n_R, NULL);
5773 else // longR or longC?
5774 {
5775 LongComplexInfo param;
5776
5777 param.float_len = si_min (float_len, 32767);
5778 param.float_len2 = si_min (float_len2, 32767);
5779
5780 // set the parameter name
5781 if (complex_flag)
5782 {
5783 if (param.float_len < SHORT_REAL_LENGTH)
5784 {
5787 }
5788 if ((pnn == NULL) || (pnn->name == NULL))
5789 param.par_name=(const char*)"i"; //default to i
5790 else
5791 param.par_name = (const char*)pnn->name;
5792 }
5793
5794 cf = nInitChar(complex_flag ? n_long_C: n_long_R, (void*)&param);
5795 }
5796 assume( cf != NULL );
5797 }
5798 else if ((pn->name != NULL) && (strcmp(pn->name, "integer") == 0))
5799 {
5800 // TODO: change to use coeffs_BIGINT!?
5801 mpz_t modBase;
5802 unsigned int modExponent = 1;
5803 mpz_init_set_si(modBase, 0);
5804 if (pn->next!=NULL)
5805 {
5806 leftv pnn=pn;
5807 if (pnn->next->Typ()==INT_CMD)
5808 {
5809 pnn=pnn->next;
5810 mpz_set_ui(modBase, (long) pnn->Data());
5811 if ((pnn->next!=NULL) && (pnn->next->Typ()==INT_CMD))
5812 {
5813 pnn=pnn->next;
5814 modExponent = (long) pnn->Data();
5815 }
5816 while ((pnn->next!=NULL) && (pnn->next->Typ()==INT_CMD))
5817 {
5818 pnn=pnn->next;
5819 mpz_mul_ui(modBase, modBase, (int)(long) pnn->Data());
5820 }
5821 }
5822 else if (pnn->next->Typ()==BIGINT_CMD)
5823 {
5824 number p=(number)pnn->next->CopyD();
5825 n_MPZ(modBase,p,coeffs_BIGINT);
5827 }
5828 }
5829 else
5831
5832 if ((mpz_cmp_ui(modBase, 1) == 0) && (mpz_sgn1(modBase) < 0))
5833 {
5834 WerrorS("Wrong ground ring specification (module is 1)");
5835 goto rInitError;
5836 }
5837 if (modExponent < 1)
5838 {
5839 WerrorS("Wrong ground ring specification (exponent smaller than 1");
5840 goto rInitError;
5841 }
5842 // module is 0 ---> integers ringtype = 4;
5843 // we have an exponent
5844 if (modExponent > 1 && cf == NULL)
5845 {
5846 if ((mpz_cmp_ui(modBase, 2) == 0) && (modExponent <= 8*sizeof(unsigned long)))
5847 {
5848 /* this branch should be active for modExponent = 2..32 resp. 2..64,
5849 depending on the size of a long on the respective platform */
5850 //ringtype = 1; // Use Z/2^ch
5851 cf=nInitChar(n_Z2m,(void*)(long)modExponent);
5852 }
5853 else
5854 {
5855 if (mpz_sgn1(modBase)==0)
5856 {
5857 WerrorS("modulus must not be 0 or parameter not allowed");
5858 goto rInitError;
5859 }
5860 //ringtype = 3;
5861 ZnmInfo info;
5862 info.base= modBase;
5863 info.exp= modExponent;
5864 cf=nInitChar(n_Znm,(void*) &info); //exponent is missing
5865 }
5866 }
5867 // just a module m > 1
5868 else if (cf == NULL)
5869 {
5870 if (mpz_sgn1(modBase)==0)
5871 {
5872 WerrorS("modulus must not be 0 or parameter not allowed");
5873 goto rInitError;
5874 }
5875 //ringtype = 2;
5876 ZnmInfo info;
5877 info.base= modBase;
5878 info.exp= modExponent;
5879 cf=nInitChar(n_Zn,(void*) &info);
5880 }
5881 assume( cf != NULL );
5882 mpz_clear(modBase);
5883 }
5884 // ring NEW = OLD, (), (); where OLD is a polynomial ring...
5885 else if ((pn->Typ()==RING_CMD) && (P == 1))
5886 {
5887 ring r=(ring)pn->Data();
5888 if (r->qideal==NULL)
5889 {
5890 TransExtInfo extParam;
5891 extParam.r = r;
5892 extParam.r->ref++;
5893 cf = nInitChar(n_transExt, &extParam); // R(a)
5894 }
5895 else if (IDELEMS(r->qideal)==1)
5896 {
5897 AlgExtInfo extParam;
5898 extParam.r=r;
5899 extParam.r->ref++;
5900 cf = nInitChar(n_algExt, &extParam); // R[a]/<minideal>
5901 }
5902 else
5903 {
5904 WerrorS("algebraic extension ring must have one minpoly");
5905 goto rInitError;
5906 }
5907 }
5908 else
5909 {
5910 WerrorS("Wrong or unknown ground field specification");
5911#if 0
5912// debug stuff for unknown cf descriptions:
5913 sleftv* p = pn;
5914 while (p != NULL)
5915 {
5916 Print( "pn[%p]: type: %d [%s]: %p, name: %s", (void*)p, p->Typ(), Tok2Cmdname(p->Typ()), p->Data(), (p->name == NULL? "NULL" : p->name) );
5917 PrintLn();
5918 p = p->next;
5919 }
5920#endif
5921 goto rInitError;
5922 }
5923
5924 /*every entry in the new ring is initialized to 0*/
5925
5926 /* characteristic -----------------------------------------------*/
5927 /* input: 0 ch=0 : Q parameter=NULL ffChar=FALSE float_len
5928 * 0 1 : Q(a,...) *names FALSE
5929 * 0 -1 : R NULL FALSE 0
5930 * 0 -1 : R NULL FALSE prec. >6
5931 * 0 -1 : C *names FALSE prec. 0..?
5932 * p p : Fp NULL FALSE
5933 * p -p : Fp(a) *names FALSE
5934 * q q : GF(q=p^n) *names TRUE
5935 */
5936 if (cf==NULL)
5937 {
5938 WerrorS("Invalid ground field specification");
5939 goto rInitError;
5940// const int ch=32003;
5941// cf=nInitChar(n_Zp, (void*)(long)ch);
5942 }
5943
5944 assume( R != NULL );
5945
5946 R->cf = cf;
5947
5948 /* names and number of variables-------------------------------------*/
5949 {
5950 int l=rv->listLength();
5951
5952 if (l>MAX_SHORT)
5953 {
5954 Werror("too many ring variables(%d), max is %d",l,MAX_SHORT);
5955 goto rInitError;
5956 }
5957 R->N = l; /*rv->listLength();*/
5958 }
5959 R->names = (char **)omAlloc0(R->N * sizeof(char_ptr));
5960 if (rSleftvList2StringArray(rv, R->names))
5961 {
5962 WerrorS("name of ring variable expected");
5963 goto rInitError;
5964 }
5965
5966 /* check names and parameters for conflicts ------------------------- */
5967 rRenameVars(R); // conflicting variables will be renamed
5968 /* ordering -------------------------------------------------------------*/
5969 if (rSleftvOrdering2Ordering(ord, R))
5970 goto rInitError;
5971
5972 // Complete the initialization
5973 if (rComplete(R,1))
5974 goto rInitError;
5975
5976/*#ifdef HAVE_RINGS
5977// currently, coefficients which are ring elements require a global ordering:
5978 if (rField_is_Ring(R) && (R->OrdSgn==-1))
5979 {
5980 WerrorS("global ordering required for these coefficients");
5981 goto rInitError;
5982 }
5983#endif*/
5984
5985 rTest(R);
5986
5987 // try to enter the ring into the name list
5988 // need to clean up sleftv here, before this ring can be set to
5989 // new currRing or currRing can be killed beacuse new ring has
5990 // same name
5991 pn->CleanUp();
5992 rv->CleanUp();
5993 ord->CleanUp();
5994 //if ((tmp = enterid(s, myynest, RING_CMD, &IDROOT))==NULL)
5995 // goto rInitError;
5996
5997 //memcpy(IDRING(tmp),R,sizeof(*R));
5998 // set current ring
5999 //omFreeBin(R, ip_sring_bin);
6000 //return tmp;
6001 return R;
6002
6003 // error case:
6004 rInitError:
6005 if ((R != NULL)&&(R->cf!=NULL)) rDelete(R);
6006 pn->CleanUp();
6007 rv->CleanUp();
6008 ord->CleanUp();
6009 return NULL;
6010}
@ n_R
single prescision (6,6) real numbers
Definition coeffs.h:31
@ n_Znm
only used if HAVE_RINGS is defined
Definition coeffs.h:45
@ n_long_R
real floating point (GMP) numbers
Definition coeffs.h:33
@ n_Z2m
only used if HAVE_RINGS is defined
Definition coeffs.h:46
@ n_Z
only used if HAVE_RINGS is defined
Definition coeffs.h:43
@ n_long_C
complex floating point (GMP) numbers
Definition coeffs.h:41
short float_len2
additional char-flags, rInit
Definition coeffs.h:109
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
Definition coeffs.h:552
const char * par_name
parameter name
Definition coeffs.h:110
short float_len
additional char-flags, rInit
Definition coeffs.h:108
idhdl rDefault(const char *s)
Definition ipshell.cc:1639
const short MAX_SHORT
Definition ipshell.cc:5609
BOOLEAN rSleftvOrdering2Ordering(sleftv *ord, ring R)
Definition ipshell.cc:5301
static BOOLEAN rSleftvList2StringArray(leftv sl, char **p)
Definition ipshell.cc:5573
#define SHORT_REAL_LENGTH
Definition numbers.h:57
#define rTest(r)
Definition ring.h:794
#define mpz_sgn1(A)
Definition si_gmp.h:18

◆ rKill() [1/2]

void rKill ( idhdl h)

Definition at line 6219 of file ipshell.cc.

6220{
6221 ring r = IDRING(h);
6222 int ref=0;
6223 if (r!=NULL)
6224 {
6225 // avoid, that sLastPrinted is the last reference to the base ring:
6226 // clean up before killing the last "named" refrence:
6227 if ((sLastPrinted.rtyp==RING_CMD)
6228 && (sLastPrinted.data==(void*)r))
6229 {
6230 sLastPrinted.CleanUp(r);
6231 }
6232 ref=r->ref;
6233 if ((ref<=0)&&(r==currRing))
6234 {
6235 // cleanup DENOMINATOR_LIST
6237 {
6239 if (TEST_V_ALLWARN)
6240 Warn("deleting denom_list for ring change from %s",IDID(h));
6241 do
6242 {
6243 n_Delete(&(dd->n),currRing->cf);
6244 dd=dd->next;
6247 } while(DENOMINATOR_LIST!=NULL);
6248 }
6249 }
6250 rKill(r);
6251 }
6252 if (h==currRingHdl)
6253 {
6254 if (ref<=0) { currRing=NULL; currRingHdl=NULL;}
6255 else
6256 {
6258 }
6259 }
6260}
void rKill(ring r)
Definition ipshell.cc:6174
VAR denominator_list DENOMINATOR_LIST
Definition kutil.cc:79
denominator_list_s * denominator_list
Definition kutil.h:64
denominator_list next
Definition kutil.h:66

◆ rKill() [2/2]

void rKill ( ring r)

Definition at line 6174 of file ipshell.cc.

6175{
6176 if ((r->ref<=0)&&(r->order!=NULL))
6177 {
6178#ifdef RDEBUG
6179 if (traceit &TRACE_SHOW_RINGS) Print("kill ring %lx\n",(long)r);
6180#endif
6181 int j;
6182 for (j=0;j<myynest;j++)
6183 {
6184 if (iiLocalRing[j]==r)
6185 {
6186 if (j==0) WarnS("killing the basering for level 0");
6188 }
6189 }
6190// any variables depending on r ?
6191 while (r->idroot!=NULL)
6192 {
6193 r->idroot->lev=myynest; // avoid warning about kill global objects
6194 killhdl2(r->idroot,&(r->idroot),r);
6195 }
6196 if (r==currRing)
6197 {
6198 // all dependend stuff is done, clean global vars:
6199 if (sLastPrinted.RingDependend())
6200 {
6201 sLastPrinted.CleanUp();
6202 }
6203 //if ((myynest>0) && (iiRETURNEXPR.RingDependend()))
6204 //{
6205 // WerrorS("return value depends on local ring variable (export missing ?)");
6206 // iiRETURNEXPR.CleanUp();
6207 //}
6208 currRing=NULL;
6210 }
6211
6212 /* nKillChar(r); will be called from inside of rDelete */
6213 rDelete(r);
6214 return;
6215 }
6216 rDecRefCnt(r);
6217}
static void rDecRefCnt(ring r)
Definition ring.h:850

◆ rSetHdl()

void rSetHdl ( idhdl h)

Definition at line 5122 of file ipshell.cc.

5123{
5124 ring rg = NULL;
5125 if (h!=NULL)
5126 {
5127// Print(" new ring:%s (l:%d)\n",IDID(h),IDLEV(h));
5128 rg = IDRING(h);
5129 if (rg==NULL) return; //id <>NULL, ring==NULL
5130 omCheckAddrSize((ADDRESS)h,sizeof(idrec));
5131 if (IDID(h)) // OB: ????
5133 rTest(rg);
5134 }
5135 else return;
5136
5137 // clean up history
5138 if (currRing!=NULL)
5139 {
5140 if(sLastPrinted.RingDependend())
5141 {
5142 sLastPrinted.CleanUp();
5143 }
5144
5145 if (rg!=currRing)/*&&(currRing!=NULL)*/
5146 {
5147 if (rg->cf!=currRing->cf)
5148 {
5151 {
5152 if (TEST_V_ALLWARN)
5153 Warn("deleting denom_list for ring change to %s",IDID(h));
5154 do
5155 {
5156 n_Delete(&(dd->n),currRing->cf);
5157 dd=dd->next;
5160 } while(DENOMINATOR_LIST!=NULL);
5161 }
5162 }
5163 }
5164 }
5165
5166 // test for valid "currRing":
5167 if ((rg!=NULL) && (rg->idroot==NULL))
5168 {
5169 ring old=rg;
5170 rg=rAssure_HasComp(rg);
5171 if (old!=rg)
5172 {
5173 rKill(old);
5174 IDRING(h)=rg;
5175 }
5176 }
5177 /*------------ change the global ring -----------------------*/
5178 rChangeCurrRing(rg);
5179 currRingHdl = h;
5180}
Definition idrec.h:35
#define omCheckAddr(addr)
#define omCheckAddrSize(addr, size)
ring rAssure_HasComp(const ring r)
Definition ring.cc:4717

◆ scIndIndset()

lists scIndIndset ( ideal S,
BOOLEAN all,
ideal Q )

Definition at line 1107 of file ipshell.cc.

1109{
1110 int i;
1111 indset save;
1113
1114 hexist = hInit(S, Q, &hNexist);
1115 if (hNexist == 0)
1116 {
1117 intvec *iv=new intvec(rVar(currRing));
1118 for(i=0; i<rVar(currRing); i++) (*iv)[i]=1;
1119 res->Init(1);
1120 res->m[0].rtyp=INTVEC_CMD;
1121 res->m[0].data=(intvec*)iv;
1122 return res;
1123 }
1125 hMu = 0;
1126 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
1127 hvar = (varset)omAlloc((rVar(currRing) + 1) * sizeof(int));
1128 hpure = (scmon)omAlloc0((1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1129 hrad = hexist;
1130 hNrad = hNexist;
1131 radmem = hCreate(rVar(currRing) - 1);
1132 hCo = rVar(currRing) + 1;
1133 hNvar = rVar(currRing);
1135 hSupp(hrad, hNrad, hvar, &hNvar);
1136 if (hNvar)
1137 {
1138 hCo = hNvar;
1139 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
1142 }
1143 if (hCo && (hCo < rVar(currRing)))
1144 {
1146 }
1147 if (hMu!=0)
1148 {
1149 ISet = save;
1150 hMu2 = 0;
1151 if (all && (hCo+1 < rVar(currRing)))
1152 {
1155 i=hMu+hMu2;
1156 res->Init(i);
1157 if (hMu2 == 0)
1158 {
1160 }
1161 }
1162 else
1163 {
1164 res->Init(hMu);
1165 }
1166 for (i=0;i<hMu;i++)
1167 {
1168 res->m[i].data = (void *)save->set;
1169 res->m[i].rtyp = INTVEC_CMD;
1170 ISet = save;
1171 save = save->nx;
1173 }
1175 if (hMu2 != 0)
1176 {
1177 save = JSet;
1178 for (i=hMu;i<hMu+hMu2;i++)
1179 {
1180 res->m[i].data = (void *)save->set;
1181 res->m[i].rtyp = INTVEC_CMD;
1182 JSet = save;
1183 save = save->nx;
1185 }
1187 }
1188 }
1189 else
1190 {
1191 res->Init(0);
1193 }
1194 hKill(radmem, rVar(currRing) - 1);
1195 omFreeSize((ADDRESS)hpure, (1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1196 omFreeSize((ADDRESS)hvar, (rVar(currRing) + 1) * sizeof(int));
1197 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
1199 return res;
1200}
void hIndMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:382
VAR omBin indlist_bin
Definition hdegree.cc:29
VAR int hMu2
Definition hdegree.cc:27
VAR int hCo
Definition hdegree.cc:27
VAR indset ISet
Definition hdegree.cc:351
VAR long hMu
Definition hdegree.cc:28
VAR indset JSet
Definition hdegree.cc:351
void hDimSolve(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:35
void hIndAllMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:562
monf hCreate(int Nvar)
Definition hutil.cc:996
VAR varset hvar
Definition hutil.cc:18
void hKill(monf xmem, int Nvar)
Definition hutil.cc:1010
VAR int hNexist
Definition hutil.cc:19
void hDelete(scfmon ev, int ev_length)
Definition hutil.cc:140
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
Definition hutil.cc:621
VAR scfmon hwork
Definition hutil.cc:16
void hSupp(scfmon stc, int Nstc, varset var, int *Nvar)
Definition hutil.cc:174
void hLexR(scfmon rad, int Nrad, varset var, int Nvar)
Definition hutil.cc:565
VAR scmon hpure
Definition hutil.cc:17
VAR scfmon hrad
Definition hutil.cc:16
VAR monf radmem
Definition hutil.cc:21
VAR int hNpure
Definition hutil.cc:19
VAR int hNrad
Definition hutil.cc:19
scfmon hInit(ideal S, ideal Q, int *Nexist)
Definition hutil.cc:31
VAR scfmon hexist
Definition hutil.cc:16
void hRadical(scfmon rad, int *Nrad, int Nvar)
Definition hutil.cc:411
VAR int hNvar
Definition hutil.cc:19
scmon * scfmon
Definition hutil.h:15
indlist * indset
Definition hutil.h:28
int * varset
Definition hutil.h:16
int * scmon
Definition hutil.h:14
#define Q
Definition sirandom.c:26

◆ semicProc()

BOOLEAN semicProc ( leftv res,
leftv u,
leftv v )

Definition at line 4547 of file ipshell.cc.

4548{
4549 sleftv tmp;
4550 tmp.Init();
4551 tmp.rtyp=INT_CMD;
4552 /* tmp.data = (void *)0; -- done by Init */
4553
4554 return semicProc3(res,u,v,&tmp);
4555}

◆ semicProc3()

BOOLEAN semicProc3 ( leftv res,
leftv u,
leftv v,
leftv w )

Definition at line 4507 of file ipshell.cc.

4508{
4509 semicState state;
4510 BOOLEAN qh=(((int)(long)w->Data())==1);
4511
4512 // -----------------
4513 // check arguments
4514 // -----------------
4515
4516 lists l1 = (lists)u->Data( );
4517 lists l2 = (lists)v->Data( );
4518
4519 if( (state=list_is_spectrum( l1 ))!=semicOK )
4520 {
4521 WerrorS( "first argument is not a spectrum" );
4522 list_error( state );
4523 }
4524 else if( (state=list_is_spectrum( l2 ))!=semicOK )
4525 {
4526 WerrorS( "second argument is not a spectrum" );
4527 list_error( state );
4528 }
4529 else
4530 {
4531 spectrum s1= spectrumFromList( l1 );
4532 spectrum s2= spectrumFromList( l2 );
4533
4534 res->rtyp = INT_CMD;
4535 if (qh)
4536 res->data = (void*)(long)(s1.mult_spectrumh( s2 ));
4537 else
4538 res->data = (void*)(long)(s1.mult_spectrum( s2 ));
4539 }
4540
4541 // -----------------
4542 // check status
4543 // -----------------
4544
4545 return (state!=semicOK);
4546}
int mult_spectrum(spectrum &)
Definition semic.cc:396
int mult_spectrumh(spectrum &)
Definition semic.cc:425
semicState
Definition ipshell.cc:3431
@ semicOK
Definition ipshell.cc:3432
void list_error(semicState state)
Definition ipshell.cc:3464
spectrum spectrumFromList(lists l)
Definition ipshell.cc:3380
semicState list_is_spectrum(lists l)
Definition ipshell.cc:4249

◆ setOption()

BOOLEAN setOption ( leftv res,
leftv v )

Definition at line 570 of file misc_ip.cc.

571{
572 const char *n;
573 do
574 {
575 if (v->Typ()==STRING_CMD)
576 {
577 n=(const char *)v->CopyD(STRING_CMD);
578 }
579 else
580 {
581 if (v->name==NULL)
582 return TRUE;
583 if (v->rtyp==0)
584 {
585 n=v->name;
586 v->name=NULL;
587 }
588 else
589 {
590 n=omStrDup(v->name);
591 }
592 }
593
594 int i;
595
596 if(strcmp(n,"get")==0)
597 {
598 intvec *w=new intvec(2);
599 (*w)[0]=si_opt_1;
600 (*w)[1]=si_opt_2;
601 res->rtyp=INTVEC_CMD;
602 res->data=(void *)w;
603 goto okay;
604 }
605 if(strcmp(n,"set")==0)
606 {
607 if((v->next!=NULL)
608 &&(v->next->Typ()==INTVEC_CMD))
609 {
610 v=v->next;
611 intvec *w=(intvec*)v->Data();
612 si_opt_1=(*w)[0];
613 si_opt_2=(*w)[1];
614#if 0
618 ) {
620 }
621#endif
622 goto okay;
623 }
624 }
625 if(strcmp(n,"none")==0)
626 {
627 si_opt_1=0;
628 si_opt_2=0;
629 goto okay;
630 }
631 for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
632 {
633 if (strcmp(n,optionStruct[i].name)==0)
634 {
635 if (optionStruct[i].setval & validOpts)
636 {
637 si_opt_1 |= optionStruct[i].setval;
638 // optOldStd disables redthrough
639 if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
641 }
642 else
643 WarnS("cannot set option");
644#if 0
648 ) {
650 }
651#endif
652 goto okay;
653 }
654 else if ((strncmp(n,"no",2)==0)
655 && (strcmp(n+2,optionStruct[i].name)==0))
656 {
657 if (optionStruct[i].setval & validOpts)
658 {
659 si_opt_1 &= optionStruct[i].resetval;
660 }
661 else
662 WarnS("cannot clear option");
663 goto okay;
664 }
665 }
666 for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
667 {
668 if (strcmp(n,verboseStruct[i].name)==0)
669 {
670 si_opt_2 |= verboseStruct[i].setval;
671 #ifdef YYDEBUG
672 #if YYDEBUG
673 /*debugging the bison grammar --> grammar.cc*/
675 if (BVERBOSE(V_YACC)) yydebug=1;
676 else yydebug=0;
677 #endif
678 #endif
679 goto okay;
680 }
681 else if ((strncmp(n,"no",2)==0)
682 && (strcmp(n+2,verboseStruct[i].name)==0))
683 {
684 si_opt_2 &= verboseStruct[i].resetval;
685 #ifdef YYDEBUG
686 #if YYDEBUG
687 /*debugging the bison grammar --> grammar.cc*/
689 if (BVERBOSE(V_YACC)) yydebug=1;
690 else yydebug=0;
691 #endif
692 #endif
693 goto okay;
694 }
695 }
696 Werror("unknown option `%s`",n);
697 okay:
698 if (currRing != NULL)
701 v=v->next;
702 } while (v!=NULL);
703
704 // set global variable to show memory usage
706 else om_sing_opt_show_mem = 0;
707
708 return FALSE;
709}
CanonicalForm test
Definition cfModGcd.cc:4104
int yydebug
Definition grammar.cc:1843
VAR BITSET validOpts
Definition kstd1.cc:60
int om_sing_opt_show_mem
#define OPT_INTSTRATEGY
Definition options.h:93
#define TEST_OPT_INTSTRATEGY
Definition options.h:112
#define V_SHOW_MEM
Definition options.h:43
#define V_YACC
Definition options.h:44
#define OPT_REDTHROUGH
Definition options.h:83
#define TEST_RINGDEP_OPTS
Definition options.h:101
#define OPT_OLDSTD
Definition options.h:87
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition ring.h:554

◆ showOption()

char * showOption ( )

Definition at line 711 of file misc_ip.cc.

712{
713 int i;
714 BITSET tmp;
715
716 StringSetS("//options:");
717 if ((si_opt_1!=0)||(si_opt_2!=0))
718 {
719 tmp=si_opt_1;
720 if(tmp)
721 {
722 for (i=0; optionStruct[i].setval!=0; i++)
723 {
724 if (optionStruct[i].setval & tmp)
725 {
727 tmp &=optionStruct[i].resetval;
728 }
729 }
730 for (i=0; i<32; i++)
731 {
732 if (tmp & Sy_bit(i)) StringAppend(" %d",i);
733 }
734 }
735 tmp=si_opt_2;
736 if (tmp)
737 {
738 for (i=0; verboseStruct[i].setval!=0; i++)
739 {
740 if (verboseStruct[i].setval & tmp)
741 {
743 tmp &=verboseStruct[i].resetval;
744 }
745 }
746 for (i=1; i<32; i++)
747 {
748 if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
749 }
750 }
751 return StringEndS();
752 }
753 StringAppendS(" none");
754 return StringEndS();
755}
#define StringAppend
Definition emacs.cc:79
void StringAppendS(const char *st)
Definition reporter.cc:107

◆ singular_example()

void singular_example ( char * str)

Definition at line 431 of file misc_ip.cc.

432{
433 assume(str!=NULL);
434 char *s=str;
435 while (*s==' ') s++;
436 char *ss=s;
437 while (*ss!='\0') ss++;
438 while (*ss<=' ')
439 {
440 *ss='\0';
441 ss--;
442 }
443 idhdl h=IDROOT->get_level(s,0);
444 if ((h!=NULL) && (IDTYP(h)==PROC_CMD))
445 {
446 char *lib=iiGetLibName(IDPROC(h));
447 if((lib!=NULL)&&(*lib!='\0'))
448 {
449 Print("// proc %s from lib %s\n",s,lib);
451 if (s!=NULL)
452 {
453 if (strlen(s)>5)
454 {
455 iiEStart(s,IDPROC(h));
456 omFree((ADDRESS)s);
457 return;
458 }
459 else omFree((ADDRESS)s);
460 }
461 }
462 }
463 else
464 {
465 char sing_file[MAXPATHLEN];
466 FILE *fd=NULL;
467 char *res_m=feResource('m', 0);
468 if (res_m!=NULL)
469 {
470 snprintf(sing_file,MAXPATHLEN, "%s/%s.sing", res_m, s);
471 fd = feFopen(sing_file, "r");
472 }
473 if (fd != NULL)
474 {
475
476 int old_echo = si_echo;
477 int length, got;
478 char* s;
479
480 fseek(fd, 0, SEEK_END);
481 length = ftell(fd);
482 fseek(fd, 0, SEEK_SET);
483 s = (char*) omAlloc((length+20)*sizeof(char));
484 got = fread(s, sizeof(char), length, fd);
485 fclose(fd);
486 if (got != length)
487 {
488 Werror("Error while reading file %s", sing_file);
489 }
490 else
491 {
492 s[length] = '\0';
493 strcat(s, "\n;return();\n\n");
494 si_echo = 2;
495 iiEStart(s, NULL);
496 si_echo = old_echo;
497 }
498 omFree(s);
499 }
500 else
501 {
502 Werror("no example for %s", str);
503 }
504 }
505}
BOOLEAN iiEStart(char *example, procinfo *pi)
Definition iplib.cc:763
static char * iiGetLibName(const procinfov pi)
find the library of an proc
Definition ipshell.h:66
#define SEEK_SET
Definition mod2.h:115
#define SEEK_END
Definition mod2.h:111
char * str(leftv arg)
Definition shared.cc:699
int status int fd
Definition si_signals.h:69

◆ singular_system()

leftv singular_system ( sleftv h)

◆ siSetCpus()

int siSetCpus ( int cpu)

Definition at line 6658 of file ipshell.cc.

6659{
6660 int old=(int)(long)feOptValue(FE_OPT_CPUS);
6661 feSetOptValue(FE_OPT_CPUS,cpu);
6662 return old;
6663}

◆ spaddProc()

BOOLEAN spaddProc ( leftv result,
leftv first,
leftv second )

Definition at line 4424 of file ipshell.cc.

4425{
4426 semicState state;
4427
4428 // -----------------
4429 // check arguments
4430 // -----------------
4431
4432 lists l1 = (lists)first->Data( );
4433 lists l2 = (lists)second->Data( );
4434
4435 if( (state=list_is_spectrum( l1 )) != semicOK )
4436 {
4437 WerrorS( "first argument is not a spectrum:" );
4438 list_error( state );
4439 }
4440 else if( (state=list_is_spectrum( l2 )) != semicOK )
4441 {
4442 WerrorS( "second argument is not a spectrum:" );
4443 list_error( state );
4444 }
4445 else
4446 {
4447 spectrum s1= spectrumFromList ( l1 );
4448 spectrum s2= spectrumFromList ( l2 );
4449 spectrum sum( s1+s2 );
4450
4451 result->rtyp = LIST_CMD;
4452 result->data = (char*)(getList(sum));
4453 }
4454
4455 return (state!=semicOK);
4456}
lists getList(spectrum &spec)
Definition ipshell.cc:3392

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv result,
leftv first )

Definition at line 4180 of file ipshell.cc.

4181{
4182 spectrumState state = spectrumOK;
4183
4184 // -------------------
4185 // check consistency
4186 // -------------------
4187
4188 // check for a local polynomial ring
4189
4190 if( currRing->OrdSgn != -1 )
4191 // ?? HS: the test above is also true for k[x][[y]], k[[x]][y]
4192 // or should we use:
4193 //if( !ringIsLocal( ) )
4194 {
4195 WerrorS( "only works for local orderings" );
4196 state = spectrumWrongRing;
4197 }
4198 else if( currRing->qideal != NULL )
4199 {
4200 WerrorS( "does not work in quotient rings" );
4201 state = spectrumWrongRing;
4202 }
4203 else
4204 {
4205 lists L = (lists)NULL;
4206 int flag = 2; // symmetric optimization
4207
4208 state = spectrumCompute( (poly)first->Data( ),&L,flag );
4209
4210 if( state==spectrumOK )
4211 {
4212 result->rtyp = LIST_CMD;
4213 result->data = (char*)L;
4214 }
4215 else
4216 {
4217 spectrumPrintError(state);
4218 }
4219 }
4220
4221 return (state!=spectrumOK);
4222}
spectrumState
Definition ipshell.cc:3547
@ spectrumWrongRing
Definition ipshell.cc:3554
@ spectrumOK
Definition ipshell.cc:3548
spectrumState spectrumCompute(poly h, lists *L, int fast)
Definition ipshell.cc:3806
void spectrumPrintError(spectrumState state)
Definition ipshell.cc:4098

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv result,
leftv first )

Definition at line 4129 of file ipshell.cc.

4130{
4131 spectrumState state = spectrumOK;
4132
4133 // -------------------
4134 // check consistency
4135 // -------------------
4136
4137 // check for a local ring
4138
4139 if( !ringIsLocal(currRing ) )
4140 {
4141 WerrorS( "only works for local orderings" );
4142 state = spectrumWrongRing;
4143 }
4144
4145 // no quotient rings are allowed
4146
4147 else if( currRing->qideal != NULL )
4148 {
4149 WerrorS( "does not work in quotient rings" );
4150 state = spectrumWrongRing;
4151 }
4152 else
4153 {
4154 lists L = (lists)NULL;
4155 int flag = 1; // weight corner optimization is safe
4156
4157 state = spectrumCompute( (poly)first->Data( ),&L,flag );
4158
4159 if( state==spectrumOK )
4160 {
4161 result->rtyp = LIST_CMD;
4162 result->data = (char*)L;
4163 }
4164 else
4165 {
4166 spectrumPrintError(state);
4167 }
4168 }
4169
4170 return (state!=spectrumOK);
4171}
BOOLEAN ringIsLocal(const ring r)
Definition spectrum.cc:461

◆ spmulProc()

BOOLEAN spmulProc ( leftv result,
leftv first,
leftv second )

Definition at line 4466 of file ipshell.cc.

4467{
4468 semicState state;
4469
4470 // -----------------
4471 // check arguments
4472 // -----------------
4473
4474 lists l = (lists)first->Data( );
4475 int k = (int)(long)second->Data( );
4476
4477 if( (state=list_is_spectrum( l ))!=semicOK )
4478 {
4479 WerrorS( "first argument is not a spectrum" );
4480 list_error( state );
4481 }
4482 else if( k < 0 )
4483 {
4484 WerrorS( "second argument should be positive" );
4485 state = semicMulNegative;
4486 }
4487 else
4488 {
4490 spectrum product( k*s );
4491
4492 result->rtyp = LIST_CMD;
4493 result->data = (char*)getList(product);
4494 }
4495
4496 return (state!=semicOK);
4497}
@ semicMulNegative
Definition ipshell.cc:3433

◆ syBetti1()

BOOLEAN syBetti1 ( leftv res,
leftv u )

Definition at line 3160 of file ipshell.cc.

3161{
3162 sleftv tmp;
3163 tmp.Init();
3164 tmp.rtyp=INT_CMD;
3165 tmp.data=(void *)1;
3166 return syBetti2(res,u,&tmp);
3167}
BOOLEAN syBetti2(leftv res, leftv u, leftv w)
Definition ipshell.cc:3136

◆ syBetti2()

BOOLEAN syBetti2 ( leftv res,
leftv u,
leftv w )

Definition at line 3136 of file ipshell.cc.

3137{
3138 syStrategy syzstr=(syStrategy)u->Data();
3139
3140 BOOLEAN minim=(int)(long)w->Data();
3141 int row_shift=0;
3142 int add_row_shift=0;
3143 intvec *weights=NULL;
3144 intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3145 if (ww!=NULL)
3146 {
3147 weights=ivCopy(ww);
3148 add_row_shift = ww->min_in();
3149 (*weights) -= add_row_shift;
3150 }
3151
3152 res->data=(void *)syBettiOfComputation(syzstr,minim,&row_shift,weights);
3153 if (ww!=NULL) delete weights;
3154 //row_shift += add_row_shift;
3155 //Print("row_shift=%d, add_row_shift=%d\n",row_shift,add_row_shift);
3156 atSet(res,omStrDup("rowShift"),(void*)(long)add_row_shift,INT_CMD);
3157
3158 return FALSE;
3159}
intvec * syBettiOfComputation(syStrategy syzstr, BOOLEAN minim=TRUE, int *row_shift=NULL, intvec *weights=NULL)
Definition syz1.cc:1756

◆ syConvList()

syStrategy syConvList ( lists li)

Definition at line 3244 of file ipshell.cc.

3245{
3246 int typ0;
3248
3249 resolvente fr = liFindRes(li,&(result->length),&typ0,&(result->weights));
3250 if (fr != NULL)
3251 {
3252
3253 result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
3254 for (int i=result->length-1;i>=0;i--)
3255 {
3256 if (fr[i]!=NULL)
3257 result->fullres[i] = idCopy(fr[i]);
3258 }
3259 result->list_length=result->length;
3260 omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal));
3261 }
3262 else
3263 {
3264 omFreeSize(result, sizeof(ssyStrategy));
3265 result = NULL;
3266 }
3267 return result;
3268}

◆ syConvRes()

lists syConvRes ( syStrategy syzstr,
BOOLEAN toDel = FALSE,
int add_row_shift = 0 )

Definition at line 3172 of file ipshell.cc.

3173{
3174 resolvente fullres = syzstr->fullres;
3175 resolvente minres = syzstr->minres;
3176
3177 const int length = syzstr->length;
3178
3179 if ((fullres==NULL) && (minres==NULL))
3180 {
3181 if (syzstr->hilb_coeffs==NULL)
3182 { // La Scala
3183 fullres = syReorder(syzstr->res, length, syzstr);
3184 }
3185 else
3186 { // HRES
3187 minres = syReorder(syzstr->orderedRes, length, syzstr);
3188 syKillEmptyEntres(minres, length);
3189 }
3190 }
3191
3192 resolvente tr;
3193 int typ0=IDEAL_CMD;
3194
3195 if (minres!=NULL)
3196 tr = minres;
3197 else
3198 tr = fullres;
3199
3200 resolvente trueres=NULL;
3201 intvec ** w=NULL;
3202
3203 if (length>0)
3204 {
3205 trueres = (resolvente)omAlloc0((length)*sizeof(ideal));
3206 for (int i=length-1;i>=0;i--)
3207 {
3208 if (tr[i]!=NULL)
3209 {
3210 trueres[i] = idCopy(tr[i]);
3211 }
3212 }
3213 if ( id_RankFreeModule(trueres[0], currRing) > 0)
3214 typ0 = MODUL_CMD;
3215 if (syzstr->weights!=NULL)
3216 {
3217 w = (intvec**)omAlloc0(length*sizeof(intvec*));
3218 for (int i=length-1;i>=0;i--)
3219 {
3220 if (syzstr->weights[i]!=NULL) w[i] = ivCopy(syzstr->weights[i]);
3221 }
3222 }
3223 }
3224
3225 lists li = liMakeResolv(trueres, length, syzstr->list_length,typ0,
3226 w, add_row_shift);
3227
3228 if (toDel)
3229 syKillComputation(syzstr);
3230 else
3231 {
3232 if( fullres != NULL && syzstr->fullres == NULL )
3233 syzstr->fullres = fullres;
3234
3235 if( minres != NULL && syzstr->minres == NULL )
3236 syzstr->minres = minres;
3237 }
3238 return li;
3239}
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
intvec ** hilb_coeffs
Definition syz.h:46
resolvente minres
Definition syz.h:58
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition syz1.cc:1495
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy=TRUE, resolvente totake=NULL)
Definition syz1.cc:1641
void syKillEmptyEntres(resolvente res, int length)
Definition syz1.cc:2199
short list_length
Definition syz.h:62
resolvente res
Definition syz.h:47
resolvente fullres
Definition syz.h:57
intvec ** weights
Definition syz.h:45
resolvente orderedRes
Definition syz.h:48
int length
Definition syz.h:60

◆ test_cmd()

void test_cmd ( int i)

Definition at line 513 of file ipshell.cc.

514{
515 int ii;
516
517 if (i<0)
518 {
519 ii= -i;
520 if (ii < 32)
521 {
522 si_opt_1 &= ~Sy_bit(ii);
523 }
524 else if (ii < 64)
525 {
526 si_opt_2 &= ~Sy_bit(ii-32);
527 }
528 else
529 WerrorS("out of bounds\n");
530 }
531 else if (i<32)
532 {
533 ii=i;
534 if (Sy_bit(ii) & kOptions)
535 {
536 WarnS("Gerhard, use the option command");
537 si_opt_1 |= Sy_bit(ii);
538 }
539 else if (Sy_bit(ii) & validOpts)
540 si_opt_1 |= Sy_bit(ii);
541 }
542 else if (i<64)
543 {
544 ii=i-32;
545 si_opt_2 |= Sy_bit(ii);
546 }
547 else
548 WerrorS("out of bounds\n");
549}
VAR BITSET kOptions
Definition kstd1.cc:45

◆ Tok2Cmdname()

const char * Tok2Cmdname ( int i)

Definition at line 137 of file gentable.cc.

138{
139 if (tok < 0)
140 {
141 return cmds[0].name;
142 }
143 if (tok==COMMAND) return "command";
144 if (tok==ANY_TYPE) return "any_type";
145 if (tok==NONE) return "nothing";
146 //if (tok==IFBREAK) return "if_break";
147 //if (tok==VECTOR_FROM_POLYS) return "vector_from_polys";
148 //if (tok==ORDER_VECTOR) return "ordering";
149 //if (tok==REF_VAR) return "ref";
150 //if (tok==OBJECT) return "object";
151 //if (tok==PRINT_EXPR) return "print_expr";
152 if (tok==IDHDL) return "identifier";
153 // we do not blackbox objects during table generation:
154 //if (tok>MAX_TOK) return getBlackboxName(tok);
155 int i = 0;
156 while (cmds[i].tokval!=0)
157 {
158 if ((cmds[i].tokval == tok)&&(cmds[i].alias==0))
159 {
160 return cmds[i].name;
161 }
162 i++;
163 }
164 i=0;// try again for old/alias names:
165 while (cmds[i].tokval!=0)
166 {
167 if (cmds[i].tokval == tok)
168 {
169 return cmds[i].name;
170 }
171 i++;
172 }
173 #if 0
174 char *s=(char*)malloc(10);
175 snprintf(s,10,"(%d)",tok);
176 return s;
177 #else
178 return cmds[0].name;
179 #endif
180}
#define malloc
Definition omAllocFunc.c:12
VAR cmdnames cmds[]
Definition table.h:1027

◆ type_cmd()

void type_cmd ( leftv v)

Definition at line 255 of file ipshell.cc.

256{
257 BOOLEAN oldShortOut = FALSE;
258
259 if (currRing != NULL)
260 {
261 oldShortOut = currRing->ShortOut;
262 currRing->ShortOut = 1;
263 }
264 int t=v->Typ();
265 Print("// %s %s ",v->Name(),Tok2Cmdname(t));
266 switch (t)
267 {
268 case MAP_CMD:Print(" from %s\n",((map)(v->Data()))->preimage); break;
269 case INTMAT_CMD: Print(" %d x %d\n",((intvec*)(v->Data()))->rows(),
270 ((intvec*)(v->Data()))->cols()); break;
271 case MATRIX_CMD:Print(" %u x %u\n" ,
272 MATROWS((matrix)(v->Data())),
273 MATCOLS((matrix)(v->Data())));break;
274 case MODUL_CMD: Print(", rk %d\n", (int)(((ideal)(v->Data()))->rank));break;
275 case LIST_CMD: Print(", size %d\n",((lists)(v->Data()))->nr+1); break;
276
277 case PROC_CMD:
278 case RING_CMD:
279 case IDEAL_CMD: PrintLn(); break;
280
281 //case INT_CMD:
282 //case STRING_CMD:
283 //case INTVEC_CMD:
284 //case POLY_CMD:
285 //case VECTOR_CMD:
286 //case PACKAGE_CMD:
287
288 default:
289 break;
290 }
291 v->Print();
292 if (currRing != NULL)
293 currRing->ShortOut = oldShortOut;
294}

◆ versionString()

char * versionString ( )

Definition at line 772 of file misc_ip.cc.

773{
774 StringSetS("");
775 StringAppend("Singular for %s version %s (%d, %d bit) %s",
776 S_UNAME, VERSION, // SINGULAR_VERSION,
777 SINGULAR_VERSION, sizeof(void*)*8,
779 VERSION_DATE);
780#else
781 singular_date);
782#endif
783 StringAppendS("\nwith\n\t");
784
785#if defined(mpir_version)
786 StringAppend("MPIR(%s)~GMP(%s),", mpir_version, gmp_version);
787#elif defined(gmp_version)
788 // #if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
789 // StringAppend("GMP(%d.%d),",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
790 StringAppend("GMP(%s),", gmp_version);
791#endif
792#ifdef HAVE_NTL
793 StringAppend("NTL(%s),",NTL_VERSION);
794#endif
795
796#ifdef HAVE_FLINT
797 StringAppend("FLINT(%s),",FLINT_VERSION);
798#endif
799// StringAppendS("factory(" FACTORYVERSION "),");
800 StringAppendS("\n\t");
801#ifndef HAVE_OMALLOC
802 StringAppendS("xalloc,");
803#else
804 StringAppendS("omalloc,");
805#endif
806#if defined(HAVE_DYN_RL)
808 StringAppendS("no input,");
809 else if (fe_fgets_stdin==fe_fgets)
810 StringAppendS("fgets,");
812 StringAppend("dynamic readline%d),",RL_VERSION_MAJOR);
813 #ifdef HAVE_FEREAD
815 StringAppendS("emulated readline,");
816 #endif
817 else
818 StringAppendS("unknown fgets method,");
819#else
820 #if defined(HAVE_READLINE) && !defined(FEREAD)
821 StringAppend("static readline(%d),",RL_VERSION_MAJOR);
822 #else
823 #ifdef HAVE_FEREAD
824 StringAppendS("emulated readline,");
825 #else
826 StringAppendS("fgets,");
827 #endif
828 #endif
829#endif
830#ifdef HAVE_PLURAL
831 StringAppendS("Plural,");
832#endif
833#ifdef HAVE_VSPACE
834 #if defined(__GNUC__) && (__GNUC__<9) &&!defined(__clang__)
835 StringAppendS("vspace(1),");
836 #else
837 StringAppendS("vspace(2),");
838 #endif
839#endif
840#ifdef HAVE_DBM
841 StringAppendS("DBM,\n\t");
842#else
843 StringAppendS("\n\t");
844#endif
845#ifdef HAVE_DYNAMIC_LOADING
846 StringAppendS("dynamic modules,");
847#endif
848#ifdef HAVE_DYNANIC_PPROCS
849 StringAppendS("dynamic p_Procs,");
850#endif
851#if YYDEBUG
852 StringAppendS("YYDEBUG=1,");
853#endif
854#ifdef MDEBUG
855 StringAppend("MDEBUG=%d,",MDEBUG);
856#endif
857#ifdef OM_CHECK
858 StringAppend("OM_CHECK=%d,",OM_CHECK);
859#endif
860#ifdef OM_TRACK
861 StringAppend("OM_TRACK=%d,",OM_TRACK);
862#endif
863#ifdef OM_NDEBUG
864 StringAppendS("OM_NDEBUG,");
865#endif
866#ifdef SING_NDEBUG
867 StringAppendS("SING_NDEBUG,");
868#endif
869#ifdef PDEBUG
870 StringAppendS("PDEBUG,");
871#endif
872#ifdef KDEBUG
873 StringAppendS("KDEBUG,");
874#endif
875#ifdef HAVE_SDB
876 StringAppendS("sdb,");
877#endif
878 StringAppendS("\n\t");
879#ifdef __OPTIMIZE__
880 StringAppendS("CC:OPTIMIZE,");
881#endif
882#ifdef __OPTIMIZE_SIZE__
883 StringAppendS("CC:OPTIMIZE_SIZE,");
884#endif
885#ifdef __NO_INLINE__
886 StringAppendS("CC:NO_INLINE,");
887#endif
888#ifdef HAVE_NTL
889 #ifdef NTL_AVOID_BRANCHING
890 #undef HAVE_GENERIC_ADD
891 #endif
892#endif
893#ifdef HAVE_GENERIC_ADD
894 StringAppendS("GenericAdd,");
895#else
896 StringAppendS("AvoidBranching,");
897#endif
898#ifdef HAVE_GENERIC_MULT
899 StringAppendS("GenericMult,");
900#else
901 StringAppendS("TableMult,");
902#endif
903#ifdef HAVE_INVTABLE
904 StringAppendS("invTable,");
905#else
906 StringAppendS("no invTable,");
907#endif
908 StringAppendS("\n\t");
909#ifdef HAVE_EIGENVAL
910 StringAppendS("eigenvalues,");
911#endif
912#ifdef HAVE_GMS
913 StringAppendS("Gauss-Manin system,");
914#endif
915#ifdef HAVE_RATGRING
916 StringAppendS("ratGB,");
917#endif
918 StringAppend("random=%d\n",siRandomStart);
919
920#define SI_SHOW_BUILTIN_MODULE(name) StringAppend(" %s", #name);
921 StringAppendS("built-in modules: {");
923 StringAppendS("}\n");
924#undef SI_SHOW_BUILTIN_MODULE
925
926 StringAppend("AC_CONFIGURE_ARGS = %s,\n"
927 "CC = %s,FLAGS : %s,\n"
928 "CXX = %s,FLAGS : %s,\n"
929 "DEFS : %s,CPPFLAGS : %s,\n"
930 "LDFLAGS : %s,LIBS : %s "
931#ifdef __GNUC__
932 "(ver: " __VERSION__ ")"
933#endif
934 "\n",AC_CONFIGURE_ARGS, CC,CFLAGS " " PTHREAD_CFLAGS,
935 CXX,CXXFLAGS " " PTHREAD_CFLAGS, DEFS,CPPFLAGS, LDFLAGS,
936 LIBS " " PTHREAD_LIBS);
939 StringAppendS("\n");
940 return StringEndS();
941}
#define MAKE_DISTRIBUTION
Definition distrib.h:1
#define VERSION
char * fe_fgets_dummy(const char *, char *, int)
Definition feread.cc:455
char * fe_fgets(const char *pr, char *s, int size)
Definition feread.cc:309
char * fe_fgets_stdin_drl(const char *pr, char *s, int size)
Definition feread.cc:269
char * fe_fgets_stdin_emu(const char *pr, char *s, int size)
Definition feread.cc:253
#define SI_SHOW_BUILTIN_MODULE(name)
#define MDEBUG
Definition mod2.h:180
#define SI_FOREACH_BUILTIN(add)
Data for type_of_LIB to determine built-in modules, use add(name) to add built-in library to macro.
Definition mod_lib.h:17
#define OM_TRACK
#define OM_CHECK
void feStringAppendResources(int warn)
Definition reporter.cc:398

Variable Documentation

◆ currid

const char* currid
extern

Definition at line 171 of file grammar.cc.

◆ dArith1

const struct sValCmd1 dArith1[]
extern

Definition at line 38 of file table.h.

39{
40// operationsi
41// proc cmd res arg context
47#ifdef SINGULAR_4_2
48,{D(jjNUMBER2_OP1),'-', CNUMBER_CMD, CNUMBER_CMD , ALLOW_NC |ALLOW_RING}
49,{D(jjPOLY2_OP1), '-', CPOLY_CMD, CPOLY_CMD , ALLOW_NC |ALLOW_RING}
50#endif
57#ifdef SINGULAR_4_2
59#endif
60,{D(jjPROC1), '(', ANY_TYPE/*set by p*/,PROC_CMD , ALLOW_NC |ALLOW_RING}
61// and the procedures with 1 argument:
78#ifdef SINGULAR_4_2
80#endif
81//,{ jjWRONG , COLS_CMD, 0, VECTOR_CMD , ALLOW_NC |ALLOW_RING}
89#ifdef SINGULAR_4_2
91#endif
92//,{ jjWRONG , COLS_CMD, 0, INTVEC_CMD , ALLOW_NC |ALLOW_RING}
121#ifdef SINGULAR_4_2
123#endif
173,{D(jjKBASE), KBASE_CMD, IDEAL_CMD, IDEAL_CMD , ALLOW_PLURAL |ALLOW_RING|WARN_RING} /*ring-cf: warning at top level*/
174,{D(jjKBASE), KBASE_CMD, MODUL_CMD, MODUL_CMD , ALLOW_PLURAL |ALLOW_RING|WARN_RING} /*ring-cf: warning at top level*/
214#ifdef SINGULAR_4_2
216#endif
230#ifdef SINGULAR_4_2
235#endif
262//,{ jjWRONG , ROWS_CMD, 0, POLY_CMD , ALLOW_NC |ALLOW_RING}
269#ifdef SINGULAR_4_2
271#endif
292//,{ jjWRONG , TRACE_CMD, 0, INTVEC_CMD , ALLOW_NC |ALLOW_RING}
293//,{ jjWRONG , TRACE_CMD, 0, IDEAL_CMD , ALLOW_NC |ALLOW_RING}
299#ifdef SINGULAR_4_2
301#endif
311,{D(jjVDIM), VDIM_CMD, INT_CMD, IDEAL_CMD , ALLOW_NC |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
312,{D(jjVDIM), VDIM_CMD, INT_CMD, MODUL_CMD , ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
322,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
323};
BOOLEAN atKILLATTR1(leftv, leftv a)
Definition attrib.cc:476
BOOLEAN atATTRIB1(leftv res, leftv v)
Definition attrib.cc:234
BOOLEAN findUniProc(leftv result, leftv first)
Definition fglm.cc:541
#define NO_ZERODIVISOR
Definition gentable.cc:42
#define ALLOW_ZZ
Definition gentable.cc:46
#define ALLOW_RING
Definition gentable.cc:38
#define NO_LRING
Definition gentable.cc:54
#define ALLOW_LP
Definition gentable.cc:33
#define NO_RING
Definition gentable.cc:39
#define D(A)
Definition gentable.cc:128
#define WARN_RING
Definition gentable.cc:49
#define ALLOW_NC
Definition gentable.cc:35
#define ALLOW_PLURAL
Definition gentable.cc:30
#define NO_NC
Definition gentable.cc:29
#define NULL_VAL
Definition gentable.cc:129
@ NOT
Definition grammar.cc:272
@ PAR_CMD
Definition grammar.cc:303
@ PREIMAGE_CMD
Definition grammar.cc:304
@ SETRING_CMD
Definition grammar.cc:330
@ MONOM_CMD
Definition grammar.cc:302
@ VAR_CMD
Definition grammar.cc:305
@ MAXID_CMD
Definition grammar.cc:301
@ E_CMD
Definition grammar.cc:295
@ FREEMODULE_CMD
Definition grammar.cc:297
@ BETTI_CMD
Definition grammar.cc:294
static BOOLEAN jjUMINUS_MA(leftv res, leftv u)
Definition iparith.cc:3819
static BOOLEAN jjRANK1(leftv res, leftv v)
Definition iparith.cc:4949
static BOOLEAN jjIMPART(leftv res, leftv v)
Definition iparith.cc:4446
static BOOLEAN jjIm2Iv(leftv res, leftv v)
Definition iparith.cc:4439
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
Definition iparith.cc:3825
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
Definition iparith.cc:5291
BOOLEAN jjWAITALL1(leftv res, leftv u)
Definition iparith.cc:5532
static BOOLEAN jjRESTART(leftv, leftv u)
Definition iparith.cc:8942
static BOOLEAN jjidHead(leftv res, leftv v)
Definition iparith.cc:5694
static BOOLEAN jjHILBERT(leftv, leftv v)
Definition iparith.cc:4330
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
Definition iparith.cc:4605
static BOOLEAN jjstrlen(leftv res, leftv v)
Definition iparith.cc:5659
static BOOLEAN jjDET_BI(leftv res, leftv v)
Definition iparith.cc:4087
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
Definition iparith.cc:5517
static BOOLEAN jjP2I(leftv res, leftv v)
Definition iparith.cc:4863
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
Definition iparith.cc:4473
static BOOLEAN jjREPART(leftv res, leftv v)
Definition iparith.cc:4965
static BOOLEAN jjN2BI(leftv res, leftv v)
Definition iparith.cc:4746
static BOOLEAN jjCHAR(leftv res, leftv v)
Definition iparith.cc:3934
static BOOLEAN jjROWS_IV(leftv res, leftv v)
Definition iparith.cc:5010
static BOOLEAN jjNULL(leftv, leftv)
Definition iparith.cc:3769
static BOOLEAN jjBIV2IV(leftv res, leftv v)
Definition iparith.cc:4464
static BOOLEAN jjDIM(leftv res, leftv v)
Definition iparith.cc:4143
static BOOLEAN jjCOUNT_BIM(leftv res, leftv v)
Definition iparith.cc:3974
static BOOLEAN jjCOLS_IV(leftv res, leftv v)
Definition iparith.cc:3956
static BOOLEAN jjNAMES_I(leftv res, leftv v)
Definition iparith.cc:4776
static BOOLEAN jjMULT(leftv res, leftv v)
Definition iparith.cc:4726
static BOOLEAN jjPARDEG(leftv res, leftv v)
Definition iparith.cc:4819
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number.
Definition iparith.cc:4064
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
Definition iparith.cc:4403
static BOOLEAN jjmpTransp(leftv res, leftv v)
Definition iparith.cc:5722
static BOOLEAN jjDET_S(leftv res, leftv v)
Definition iparith.cc:4137
static BOOLEAN jjL2R(leftv res, leftv v)
Definition iparith.cc:4565
static BOOLEAN jjrCharStr(leftv res, leftv v)
Definition iparith.cc:5684
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
Definition iparith.cc:4343
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
Definition iparith.cc:4422
static BOOLEAN jjINDEPSET(leftv res, leftv v)
Definition iparith.cc:4451
static BOOLEAN jjTYPEOF(leftv res, leftv v)
Definition iparith.cc:5405
static BOOLEAN jjFACSTD(leftv res, leftv v)
Definition iparith.cc:4206
static BOOLEAN jjMEMORY(leftv res, leftv v)
Definition iparith.cc:4681
static BOOLEAN jjidTransp(leftv res, leftv v)
Definition iparith.cc:5752
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
Definition iparith.cc:3832
static BOOLEAN jjDIM_R(leftv res, leftv v)
Definition iparith.cc:5747
static BOOLEAN jjDUMP(leftv, leftv v)
Definition iparith.cc:4171
static BOOLEAN jjpMaxComp(leftv res, leftv v)
Definition iparith.cc:5712
static BOOLEAN jjCOEFFS1(leftv res, leftv v)
Definition iparith.cc:3939
static BOOLEAN jjNAMEOF(leftv res, leftv v)
Definition iparith.cc:4758
static BOOLEAN jjPRIME(leftv res, leftv v)
Definition iparith.cc:4881
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
Definition iparith.cc:5679
static BOOLEAN jjJACOB_P(leftv res, leftv v)
Definition iparith.cc:4489
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
Definition iparith.cc:5178
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
Definition iparith.cc:3930
static BOOLEAN jjINTERRED(leftv res, leftv v)
Definition iparith.cc:4457
static BOOLEAN jjJACOB_M(leftv res, leftv a)
Definition iparith.cc:4520
static BOOLEAN jjBAREISS(leftv res, leftv v)
Definition iparith.cc:3864
static BOOLEAN jjREAD(leftv res, leftv v)
Definition iparith.cc:4956
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
Definition iparith.cc:4478
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
Definition iparith.cc:5005
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
Definition iparith.cc:5025
static BOOLEAN jjMSTD(leftv res, leftv v)
Definition iparith.cc:4711
static BOOLEAN jjnInt(leftv res, leftv u)
Definition iparith.cc:5757
static BOOLEAN jjREGULARITY(leftv res, leftv v)
Definition iparith.cc:4960
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
Definition iparith.cc:5276
static BOOLEAN jjMONOM(leftv res, leftv v)
Definition iparith.cc:2779
static BOOLEAN jjSort_Id(leftv res, leftv v)
Definition iparith.cc:5173
static BOOLEAN jjidMinBase(leftv res, leftv v)
Definition iparith.cc:5700
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
Definition iparith.cc:4875
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
Definition iparith.cc:4386
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
Definition iparith.cc:3969
static BOOLEAN jjKERNEL_M(leftv res, leftv v)
Definition iparith.cc:4541
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
Definition iparith.cc:3951
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
Definition iparith.cc:4412
static BOOLEAN jjEXECUTE(leftv, leftv v)
Definition iparith.cc:4197
static BOOLEAN jjLEADEXP(leftv res, leftv v)
Definition iparith.cc:4587
static BOOLEAN jjDEG_M(leftv res, leftv u)
Definition iparith.cc:4024
static BOOLEAN jjPAR1(leftv res, leftv v)
Definition iparith.cc:4803
static BOOLEAN jjnlInt(leftv res, leftv u)
Definition iparith.cc:5764
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
Definition iparith.cc:3783
static BOOLEAN jjROWS(leftv res, leftv v)
Definition iparith.cc:4999
static BOOLEAN jjSBA(leftv res, leftv v)
Definition iparith.cc:5067
static BOOLEAN jjJanetBasis(leftv res, leftv v)
Definition iparith.cc:2541
static BOOLEAN jjKBASE(leftv res, leftv v)
Definition iparith.cc:4559
static BOOLEAN jjmpTrace(leftv res, leftv v)
Definition iparith.cc:5717
static BOOLEAN jjPRUNE(leftv res, leftv v)
Definition iparith.cc:4887
static BOOLEAN jjDEFINED(leftv res, leftv v)
Definition iparith.cc:4052
static BOOLEAN jjLagSolve(leftv res, leftv v)
Definition iparith.cc:4642
static BOOLEAN jjVDIM(leftv res, leftv v)
Definition iparith.cc:5490
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
Definition iparith.cc:3980
static BOOLEAN jjP2N(leftv res, leftv v)
Definition iparith.cc:4911
static BOOLEAN jjE(leftv res, leftv v)
Definition iparith.cc:4185
static BOOLEAN jjLISTRING(leftv res, leftv v)
Definition iparith.cc:4624
static BOOLEAN jjVAR1(leftv res, leftv v)
Definition iparith.cc:5456
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
Definition iparith.cc:4573
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
Definition iparith.cc:3795
static BOOLEAN jjpLength(leftv res, leftv v)
Definition iparith.cc:5664
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
Definition iparith.cc:4484
static BOOLEAN jjBI2P(leftv res, leftv u)
Definition iparith.cc:3915
static BOOLEAN jjTWOSTD(leftv res, leftv a)
Definition iparith.cc:5325
static BOOLEAN jjFAC_P(leftv res, leftv u)
Definition iparith.cc:4246
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
Definition iparith.cc:5281
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
Definition iparith.cc:5742
static BOOLEAN jjrOrdStr(leftv res, leftv v)
Definition iparith.cc:5727
static BOOLEAN jjpHead(leftv res, leftv v)
Definition iparith.cc:5689
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
Definition iparith.cc:3985
static BOOLEAN jjDET_I(leftv res, leftv v)
Definition iparith.cc:4123
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
Definition iparith.cc:4002
static BOOLEAN jjrVarStr(leftv res, leftv v)
Definition iparith.cc:5732
static BOOLEAN jjMONITOR1(leftv res, leftv v)
Definition iparith.cc:2734
static BOOLEAN jjUMINUS_N(leftv res, leftv u)
Definition iparith.cc:3807
static BOOLEAN jjNUMERATOR(leftv res, leftv v)
Return the numerator of the input number.
Definition iparith.cc:4073
static BOOLEAN jjORD(leftv res, leftv v)
Definition iparith.cc:4797
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
Definition iparith.cc:3802
static BOOLEAN jjENVELOPE(leftv res, leftv a)
Definition iparith.cc:5310
static BOOLEAN jjSetRing(leftv, leftv u)
Definition iparith.cc:3840
static BOOLEAN jjMINRES_R(leftv res, leftv v)
Definition iparith.cc:4732
static BOOLEAN jjCOLS(leftv res, leftv v)
Definition iparith.cc:3946
static BOOLEAN jjP2BI(leftv res, leftv v)
Definition iparith.cc:4843
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
Definition iparith.cc:5286
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
Definition iparith.cc:5451
static BOOLEAN jjBAREISS_BIM(leftv res, leftv v)
Definition iparith.cc:3887
static BOOLEAN jjPFAC1(leftv res, leftv v)
Definition iparith.cc:4633
static BOOLEAN jjCONTENT(leftv res, leftv v)
Definition iparith.cc:3961
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5145
static BOOLEAN jjCOUNT_IV(leftv res, leftv v)
Definition iparith.cc:3997
static BOOLEAN jjDUMMY(leftv res, leftv u)
Definition iparith.cc:3762
static BOOLEAN jjS2I(leftv res, leftv v)
Definition iparith.cc:5020
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3894
static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
Definition iparith.cc:5344
static BOOLEAN jjGETDUMP(leftv, leftv v)
Definition iparith.cc:4262
static BOOLEAN jjidFreeModule(leftv res, leftv v)
Definition iparith.cc:5674
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
Definition iparith.cc:4927
static BOOLEAN jjRPAR(leftv res, leftv v)
Definition iparith.cc:5015
static BOOLEAN jjLOAD1(leftv, leftv v)
Definition iparith.cc:4620
static BOOLEAN jjKERNEL_SM(leftv res, leftv v)
Definition iparith.cc:4550
static BOOLEAN jjrParStr(leftv res, leftv v)
Definition iparith.cc:5737
static BOOLEAN jjDEG(leftv res, leftv v)
Definition iparith.cc:4016
static BOOLEAN jjRINGLIST(leftv res, leftv v)
Definition iparith.cc:4970
static BOOLEAN jjidElem(leftv res, leftv v)
Definition iparith.cc:5669
static BOOLEAN jjBI2IM(leftv res, leftv u)
Definition iparith.cc:3909
static BOOLEAN jjDEGREE(leftv res, leftv v)
Definition iparith.cc:4035
static BOOLEAN jjOpenClose(leftv, leftv v)
Definition iparith.cc:4791
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
Definition iparith.cc:3814
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
Definition iparith.cc:4283
static BOOLEAN jjNAMES(leftv res, leftv v)
Definition iparith.cc:4771
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
Definition iparith.cc:4276
static BOOLEAN jjPROC1(leftv res, leftv u)
Definition iparith.cc:3860
static BOOLEAN jjNOT(leftv res, leftv v)
Definition iparith.cc:4781
static BOOLEAN jjPARSTR1(leftv res, leftv v)
Definition iparith.cc:4825
static BOOLEAN jjHOMOG1(leftv res, leftv v)
Definition iparith.cc:4353
static BOOLEAN jjDET(leftv res, leftv v)
Definition iparith.cc:4081
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
Definition iparith.cc:3991
static BOOLEAN jjRING_LIST(leftv res, leftv v)
Definition iparith.cc:4992
static BOOLEAN jjVARSTR1(leftv res, leftv v)
Definition iparith.cc:5473
static BOOLEAN jjSYZYGY(leftv res, leftv v)
Definition iparith.cc:5205
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
Definition iparith.cc:4651
static BOOLEAN jjNVARS(leftv res, leftv v)
Definition iparith.cc:4786
static BOOLEAN jjERROR(leftv, leftv u)
Definition iparith.cc:1997
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
Definition iparith.cc:4985
BOOLEAN jjPRINT(leftv res, leftv u)
Definition ipprint.cc:252
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
Definition ipshell.cc:6303
BOOLEAN jjMINRES(leftv res, leftv v)
Definition ipshell.cc:950
BOOLEAN syBetti1(leftv res, leftv u)
Definition ipshell.cc:3160
BOOLEAN jjCHARSERIES(leftv res, leftv u)
Definition ipshell.cc:3343
BOOLEAN mpJacobi(leftv res, leftv a)
Definition ipshell.cc:3058
BOOLEAN kWeight(leftv res, leftv id)
Definition ipshell.cc:3291
BOOLEAN kQHWeight(leftv res, leftv v)
Definition ipshell.cc:3319
BOOLEAN jjBETTI(leftv res, leftv u)
Definition ipshell.cc:971
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
Definition ipshell.cc:6311
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
Definition ipshell.cc:4559
BOOLEAN jjR2_CR(leftv res, leftv a)
Definition number2.cc:132
@ ERROR_CMD
Definition tok.h:72
@ PFAC_CMD
Definition tok.h:154
@ PARSTR_CMD
Definition tok.h:153
@ HIGHCORNER_CMD
Definition tok.h:88
@ REPART_CMD
Definition tok.h:168
@ VARIABLES_CMD
Definition tok.h:201
@ JACOB_CMD
Definition tok.h:103
@ MSTD_CMD
Definition tok.h:133
@ INDEPSET_CMD
Definition tok.h:94
@ RESTART_CMD
Definition tok.h:172
@ BAREISS_CMD
Definition tok.h:37
@ DEG_CMD
Definition tok.h:60
@ READ_CMD
Definition tok.h:165
@ CLOSE_CMD
Definition tok.h:49
@ SLIM_GB_CMD
Definition tok.h:181
@ COUNT_CMD
Definition tok.h:55
@ MULTIPLICITY_CMD
Definition tok.h:134
@ NAMES_CMD
Definition tok.h:136
@ HILBERT_CMD
Definition tok.h:89
@ RIGHTSTD_CMD
Definition tok.h:174
@ HOMOG_CMD
Definition tok.h:90
@ NVARS_CMD
Definition tok.h:143
@ MEMORY_CMD
Definition tok.h:124
@ NEWTONPOLY_CMD
Definition tok.h:140
@ KBASE_CMD
Definition tok.h:106
@ ATTRIB_CMD
Definition tok.h:36
@ CHARSTR_CMD
Definition tok.h:43
@ JANET_CMD
Definition tok.h:104
@ OPTION_CMD
Definition tok.h:148
@ OPEN_CMD
Definition tok.h:145
@ COEFFS_CMD
Definition tok.h:50
@ LEADEXP_CMD
Definition tok.h:113
@ CNUMBER_CMD
Definition tok.h:47
@ TRANSPOSE_CMD
Definition tok.h:193
@ STD_CMD
Definition tok.h:186
@ SBA_CMD
Definition tok.h:178
@ WAITALL_CMD
Definition tok.h:205
@ EXECUTE_CMD
Definition tok.h:73
@ DET_CMD
Definition tok.h:64
@ RING_LIST_CMD
Definition tok.h:176
@ NUMERATOR_CMD
Definition tok.h:142
@ ORD_CMD
Definition tok.h:144
@ PRINT_CMD
Definition tok.h:156
@ UNIVARIATE_CMD
Definition tok.h:197
@ PARDEG_CMD
Definition tok.h:151
@ NPARS_CMD
Definition tok.h:141
@ PARENT_CMD
Definition tok.h:152
@ PRIME_CMD
Definition tok.h:155
@ LEADCOEF_CMD
Definition tok.h:112
@ IMPART_CMD
Definition tok.h:92
@ NAMEOF_CMD
Definition tok.h:135
@ TYPEOF_CMD
Definition tok.h:196
@ KILLATTR_CMD
Definition tok.h:108
@ REGULARITY_CMD
Definition tok.h:167
@ WAIT1ST_CMD
Definition tok.h:204
@ CONTENT_CMD
Definition tok.h:53
@ DEGREE_CMD
Definition tok.h:61
@ OPPOSITE_CMD
Definition tok.h:147
@ GETDUMP_CMD
Definition tok.h:87
@ WEIGHT_CMD
Definition tok.h:207
@ MONITOR_CMD
Definition tok.h:129
@ VARSTR_CMD
Definition tok.h:202
@ PRUNE_CMD
Definition tok.h:157
@ DUMP_CMD
Definition tok.h:68
@ ENVELOPE_CMD
Definition tok.h:71
@ INTERRED_CMD
Definition tok.h:99
@ SQR_FREE_CMD
Definition tok.h:183
@ SORTVEC_CMD
Definition tok.h:182
@ FACSTD_CMD
Definition tok.h:79
@ QHWEIGHT_CMD
Definition tok.h:159
@ RINGLIST_CMD
Definition tok.h:175
@ LEAD_CMD
Definition tok.h:111
@ ORDSTR_CMD
Definition tok.h:149
@ LOAD_CMD
Definition tok.h:119
@ DENOMINATOR_CMD
Definition tok.h:63
@ TWOSTD_CMD
Definition tok.h:195
@ FINDUNI_CMD
Definition tok.h:85
@ CPOLY_CMD
Definition tok.h:48
@ TRACE_CMD
Definition tok.h:194
@ KERNEL_CMD
Definition tok.h:107
@ VDIM_CMD
Definition tok.h:203
@ MINBASE_CMD
Definition tok.h:125
@ SYZYGY_CMD
Definition tok.h:190
@ LEADMONOM_CMD
Definition tok.h:114
@ DIM_CMD
Definition tok.h:66
@ ROWS_CMD
Definition tok.h:177
@ RESERVEDNAME_CMD
Definition tok.h:170
@ DEFINED_CMD
Definition tok.h:59
@ IS_RINGVAR
Definition tok.h:102
@ CHARACTERISTIC_CMD
Definition tok.h:42
@ LU_CMD
Definition tok.h:121
@ COLS_CMD
Definition tok.h:52
@ FAC_CMD
Definition tok.h:76
@ MINRES_CMD
Definition tok.h:127
@ LAGSOLVE_CMD
Definition tok.h:110
@ CHAR_SERIES_CMD
Definition tok.h:44
@ RANK_CMD
Definition tok.h:164

◆ dArith2

const struct sValCmd2 dArith2[]
extern

Definition at line 325 of file table.h.

326{
327// operations:
328// proc cmd res arg1 arg2 context
358#ifdef SINGULAR_4_2
359,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
360,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, DEF_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
361,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, CNUMBER_CMD,DEF_CMD, ALLOW_NC | ALLOW_RING}
362,{D(jjPOLY2_OP2), '+', CPOLY_CMD, CPOLY_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
363,{D(jjPOLY2_OP2), '+', CPOLY_CMD, DEF_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
365#endif
394#ifdef SINGULAR_4_2
395,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NALLOW_NC | ALLOW_RING}
396,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
397,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
398,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
399,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
400,{D(jjPOLY2_OP2), '-', CPOLY_CMD, CPOLY_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
401,{D(jjPOLY2_OP2), '-', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
402,{D(jjPOLY2_OP2), '-', CPOLY_CMD, INT_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
404#endif
450#ifdef SINGULAR_4_2
451,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
452,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
453,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
454,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
455,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
456,{D(jjPOLY2_OP2), '*', CPOLY_CMD, CPOLY_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
457,{D(jjPOLY2_OP2), '*', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
458,{D(jjPOLY2_OP2), '*', CPOLY_CMD, INT_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
460#endif
472#ifdef SINGULAR_4_2
473,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
474,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
475,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
476,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
477,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
478#endif
491#ifdef SINGULAR_4_2
492,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
493,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
494,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
495,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
496,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
497#endif
503#ifdef SINGULAR_4_2
504,{D(jjNUMBER2_POW),'^', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
505,{D(jjPOLY2_POW), '^', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_PLURAL | ALLOW_RING}
506#endif
558#ifdef SINGULAR_4_2
560#endif
599,{D(jjINDEX_I), '[', ANY_TYPE/*set by p*/,LIST_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
607,{D(jjPROC), '(', ANY_TYPE/*set by p*/,PROC_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
608,{D(jjMAP), '(', ANY_TYPE/*set by p*/,MAP_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
610,{D(jjKLAMMER), '(', ANY_TYPE/*set by p*/,ANY_TYPE, INT_CMD, ALLOW_NC | ALLOW_RING}
613// and the procedures with 2 arguments:
621#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
623#endif
625//,{D(jjCHINREM_P), CHINREM_CMD, POLY_CMD, LIST_CMD, INTVEC_CMD, ALLOW_PLURAL}
628#ifdef SINGULAR_4_2
632#endif
712,{D(jjKBASE2), KBASE_CMD, IDEAL_CMD, IDEAL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
713,{D(jjKBASE2), KBASE_CMD, MODUL_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
730//,{D(jjRES), MRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
731//,{D(jjRES), MRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
734#ifdef SINGULAR_4_2
739#endif
742#ifdef HAVE_PLURAL
752#endif
779//,{D(jjRES), SRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
780//,{D(jjRES), SRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
798,{NULL_VAL, 0, 0, 0, 0, NO_NC |NO_RING}
799};
BOOLEAN atKILLATTR2(leftv, leftv a, leftv b)
Definition attrib.cc:493
BOOLEAN atATTRIB2(leftv res, leftv v, leftv b)
Definition attrib.cc:282
BOOLEAN fglmProc(leftv result, leftv first, leftv second)
Definition fglm.cc:277
BOOLEAN fglmQuotProc(leftv result, leftv first, leftv second)
Definition fglm.cc:411
#define jjWRONG2
Definition gentable.cc:125
@ BUCKET_CMD
Definition grammar.cc:284
@ KOSZUL_CMD
Definition grammar.cc:300
@ IMAP_CMD
Definition grammar.cc:299
@ LIB_CMD
Definition grammar.cc:328
@ FETCH_CMD
Definition grammar.cc:296
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:243
static BOOLEAN jjINDEX_V_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1522
static BOOLEAN jjQUOT(leftv res, leftv u, leftv v)
Definition iparith.cc:3099
static BOOLEAN jjTIMES_MA_P1(leftv res, leftv u, leftv v)
Definition iparith.cc:1098
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:279
static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2046
static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
Definition iparith.cc:332
static BOOLEAN jjTIMES_MA_BI2(leftv res, leftv u, leftv v)
Definition iparith.cc:1094
static BOOLEAN jjMAP(leftv res, leftv u, leftv v)
Definition iparith.cc:1651
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1182
static BOOLEAN jjOP_I_IM(leftv res, leftv u, leftv v)
Definition iparith.cc:315
static BOOLEAN jjLIFTSTD(leftv res, leftv u, leftv v)
Definition iparith.cc:2605
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
Definition iparith.cc:2803
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2738
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
Definition iparith.cc:2914
static BOOLEAN jjHOMOG1_WI(leftv res, leftv v, leftv u)
Definition iparith.cc:2503
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
Definition iparith.cc:3106
static BOOLEAN jjDIVISION(leftv res, leftv u, leftv v)
Definition iparith.cc:1952
static BOOLEAN jjOP_I_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:296
static BOOLEAN jjEQUAL_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1321
static BOOLEAN jjMINUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:908
static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
Definition iparith.cc:2585
static BOOLEAN jjTIMES_MA_N2(leftv res, leftv u, leftv v)
Definition iparith.cc:1123
static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2874
static BOOLEAN jjTIMES_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1150
static BOOLEAN jjMOD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2693
static BOOLEAN jjTIMES_MA_I2(leftv res, leftv u, leftv v)
Definition iparith.cc:1132
static BOOLEAN jjSTATUS2L(leftv res, leftv u, leftv v)
Definition iparith.cc:3433
static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1189
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition iparith.cc:3285
static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1327
static BOOLEAN jjTIMES_MA_P2(leftv res, leftv u, leftv v)
Definition iparith.cc:1107
static BOOLEAN jjSBA_1(leftv res, leftv v, leftv u)
Definition iparith.cc:5093
static BOOLEAN jjPLUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:823
static BOOLEAN jjMINUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:903
static BOOLEAN jjTIMES_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1053
static BOOLEAN jjLT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1221
static BOOLEAN jjMINUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:951
static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2018
static BOOLEAN jjDelete_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1867
static BOOLEAN jjLE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1208
static BOOLEAN jjCOMPARE_S(leftv res, leftv u, leftv v)
Definition iparith.cc:478
static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1383
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition iparith.cc:1127
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition iparith.cc:1116
static BOOLEAN jjMINUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:941
static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:3381
static BOOLEAN jjMINUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:898
static BOOLEAN jjDEG_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1846
static BOOLEAN jjMINUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:931
static BOOLEAN jjHOMOG_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2444
static BOOLEAN jjLE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1199
static BOOLEAN jjPLUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:794
static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2894
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2817
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
Definition iparith.cc:2573
static BOOLEAN jjTIMES_N(leftv res, leftv u, leftv v)
Definition iparith.cc:996
static BOOLEAN jjTIMES_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:1136
static BOOLEAN jjTIMES_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1060
static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:754
static BOOLEAN jjREDUCE_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3147
static BOOLEAN jjCOEF(leftv res, leftv u, leftv v)
Definition iparith.cc:1791
static BOOLEAN jjDEG_M_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1835
static BOOLEAN jjPLUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:803
static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
Definition iparith.cc:4501
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1176
static BOOLEAN jjEQUAL_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1339
static BOOLEAN jjINTERPOLATION(leftv res, leftv l, leftv v)
Definition iparith.cc:2523
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3344
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3139
static BOOLEAN jjDIV_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1292
static BOOLEAN jjMODULO(leftv res, leftv u, leftv v)
Definition iparith.cc:2640
static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:338
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition iparith.cc:3123
static BOOLEAN jjFAREY_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2143
static BOOLEAN jjPLUS_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:872
static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2383
static BOOLEAN jjELIMIN(leftv res, leftv u, leftv v)
Definition iparith.cc:1972
static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1680
static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2551
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:300
static BOOLEAN jjTENSOR(leftv res, leftv u, leftv v)
Definition iparith.cc:3629
static BOOLEAN jjFWALK(leftv res, leftv u, leftv v)
Definition iparith.cc:2357
static BOOLEAN jjDIFF_ID_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1930
static BOOLEAN jjSYZ_2(leftv res, leftv u, leftv v)
Definition iparith.cc:3566
static BOOLEAN jjRING_1(leftv res, leftv u, leftv v)
Definition iparith.cc:1671
static BOOLEAN jjOP_I_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:258
static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v)
Definition iparith.cc:2406
static BOOLEAN jjFIND2(leftv res, leftv u, leftv v)
Definition iparith.cc:2292
static BOOLEAN jjCOEF_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1798
static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:624
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition iparith.cc:1084
static BOOLEAN jjCOEFFS2_KB(leftv res, leftv u, leftv v)
Definition iparith.cc:1816
static BOOLEAN jjVARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:3655
static BOOLEAN jjPLUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:771
static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1216
static BOOLEAN jjEXTGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2004
static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2363
static BOOLEAN jjCONTRACT(leftv res, leftv u, leftv v)
Definition iparith.cc:1830
static BOOLEAN jjFAREY_LI(leftv res, leftv u, leftv v)
Definition iparith.cc:10393
static BOOLEAN jjDelete_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1860
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1164
static BOOLEAN jjKERNEL(leftv res, leftv u, leftv v)
Definition iparith.cc:2569
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2704
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
Definition iparith.cc:2629
static BOOLEAN jjEQUAL_R(leftv res, leftv u, leftv v)
Definition iparith.cc:1345
static BOOLEAN jjINTERSECT(leftv res, leftv u, leftv v)
Definition iparith.cc:2517
static BOOLEAN jjOP_BI_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:275
static BOOLEAN jjDIFF_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1908
static BOOLEAN jjMINUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:918
static BOOLEAN jjRSUM(leftv res, leftv u, leftv v)
Definition iparith.cc:3330
static BOOLEAN jjINDEX_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1388
static BOOLEAN jjPOWER_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:567
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1570
static BOOLEAN jjFETCH(leftv res, leftv u, leftv v)
Definition iparith.cc:2164
static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
Definition iparith.cc:3482
static BOOLEAN jjTIMES_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1006
static BOOLEAN jjPLUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:835
static BOOLEAN jjMINUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:893
static BOOLEAN jjTIMES_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:989
static BOOLEAN jjFACSTD2(leftv res, leftv v, leftv w)
Definition iparith.cc:2110
static BOOLEAN jjEXPORTTO(leftv, leftv u, leftv v)
Definition iparith.cc:1992
static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2834
static BOOLEAN jjDIV_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1274
static BOOLEAN jjKBASE2(leftv res, leftv u, leftv v)
Definition iparith.cc:2556
static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
Definition iparith.cc:521
static BOOLEAN jjRES(leftv res, leftv u, leftv v)
Definition iparith.cc:3156
static BOOLEAN jjPLUS_P_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:858
static BOOLEAN jjPLUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:813
static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1171
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1194
static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
Definition iparith.cc:3740
static BOOLEAN jjCOMPARE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:451
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition iparith.cc:847
static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3439
static BOOLEAN jjELIMIN_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1978
static BOOLEAN jjDIFF_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1919
static BOOLEAN jjTIMES_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:1072
static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
Definition iparith.cc:977
static BOOLEAN jjDIV_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1261
static BOOLEAN jjFRES(leftv res, leftv u, leftv v)
Definition iparith.cc:2347
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition iparith.cc:1558
static BOOLEAN jjCOMPARE_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:423
static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2132
static BOOLEAN jjCOMPARE_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:396
static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1225
static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1203
static BOOLEAN jjTENSOR_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:3636
static BOOLEAN jjRMINUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3311
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition iparith.cc:1615
static BOOLEAN jjPLUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:766
static BOOLEAN jjDET2(leftv res, leftv u, leftv v)
Definition iparith.cc:1894
static BOOLEAN jjSTD_HILB(leftv res, leftv u, leftv v)
Definition iparith.cc:3455
static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1378
static BOOLEAN jjINDEX_P_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1486
static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
Definition iparith.cc:2535
static BOOLEAN jjCOLON(leftv res, leftv u, leftv v)
Definition iparith.cc:319
static BOOLEAN jjRPLUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3317
static BOOLEAN jjCOLCOL(leftv res, leftv u, leftv v)
Definition iparith.cc:692
static BOOLEAN jjFAC_P2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:2063
static BOOLEAN jjHOMOG_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2461
static BOOLEAN jjINDEX_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1515
static BOOLEAN jjDIM2(leftv res, leftv v, leftv w)
Definition iparith.cc:1935
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:262
static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2376
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
Definition iparith.cc:3114
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
Definition iparith.cc:2510
static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
Definition iparith.cc:3692
static BOOLEAN jjMINUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:964
static BOOLEAN jjINDEX_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1446
static BOOLEAN jjEQUAL_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1333
static BOOLEAN jjLOAD2(leftv, leftv, leftv v)
Definition iparith.cc:2625
static BOOLEAN jjALIGN_M(leftv res, leftv u, leftv v)
Definition iparith.cc:1777
static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
Definition iparith.cc:3668
static BOOLEAN jjDIV_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1248
static BOOLEAN jjCOMPARE_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:366
static BOOLEAN jjEQUAL_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1351
static BOOLEAN jjDelete_ID_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1874
static BOOLEAN jjDET2_S(leftv res, leftv u, leftv v)
Definition iparith.cc:1901
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1805
static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b)
Definition iparith.cc:2982
static BOOLEAN jjMOD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2715
static BOOLEAN jjPLUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:781
static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2400
static BOOLEAN jjPLUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:776
static BOOLEAN jjKoszul_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:2577
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:10194
static BOOLEAN jjPLUS_S(leftv res, leftv u, leftv v)
Definition iparith.cc:862
static BOOLEAN jjHOMOG1_W(leftv res, leftv v, leftv u)
Definition iparith.cc:2483
static BOOLEAN jjINDEX_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1410
static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:877
static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2546
static BOOLEAN jjPRUNE_MAP(leftv res, leftv v, leftv ma)
Definition iparith.cc:3055
static BOOLEAN jjLT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1212
static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
Definition iparith.cc:601
static BOOLEAN jjINDEX_PBu(leftv res, leftv u, leftv v)
Definition iparith.cc:1463
static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
Definition iparith.cc:583
static BOOLEAN jjEQUAL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1357
static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2854
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3428
static BOOLEAN jjALIGN_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1767
BOOLEAN jjIMPORTFROM(leftv, leftv u, leftv v)
Definition ipassign.cc:2510
BOOLEAN jjPRINT_FORMAT(leftv res, leftv u, leftv v)
Definition ipprint.cc:391
BOOLEAN lDelete(leftv res, leftv u, leftv v)
Definition lists.cc:161
BOOLEAN lAdd(leftv res, leftv u, leftv v)
Definition lists.cc:51
BOOLEAN lDeleteIV(leftv res, leftv u, leftv v)
Definition lists.cc:192
BOOLEAN lInsert(leftv res, leftv u, leftv v)
Definition lists.cc:120
BOOLEAN nuMPResMat(leftv res, leftv arg1, leftv arg2)
returns module representing the multipolynomial resultant matrix Arguments 2: ideal i,...
Definition ipshell.cc:4651
BOOLEAN jjCRING_Zp(leftv res, leftv a, leftv b)
Definition number2.cc:35
BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b)
Definition number2.cc:123
BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b)
Definition number2.cc:88
@ ELIMINATION_CMD
Definition tok.h:69
@ NCALGEBRA_CMD
Definition tok.h:138
@ SIMPLIFY_CMD
Definition tok.h:180
@ FGLMQUOT_CMD
Definition tok.h:84
@ RANDOM_CMD
Definition tok.h:163
@ FWALK_CMD
Definition tok.h:82
@ MODULO_CMD
Definition tok.h:128
@ JET_CMD
Definition tok.h:105
@ DIFF_CMD
Definition tok.h:65
@ LRES_CMD
Definition tok.h:120
@ IMPORTFROM_CMD
Definition tok.h:93
@ HRES_CMD
Definition tok.h:91
@ REDUCE_CMD
Definition tok.h:166
@ LIFTSTD_CMD
Definition tok.h:115
@ KRES_CMD
Definition tok.h:109
@ CONTRACT_CMD
Definition tok.h:54
@ LIFT_CMD
Definition tok.h:116
@ BRACKET_CMD
Definition tok.h:40
@ CHINREM_CMD
Definition tok.h:45
@ NC_ALGEBRA_CMD
Definition tok.h:139
@ MPRES_CMD
Definition tok.h:130
@ MRES_CMD
Definition tok.h:131
@ DIVISION_CMD
Definition tok.h:67
@ EXPORTTO_CMD
Definition tok.h:74
@ PRUNE_MAP_CMD
Definition tok.h:158
@ SRES_CMD
Definition tok.h:184
@ ALIGN_CMD
Definition tok.h:35
@ STATUS_CMD
Definition tok.h:185
@ FIND_CMD
Definition tok.h:78
@ COEF_CMD
Definition tok.h:51
@ WEDGE_CMD
Definition tok.h:206
@ DELETE_CMD
Definition tok.h:62
@ INTDIV_CMD
Definition tok.h:97
@ QUOTIENT_CMD
Definition tok.h:162
@ INTERSECT_CMD
Definition tok.h:100
@ INSERT_CMD
Definition tok.h:95
@ EXTGCD_CMD
Definition tok.h:75
@ GCD_CMD
Definition tok.h:86
@ FAREY_CMD
Definition tok.h:77
@ INTERPOLATE_CMD
Definition tok.h:98
@ NEWSTRUCT_CMD
Definition tok.h:137
@ OPPOSE_CMD
Definition tok.h:146
@ TENSOR_CMD
Definition tok.h:191
@ FRES_CMD
Definition tok.h:81
@ FGLM_CMD
Definition tok.h:83
@ RES_CMD
Definition tok.h:169

◆ dArith3

const struct sValCmd3 dArith3[]
extern

Definition at line 801 of file table.h.

802{
803// operations:
804// proc cmd res arg1 arg2 arg3 context
820#ifdef SINGULAR_4_2
822#endif
826#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
828#endif
835#ifdef SINGULAR_4_2
837#endif
888#ifdef OLD_RES
891#endif
895#ifdef SINGULAR_4_2
897#endif
908#ifdef OLD_RES
911#endif
914#ifdef OLD_RES
917#endif
933,{NULL_VAL, 0, 0, 0, 0, 0 , NO_NC |NO_RING}
934};
BOOLEAN atATTRIB3(leftv, leftv v, leftv b, leftv c)
Definition attrib.cc:374
#define jjWRONG3
Definition gentable.cc:126
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5816
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6940
static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6191
static BOOLEAN jjBRACK_Ma_IV_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5952
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6899
static BOOLEAN jjSUBST_Bu(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6803
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7192
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6151
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7255
static BOOLEAN jjMODULO3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6979
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6116
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6348
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6917
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6816
static BOOLEAN jjLIFTSTD_SYZ(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7116
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6071
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6354
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6096
static BOOLEAN jjHOMOG_W_M(leftv res, leftv v1, leftv v2, leftv v3)
Definition iparith.cc:6288
static BOOLEAN jjRING_2(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6059
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5789
static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6953
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6052
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7161
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5902
static BOOLEAN jjINTERSEC3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6323
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7200
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6331
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7246
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7241
static BOOLEAN jjFRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:2310
static BOOLEAN jjREDUCE3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7185
static BOOLEAN jjELIMIN_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6143
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6338
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7173
static BOOLEAN jjINTERSECT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6310
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5844
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6644
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6270
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6849
static BOOLEAN jjSMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7081
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6654
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6001
static BOOLEAN jjMRES_MAP(leftv res, leftv u, leftv v, leftv ma)
Definition iparith.cc:6561
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7094
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6252
static BOOLEAN jjFIND3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6160
static BOOLEAN jjMODULO3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7030
static BOOLEAN jjHILBERT3Qt(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6230
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6296
static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
Definition iparith.cc:2941
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6728
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6110
static BOOLEAN jjHILBERT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6200
static BOOLEAN jjLIFTSTD_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7139
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5773
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6903
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
Definition iparith.cc:5119
static BOOLEAN jjBRACK_SM(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5873
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3080
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:3336
BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w)
Definition lists.cc:135
BOOLEAN nuLagSolve(leftv res, leftv arg1, leftv arg2, leftv arg3)
find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial us...
Definition ipshell.cc:4674
BOOLEAN nuVanderSys(leftv res, leftv arg1, leftv arg2, leftv arg3)
COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consi...
Definition ipshell.cc:4817
@ VANDER_CMD
Definition tok.h:200
@ SUBST_CMD
Definition tok.h:188
@ MRES_MAP_CMD
Definition tok.h:132
@ RESULTANT_CMD
Definition tok.h:173

◆ dArithM

const struct sValCmdM dArithM[]
extern

Definition at line 937 of file table.h.

938{
939// operations:
940// proc cmd res number_of_args context
942,{D(jjRING_PL), '[', RING_CMD, -2 , ALLOW_NC |ALLOW_RING}
948#ifdef SINGULAR_4_2
951#endif
958//,{D(jjEXPORTTO_M), EXPORTTO_CMD, NONE, -2 , ALLOW_NC |ALLOW_RING}
959,{D(jjCALL2ARG), FETCH_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
960,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_PLURAL |ALLOW_RING}
961,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,4 , ALLOW_PLURAL |ALLOW_RING}
962,{D(jjCALL1ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,1 , ALLOW_NC |ALLOW_RING}
963,{D(jjCALL2ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
964,{D(jjCALL3ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_NC |ALLOW_RING}
972,{D(jjCALL2ARG), JET_CMD, POLY_CMD,/*or set by p*/ 2 , ALLOW_PLURAL |ALLOW_RING}
973,{D(jjCALL3ARG), JET_CMD, POLY_CMD,/*or set by p*/ 3 , ALLOW_PLURAL |ALLOW_RING}
974,{D(jjJET4), JET_CMD, POLY_CMD,/*or set by p*/ 4 , ALLOW_PLURAL |ALLOW_RING}
996,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING}
997,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING}
998,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_NC |ALLOW_RING}
999,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING}
1000,{D(jjREDUCE5), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 5, ALLOW_PLURAL |ALLOW_RING}
1003//,{D(jjCALL1ARG), RESERVEDNAMELIST_CMD, LIST_CMD, 1 , ALLOW_NC |ALLOW_RING}
1006,{D(jjCALL3ARG), SUBST_CMD, NONE/*set by p*/, 3 , ALLOW_NC |ALLOW_RING}
1007,{D(jjSUBST_M), SUBST_CMD, NONE/*set by p*/, -2 , ALLOW_NC |ALLOW_RING}
1008,{D(jjSYSTEM), SYSTEM_CMD, NONE/*or set by p*/,-2 , ALLOW_NC |ALLOW_RING}
1016,{D(jjCALL1ARG), STD_CMD, IDEAL_CMD/* or set by p*/,1 , ALLOW_NC |ALLOW_RING}
1022,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
1023};
BOOLEAN jjSYSTEM(leftv res, leftv args)
Definition extra.cc:231
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8490
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8339
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8420
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7785
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8623
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8468
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8095
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7305
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7298
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7346
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6365
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7630
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7898
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8913
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8349
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8604
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7363
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8830
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8126
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8570
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7334
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7866
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8267
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7704
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8813
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7505
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8334
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:7959
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8755
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7322
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8216
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7326
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8042
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8786
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7462
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1277
BOOLEAN iiWRITE(leftv, leftv v)
Definition ipshell.cc:587
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4565
BOOLEAN nuUResSolve(leftv res, leftv args)
solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing-...
Definition ipshell.cc:4918
@ SIMPLEX_CMD
Definition tok.h:179
@ LUS_CMD
Definition tok.h:123
@ BRANCHTO_CMD
Definition tok.h:39
@ BREAKPOINT_CMD
Definition tok.h:41
@ QRDS_CMD
Definition tok.h:161
@ DBPRINT_CMD
Definition tok.h:57
@ URSOLVE_CMD
Definition tok.h:199
@ FMD_CMD
Definition tok.h:80
@ WRITE_CMD
Definition tok.h:208
@ RESERVEDNAMELIST_CMD
Definition tok.h:171
@ MINOR_CMD
Definition tok.h:126
@ LUI_CMD
Definition tok.h:122
@ TEST_CMD
Definition tok.h:192
@ SYSTEM_CMD
Definition tok.h:189

◆ iiCurrArgs

EXTERN_VAR leftv iiCurrArgs

Definition at line 29 of file ipshell.h.

◆ iiCurrProc

EXTERN_VAR idhdl iiCurrProc

Definition at line 30 of file ipshell.h.

◆ iiLocalRing

EXTERN_VAR ring* iiLocalRing

Definition at line 35 of file ipshell.h.

◆ iiOp

EXTERN_VAR int iiOp

Definition at line 31 of file ipshell.h.

◆ iiRETURNEXPR

EXTERN_INST_VAR sleftv iiRETURNEXPR

Definition at line 34 of file ipshell.h.

◆ iiRETURNEXPR_len

EXTERN_VAR int iiRETURNEXPR_len

Definition at line 33 of file ipshell.h.

◆ lastreserved

const char* lastreserved
extern

Definition at line 83 of file ipshell.cc.

◆ myynest

EXTERN_VAR int myynest

Definition at line 38 of file ipshell.h.

◆ printlevel

EXTERN_VAR int printlevel

Definition at line 39 of file ipshell.h.

◆ si_echo

EXTERN_VAR int si_echo

Definition at line 40 of file ipshell.h.

◆ yyInRingConstruction

EXTERN_VAR BOOLEAN yyInRingConstruction

Definition at line 43 of file ipshell.h.