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)
 
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 122 of file ipshell.h.

◆ proc2

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

Definition at line 134 of file ipshell.h.

◆ proc3

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

Definition at line 145 of file ipshell.h.

◆ proci

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

Definition at line 175 of file ipshell.h.

Function Documentation

◆ exprlist_length()

int exprlist_length ( leftv v)

Definition at line 550 of file ipshell.cc.

551{
552 int rc = 0;
553 while (v!=NULL)
554 {
555 switch (v->Typ())
556 {
557 case INT_CMD:
558 case POLY_CMD:
559 case VECTOR_CMD:
560 case NUMBER_CMD:
561 rc++;
562 break;
563 case INTVEC_CMD:
564 case INTMAT_CMD:
565 rc += ((intvec *)(v->Data()))->length();
566 break;
567 case MATRIX_CMD:
568 case IDEAL_CMD:
569 case MODUL_CMD:
570 {
571 matrix mm = (matrix)(v->Data());
572 rc += mm->rows() * mm->cols();
573 }
574 break;
575 case LIST_CMD:
576 rc+=((lists)v->Data())->nr+1;
577 break;
578 default:
579 rc++;
580 }
581 v = v->next;
582 }
583 return rc;
584}
Variable next() const
Definition factory.h:146
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));
755 return h;
756 }
757 return NULL;
758}
#define FALSE
Definition auxiliary.h:96
int i
Definition cfEzgcd.cc:132
Definition idrec.h:35
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:560
VAR idhdl currRingHdl
Definition ipid.cc:59
VAR package currPack
Definition ipid.cc:57
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:15
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
#define R
Definition sirandom.c:27
sleftv * leftv
Definition structs.h:57

◆ 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:87
#define TRUE
Definition auxiliary.h:100
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:9761
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:258
#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
@ 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 823 of file ipid.cc.

824{
825 if (iiCurrArgs==NULL)
826 {
827 Werror("not enough arguments for proc %s",VoiceName());
828 p->CleanUp();
829 return TRUE;
830 }
832 iiCurrArgs=h->next;
833 h->next=NULL;
834 if (h->rtyp!=IDHDL)
835 {
837 h->CleanUp();
839 return res;
840 }
841 if ((h->Typ()!=p->Typ()) &&(p->Typ()!=DEF_CMD))
842 {
843 WerrorS("type mismatch");
844 return TRUE;
845 }
846 idhdl pp=(idhdl)p->data;
847 switch(pp->typ)
848 {
849 case CRING_CMD:
851 break;
852 case DEF_CMD:
853 case INT_CMD:
854 break;
855 case INTVEC_CMD:
856 case INTMAT_CMD:
857 delete IDINTVEC(pp);
858 break;
859 case NUMBER_CMD:
861 break;
862 case BIGINT_CMD:
864 break;
865 case MAP_CMD:
866 {
867 map im = IDMAP(pp);
868 omFreeBinAddr((ADDRESS)im->preimage);
869 im->preimage=NULL;// and continue
870 }
871 // continue as ideal:
872 case IDEAL_CMD:
873 case MODUL_CMD:
874 case MATRIX_CMD:
876 break;
877 case PROC_CMD:
878 case RESOLUTION_CMD:
879 case STRING_CMD:
881 break;
882 case LIST_CMD:
883 IDLIST(pp)->Clean();
884 break;
885 case LINK_CMD:
887 break;
888 // case ring: cannot happen
889 default:
890 {
891 int t=p->Typ();
892 if (t<MAX_TOK)
893 {
894 Werror("unknown type %d(%s)",t,Tok2Cmdname(t));
895 return TRUE;
896 }
897 /*else: blackbox type, not yet set*/
898 break;
899 }
900 }
901 pp->typ=ALIAS_CMD;
902 IDDATA(pp)=(char*)h->data;
903 int eff_typ=h->Typ();
904 if ((RingDependend(eff_typ))
905 || ((eff_typ==LIST_CMD) && (lRingDependend((lists)h->Data()))))
906 {
907 ipSwapId(pp,IDROOT,currRing->idroot);
908 }
909 h->CleanUp();
911 return FALSE;
912}
void * ADDRESS
Definition auxiliary.h:119
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
Definition lists.h:24
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:658
VAR coeffs coeffs_BIGINT
Definition ipid.cc:50
#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:80
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)
idrec * idhdl
Definition ring.h:21
#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 {
313 traceit &=(~TRACE_SHOW_LINE);
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 {
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}
int l
Definition cfEzgcd.cc:100
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
#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
unsigned setval
Definition ipid.h:153
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
#define BITSET
Definition structs.h:16
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 6412 of file ipshell.cc.

6413{
6414 res->Init();
6415 res->rtyp=a->Typ();
6416 switch (res->rtyp /*a->Typ()*/)
6417 {
6418 case INTVEC_CMD:
6419 case INTMAT_CMD:
6420 return iiApplyINTVEC(res,a,op,proc);
6421 case BIGINTMAT_CMD:
6422 return iiApplyBIGINTMAT(res,a,op,proc);
6423 case IDEAL_CMD:
6424 case MODUL_CMD:
6425 case MATRIX_CMD:
6426 return iiApplyIDEAL(res,a,op,proc);
6427 case LIST_CMD:
6428 return iiApplyLIST(res,a,op,proc);
6429 }
6430 WerrorS("first argument to `apply` must allow an index");
6431 return TRUE;
6432}
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:6331
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6373
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
Definition ipshell.cc:6368
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
Definition ipshell.cc:6363

◆ iiARROW()

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

Definition at line 6461 of file ipshell.cc.

6462{
6463 size_t len=strlen(a)+strlen(s)+30; /* max. 27 currently */
6464 char *ss=(char*)omAlloc(len);
6465 // find end of s:
6466 int end_s=strlen(s);
6467 while ((end_s>0) && ((s[end_s]<=' ')||(s[end_s]==';'))) end_s--;
6468 s[end_s+1]='\0';
6469 char *name=(char *)omAlloc(len);
6470 snprintf(name,len,"%s->%s",a,s);
6471 // find start of last expression
6472 int start_s=end_s-1;
6473 while ((start_s>=0) && (s[start_s]!=';')) start_s--;
6474 if (start_s<0) // ';' not found
6475 {
6476 snprintf(ss,len,"parameter def %s;return(%s);\n",a,s);
6477 }
6478 else // s[start_s] is ';'
6479 {
6480 s[start_s]='\0';
6481 snprintf(ss,len,"parameter def %s;%s;return(%s);\n",a,s,s+start_s+1);
6482 }
6483 r->Init();
6484 // now produce procinfo for PROC_CMD:
6485 r->data = (void *)omAlloc0Bin(procinfo_bin);
6486 ((procinfo *)(r->data))->language=LANG_NONE;
6488 ((procinfo *)r->data)->data.s.body=ss;
6489 omFree(name);
6490 r->rtyp=PROC_CMD;
6491 //r->rtyp=STRING_CMD;
6492 //r->data=ss;
6493 return FALSE;
6494}
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:124
static int si_min(const int a, const int b)
Definition auxiliary.h:125
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
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:457
void ipMoveId(idhdl tomove)
Definition ipid.cc:683
#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:550
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
#define pMaxComp(p)
Definition polys.h:299
#define pNormalize(p)
Definition polys.h:317
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:75
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 6496 of file ipshell.cc.

6497{
6498 char* ring_name=omStrDup((char*)r->Name());
6499 int t=arg->Typ();
6500 if (t==RING_CMD)
6501 {
6502 sleftv tmp;
6503 tmp.Init();
6504 tmp.rtyp=IDHDL;
6505 idhdl h=enterid(ring_name, myynest, RING_CMD, &IDROOT);
6506 IDRING(h)=NULL;
6507 tmp.data=(char*)h;
6508 if (h!=NULL)
6509 {
6510 tmp.name=h->id;
6511 BOOLEAN b=iiAssign(&tmp,arg);
6512 if (b) return TRUE;
6513 rSetHdl(ggetid(ring_name));
6514 omFree(ring_name);
6515 return FALSE;
6516 }
6517 else
6518 return TRUE;
6519 }
6520 else if (t==CRING_CMD)
6521 {
6522 sleftv tmp;
6523 sleftv n;
6524 n.Init();
6525 n.name=ring_name;
6526 if (iiDeclCommand(&tmp,&n,myynest,CRING_CMD,&IDROOT)) return TRUE;
6527 if (iiAssign(&tmp,arg)) return TRUE;
6528 //Print("create %s\n",r->Name());
6529 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6530 return FALSE;
6531 }
6532 //Print("create %s\n",r->Name());
6533 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6534 return TRUE;// not handled -> error for now
6535}
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:1197
void rSetHdl(idhdl h)
Definition ipshell.cc:5110

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv r,
leftv args )

Definition at line 1272 of file ipshell.cc.

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

◆ iiCheckPack()

void iiCheckPack ( package & p)

Definition at line 1620 of file ipshell.cc.

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

◆ iiCheckRing()

BOOLEAN iiCheckRing ( int i)

Definition at line 1576 of file ipshell.cc.

1577{
1578 if (currRing==NULL)
1579 {
1580 #ifdef SIQ
1581 if (siq<=0)
1582 {
1583 #endif
1584 if (RingDependend(i))
1585 {
1586 WerrorS("no ring active (9)");
1587 return TRUE;
1588 }
1589 #ifdef SIQ
1590 }
1591 #endif
1592 }
1593 return FALSE;
1594}
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 6557 of file ipshell.cc.

6558{
6559 int l=0;
6560 if (args==NULL)
6561 {
6562 if (type_list[0]==0) return TRUE;
6563 }
6564 else l=args->listLength();
6565 if (l!=(int)type_list[0])
6566 {
6567 if (report) iiReportTypes(0,l,type_list);
6568 return FALSE;
6569 }
6570 for(int i=1;i<=l;i++,args=args->next)
6571 {
6572 short t=type_list[i];
6573 if (t!=ANY_TYPE)
6574 {
6575 if (((t==IDHDL)&&(args->rtyp!=IDHDL))
6576 || (t!=args->Typ()))
6577 {
6578 if (report) iiReportTypes(i,args->Typ(),type_list);
6579 return FALSE;
6580 }
6581 }
6582 }
6583 return TRUE;
6584}
static void iiReportTypes(int nr, int t, const short *T)
Definition ipshell.cc:6537
#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 1064 of file ipshell.cc.

1065{
1066#ifdef HAVE_SDB
1067 sdb_flags=1;
1068#endif
1069 Print("\n-- break point in %s --\n",VoiceName());
1071 char * s;
1073 s = (char *)omAlloc(BREAK_LINE_LENGTH+4);
1074 loop
1075 {
1076 memset(s,0,BREAK_LINE_LENGTH+4);
1078 if (s[BREAK_LINE_LENGTH-1]!='\0')
1079 {
1080 Print("line too long, max is %d chars\n",BREAK_LINE_LENGTH);
1081 }
1082 else
1083 break;
1084 }
1085 if (*s=='\n')
1086 {
1088 }
1089#if MDEBUG
1090 else if(strncmp(s,"cont;",5)==0)
1091 {
1093 }
1094#endif /* MDEBUG */
1095 else
1096 {
1097 strcat( s, "\n;~\n");
1099 }
1100}
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:1062
#define BREAK_LINE_LENGTH
Definition ipshell.cc:1063
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 1197 of file ipshell.cc.

1198{
1200 BOOLEAN is_qring=FALSE;
1201 const char *id = name->name;
1202
1203 sy->Init();
1204 if ((name->name==NULL)||(isdigit(name->name[0])))
1205 {
1206 WerrorS("object to declare is not a name");
1207 res=TRUE;
1208 }
1209 else
1210 {
1211 if (root==NULL) return TRUE;
1212 if (*root!=IDROOT)
1213 {
1214 if ((currRing==NULL) || (*root!=currRing->idroot))
1215 {
1216 Werror("can not define `%s` in other package",name->name);
1217 return TRUE;
1218 }
1219 }
1220 if (t==QRING_CMD)
1221 {
1222 t=RING_CMD; // qring is always RING_CMD
1223 is_qring=TRUE;
1224 }
1225
1226 if (TEST_V_ALLWARN
1227 && (name->rtyp!=0)
1228 && (name->rtyp!=IDHDL)
1230 {
1231 Warn("`%s` is %s in %s:%d:%s",name->name,Tok2Cmdname(name->rtyp),
1233 }
1234 {
1235 sy->data = (char *)enterid(id,lev,t,root,init_b);
1236 }
1237 if (sy->data!=NULL)
1238 {
1239 sy->rtyp=IDHDL;
1240 currid=sy->name=IDID((idhdl)sy->data);
1241 if (is_qring)
1242 {
1244 }
1245 // name->name=NULL; /* used in enterid */
1246 //sy->e = NULL;
1247 if (name->next!=NULL)
1248 {
1250 res=iiDeclCommand(sy->next,name->next,lev,t,root, isring);
1251 }
1252 }
1253 else res=TRUE;
1254 }
1255 name->CleanUp();
1256 return res;
1257}
char * filename
Definition fevoices.h:63
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}
void pop()
Definition ipid.cc:792
void push(char *)
Definition ipid.cc:782
VAR int si_echo
Definition febase.cc:35
@ BT_example
Definition fevoices.h:21
VAR proclevel * procstack
Definition ipid.cc:52
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:1690
#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 1501 of file ipshell.cc.

1502{
1503 BOOLEAN nok=FALSE;
1504 leftv r=v;
1505 while (v!=NULL)
1506 {
1507 if ((v->name==NULL)||(v->rtyp==0)||(v->e!=NULL))
1508 {
1509 Werror("cannot export:%s of internal type %d",v->name,v->rtyp);
1510 nok=TRUE;
1511 }
1512 else
1513 {
1514 if(iiInternalExport(v, toLev))
1515 nok=TRUE;
1516 }
1517 v=v->next;
1518 }
1519 r->CleanUp();
1520 return nok;
1521}
char name() const
Definition variable.cc:122
static BOOLEAN iiInternalExport(leftv v, int toLev)
Definition ipshell.cc:1402

◆ iiExport() [2/2]

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

Definition at line 1524 of file ipshell.cc.

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

◆ 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 9223 of file iparith.cc.

9224{
9225 res->Init();
9226 BOOLEAN call_failed=FALSE;
9227
9228 if (!errorreported)
9229 {
9230 BOOLEAN failed=FALSE;
9231 iiOp=op;
9232 int i = 0;
9233 while (dA1[i].cmd==op)
9234 {
9235 if (at==dA1[i].arg)
9236 {
9237 if (currRing!=NULL)
9238 {
9239 if (check_valid(dA1[i].valid_for,op)) break;
9240 }
9241 else
9242 {
9243 if (RingDependend(dA1[i].res))
9244 {
9245 WerrorS("no ring active (5)");
9246 break;
9247 }
9248 }
9249 if (traceit&TRACE_CALL)
9250 Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
9251 res->rtyp=dA1[i].res;
9252 if ((call_failed=dA1[i].p(res,a)))
9253 {
9254 break;// leave loop, goto error handling
9255 }
9256 if (a->Next()!=NULL)
9257 {
9259 failed=iiExprArith1(res->next,a->next,op);
9260 }
9261 a->CleanUp();
9262 return failed;
9263 }
9264 i++;
9265 }
9266 // implicite type conversion --------------------------------------------
9267 if (dA1[i].cmd!=op)
9268 {
9270 i=0;
9271 //Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
9272 while (dA1[i].cmd==op)
9273 {
9274 int ai;
9275 //Print("test %s\n",Tok2Cmdname(dA1[i].arg));
9276 if ((dA1[i].valid_for & NO_CONVERSION)==0)
9277 {
9278 if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
9279 {
9280 if (currRing!=NULL)
9281 {
9282 if (check_valid(dA1[i].valid_for,op)) break;
9283 }
9284 else
9285 {
9286 if (RingDependend(dA1[i].res))
9287 {
9288 WerrorS("no ring active (6)");
9289 break;
9290 }
9291 }
9292 if (traceit&TRACE_CALL)
9293 Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
9294 res->rtyp=dA1[i].res;
9295 failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
9296 || (call_failed=dA1[i].p(res,an)));
9297 // everything done, clean up temp. variables
9298 if (failed)
9299 {
9300 // leave loop, goto error handling
9301 break;
9302 }
9303 else
9304 {
9305 if (an->Next() != NULL)
9306 {
9307 res->next = (leftv)omAllocBin(sleftv_bin);
9308 failed=iiExprArith1(res->next,an->next,op);
9309 }
9310 // everything ok, clean up and return
9311 an->CleanUp();
9313 return failed;
9314 }
9315 }
9316 }
9317 i++;
9318 }
9319 an->CleanUp();
9321 }
9322 // error handling
9323 if (!errorreported)
9324 {
9325 if ((at==0) && (a->Fullname()!=sNoName_fe))
9326 {
9327 Werror("`%s` is not defined",a->Fullname());
9328 }
9329 else
9330 {
9331 i=0;
9332 const char *s = iiTwoOps(op);
9333 Werror("%s(`%s`) failed"
9334 ,s,Tok2Cmdname(at));
9335 if ((!call_failed) && BVERBOSE(V_SHOW_USE))
9336 {
9337 while (dA1[i].cmd==op)
9338 {
9339 if ((dA1[i].res!=0)
9340 && (dA1[i].p!=jjWRONG))
9341 Werror("expected %s(`%s`)"
9342 ,s,Tok2Cmdname(dA1[i].arg));
9343 i++;
9344 }
9345 }
9346 }
9347 }
9348 res->rtyp = UNKNOWN;
9349 }
9350 a->CleanUp();
9351 return TRUE;
9352}
leftv Next()
Definition subexpr.h:136
const char * Fullname()
Definition subexpr.h:125
const char sNoName_fe[]
Definition fevoices.cc:57
const char * iiTwoOps(int t)
Definition gentable.cc:258
#define jjWRONG
Definition gentable.cc:124
#define NO_CONVERSION
Definition iparith.cc:116
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition iparith.cc:9353
static BOOLEAN check_valid(const int p, const int op)
Definition iparith.cc:10165
VAR int iiOp
Definition iparith.cc:218
const char * Tok2Cmdname(int tok)
Definition iparith.cc:9885
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 9150 of file iparith.cc.

9154{
9155 res->Init();
9156 leftv b=a->next;
9157 a->next=NULL;
9158 int bt=b->Typ();
9160 a->next=b;
9161 a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
9162 return bo;
9163}
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:8991

◆ iiExprArith3()

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

Definition at line 9563 of file iparith.cc.

9564{
9565 res->Init();
9566
9567 if (!errorreported)
9568 {
9569#ifdef SIQ
9570 if (siq>0)
9571 {
9572 //Print("siq:%d\n",siq);
9574 memcpy(&d->arg1,a,sizeof(sleftv));
9575 a->Init();
9576 memcpy(&d->arg2,b,sizeof(sleftv));
9577 b->Init();
9578 memcpy(&d->arg3,c,sizeof(sleftv));
9579 c->Init();
9580 d->op=op;
9581 d->argc=3;
9582 res->data=(char *)d;
9583 res->rtyp=COMMAND;
9584 return FALSE;
9585 }
9586#endif
9587 int at=a->Typ();
9588 // handling bb-objects ----------------------------------------------
9589 if (at>MAX_TOK)
9590 {
9591 blackbox *bb=getBlackboxStuff(at);
9592 if (bb!=NULL)
9593 {
9594 if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
9595 // otherwise, try defaul (attrib,..)
9596 }
9597 else
9598 return TRUE;
9599 if (errorreported) return TRUE;
9600 }
9601 int bt=b->Typ();
9602 int ct=c->Typ();
9603
9604 iiOp=op;
9605 int i=0;
9606 while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
9607 return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
9608 }
9609 a->CleanUp();
9610 b->CleanUp();
9611 c->CleanUp();
9612 //Print("op: %d,result typ:%d\n",op,res->rtyp);
9613 return TRUE;
9614}
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:9410
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 9615 of file iparith.cc.

9619{
9620 res->Init();
9621 leftv b=a->next;
9622 a->next=NULL;
9623 int bt=b->Typ();
9624 leftv c=b->next;
9625 b->next=NULL;
9626 int ct=c->Typ();
9627 BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
9628 b->next=c;
9629 a->next=b;
9630 a->CleanUp(); // to cleanup the chain, content already done
9631 return bo;
9632}

◆ 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 1596 of file ipshell.cc.

1597{
1598 int i;
1599 if(!idIsZeroDim(I)) return NULL; // not zero-dim.
1600 poly po=NULL;
1602 {
1603 scComputeHC(I,currRing->qideal,ak,po);
1604 if (po!=NULL)
1605 {
1606 pGetCoeff(po)=nInit(1);
1607 for (i=rVar(currRing); i>0; i--)
1608 {
1609 if (pGetExp(po, i) > 0) pDecrExp(po,i);
1610 }
1611 pSetComp(po,ak);
1612 pSetm(po);
1613 }
1614 }
1615 else
1616 po=pOne();
1617 return po;
1618}
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
Definition hdegree.cc:1074
static BOOLEAN idIsZeroDim(ideal i)
Definition ideals.h:179
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:271
#define pSetComp(p, v)
Definition polys.h:38
#define pGetExp(p, i)
Exponent.
Definition polys.h:41
#define pOne()
Definition polys.h:315
#define pDecrExp(p, i)
Definition polys.h:44
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition ring.h:597
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:767

◆ iiInternalExport()

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

Definition at line 1455 of file ipshell.cc.

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

◆ 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

◆ 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));
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 {
584 //iiRETURNEXPR.Init(); //done by CleanUp
585 }
586 if (iiCurrArgs!=NULL)
587 {
588 if (!err) Warn("too many arguments for %s",IDID(pn));
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 845 of file ipshell.cc.

847{
848 lists L=liMakeResolv(r,length,rlen,typ0,weights);
849 int i=0;
850 idhdl h;
851 size_t len=strlen(name)+5;
852 char * s=(char *)omAlloc(len);
853
854 while (i<=L->nr)
855 {
856 snprintf(s,len,"%s(%d)",name,i+1);
857 if (i==0)
858 h=enterid(s,myynest,typ0,&(currRing->idroot), FALSE);
859 else
861 if (h!=NULL)
862 {
863 h->data.uideal=(ideal)L->m[i].data;
864 h->attribute=L->m[i].attribute;
865 if (BVERBOSE(V_DEF_RES))
866 Print("//defining: %s as %d-th syzygy module\n",s,i+1);
867 }
868 else
869 {
870 idDelete((ideal *)&(L->m[i].data));
871 Warn("cannot define %s",s);
872 }
873 //L->m[i].data=NULL;
874 //L->m[i].rtyp=0;
875 //L->m[i].attribute=NULL;
876 i++;
877 }
878 omFreeSize((ADDRESS)L->m,(L->nr+1)*sizeof(sleftv));
880 omFreeSize((ADDRESS)s,strlen(name)+5);
881}
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 613 of file ipshell.cc.

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

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char * s)

Definition at line 121 of file ipshell.cc.

122{
123/* not handling: &&, ||, ** */
124 if (s[1]=='\0') return s[0];
125 else if (s[2]!='\0') return 0;
126 switch(s[0])
127 {
128 case '.': if (s[1]=='.') return DOTDOT;
129 else return 0;
130 case ':': if (s[1]==':') return COLONCOLON;
131 else return 0;
132 case '-': if (s[1]=='-') return MINUSMINUS;
133 else return 0;
134 case '+': if (s[1]=='+') return PLUSPLUS;
135 else return 0;
136 case '=': if (s[1]=='=') return EQUAL_EQUAL;
137 else return 0;
138 case '<': if (s[1]=='=') return LE;
139 else if (s[1]=='>') return NOTEQUAL;
140 else return 0;
141 case '>': if (s[1]=='=') return GE;
142 else return 0;
143 case '!': if (s[1]=='=') return NOTEQUAL;
144 else return 0;
145 }
146 return 0;
147}
@ 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 1375 of file ipshell.cc.

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

◆ 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 {
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);
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
BOOLEAN RingDependend()
Definition subexpr.cc:421
#define SI_MAX_NEST
Definition iplib.cc:27
char trace_flag
Definition subexpr.h:62

◆ iiRegularity()

int iiRegularity ( lists L)

Definition at line 1036 of file ipshell.cc.

1037{
1038 int len,reg,typ0;
1039
1040 resolvente r=liFindRes(L,&len,&typ0);
1041
1042 if (r==NULL)
1043 return -2;
1044 intvec *weights=NULL;
1045 int add_row_shift=0;
1046 intvec *ww=(intvec *)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
1047 if (ww!=NULL)
1048 {
1049 weights=ivCopy(ww);
1050 add_row_shift = ww->min_in();
1051 (*weights) -= add_row_shift;
1052 }
1053 //Print("attr:%x\n",weights);
1054
1055 intvec *dummy=syBetti(r,len,&reg,weights);
1056 if (weights!=NULL) delete weights;
1057 delete dummy;
1058 omFreeSize((ADDRESS)r,len*sizeof(ideal));
1059 return reg+1+add_row_shift;
1060}
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition attrib.cc:132
int min_in()
Definition intvec.h:121
ideal * resolvente
Definition ideals.h:18
intvec * ivCopy(const intvec *o)
Definition intvec.h:145
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 6615 of file ipshell.cc.

6616{
6617 if ((source->next==NULL)&&(source->e==NULL))
6618 {
6619 if ((source->rtyp!=IDHDL)&&(source->rtyp!=ALIAS_CMD))
6620 {
6621 memcpy(&iiRETURNEXPR,source,sizeof(sleftv));
6622 source->Init();
6623 return;
6624 }
6625 if (source->rtyp==IDHDL)
6626 {
6627 if ((IDLEV((idhdl)source->data)==myynest)
6628 &&(IDTYP((idhdl)source->data)!=RING_CMD))
6629 {
6631 iiRETURNEXPR.rtyp=IDTYP((idhdl)source->data);
6632 iiRETURNEXPR.data=IDDATA((idhdl)source->data);
6633 iiRETURNEXPR.flag=IDFLAG((idhdl)source->data);
6634 iiRETURNEXPR.attribute=IDATTR((idhdl)source->data);
6635 IDATTR((idhdl)source->data)=NULL;
6636 IDDATA((idhdl)source->data)=NULL;
6637 source->name=NULL;
6638 source->attribute=NULL;
6639 return;
6640 }
6641 }
6642 }
6643 iiRETURNEXPR.Copy(source);
6644}
void Copy(leftv e)
Definition subexpr.cc:689

◆ iiTestAssume()

BOOLEAN iiTestAssume ( leftv a,
leftv b )

Definition at line 6434 of file ipshell.cc.

6435{
6436 // assume a: level
6437 if ((a->Typ()==INT_CMD)&&((long)a->Data()>=0))
6438 {
6439 if ((TEST_V_ALLWARN) && (myynest==0)) WarnS("ASSUME at top level is of no use: see documentation");
6440 char assume_yylinebuf[80];
6441 strncpy(assume_yylinebuf,my_yylinebuf,79);
6442 int lev=(long)a->Data();
6443 int startlev=0;
6444 idhdl h=ggetid("assumeLevel");
6445 if ((h!=NULL)&&(IDTYP(h)==INT_CMD)) startlev=(long)IDINT(h);
6446 if(lev <=startlev)
6447 {
6448 BOOLEAN bo=b->Eval();
6449 if (bo) { WerrorS("syntax error in ASSUME");return TRUE;}
6450 if (b->Typ()!=INT_CMD) { WerrorS("ASUMME(<level>,<int expr>)");return TRUE; }
6451 if (b->Data()==NULL) { Werror("ASSUME failed:%s",assume_yylinebuf);return TRUE;}
6452 }
6453 }
6454 b->CleanUp();
6455 a->CleanUp();
6456 return FALSE;
6457}
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}
cmdnames * sCmds
array of existing commands
Definition iparith.cc:182
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
Definition iparith.cc:197
unsigned nCmdUsed
number of commands used
Definition iparith.cc:187

◆ 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 586 of file ipshell.cc.

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

◆ IsCmd()

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

Definition at line 9761 of file iparith.cc.

9762{
9763 int i;
9764 int an=1;
9766
9767 loop
9768 //for(an=0; an<sArithBase.nCmdUsed; )
9769 {
9770 if(an>=en-1)
9771 {
9772 if (strcmp(n, sArithBase.sCmds[an].name) == 0)
9773 {
9774 i=an;
9775 break;
9776 }
9777 else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
9778 {
9779 i=en;
9780 break;
9781 }
9782 else
9783 {
9784 // -- blackbox extensions:
9785 // return 0;
9786 return blackboxIsCmd(n,tok);
9787 }
9788 }
9789 i=(an+en)/2;
9790 if (*n < *(sArithBase.sCmds[i].name))
9791 {
9792 en=i-1;
9793 }
9794 else if (*n > *(sArithBase.sCmds[i].name))
9795 {
9796 an=i+1;
9797 }
9798 else
9799 {
9800 int v=strcmp(n,sArithBase.sCmds[i].name);
9801 if(v<0)
9802 {
9803 en=i-1;
9804 }
9805 else if(v>0)
9806 {
9807 an=i+1;
9808 }
9809 else /*v==0*/
9810 {
9811 break;
9812 }
9813 }
9814 }
9816 tok=sArithBase.sCmds[i].tokval;
9817 if(sArithBase.sCmds[i].alias==2)
9818 {
9819 Warn("outdated identifier `%s` used - please change your code",
9820 sArithBase.sCmds[i].name);
9821 sArithBase.sCmds[i].alias=1;
9822 }
9823 #if 0
9824 if (currRingHdl==NULL)
9825 {
9826 #ifdef SIQ
9827 if (siq<=0)
9828 {
9829 #endif
9830 if ((tok>=BEGIN_RING) && (tok<=END_RING))
9831 {
9832 WerrorS("no ring active");
9833 return 0;
9834 }
9835 #ifdef SIQ
9836 }
9837 #endif
9838 }
9839 #endif
9840 if (!expected_parms)
9841 {
9842 switch (tok)
9843 {
9844 case IDEAL_CMD:
9845 case INT_CMD:
9846 case INTVEC_CMD:
9847 case MAP_CMD:
9848 case MATRIX_CMD:
9849 case MODUL_CMD:
9850 case POLY_CMD:
9851 case PROC_CMD:
9852 case RING_CMD:
9853 case STRING_CMD:
9854 cmdtok = tok;
9855 break;
9856 }
9857 }
9858 return sArithBase.sCmds[i].toktype;
9859}
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
unsigned nLastIdentifier
valid identifiers are slot 1..nLastIdentifier
Definition iparith.cc:189
EXTERN_VAR BOOLEAN expected_parms
Definition iparith.cc:214
EXTERN_VAR int cmdtok
Definition iparith.cc:213
const char * lastreserved
Definition ipshell.cc:82

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv res,
leftv v )

Definition at line 966 of file ipshell.cc.

967{
968 sleftv tmp;
969 tmp.Init();
970 tmp.rtyp=INT_CMD;
971 tmp.data=(void *)1;
972 if ((u->Typ()==IDEAL_CMD)
973 || (u->Typ()==MODUL_CMD))
974 return jjBETTI2_ID(res,u,&tmp);
975 else
976 return jjBETTI2(res,u,&tmp);
977}
BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v)
Definition ipshell.cc:979
BOOLEAN jjBETTI2(leftv res, leftv u, leftv v)
Definition ipshell.cc:1000

◆ jjBETTI2()

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

Definition at line 1000 of file ipshell.cc.

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

◆ jjBETTI2_ID()

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

Definition at line 979 of file ipshell.cc.

980{
982 l->Init(1);
983 l->m[0].rtyp=u->Typ();
984 l->m[0].data=u->Data();
985 attr *a=u->Attribute();
986 if (a!=NULL)
987 l->m[0].attribute=*a;
988 sleftv tmp2;
989 tmp2.Init();
990 tmp2.rtyp=LIST_CMD;
991 tmp2.data=(void *)l;
993 l->m[0].data=NULL;
994 l->m[0].attribute=NULL;
995 l->m[0].rtyp=DEF_CMD;
996 l->Clean();
997 return r;
998}
Definition attrib.h:21
attr * Attribute()
Definition subexpr.cc:1505
INLINE_THIS void Init(int l=0)
CFList tmp2
Definition facFqBivar.cc:75

◆ jjCHARSERIES()

BOOLEAN jjCHARSERIES ( leftv res,
leftv u )

Definition at line 3331 of file ipshell.cc.

3332{
3333 res->data=singclap_irrCharSeries((ideal)u->Data(), currRing);
3334 return (res->data==NULL);
3335}
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:393
#define assume(x)
Definition mod2.h:387
ip_package * package
Definition structs.h:43

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv res,
leftv v )

Definition at line 8239 of file iparith.cc.

8240{
8241 int sl=0;
8242 if (v!=NULL) sl = v->listLength();
8243 lists L;
8244 if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
8245 {
8246 int add_row_shift = 0;
8247 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
8248 if (weights!=NULL) add_row_shift=weights->min_in();
8249 L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
8250 }
8251 else
8252 {
8254 leftv h=NULL;
8255 int i;
8256 int rt;
8257
8258 L->Init(sl);
8259 for (i=0;i<sl;i++)
8260 {
8261 if (h!=NULL)
8262 { /* e.g. not in the first step:
8263 * h is the pointer to the old sleftv,
8264 * v is the pointer to the next sleftv
8265 * (in this moment) */
8266 h->next=v;
8267 }
8268 h=v;
8269 v=v->next;
8270 h->next=NULL;
8271 rt=h->Typ();
8272 if (rt==0)
8273 {
8274 L->Clean();
8275 Werror("`%s` is undefined",h->Fullname());
8276 return TRUE;
8277 }
8278 if (rt==RING_CMD)
8279 {
8280 L->m[i].rtyp=rt;
8281 L->m[i].data=rIncRefCnt(((ring)h->Data()));
8282 }
8283 else
8284 L->m[i].Copy(h);
8285 }
8286 }
8287 res->data=(char *)L;
8288 return FALSE;
8289}
void Clean(ring r=currRing)
Definition lists.h:26
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition ipshell.cc:3166
static ring rIncRefCnt(ring r)
Definition ring.h:846

◆ jjLOAD()

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

load lib/module given in v

Definition at line 5576 of file iparith.cc.

5577{
5578 char libnamebuf[1024];
5580
5581#ifdef HAVE_DYNAMIC_LOADING
5582 extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
5583#endif /* HAVE_DYNAMIC_LOADING */
5584 switch(LT)
5585 {
5586 default:
5587 case LT_NONE:
5588 Werror("%s: unknown type", s);
5589 break;
5590 case LT_NOTFOUND:
5591 Werror("cannot open %s", s);
5592 break;
5593
5594 case LT_SINGULAR:
5595 {
5596 char *plib = iiConvName(s);
5597 idhdl pl = IDROOT->get_level(plib,0);
5598 if (pl==NULL)
5599 {
5600 pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
5601 IDPACKAGE(pl)->language = LANG_SINGULAR;
5602 IDPACKAGE(pl)->libname=omStrDup(s);
5603 }
5604 else if (IDTYP(pl)!=PACKAGE_CMD)
5605 {
5606 Werror("can not create package `%s`",plib);
5607 omFreeBinAddr(plib);
5608 return TRUE;
5609 }
5610 else /* package */
5611 {
5612 package pa=IDPACKAGE(pl);
5613 if ((pa->language==LANG_C)
5614 || (pa->language==LANG_MIX))
5615 {
5616 Werror("can not create package `%s` - binaries exists",plib);
5617 omFreeBinAddr(plib);
5618 return TRUE;
5619 }
5620 }
5621 omFreeBinAddr(plib);
5622 package savepack=currPack;
5623 currPack=IDPACKAGE(pl);
5624 IDPACKAGE(pl)->loaded=TRUE;
5625 char libnamebuf[1024];
5626 FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
5627 BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
5628 currPack=savepack;
5629 IDPACKAGE(pl)->loaded=(!bo);
5630 return bo;
5631 }
5632 case LT_BUILTIN:
5633 SModulFunc_t iiGetBuiltinModInit(const char*);
5634 return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
5635 case LT_MACH_O:
5636 case LT_ELF:
5637 case LT_HPUX:
5638#ifdef HAVE_DYNAMIC_LOADING
5639 return load_modules(s, libnamebuf, autoexport);
5640#else /* HAVE_DYNAMIC_LOADING */
5641 WerrorS("Dynamic modules are not supported by this version of Singular");
5642 break;
5643#endif /* HAVE_DYNAMIC_LOADING */
5644 }
5645 return TRUE;
5646}
idhdl get_level(const char *s, int lev)
Definition ipid.cc:89
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 5652 of file iparith.cc.

5653{
5654 if (!iiGetLibStatus(s))
5655 {
5656 void (*WerrorS_save)(const char *s) = WerrorS_callback;
5659 BOOLEAN bo=jjLOAD(s,TRUE);
5660 if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5661 Print("loading of >%s< failed\n",s);
5662 WerrorS_callback=WerrorS_save;
5663 errorreported=0;
5664 }
5665 return FALSE;
5666}
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:5576
STATIC_VAR int WerrorS_dummy_cnt
Definition iparith.cc:5647
static void WerrorS_dummy(const char *)
Definition iparith.cc:5648
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 945 of file ipshell.cc.

946{
947 int len=0;
948 int typ0;
949 lists L=(lists)v->Data();
950 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
951 int add_row_shift = 0;
952 if (weights==NULL)
953 weights=(intvec*)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
954 if (weights!=NULL) add_row_shift=weights->min_in();
955 resolvente rr=liFindRes(L,&len,&typ0);
956 if (rr==NULL) return TRUE;
957 resolvente r=iiCopyRes(rr,len);
958
959 syMinimizeResolvente(r,len,0);
960 omFreeSize((ADDRESS)rr,len*sizeof(ideal));
961 len++;
962 res->data=(char *)liMakeResolv(r,len,-1,typ0,NULL,add_row_shift);
963 return FALSE;
964}
static resolvente iiCopyRes(resolvente r, int l)
Definition ipshell.cc:935
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 3324 of file ipshell.cc.

3325{
3326 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(),
3327 (poly)w->CopyD(), currRing);
3328 return errorreported;
3329}
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}
ring r
Definition algext.h:37
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:1978
#define NUM
Definition readcf.cc:180
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:452
ring rCopy(ring r)
Definition ring.cc:1734
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 230 of file extra.cc.

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

6300{
6301 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6302 ideal I=(ideal)u->Data();
6303 int i;
6304 int n=0;
6305 for(i=I->nrows*I->ncols-1;i>=0;i--)
6306 {
6307 int n0=pGetVariables(I->m[i],e);
6308 if (n0>n) n=n0;
6309 }
6310 jjINT_S_TO_ID(n,e,res);
6311 return FALSE;
6312}
static void jjINT_S_TO_ID(int n, int *e, leftv res)
Definition ipshell.cc:6269
#define omAlloc0(size)
#define pGetVariables(p, e)
Definition polys.h:251

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv res,
leftv u )

Definition at line 6291 of file ipshell.cc.

6292{
6293 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6294 int n=pGetVariables((poly)u->Data(),e);
6295 jjINT_S_TO_ID(n,e,res);
6296 return FALSE;
6297}

◆ killlocals()

void killlocals ( int v)

Definition at line 386 of file ipshell.cc.

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

◆ kQHWeight()

BOOLEAN kQHWeight ( leftv res,
leftv v )

Definition at line 3307 of file ipshell.cc.

3308{
3309 res->data=(char *)id_QHomWeight((ideal)v->Data(), currRing);
3310 if (res->data==NULL)
3311 res->data=(char *)new intvec(rVar(currRing));
3312 return FALSE;
3313}
intvec * id_QHomWeight(ideal id, const ring r)

◆ kWeight()

BOOLEAN kWeight ( leftv res,
leftv id )

Definition at line 3285 of file ipshell.cc.

3286{
3287 ideal F=(ideal)id->Data();
3288 intvec * iv = new intvec(rVar(currRing));
3289 polyset s;
3290 int sl, n, i;
3291 int *x;
3292
3293 res->data=(char *)iv;
3294 s = F->m;
3295 sl = IDELEMS(F) - 1;
3296 n = rVar(currRing);
3297 double wNsqr = (double)2.0 / (double)n;
3299 x = (int * )omAlloc(2 * (n + 1) * sizeof(int));
3300 wCall(s, sl, x, wNsqr, currRing);
3301 for (i = n; i!=0; i--)
3302 (*iv)[i-1] = x[i + n + 1];
3303 omFreeSize((ADDRESS)x, 2 * (n + 1) * sizeof(int));
3304 return FALSE;
3305}
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 425 of file ipshell.cc.

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

◆ loNewtonP()

BOOLEAN loNewtonP ( leftv res,
leftv arg1 )

compute Newton Polytopes of input polynomials

Definition at line 4547 of file ipshell.cc.

4548{
4549 res->data= (void*)loNewtonPolytope( (ideal)arg1->Data() );
4550 return FALSE;
4551}
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 4553 of file ipshell.cc.

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

◆ mpJacobi()

BOOLEAN mpJacobi ( leftv res,
leftv a )

Definition at line 3053 of file ipshell.cc.

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

◆ mpKoszul()

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

Definition at line 3075 of file ipshell.cc.

3076{
3077 int n=(int)(long)b->Data();
3078 int d=(int)(long)c->Data();
3079 int k,l,sign,row,col;
3080 matrix result;
3081 ideal temp;
3082 BOOLEAN bo;
3083 poly p;
3084
3085 if ((d>n) || (d<1) || (n<1))
3086 {
3087 res->data=(char *)mpNew(1,1);
3088 return FALSE;
3089 }
3090 int *choise = (int*)omAlloc(d*sizeof(int));
3091 if (id==NULL)
3092 temp=idMaxIdeal(1);
3093 else
3094 temp=(ideal)id->Data();
3095
3096 k = binom(n,d);
3097 l = k*d;
3098 l /= n-d+1;
3099 result =mpNew(l,k);
3100 col = 1;
3101 idInitChoise(d,1,n,&bo,choise);
3102 while (!bo)
3103 {
3104 sign = 1;
3105 for (l=1;l<=d;l++)
3106 {
3107 if (choise[l-1]<=IDELEMS(temp))
3108 {
3109 p = pCopy(temp->m[choise[l-1]-1]);
3110 if (sign == -1) p = pNeg(p);
3111 sign *= -1;
3112 row = idGetNumberOfChoise(l-1,d,1,n,choise);
3113 MATELEM(result,row,col) = p;
3114 }
3115 }
3116 col++;
3117 idGetNextChoise(d,n,&bo,choise);
3118 }
3119 omFreeSize(choise,d*sizeof(int));
3120 if (id==NULL) idDelete(&temp);
3121
3122 res->data=(char *)result;
3123 return FALSE;
3124}
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:198
#define pCopy(p)
return a copy of the poly
Definition polys.h:185
static int sign(int x)
Definition ring.cc:3442

◆ 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 4662 of file ipshell.cc.

4663{
4664 poly gls;
4665 gls= (poly)(arg1->Data());
4666 int howclean= (int)(long)arg3->Data();
4667
4668 if ( gls == NULL || pIsConstant( gls ) )
4669 {
4670 WerrorS("Input polynomial is constant!");
4671 return TRUE;
4672 }
4673
4675 {
4676 int* r=Zp_roots(gls, currRing);
4677 lists rlist;
4678 rlist= (lists)omAlloc( sizeof(slists) );
4679 rlist->Init( r[0] );
4680 for(int i=r[0];i>0;i--)
4681 {
4682 rlist->m[i-1].data=n_Init(r[i],currRing->cf);
4683 rlist->m[i-1].rtyp=NUMBER_CMD;
4684 }
4685 omFree(r);
4686 res->data=rlist;
4687 res->rtyp= LIST_CMD;
4688 return FALSE;
4689 }
4690 if ( !(rField_is_R(currRing) ||
4694 {
4695 WerrorS("Ground field not implemented!");
4696 return TRUE;
4697 }
4698
4701 {
4702 unsigned long int ii = (unsigned long int)arg2->Data();
4703 setGMPFloatDigits( ii, ii );
4704 }
4705
4706 int ldummy;
4707 int deg= currRing->pLDeg( gls, &ldummy, currRing );
4708 int i,vpos=0;
4709 poly piter;
4710 lists elist;
4711
4712 elist= (lists)omAlloc( sizeof(slists) );
4713 elist->Init( 0 );
4714
4715 if ( rVar(currRing) > 1 )
4716 {
4717 piter= gls;
4718 for ( i= 1; i <= rVar(currRing); i++ )
4719 if ( pGetExp( piter, i ) )
4720 {
4721 vpos= i;
4722 break;
4723 }
4724 while ( piter )
4725 {
4726 for ( i= 1; i <= rVar(currRing); i++ )
4727 if ( (vpos != i) && (pGetExp( piter, i ) != 0) )
4728 {
4729 WerrorS("The input polynomial must be univariate!");
4730 return TRUE;
4731 }
4732 pIter( piter );
4733 }
4734 }
4735
4736 rootContainer * roots= new rootContainer();
4737 number * pcoeffs= (number *)omAlloc( (deg+1) * sizeof( number ) );
4738 piter= gls;
4739 for ( i= deg; i >= 0; i-- )
4740 {
4741 if ( piter && pTotaldegree(piter) == i )
4742 {
4743 pcoeffs[i]= nCopy( pGetCoeff( piter ) );
4744 //nPrint( pcoeffs[i] );PrintS(" ");
4745 pIter( piter );
4746 }
4747 else
4748 {
4749 pcoeffs[i]= nInit(0);
4750 }
4751 }
4752
4753#ifdef mprDEBUG_PROT
4754 for (i=deg; i >= 0; i--)
4755 {
4756 nPrint( pcoeffs[i] );PrintS(" ");
4757 }
4758 PrintLn();
4759#endif
4760
4761 roots->fillContainer( pcoeffs, NULL, 1, deg, rootContainer::onepoly, 1 );
4762 roots->solver( howclean );
4763
4764 int elem= roots->getAnzRoots();
4765 char *dummy;
4766 int j;
4767
4768 lists rlist;
4769 rlist= (lists)omAlloc( sizeof(slists) );
4770 rlist->Init( elem );
4771
4773 {
4774 for ( j= 0; j < elem; j++ )
4775 {
4776 rlist->m[j].rtyp=NUMBER_CMD;
4777 rlist->m[j].data=(void *)nCopy((number)(roots->getRoot(j)));
4778 //rlist->m[j].data=(void *)(number)(roots->getRoot(j));
4779 }
4780 }
4781 else
4782 {
4783 for ( j= 0; j < elem; j++ )
4784 {
4785 dummy = complexToStr( (*roots)[j], gmp_output_digits, currRing->cf );
4786 rlist->m[j].rtyp=STRING_CMD;
4787 rlist->m[j].data=(void *)dummy;
4788 }
4789 }
4790
4791 elist->Clean();
4792 //omFreeSize( (ADDRESS) elist, sizeof(slists) );
4793
4794 // this is (via fillContainer) the same data as in root
4795 //for ( i= deg; i >= 0; i-- ) nDelete( &pcoeffs[i] );
4796 //omFreeSize( (ADDRESS) pcoeffs, (deg+1) * sizeof( number ) );
4797
4798 delete roots;
4799
4800 res->data= (void*)rlist;
4801
4802 return FALSE;
4803}
int * Zp_roots(poly p, const ring r)
Definition clapsing.cc:2190
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:238
static BOOLEAN rField_is_R(const ring r)
Definition ring.h:523
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:505
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:511

◆ 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 4639 of file ipshell.cc.

4640{
4641 ideal gls = (ideal)(arg1->Data());
4642 int imtype= (int)(long)arg2->Data();
4643
4644 uResultant::resMatType mtype= determineMType( imtype );
4645
4646 // check input ideal ( = polynomial system )
4647 if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
4648 {
4649 return TRUE;
4650 }
4651
4652 uResultant *resMat= new uResultant( gls, mtype, false );
4653 if (resMat!=NULL)
4654 {
4655 res->rtyp = MODUL_CMD;
4656 res->data= (void*)resMat->accessResMat()->getMatrix();
4657 if (!errorreported) delete resMat;
4658 }
4659 return errorreported;
4660}
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 4906 of file ipshell.cc.

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

4806{
4807 int i;
4808 ideal p,w;
4809 p= (ideal)arg1->Data();
4810 w= (ideal)arg2->Data();
4811
4812 // w[0] = f(p^0)
4813 // w[1] = f(p^1)
4814 // ...
4815 // p can be a vector of numbers (multivariate polynom)
4816 // or one number (univariate polynom)
4817 // tdg = deg(f)
4818
4819 int n= IDELEMS( p );
4820 int m= IDELEMS( w );
4821 int tdg= (int)(long)arg3->Data();
4822
4823 res->data= (void*)NULL;
4824
4825 // check the input
4826 if ( tdg < 1 )
4827 {
4828 WerrorS("Last input parameter must be > 0!");
4829 return TRUE;
4830 }
4831 if ( n != rVar(currRing) )
4832 {
4833 Werror("Size of first input ideal must be equal to %d!",rVar(currRing));
4834 return TRUE;
4835 }
4836 if ( m != (int)pow((double)tdg+1,(double)n) )
4837 {
4838 Werror("Size of second input ideal must be equal to %d!",
4839 (int)pow((double)tdg+1,(double)n));
4840 return TRUE;
4841 }
4842 if ( !(rField_is_Q(currRing) /* ||
4843 rField_is_R() || rField_is_long_R() ||
4844 rField_is_long_C()*/ ) )
4845 {
4846 WerrorS("Ground field not implemented!");
4847 return TRUE;
4848 }
4849
4850 number tmp;
4851 number *pevpoint= (number *)omAlloc( n * sizeof( number ) );
4852 for ( i= 0; i < n; i++ )
4853 {
4854 pevpoint[i]=nInit(0);
4855 if ( (p->m)[i] )
4856 {
4857 tmp = pGetCoeff( (p->m)[i] );
4858 if ( nIsZero(tmp) || nIsOne(tmp) || nIsMOne(tmp) )
4859 {
4860 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4861 WerrorS("Elements of first input ideal must not be equal to -1, 0, 1!");
4862 return TRUE;
4863 }
4864 } else tmp= NULL;
4865 if ( !nIsZero(tmp) )
4866 {
4867 if ( !pIsConstant((p->m)[i]))
4868 {
4869 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4870 WerrorS("Elements of first input ideal must be numbers!");
4871 return TRUE;
4872 }
4873 pevpoint[i]= nCopy( tmp );
4874 }
4875 }
4876
4877 number *wresults= (number *)omAlloc( m * sizeof( number ) );
4878 for ( i= 0; i < m; i++ )
4879 {
4880 wresults[i]= nInit(0);
4881 if ( (w->m)[i] && !nIsZero(pGetCoeff((w->m)[i])) )
4882 {
4883 if ( !pIsConstant((w->m)[i]))
4884 {
4885 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4886 omFreeSize( (ADDRESS)wresults, m * sizeof( number ) );
4887 WerrorS("Elements of second input ideal must be numbers!");
4888 return TRUE;
4889 }
4890 wresults[i]= nCopy(pGetCoeff((w->m)[i]));
4891 }
4892 }
4893
4894 vandermonde vm( m, n, tdg, pevpoint, FALSE );
4895 number *ncpoly= vm.interpolateDense( wresults );
4896 // do not free ncpoly[]!!
4897 poly rpoly= vm.numvec2poly( ncpoly );
4898
4899 omFreeSize( (ADDRESS)pevpoint, n * sizeof( number ) );
4900 omFreeSize( (ADDRESS)wresults, m * sizeof( number ) );
4901
4902 res->data= (void*)rpoly;
4903 return FALSE;
4904}
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 6314 of file ipshell.cc.

6315{
6316 Print(" %s (",n);
6317 switch (p->language)
6318 {
6319 case LANG_SINGULAR: PrintS("S"); break;
6320 case LANG_C: PrintS("C"); break;
6321 case LANG_TOP: PrintS("T"); break;
6322 case LANG_MAX: PrintS("M"); break;
6323 case LANG_NONE: PrintS("N"); break;
6324 default: PrintS("U");
6325 }
6326 if(p->libname!=NULL)
6327 Print(",%s", p->libname);
6328 PrintS(")");
6329}
@ 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 2771 of file ipshell.cc.

2772{
2773 if ((L->nr!=3)
2774#ifdef HAVE_PLURAL
2775 &&(L->nr!=5)
2776#endif
2777 )
2778 return NULL;
2779 int is_gf_char=0;
2780 // 0: char/ cf - ring
2781 // 1: list (var)
2782 // 2: list (ord)
2783 // 3: qideal
2784 // possibly:
2785 // 4: C
2786 // 5: D
2787
2788 ring R = (ring) omAlloc0Bin(sip_sring_bin);
2789
2790 // ------------------------------------------------------------------
2791 // 0: char:
2792 if (L->m[0].Typ()==CRING_CMD)
2793 {
2794 R->cf=(coeffs)L->m[0].Data();
2795 R->cf->ref++;
2796 }
2797 else if (L->m[0].Typ()==INT_CMD)
2798 {
2799 int ch = (int)(long)L->m[0].Data();
2800 assume( ch >= 0 );
2801
2802 if (ch == 0) // Q?
2803 R->cf = nInitChar(n_Q, NULL);
2804 else
2805 {
2806 int l = IsPrime(ch); // Zp?
2807 if( l != ch )
2808 {
2809 Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
2810 ch = l;
2811 }
2812 #ifndef TEST_ZN_AS_ZP
2813 R->cf = nInitChar(n_Zp, (void*)(long)ch);
2814 #else
2815 mpz_t modBase;
2816 mpz_init_set_ui(modBase,(long) ch);
2817 ZnmInfo info;
2818 info.base= modBase;
2819 info.exp= 1;
2820 R->cf=nInitChar(n_Zn,(void*) &info); //exponent is missing
2821 R->cf->is_field=1;
2822 R->cf->is_domain=1;
2823 R->cf->has_simple_Inverse=1;
2824 #endif
2825 }
2826 }
2827 else if (L->m[0].Typ()==LIST_CMD) // something complicated...
2828 {
2829 lists LL=(lists)L->m[0].Data();
2830
2831 if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
2832 {
2833 rComposeRing(LL, R); // Ring!?
2834 }
2835 else
2836 if (LL->nr < 3)
2837 rComposeC(LL,R); // R, long_R, long_C
2838 else
2839 {
2840 if (LL->m[0].Typ()==INT_CMD)
2841 {
2842 int ch = (int)(long)LL->m[0].Data();
2843 while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
2844 if (fftable[is_gf_char]==0) is_gf_char=-1;
2845
2846 if(is_gf_char!= -1)
2847 {
2848 GFInfo param;
2849
2850 param.GFChar = ch;
2851 param.GFDegree = 1;
2852 param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
2853
2854 // nfInitChar should be able to handle the case when ch is in fftables!
2855 R->cf = nInitChar(n_GF, (void*)&param);
2856 }
2857 }
2858
2859 if( R->cf == NULL )
2860 {
2861 ring extRing = rCompose((lists)L->m[0].Data(),FALSE,0x7fff);
2862
2863 if (extRing==NULL)
2864 {
2865 WerrorS("could not create the specified coefficient field");
2866 goto rCompose_err;
2867 }
2868
2869 if( extRing->qideal != NULL ) // Algebraic extension
2870 {
2871 AlgExtInfo extParam;
2872 extParam.r = extRing;
2873 R->cf = nInitChar(n_algExt, (void*)&extParam);
2874 }
2875 else // Transcendental extension
2876 {
2877 TransExtInfo extParam;
2878 extParam.r = extRing;
2879 R->cf = nInitChar(n_transExt, &extParam);
2880 }
2881 //rDecRefCnt(R);
2882 }
2883 }
2884 }
2885 else
2886 {
2887 WerrorS("coefficient field must be described by `int` or `list`");
2888 goto rCompose_err;
2889 }
2890
2891 if( R->cf == NULL )
2892 {
2893 WerrorS("could not create coefficient field described by the input!");
2894 goto rCompose_err;
2895 }
2896
2897 // ------------------------- VARS ---------------------------
2898 if (rComposeVar(L,R)) goto rCompose_err;
2899 // ------------------------ ORDER ------------------------------
2900 if (rComposeOrder(L,check_comp,R)) goto rCompose_err;
2901
2902 // ------------------------ ??????? --------------------
2903
2904 if (!isLetterplace) rRenameVars(R);
2905 #ifdef HAVE_SHIFTBBA
2906 else
2907 {
2908 R->isLPring=isLetterplace;
2909 R->ShortOut=FALSE;
2910 R->CanShortOut=FALSE;
2911 }
2912 #endif
2913 if ((bitmask!=0)&&(R->wanted_maxExp==0)) R->wanted_maxExp=bitmask;
2914 rComplete(R);
2915
2916 // ------------------------ Q-IDEAL ------------------------
2917
2918 if (L->m[3].Typ()==IDEAL_CMD)
2919 {
2920 ideal q=(ideal)L->m[3].Data();
2921 if (q->m[0]!=NULL)
2922 {
2923 if (R->cf != currRing->cf) //->cf->ch!=currRing->cf->ch)
2924 {
2925 #if 0
2926 WerrorS("coefficient fields must be equal if q-ideal !=0");
2927 goto rCompose_err;
2928 #else
2929 ring orig_ring=currRing;
2931 int *perm=NULL;
2932 int *par_perm=NULL;
2933 int par_perm_size=0;
2934 nMapFunc nMap;
2935
2936 if ((nMap=nSetMap(orig_ring->cf))==NULL)
2937 {
2938 if (rEqual(orig_ring,currRing))
2939 {
2940 nMap=n_SetMap(currRing->cf, currRing->cf);
2941 }
2942 else
2943 // Allow imap/fetch to be make an exception only for:
2944 if ( (rField_is_Q_a(orig_ring) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2948 ||
2949 (rField_is_Zp_a(orig_ring) && // Zp(a..) -> Zp(a..) || Zp
2950 (rField_is_Zp(currRing, rInternalChar(orig_ring)) ||
2951 rField_is_Zp_a(currRing, rInternalChar(orig_ring)))) )
2952 {
2953 par_perm_size=rPar(orig_ring);
2954
2955// if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
2956// naSetChar(rInternalChar(orig_ring),orig_ring);
2957// else ntSetChar(rInternalChar(orig_ring),orig_ring);
2958
2959 nSetChar(currRing->cf);
2960 }
2961 else
2962 {
2963 WerrorS("coefficient fields must be equal if q-ideal !=0");
2964 goto rCompose_err;
2965 }
2966 }
2967 perm=(int *)omAlloc0((orig_ring->N+1)*sizeof(int));
2968 if (par_perm_size!=0)
2969 par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2970 int i;
2971 #if 0
2972 // use imap:
2973 maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2974 currRing->names,currRing->N,currRing->parameter, currRing->P,
2975 perm,par_perm, currRing->ch);
2976 #else
2977 // use fetch
2978 if ((rPar(orig_ring)>0) && (rPar(currRing)==0))
2979 {
2980 for(i=si_min(rPar(orig_ring),rVar(currRing))-1;i>=0;i--) par_perm[i]=i+1;
2981 }
2982 else if (par_perm_size!=0)
2983 for(i=si_min(rPar(orig_ring),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2984 for(i=si_min(orig_ring->N,rVar(currRing));i>0;i--) perm[i]=i;
2985 #endif
2986 ideal dest_id=idInit(IDELEMS(q),1);
2987 for(i=IDELEMS(q)-1; i>=0; i--)
2988 {
2989 dest_id->m[i]=p_PermPoly(q->m[i],perm,orig_ring, currRing,nMap,
2990 par_perm,par_perm_size);
2991 // PrintS("map:");pWrite(dest_id->m[i]);PrintLn();
2992 pTest(dest_id->m[i]);
2993 }
2994 R->qideal=dest_id;
2995 if (perm!=NULL)
2996 omFreeSize((ADDRESS)perm,(orig_ring->N+1)*sizeof(int));
2997 if (par_perm!=NULL)
2998 omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2999 rChangeCurrRing(orig_ring);
3000 #endif
3001 }
3002 else
3003 R->qideal=idrCopyR(q,currRing,R);
3004 }
3005 }
3006 else
3007 {
3008 WerrorS("q-ideal must be given as `ideal`");
3009 goto rCompose_err;
3010 }
3011
3012
3013 // ---------------------------------------------------------------
3014 #ifdef HAVE_PLURAL
3015 if (L->nr==5)
3016 {
3017 if (nc_CallPlural((matrix)L->m[4].Data(),
3018 (matrix)L->m[5].Data(),
3019 NULL,NULL,
3020 R,
3021 true, // !!!
3022 true, false,
3023 currRing, FALSE)) goto rCompose_err;
3024 // takes care about non-comm. quotient! i.e. calls "nc_SetupQuotient" due to last true
3025 }
3026 #endif
3027 return R;
3028
3029rCompose_err:
3030 if (R->N>0)
3031 {
3032 int i;
3033 if (R->names!=NULL)
3034 {
3035 i=R->N-1;
3036 while (i>=0) { omfree(R->names[i]); i--; }
3037 omFree(R->names);
3038 }
3039 }
3040 omfree(R->order);
3041 omfree(R->block0);
3042 omfree(R->block1);
3043 omfree(R->wvhdl);
3044 omFree(R);
3045 return NULL;
3046}
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:2384
void rComposeC(lists L, ring R)
Definition ipshell.cc:2241
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
Definition ipshell.cc:2471
ring rCompose(const lists L, const BOOLEAN check_comp, const long bitmask, const int isLetterplace)
Definition ipshell.cc:2771
void rComposeRing(lists L, ring R)
Definition ipshell.cc:2292
static BOOLEAN rComposeVar(const lists L, ring R)
Definition ipshell.cc:2426
#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:4152
#define pTest(p)
Definition polys.h:414
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:3465
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:1749
static BOOLEAN rField_is_Zp_a(const ring r)
Definition ring.h:534
static BOOLEAN rField_is_Zn(const ring r)
Definition ring.h:517
static int rPar(const ring r)
(r->cf->P)
Definition ring.h:604
static int rInternalChar(const ring r)
Definition ring.h:694
static BOOLEAN rField_is_Q_a(const ring r)
Definition ring.h:544
mpz_ptr base
Definition rmodulon.h:17
struct for passing initialization parameters to naInitChar
Definition transext.h:88

◆ rDecompose()

lists rDecompose ( const ring r)

Definition at line 2142 of file ipshell.cc.

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

◆ rDecompose_CF()

BOOLEAN rDecompose_CF ( leftv res,
const coeffs C )

Definition at line 1932 of file ipshell.cc.

1933{
1934 assume( C != NULL );
1935
1936 // sanity check: require currRing==r for rings with polynomial data
1937 if ( nCoeff_is_algExt(C) && (C != currRing->cf))
1938 {
1939 WerrorS("ring with polynomial data must be the base ring or compatible");
1940 return TRUE;
1941 }
1942 if (nCoeff_is_numeric(C))
1943 {
1945 }
1946 else if (nCoeff_is_Ring(C))
1947 {
1949 }
1950 else if ( C->extRing!=NULL )// nCoeff_is_algExt(r->cf))
1951 {
1952 rDecomposeCF(res, C->extRing, currRing);
1953 }
1954 else if(nCoeff_is_GF(C))
1955 {
1957 Lc->Init(4);
1958 // char:
1959 Lc->m[0].rtyp=INT_CMD;
1960 Lc->m[0].data=(void*)(long)C->m_nfCharQ;
1961 // var:
1963 Lv->Init(1);
1964 Lv->m[0].rtyp=STRING_CMD;
1965 Lv->m[0].data=(void *)omStrDup(*n_ParameterNames(C));
1966 Lc->m[1].rtyp=LIST_CMD;
1967 Lc->m[1].data=(void*)Lv;
1968 // ord:
1970 Lo->Init(1);
1972 Loo->Init(2);
1973 Loo->m[0].rtyp=STRING_CMD;
1974 Loo->m[0].data=(void *)omStrDup(rSimpleOrdStr(ringorder_lp));
1975
1976 intvec *iv=new intvec(1); (*iv)[0]=1;
1977 Loo->m[1].rtyp=INTVEC_CMD;
1978 Loo->m[1].data=(void *)iv;
1979
1980 Lo->m[0].rtyp=LIST_CMD;
1981 Lo->m[0].data=(void*)Loo;
1982
1983 Lc->m[2].rtyp=LIST_CMD;
1984 Lc->m[2].data=(void*)Lo;
1985 // q-ideal:
1986 Lc->m[3].rtyp=IDEAL_CMD;
1987 Lc->m[3].data=(void *)idInit(1,1);
1988 // ----------------------
1989 res->rtyp=LIST_CMD;
1990 res->data=(void*)Lc;
1991 }
1992 else
1993 {
1994 res->rtyp=INT_CMD;
1995 res->data=(void *)(long)C->ch;
1996 }
1997 // ----------------------------------------
1998 return FALSE;
1999}
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:1808
static void rDecomposeRing_41(leftv h, const coeffs C)
Definition ipshell.cc:1877

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring r)

Definition at line 2103 of file ipshell.cc.

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

◆ rDefault()

idhdl rDefault ( const char * s)

Definition at line 1634 of file ipshell.cc.

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

◆ rFindHdl()

idhdl rFindHdl ( ring r,
idhdl n )

Definition at line 1690 of file ipshell.cc.

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

◆ rInit()

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

Definition at line 5609 of file ipshell.cc.

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

◆ rKill() [1/2]

void rKill ( idhdl h)

Definition at line 6207 of file ipshell.cc.

6208{
6209 ring r = IDRING(h);
6210 int ref=0;
6211 if (r!=NULL)
6212 {
6213 // avoid, that sLastPrinted is the last reference to the base ring:
6214 // clean up before killing the last "named" refrence:
6216 && (sLastPrinted.data==(void*)r))
6217 {
6219 }
6220 ref=r->ref;
6221 if ((ref<=0)&&(r==currRing))
6222 {
6223 // cleanup DENOMINATOR_LIST
6225 {
6227 if (TEST_V_ALLWARN)
6228 Warn("deleting denom_list for ring change from %s",IDID(h));
6229 do
6230 {
6231 n_Delete(&(dd->n),currRing->cf);
6232 dd=dd->next;
6235 } while(DENOMINATOR_LIST!=NULL);
6236 }
6237 }
6238 rKill(r);
6239 }
6240 if (h==currRingHdl)
6241 {
6242 if (ref<=0) { currRing=NULL; currRingHdl=NULL;}
6243 else
6244 {
6246 }
6247 }
6248}
void rKill(ring r)
Definition ipshell.cc:6162
VAR denominator_list DENOMINATOR_LIST
Definition kutil.cc:84
denominator_list next
Definition kutil.h:65

◆ rKill() [2/2]

void rKill ( ring r)

Definition at line 6162 of file ipshell.cc.

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

◆ rSetHdl()

void rSetHdl ( idhdl h)

Definition at line 5110 of file ipshell.cc.

5111{
5112 ring rg = NULL;
5113 if (h!=NULL)
5114 {
5115// Print(" new ring:%s (l:%d)\n",IDID(h),IDLEV(h));
5116 rg = IDRING(h);
5117 if (rg==NULL) return; //id <>NULL, ring==NULL
5118 omCheckAddrSize((ADDRESS)h,sizeof(idrec));
5119 if (IDID(h)) // OB: ????
5121 rTest(rg);
5122 }
5123 else return;
5124
5125 // clean up history
5126 if (currRing!=NULL)
5127 {
5129 {
5131 }
5132
5133 if (rg!=currRing)/*&&(currRing!=NULL)*/
5134 {
5135 if (rg->cf!=currRing->cf)
5136 {
5139 {
5140 if (TEST_V_ALLWARN)
5141 Warn("deleting denom_list for ring change to %s",IDID(h));
5142 do
5143 {
5144 n_Delete(&(dd->n),currRing->cf);
5145 dd=dd->next;
5148 } while(DENOMINATOR_LIST!=NULL);
5149 }
5150 }
5151 }
5152 }
5153
5154 // test for valid "currRing":
5155 if ((rg!=NULL) && (rg->idroot==NULL))
5156 {
5157 ring old=rg;
5158 rg=rAssure_HasComp(rg);
5159 if (old!=rg)
5160 {
5161 rKill(old);
5162 IDRING(h)=rg;
5163 }
5164 }
5165 /*------------ change the global ring -----------------------*/
5166 rChangeCurrRing(rg);
5167 currRingHdl = h;
5168}
#define omCheckAddr(addr)
#define omCheckAddrSize(addr, size)
ring rAssure_HasComp(const ring r)
Definition ring.cc:4656

◆ scIndIndset()

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

Definition at line 1102 of file ipshell.cc.

1104{
1105 int i;
1106 indset save;
1108
1109 hexist = hInit(S, Q, &hNexist);
1110 if (hNexist == 0)
1111 {
1112 intvec *iv=new intvec(rVar(currRing));
1113 for(i=0; i<rVar(currRing); i++) (*iv)[i]=1;
1114 res->Init(1);
1115 res->m[0].rtyp=INTVEC_CMD;
1116 res->m[0].data=(intvec*)iv;
1117 return res;
1118 }
1120 hMu = 0;
1121 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
1122 hvar = (varset)omAlloc((rVar(currRing) + 1) * sizeof(int));
1123 hpure = (scmon)omAlloc0((1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1124 hrad = hexist;
1125 hNrad = hNexist;
1126 radmem = hCreate(rVar(currRing) - 1);
1127 hCo = rVar(currRing) + 1;
1128 hNvar = rVar(currRing);
1130 hSupp(hrad, hNrad, hvar, &hNvar);
1131 if (hNvar)
1132 {
1133 hCo = hNvar;
1134 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
1137 }
1138 if (hCo && (hCo < rVar(currRing)))
1139 {
1141 }
1142 if (hMu!=0)
1143 {
1144 ISet = save;
1145 hMu2 = 0;
1146 if (all && (hCo+1 < rVar(currRing)))
1147 {
1150 i=hMu+hMu2;
1151 res->Init(i);
1152 if (hMu2 == 0)
1153 {
1155 }
1156 }
1157 else
1158 {
1159 res->Init(hMu);
1160 }
1161 for (i=0;i<hMu;i++)
1162 {
1163 res->m[i].data = (void *)save->set;
1164 res->m[i].rtyp = INTVEC_CMD;
1165 ISet = save;
1166 save = save->nx;
1168 }
1170 if (hMu2 != 0)
1171 {
1172 save = JSet;
1173 for (i=hMu;i<hMu+hMu2;i++)
1174 {
1175 res->m[i].data = (void *)save->set;
1176 res->m[i].rtyp = INTVEC_CMD;
1177 JSet = save;
1178 save = save->nx;
1180 }
1182 }
1183 }
1184 else
1185 {
1186 res->Init(0);
1188 }
1189 hKill(radmem, rVar(currRing) - 1);
1190 omFreeSize((ADDRESS)hpure, (1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1191 omFreeSize((ADDRESS)hvar, (rVar(currRing) + 1) * sizeof(int));
1192 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
1194 return res;
1195}
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 4535 of file ipshell.cc.

4536{
4537 sleftv tmp;
4538 tmp.Init();
4539 tmp.rtyp=INT_CMD;
4540 /* tmp.data = (void *)0; -- done by Init */
4541
4542 return semicProc3(res,u,v,&tmp);
4543}

◆ semicProc3()

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

Definition at line 4495 of file ipshell.cc.

4496{
4497 semicState state;
4498 BOOLEAN qh=(((int)(long)w->Data())==1);
4499
4500 // -----------------
4501 // check arguments
4502 // -----------------
4503
4504 lists l1 = (lists)u->Data( );
4505 lists l2 = (lists)v->Data( );
4506
4507 if( (state=list_is_spectrum( l1 ))!=semicOK )
4508 {
4509 WerrorS( "first argument is not a spectrum" );
4510 list_error( state );
4511 }
4512 else if( (state=list_is_spectrum( l2 ))!=semicOK )
4513 {
4514 WerrorS( "second argument is not a spectrum" );
4515 list_error( state );
4516 }
4517 else
4518 {
4519 spectrum s1= spectrumFromList( l1 );
4520 spectrum s2= spectrumFromList( l2 );
4521
4522 res->rtyp = INT_CMD;
4523 if (qh)
4524 res->data = (void*)(long)(s1.mult_spectrumh( s2 ));
4525 else
4526 res->data = (void*)(long)(s1.mult_spectrum( s2 ));
4527 }
4528
4529 // -----------------
4530 // check status
4531 // -----------------
4532
4533 return (state!=semicOK);
4534}
int mult_spectrum(spectrum &)
Definition semic.cc:396
int mult_spectrumh(spectrum &)
Definition semic.cc:425
semicState
Definition ipshell.cc:3419
@ semicOK
Definition ipshell.cc:3420
void list_error(semicState state)
Definition ipshell.cc:3452
spectrum spectrumFromList(lists l)
Definition ipshell.cc:3368
semicState list_is_spectrum(lists l)
Definition ipshell.cc:4237

◆ 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 ) {
619 si_opt_1 &=~Sy_bit(OPT_INTSTRATEGY);
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 {
638 // optOldStd disables redthrough
639 if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
640 si_opt_1 &= ~Sy_bit(OPT_REDTHROUGH);
641 }
642 else
643 WarnS("cannot set option");
644#if 0
648 ) {
649 test &=~Sy_bit(OPT_INTSTRATEGY);
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 {
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 {
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 {
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
unsigned resetval
Definition ipid.h:154
VAR BITSET validOpts
Definition kstd1.cc:60
const struct soptionStruct verboseStruct[]
Definition misc_ip.cc:539
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:508
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:553

◆ 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:113
#define SEEK_END
Definition mod2.h:109
char * str(leftv arg)
Definition shared.cc:699
int status int fd
Definition si_signals.h:69

◆ singular_system()

leftv singular_system ( sleftv h)

◆ spaddProc()

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

Definition at line 4412 of file ipshell.cc.

4413{
4414 semicState state;
4415
4416 // -----------------
4417 // check arguments
4418 // -----------------
4419
4420 lists l1 = (lists)first->Data( );
4421 lists l2 = (lists)second->Data( );
4422
4423 if( (state=list_is_spectrum( l1 )) != semicOK )
4424 {
4425 WerrorS( "first argument is not a spectrum:" );
4426 list_error( state );
4427 }
4428 else if( (state=list_is_spectrum( l2 )) != semicOK )
4429 {
4430 WerrorS( "second argument is not a spectrum:" );
4431 list_error( state );
4432 }
4433 else
4434 {
4435 spectrum s1= spectrumFromList ( l1 );
4436 spectrum s2= spectrumFromList ( l2 );
4437 spectrum sum( s1+s2 );
4438
4439 result->rtyp = LIST_CMD;
4440 result->data = (char*)(getList(sum));
4441 }
4442
4443 return (state!=semicOK);
4444}
lists getList(spectrum &spec)
Definition ipshell.cc:3380

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv result,
leftv first )

Definition at line 4168 of file ipshell.cc.

4169{
4170 spectrumState state = spectrumOK;
4171
4172 // -------------------
4173 // check consistency
4174 // -------------------
4175
4176 // check for a local polynomial ring
4177
4178 if( currRing->OrdSgn != -1 )
4179 // ?? HS: the test above is also true for k[x][[y]], k[[x]][y]
4180 // or should we use:
4181 //if( !ringIsLocal( ) )
4182 {
4183 WerrorS( "only works for local orderings" );
4184 state = spectrumWrongRing;
4185 }
4186 else if( currRing->qideal != NULL )
4187 {
4188 WerrorS( "does not work in quotient rings" );
4189 state = spectrumWrongRing;
4190 }
4191 else
4192 {
4193 lists L = (lists)NULL;
4194 int flag = 2; // symmetric optimization
4195
4196 state = spectrumCompute( (poly)first->Data( ),&L,flag );
4197
4198 if( state==spectrumOK )
4199 {
4200 result->rtyp = LIST_CMD;
4201 result->data = (char*)L;
4202 }
4203 else
4204 {
4205 spectrumPrintError(state);
4206 }
4207 }
4208
4209 return (state!=spectrumOK);
4210}
spectrumState
Definition ipshell.cc:3535
@ spectrumWrongRing
Definition ipshell.cc:3542
@ spectrumOK
Definition ipshell.cc:3536
spectrumState spectrumCompute(poly h, lists *L, int fast)
Definition ipshell.cc:3794
void spectrumPrintError(spectrumState state)
Definition ipshell.cc:4086

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv result,
leftv first )

Definition at line 4117 of file ipshell.cc.

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

◆ spmulProc()

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

Definition at line 4454 of file ipshell.cc.

4455{
4456 semicState state;
4457
4458 // -----------------
4459 // check arguments
4460 // -----------------
4461
4462 lists l = (lists)first->Data( );
4463 int k = (int)(long)second->Data( );
4464
4465 if( (state=list_is_spectrum( l ))!=semicOK )
4466 {
4467 WerrorS( "first argument is not a spectrum" );
4468 list_error( state );
4469 }
4470 else if( k < 0 )
4471 {
4472 WerrorS( "second argument should be positive" );
4473 state = semicMulNegative;
4474 }
4475 else
4476 {
4478 spectrum product( k*s );
4479
4480 result->rtyp = LIST_CMD;
4481 result->data = (char*)getList(product);
4482 }
4483
4484 return (state!=semicOK);
4485}
@ semicMulNegative
Definition ipshell.cc:3421

◆ syBetti1()

BOOLEAN syBetti1 ( leftv res,
leftv u )

Definition at line 3154 of file ipshell.cc.

3155{
3156 sleftv tmp;
3157 tmp.Init();
3158 tmp.rtyp=INT_CMD;
3159 tmp.data=(void *)1;
3160 return syBetti2(res,u,&tmp);
3161}
BOOLEAN syBetti2(leftv res, leftv u, leftv w)
Definition ipshell.cc:3131

◆ syBetti2()

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

Definition at line 3131 of file ipshell.cc.

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

◆ syConvList()

syStrategy syConvList ( lists li)

Definition at line 3238 of file ipshell.cc.

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

◆ syConvRes()

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

Definition at line 3166 of file ipshell.cc.

3167{
3168 resolvente fullres = syzstr->fullres;
3169 resolvente minres = syzstr->minres;
3170
3171 const int length = syzstr->length;
3172
3173 if ((fullres==NULL) && (minres==NULL))
3174 {
3175 if (syzstr->hilb_coeffs==NULL)
3176 { // La Scala
3177 fullres = syReorder(syzstr->res, length, syzstr);
3178 }
3179 else
3180 { // HRES
3181 minres = syReorder(syzstr->orderedRes, length, syzstr);
3182 syKillEmptyEntres(minres, length);
3183 }
3184 }
3185
3186 resolvente tr;
3187 int typ0=IDEAL_CMD;
3188
3189 if (minres!=NULL)
3190 tr = minres;
3191 else
3192 tr = fullres;
3193
3194 resolvente trueres=NULL;
3195 intvec ** w=NULL;
3196
3197 if (length>0)
3198 {
3199 trueres = (resolvente)omAlloc0((length)*sizeof(ideal));
3200 for (int i=length-1;i>=0;i--)
3201 {
3202 if (tr[i]!=NULL)
3203 {
3204 trueres[i] = idCopy(tr[i]);
3205 }
3206 }
3207 if ( id_RankFreeModule(trueres[0], currRing) > 0)
3208 typ0 = MODUL_CMD;
3209 if (syzstr->weights!=NULL)
3210 {
3211 w = (intvec**)omAlloc0(length*sizeof(intvec*));
3212 for (int i=length-1;i>=0;i--)
3213 {
3214 if (syzstr->weights[i]!=NULL) w[i] = ivCopy(syzstr->weights[i]);
3215 }
3216 }
3217 }
3218
3219 lists li = liMakeResolv(trueres, length, syzstr->list_length,typ0,
3220 w, add_row_shift);
3221
3222 if (toDel)
3223 syKillComputation(syzstr);
3224 else
3225 {
3226 if( fullres != NULL && syzstr->fullres == NULL )
3227 syzstr->fullres = fullres;
3228
3229 if( minres != NULL && syzstr->minres == NULL )
3230 syzstr->minres = minres;
3231 }
3232 return li;
3233}
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 512 of file ipshell.cc.

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

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

◆ 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,
778#ifdef MAKE_DISTRIBUTION
779 VERSION_DATE);
780#else
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 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)
const char * singular_date
Definition misc_ip.cc:769
#define MDEBUG
Definition mod2.h:178
#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:470
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 NO_CONVERSION
Definition gentable.cc:51
#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:3828
static BOOLEAN jjRANK1(leftv res, leftv v)
Definition iparith.cc:4958
static BOOLEAN jjIMPART(leftv res, leftv v)
Definition iparith.cc:4455
static BOOLEAN jjIm2Iv(leftv res, leftv v)
Definition iparith.cc:4448
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
Definition iparith.cc:3834
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
Definition iparith.cc:5300
BOOLEAN jjWAITALL1(leftv res, leftv u)
Definition iparith.cc:5541
static BOOLEAN jjRESTART(leftv, leftv u)
Definition iparith.cc:8965
static BOOLEAN jjidHead(leftv res, leftv v)
Definition iparith.cc:5703
static BOOLEAN jjHILBERT(leftv, leftv v)
Definition iparith.cc:4339
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
Definition iparith.cc:4614
static BOOLEAN jjstrlen(leftv res, leftv v)
Definition iparith.cc:5668
static BOOLEAN jjDET_BI(leftv res, leftv v)
Definition iparith.cc:4096
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
Definition iparith.cc:5526
static BOOLEAN jjP2I(leftv res, leftv v)
Definition iparith.cc:4872
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
Definition iparith.cc:4482
static BOOLEAN jjREPART(leftv res, leftv v)
Definition iparith.cc:4974
static BOOLEAN jjN2BI(leftv res, leftv v)
Definition iparith.cc:4755
static BOOLEAN jjCHAR(leftv res, leftv v)
Definition iparith.cc:3943
static BOOLEAN jjROWS_IV(leftv res, leftv v)
Definition iparith.cc:5019
static BOOLEAN jjNULL(leftv, leftv)
Definition iparith.cc:3778
static BOOLEAN jjBIV2IV(leftv res, leftv v)
Definition iparith.cc:4473
static BOOLEAN jjDIM(leftv res, leftv v)
Definition iparith.cc:4152
static BOOLEAN jjCOUNT_BIM(leftv res, leftv v)
Definition iparith.cc:3983
static BOOLEAN jjCOLS_IV(leftv res, leftv v)
Definition iparith.cc:3965
static BOOLEAN jjNAMES_I(leftv res, leftv v)
Definition iparith.cc:4785
static BOOLEAN jjMULT(leftv res, leftv v)
Definition iparith.cc:4735
static BOOLEAN jjPARDEG(leftv res, leftv v)
Definition iparith.cc:4828
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number.
Definition iparith.cc:4073
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
Definition iparith.cc:4412
static BOOLEAN jjmpTransp(leftv res, leftv v)
Definition iparith.cc:5731
static BOOLEAN jjDET_S(leftv res, leftv v)
Definition iparith.cc:4146
static BOOLEAN jjL2R(leftv res, leftv v)
Definition iparith.cc:4574
static BOOLEAN jjrCharStr(leftv res, leftv v)
Definition iparith.cc:5693
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
Definition iparith.cc:4352
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
Definition iparith.cc:4431
static BOOLEAN jjINDEPSET(leftv res, leftv v)
Definition iparith.cc:4460
static BOOLEAN jjTYPEOF(leftv res, leftv v)
Definition iparith.cc:5414
static BOOLEAN jjFACSTD(leftv res, leftv v)
Definition iparith.cc:4215
static BOOLEAN jjMEMORY(leftv res, leftv v)
Definition iparith.cc:4690
static BOOLEAN jjidTransp(leftv res, leftv v)
Definition iparith.cc:5761
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
Definition iparith.cc:3841
static BOOLEAN jjDIM_R(leftv res, leftv v)
Definition iparith.cc:5756
static BOOLEAN jjDUMP(leftv, leftv v)
Definition iparith.cc:4180
static BOOLEAN jjpMaxComp(leftv res, leftv v)
Definition iparith.cc:5721
static BOOLEAN jjCOEFFS1(leftv res, leftv v)
Definition iparith.cc:3948
static BOOLEAN jjNAMEOF(leftv res, leftv v)
Definition iparith.cc:4767
static BOOLEAN jjPRIME(leftv res, leftv v)
Definition iparith.cc:4890
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
Definition iparith.cc:5688
static BOOLEAN jjJACOB_P(leftv res, leftv v)
Definition iparith.cc:4498
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
Definition iparith.cc:5187
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
Definition iparith.cc:3939
static BOOLEAN jjINTERRED(leftv res, leftv v)
Definition iparith.cc:4466
static BOOLEAN jjJACOB_M(leftv res, leftv a)
Definition iparith.cc:4529
static BOOLEAN jjBAREISS(leftv res, leftv v)
Definition iparith.cc:3873
static BOOLEAN jjREAD(leftv res, leftv v)
Definition iparith.cc:4965
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
Definition iparith.cc:4487
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
Definition iparith.cc:5014
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
Definition iparith.cc:5034
static BOOLEAN jjMSTD(leftv res, leftv v)
Definition iparith.cc:4720
static BOOLEAN jjnInt(leftv res, leftv u)
Definition iparith.cc:5766
static BOOLEAN jjREGULARITY(leftv res, leftv v)
Definition iparith.cc:4969
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
Definition iparith.cc:5285
static BOOLEAN jjMONOM(leftv res, leftv v)
Definition iparith.cc:2781
static BOOLEAN jjSort_Id(leftv res, leftv v)
Definition iparith.cc:5182
static BOOLEAN jjidMinBase(leftv res, leftv v)
Definition iparith.cc:5709
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
Definition iparith.cc:4884
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
Definition iparith.cc:4395
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
Definition iparith.cc:3978
static BOOLEAN jjKERNEL_M(leftv res, leftv v)
Definition iparith.cc:4550
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
Definition iparith.cc:3960
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
Definition iparith.cc:4421
static BOOLEAN jjEXECUTE(leftv, leftv v)
Definition iparith.cc:4206
static BOOLEAN jjLEADEXP(leftv res, leftv v)
Definition iparith.cc:4596
static BOOLEAN jjDEG_M(leftv res, leftv u)
Definition iparith.cc:4033
static BOOLEAN jjPAR1(leftv res, leftv v)
Definition iparith.cc:4812
static BOOLEAN jjnlInt(leftv res, leftv u)
Definition iparith.cc:5773
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
Definition iparith.cc:3792
static BOOLEAN jjROWS(leftv res, leftv v)
Definition iparith.cc:5008
static BOOLEAN jjSBA(leftv res, leftv v)
Definition iparith.cc:5076
static BOOLEAN jjJanetBasis(leftv res, leftv v)
Definition iparith.cc:2543
static BOOLEAN jjKBASE(leftv res, leftv v)
Definition iparith.cc:4568
static BOOLEAN jjmpTrace(leftv res, leftv v)
Definition iparith.cc:5726
static BOOLEAN jjPRUNE(leftv res, leftv v)
Definition iparith.cc:4896
static BOOLEAN jjDEFINED(leftv res, leftv v)
Definition iparith.cc:4061
static BOOLEAN jjLagSolve(leftv res, leftv v)
Definition iparith.cc:4651
static BOOLEAN jjVDIM(leftv res, leftv v)
Definition iparith.cc:5499
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
Definition iparith.cc:3989
static BOOLEAN jjP2N(leftv res, leftv v)
Definition iparith.cc:4920
static BOOLEAN jjE(leftv res, leftv v)
Definition iparith.cc:4194
static BOOLEAN jjLISTRING(leftv res, leftv v)
Definition iparith.cc:4633
static BOOLEAN jjVAR1(leftv res, leftv v)
Definition iparith.cc:5465
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
Definition iparith.cc:4582
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
Definition iparith.cc:3804
static BOOLEAN jjpLength(leftv res, leftv v)
Definition iparith.cc:5673
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
Definition iparith.cc:4493
static BOOLEAN jjBI2P(leftv res, leftv u)
Definition iparith.cc:3924
static BOOLEAN jjTWOSTD(leftv res, leftv a)
Definition iparith.cc:5334
static BOOLEAN jjFAC_P(leftv res, leftv u)
Definition iparith.cc:4255
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
Definition iparith.cc:5290
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
Definition iparith.cc:5751
static BOOLEAN jjrOrdStr(leftv res, leftv v)
Definition iparith.cc:5736
static BOOLEAN jjpHead(leftv res, leftv v)
Definition iparith.cc:5698
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
Definition iparith.cc:3994
static BOOLEAN jjDET_I(leftv res, leftv v)
Definition iparith.cc:4132
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
Definition iparith.cc:4011
static BOOLEAN jjrVarStr(leftv res, leftv v)
Definition iparith.cc:5741
static BOOLEAN jjMONITOR1(leftv res, leftv v)
Definition iparith.cc:2736
static BOOLEAN jjUMINUS_N(leftv res, leftv u)
Definition iparith.cc:3816
static BOOLEAN jjNUMERATOR(leftv res, leftv v)
Return the numerator of the input number.
Definition iparith.cc:4082
static BOOLEAN jjORD(leftv res, leftv v)
Definition iparith.cc:4806
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
Definition iparith.cc:3811
static BOOLEAN jjENVELOPE(leftv res, leftv a)
Definition iparith.cc:5319
static BOOLEAN jjSetRing(leftv, leftv u)
Definition iparith.cc:3849
static BOOLEAN jjMINRES_R(leftv res, leftv v)
Definition iparith.cc:4741
static BOOLEAN jjCOLS(leftv res, leftv v)
Definition iparith.cc:3955
static BOOLEAN jjP2BI(leftv res, leftv v)
Definition iparith.cc:4852
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
Definition iparith.cc:5295
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
Definition iparith.cc:5460
static BOOLEAN jjBAREISS_BIM(leftv res, leftv v)
Definition iparith.cc:3896
static BOOLEAN jjPFAC1(leftv res, leftv v)
Definition iparith.cc:4642
static BOOLEAN jjCONTENT(leftv res, leftv v)
Definition iparith.cc:3970
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5154
static BOOLEAN jjCOUNT_IV(leftv res, leftv v)
Definition iparith.cc:4006
static BOOLEAN jjDUMMY(leftv res, leftv u)
Definition iparith.cc:3771
static BOOLEAN jjS2I(leftv res, leftv v)
Definition iparith.cc:5029
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3903
static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
Definition iparith.cc:5353
static BOOLEAN jjGETDUMP(leftv, leftv v)
Definition iparith.cc:4271
static BOOLEAN jjidFreeModule(leftv res, leftv v)
Definition iparith.cc:5683
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
Definition iparith.cc:4936
static BOOLEAN jjRPAR(leftv res, leftv v)
Definition iparith.cc:5024
static BOOLEAN jjLOAD1(leftv, leftv v)
Definition iparith.cc:4629
static BOOLEAN jjKERNEL_SM(leftv res, leftv v)
Definition iparith.cc:4559
static BOOLEAN jjrParStr(leftv res, leftv v)
Definition iparith.cc:5746
static BOOLEAN jjDEG(leftv res, leftv v)
Definition iparith.cc:4025
static BOOLEAN jjRINGLIST(leftv res, leftv v)
Definition iparith.cc:4979
static BOOLEAN jjidElem(leftv res, leftv v)
Definition iparith.cc:5678
static BOOLEAN jjBI2IM(leftv res, leftv u)
Definition iparith.cc:3918
static BOOLEAN jjDEGREE(leftv res, leftv v)
Definition iparith.cc:4044
static BOOLEAN jjOpenClose(leftv, leftv v)
Definition iparith.cc:4800
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
Definition iparith.cc:3823
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
Definition iparith.cc:4292
static BOOLEAN jjNAMES(leftv res, leftv v)
Definition iparith.cc:4780
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
Definition iparith.cc:4285
static BOOLEAN jjPROC1(leftv res, leftv u)
Definition iparith.cc:3869
static BOOLEAN jjNOT(leftv res, leftv v)
Definition iparith.cc:4790
static BOOLEAN jjPARSTR1(leftv res, leftv v)
Definition iparith.cc:4834
static BOOLEAN jjHOMOG1(leftv res, leftv v)
Definition iparith.cc:4362
static BOOLEAN jjDET(leftv res, leftv v)
Definition iparith.cc:4090
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
Definition iparith.cc:4000
static BOOLEAN jjRING_LIST(leftv res, leftv v)
Definition iparith.cc:5001
static BOOLEAN jjVARSTR1(leftv res, leftv v)
Definition iparith.cc:5482
static BOOLEAN jjSYZYGY(leftv res, leftv v)
Definition iparith.cc:5214
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
Definition iparith.cc:4660
static BOOLEAN jjNVARS(leftv res, leftv v)
Definition iparith.cc:4795
static BOOLEAN jjERROR(leftv, leftv u)
Definition iparith.cc:1997
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
Definition iparith.cc:4994
BOOLEAN jjPRINT(leftv res, leftv u)
Definition ipprint.cc:252
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
Definition ipshell.cc:6291
BOOLEAN jjMINRES(leftv res, leftv v)
Definition ipshell.cc:945
BOOLEAN syBetti1(leftv res, leftv u)
Definition ipshell.cc:3154
BOOLEAN jjCHARSERIES(leftv res, leftv u)
Definition ipshell.cc:3331
BOOLEAN mpJacobi(leftv res, leftv a)
Definition ipshell.cc:3053
BOOLEAN kWeight(leftv res, leftv id)
Definition ipshell.cc:3285
BOOLEAN kQHWeight(leftv res, leftv v)
Definition ipshell.cc:3307
BOOLEAN jjBETTI(leftv res, leftv u)
Definition ipshell.cc:966
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
Definition ipshell.cc:6299
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
Definition ipshell.cc:4547
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:487
BOOLEAN atATTRIB2(leftv res, leftv v, leftv b)
Definition attrib.cc:280
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:3101
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:2607
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
Definition iparith.cc:2805
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2740
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
Definition iparith.cc:2916
static BOOLEAN jjHOMOG1_WI(leftv res, leftv v, leftv u)
Definition iparith.cc:2505
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
Definition iparith.cc:3108
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:2587
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:2876
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:2695
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:3436
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:3288
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:5102
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:3384
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:2446
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:2896
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2819
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
Definition iparith.cc:2575
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:3149
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:4510
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:2525
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3347
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3141
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:2642
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:3125
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:2385
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:2553
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:3638
static BOOLEAN jjFWALK(leftv res, leftv u, leftv v)
Definition iparith.cc:2359
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:3575
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:2408
static BOOLEAN jjFIND2(leftv res, leftv u, leftv v)
Definition iparith.cc:2294
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:3664
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:2365
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:10416
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:2571
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2706
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
Definition iparith.cc:2631
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:2519
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:3333
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:2166
static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
Definition iparith.cc:3491
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:2836
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:2558
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:3158
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:3749
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:3442
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:2349
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:3645
static BOOLEAN jjRMINUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3314
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:3458
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:2537
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:3320
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:2463
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:2378
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
Definition iparith.cc:3116
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
Definition iparith.cc:2512
static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
Definition iparith.cc:3701
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:2627
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:3677
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:2984
static BOOLEAN jjMOD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2717
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:2402
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:2579
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:10217
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:2485
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:2548
static BOOLEAN jjPRUNE_MAP(leftv res, leftv v, leftv ma)
Definition iparith.cc:3057
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:2856
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3431
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:4639
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:368
#define jjWRONG3
Definition gentable.cc:126
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5825
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6955
static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6206
static BOOLEAN jjBRACK_Ma_IV_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5961
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6914
static BOOLEAN jjSUBST_Bu(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6818
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7207
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6160
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7270
static BOOLEAN jjMODULO3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6994
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6125
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6363
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6932
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6831
static BOOLEAN jjLIFTSTD_SYZ(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7131
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6080
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6369
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6105
static BOOLEAN jjHOMOG_W_M(leftv res, leftv v1, leftv v2, leftv v3)
Definition iparith.cc:6303
static BOOLEAN jjRING_2(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6068
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5798
static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6968
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6061
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7176
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5911
static BOOLEAN jjINTERSEC3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6338
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7215
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6346
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7261
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7256
static BOOLEAN jjFRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:2312
static BOOLEAN jjREDUCE3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7200
static BOOLEAN jjELIMIN_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6152
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6353
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7188
static BOOLEAN jjINTERSECT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6325
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5853
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6659
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6285
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6864
static BOOLEAN jjSMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7096
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6669
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6010
static BOOLEAN jjMRES_MAP(leftv res, leftv u, leftv v, leftv ma)
Definition iparith.cc:6576
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7109
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6267
static BOOLEAN jjFIND3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6175
static BOOLEAN jjMODULO3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7045
static BOOLEAN jjHILBERT3Qt(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6245
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6311
static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
Definition iparith.cc:2943
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6743
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6119
static BOOLEAN jjHILBERT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6215
static BOOLEAN jjLIFTSTD_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7154
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5782
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6918
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
Definition iparith.cc:5128
static BOOLEAN jjBRACK_SM(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5882
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3075
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:3324
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:4662
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:4805
@ 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:230
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8513
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8362
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8443
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7807
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8646
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8491
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8118
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7326
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7319
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7367
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6380
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7652
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7921
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8936
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8372
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8627
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7384
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8853
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8149
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8593
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7355
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7888
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8290
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7726
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8836
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7527
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8357
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:7982
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8778
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7343
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8239
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7347
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8065
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8809
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7483
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1272
BOOLEAN iiWRITE(leftv, leftv v)
Definition ipshell.cc:586
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4553
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:4906
@ 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 82 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.