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)
 the largest monomial in R/I
char * iiConvName (const char *libname)
BOOLEAN iiGetLibStatus (const char *lib)
BOOLEAN iiLoadLIB (FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
lists syConvRes (syStrategy syzstr, BOOLEAN toDel=FALSE, int add_row_shift=0)
syStrategy syConvList (lists li)
BOOLEAN syBetti1 (leftv res, leftv u)
BOOLEAN syBetti2 (leftv res, leftv u, leftv w)
int siSetCpus (int cpu)
BOOLEAN iiExprArith1 (leftv res, sleftv *a, int op)
BOOLEAN iiExprArith2 (leftv res, sleftv *a, int op, sleftv *b, BOOLEAN proccall=FALSE)
BOOLEAN iiExprArith3 (leftv res, int op, leftv a, leftv b, leftv c)
BOOLEAN iiExprArithM (leftv res, sleftv *a, int op)
BOOLEAN iiApply (leftv res, leftv a, int op, leftv proc)
BOOLEAN iiAssign (leftv left, leftv right, BOOLEAN toplevel=TRUE)
coeffs jjSetMinpoly (coeffs cf, number a)
BOOLEAN iiParameter (leftv p)
BOOLEAN iiAlias (leftv p)
int iiTokType (int op)
int iiDeclCommand (leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring=FALSE, BOOLEAN init_b=TRUE)
BOOLEAN iiMake_proc (idhdl pn, package pack, leftv sl)
void * iiCallLibProc1 (const char *n, void *arg, int arg_type, BOOLEAN &err)
leftv ii_CallLibProcM (const char *n, void **args, int *arg_types, const ring R, BOOLEAN &err)
 args: NULL terminated array of arguments arg_types: 0 terminated array of corresponding types
ideal ii_CallProcId2Id (const char *lib, const char *proc, ideal arg, const ring R)
int ii_CallProcId2Int (const char *lib, const char *proc, ideal arg, const ring R)
char * showOption ()
BOOLEAN setOption (leftv res, leftv v)
char * versionString ()
void singular_example (char *str)
BOOLEAN iiTryLoadLib (leftv v, const char *id)
int iiAddCproc (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
void iiCheckPack (package &p)
void rSetHdl (idhdl h)
ring rInit (leftv pn, leftv rv, leftv ord)
idhdl rDefault (const char *s)
idhdl rFindHdl (ring r, idhdl n)
void rKill (idhdl h)
void rKill (ring r)
lists scIndIndset (ideal S, BOOLEAN all, ideal Q)
BOOLEAN mpKoszul (leftv res, leftv c, leftv b, leftv id)
BOOLEAN mpJacobi (leftv res, leftv a)
BOOLEAN jjRESULTANT (leftv res, leftv u, leftv v, leftv w)
BOOLEAN kQHWeight (leftv res, leftv v)
BOOLEAN kWeight (leftv res, leftv id)
BOOLEAN loSimplex (leftv res, leftv args)
 Implementation of the Simplex Algorithm.
BOOLEAN loNewtonP (leftv res, leftv arg1)
 compute Newton Polytopes of input polynomials
BOOLEAN nuMPResMat (leftv res, leftv arg1, leftv arg2)
 returns module representing the multipolynomial resultant matrix Arguments 2: ideal i, int k k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default)
BOOLEAN nuLagSolve (leftv res, leftv arg1, leftv arg2, leftv arg3)
 find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial using Laguerres' root-solver.
BOOLEAN nuVanderSys (leftv res, leftv arg1, leftv arg2, leftv arg3)
 COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consider p as point in K^n and v as N elements in K, let p1,..,pN be the points in K^n obtained by evaluating all monomials of degree 0,1,...,N at p in lexicographical order, then the procedure computes the polynomial f satisfying f(pi) = v[i] RETURN: polynomial f of degree d.
BOOLEAN nuUResSolve (leftv res, leftv args)
 solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing->N) == IDELEMS(ideal).
BOOLEAN jjCHARSERIES (leftv res, leftv u)
void paPrint (const char *n, package p)
BOOLEAN iiTestAssume (leftv a, leftv b)
BOOLEAN iiExprArith1Tab (leftv res, leftv a, int op, const struct sValCmd1 *dA1, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to an argument a return TRUE on failure
BOOLEAN iiExprArith2Tab (leftv res, leftv a, int op, const struct sValCmd2 *dA2, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a and a->next return TRUE on failure
BOOLEAN iiExprArith3Tab (leftv res, leftv a, int op, const struct sValCmd3 *dA3, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a, a->next and a->next->next return TRUE on failure
BOOLEAN iiCheckTypes (leftv args, const short *type_list, int report=0)
 check a list of arguemys against a given field of types return TRUE if the types match return FALSE (and, if report) report an error via Werror otherwise
BOOLEAN iiBranchTo (leftv r, leftv args)
lists rDecompose (const ring r)
lists rDecompose_list_cf (const ring r)
BOOLEAN rDecompose_CF (leftv res, const coeffs C)
ring rCompose (const lists L, const BOOLEAN check_comp=TRUE, const long bitmask=0x7fff, const int isLetterplace=FALSE)
void iiSetReturn (const leftv h)

Variables

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

Data Structure Documentation

◆ sValCmd1

struct sValCmd1

Definition at line 75 of file gentable.cc.

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

◆ sValCmd2

struct sValCmd2

Definition at line 66 of file gentable.cc.

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

◆ sValCmd3

struct sValCmd3

Definition at line 83 of file gentable.cc.

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

◆ sValCmdM

struct sValCmdM

Definition at line 93 of file gentable.cc.

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

◆ sValAssign_sys

struct sValAssign_sys

Definition at line 101 of file gentable.cc.

Data Fields
short arg
int p
proc1 p
short res

◆ sValAssign

struct sValAssign

Definition at line 108 of file gentable.cc.

Data Fields
short arg
int p
proci p
short res

Typedef Documentation

◆ proc1

typedef BOOLEAN(* proc1) (leftv, leftv)

Definition at line 124 of file ipshell.h.

◆ proc2

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

Definition at line 136 of file ipshell.h.

◆ proc3

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

Definition at line 147 of file ipshell.h.

◆ proci

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

Definition at line 177 of file ipshell.h.

Function Documentation

◆ exprlist_length()

int exprlist_length ( leftv v)

Definition at line 551 of file ipshell.cc.

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

◆ ii_CallLibProcM()

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

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

Definition at line 710 of file iplib.cc.

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

◆ ii_CallProcId2Id()

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

Definition at line 670 of file iplib.cc.

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

◆ ii_CallProcId2Int()

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

Definition at line 689 of file iplib.cc.

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

◆ iiAddCproc()

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

Definition at line 1073 of file iplib.cc.

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

◆ iiAlias()

BOOLEAN iiAlias ( leftv p)

Definition at line 818 of file ipid.cc.

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

◆ iiAllStart()

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

Definition at line 306 of file iplib.cc.

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

◆ iiApply()

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

Definition at line 6431 of file ipshell.cc.

6432{
6433 res->Init();
6434 res->rtyp=a->Typ();
6435 switch (res->rtyp /*a->Typ()*/)
6436 {
6437 case INTVEC_CMD:
6438 case INTMAT_CMD:
6439 return iiApplyINTVEC(res,a,op,proc);
6440 case BIGINTMAT_CMD:
6441 return iiApplyBIGINTMAT(res,a,op,proc);
6442 case IDEAL_CMD:
6443 case MODUL_CMD:
6444 case MATRIX_CMD:
6445 return iiApplyIDEAL(res,a,op,proc);
6446 case LIST_CMD:
6447 return iiApplyLIST(res,a,op,proc);
6448 }
6449 WerrorS("first argument to `apply` must allow an index");
6450 return TRUE;
6451}
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:6350
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6392
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
Definition ipshell.cc:6387
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
Definition ipshell.cc:6382

◆ iiARROW()

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

Definition at line 6480 of file ipshell.cc.

6481{
6482 size_t len=strlen(a)+strlen(s)+30; /* max. 27 currently */
6483 char *ss=(char*)omAlloc(len);
6484 // find end of s:
6485 int end_s=strlen(s);
6486 while ((end_s>0) && ((s[end_s]<=' ')||(s[end_s]==';'))) end_s--;
6487 s[end_s+1]='\0';
6488 char *name=(char *)omAlloc(len);
6489 snprintf(name,len,"%s->%s",a,s);
6490 // find start of last expression
6491 int start_s=end_s-1;
6492 while ((start_s>=0) && (s[start_s]!=';')) start_s--;
6493 if (start_s<0) // ';' not found
6494 {
6495 snprintf(ss,len,"parameter def %s;return(%s);\n",a,s);
6496 }
6497 else // s[start_s] is ';'
6498 {
6499 s[start_s]='\0';
6500 snprintf(ss,len,"parameter def %s;%s;return(%s);\n",a,s,s+start_s+1);
6501 }
6502 r->Init();
6503 // now produce procinfo for PROC_CMD:
6504 r->data = (void *)omAlloc0Bin(procinfo_bin);
6505 ((procinfo *)(r->data))->language=LANG_NONE;
6507 ((procinfo *)r->data)->data.s.body=ss;
6508 omFree(name);
6509 r->rtyp=PROC_CMD;
6510 //r->rtyp=STRING_CMD;
6511 //r->data=ss;
6512 return FALSE;
6513}
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 2099 of file ipassign.cc.

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

◆ iiAssignCR()

BOOLEAN iiAssignCR ( leftv r,
leftv arg )

Definition at line 6515 of file ipshell.cc.

6516{
6517 char* ring_name=omStrDup((char*)r->Name());
6518 int t=arg->Typ();
6519 if (t==RING_CMD)
6520 {
6521 sleftv tmp;
6522 tmp.Init();
6523 tmp.rtyp=IDHDL;
6524 idhdl h=enterid(ring_name, myynest, RING_CMD, &IDROOT);
6525 IDRING(h)=NULL;
6526 tmp.data=(char*)h;
6527 if (h!=NULL)
6528 {
6529 tmp.name=h->id;
6530 BOOLEAN b=iiAssign(&tmp,arg);
6531 if (b) return TRUE;
6532 rSetHdl(ggetid(ring_name));
6533 omFree(ring_name);
6534 return FALSE;
6535 }
6536 else
6537 return TRUE;
6538 }
6539 else if (t==CRING_CMD)
6540 {
6541 sleftv tmp;
6542 sleftv n;
6543 n.Init();
6544 n.name=ring_name;
6545 if (iiDeclCommand(&tmp,&n,myynest,CRING_CMD,&IDROOT)) return TRUE;
6546 if (iiAssign(&tmp,arg)) return TRUE;
6547 //Print("create %s\n",r->Name());
6548 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6549 return FALSE;
6550 }
6551 //Print("create %s\n",r->Name());
6552 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6553 return TRUE;// not handled -> error for now
6554}
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:1206
void rSetHdl(idhdl h)
Definition ipshell.cc:5129

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv r,
leftv args )

Definition at line 1281 of file ipshell.cc.

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

◆ iiCallLibProc1()

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

Definition at line 636 of file iplib.cc.

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

◆ iiCheckPack()

void iiCheckPack ( package & p)

Definition at line 1631 of file ipshell.cc.

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

◆ iiCheckRing()

BOOLEAN iiCheckRing ( int i)

Definition at line 1585 of file ipshell.cc.

1586{
1587 if (currRing==NULL)
1588 {
1589 #ifdef SIQ
1590 if (siq<=0)
1591 {
1592 #endif
1593 if (RingDependend(i))
1594 {
1595 WerrorS("no ring active (9)");
1596 return TRUE;
1597 }
1598 #ifdef SIQ
1599 }
1600 #endif
1601 }
1602 return FALSE;
1603}
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 6576 of file ipshell.cc.

6577{
6578 int l=0;
6579 if (args==NULL)
6580 {
6581 if (type_list[0]==0) return TRUE;
6582 }
6583 else l=args->listLength();
6584 if (l!=(int)type_list[0])
6585 {
6586 if (report) iiReportTypes(0,l,type_list);
6587 return FALSE;
6588 }
6589 for(int i=1;i<=l;i++,args=args->next)
6590 {
6591 short t=type_list[i];
6592 if (t!=ANY_TYPE)
6593 {
6594 if (((t==IDHDL)&&(args->rtyp!=IDHDL))
6595 || (t!=args->Typ()))
6596 {
6597 if (report) iiReportTypes(i,args->Typ(),type_list);
6598 return FALSE;
6599 }
6600 }
6601 }
6602 return TRUE;
6603}
static void iiReportTypes(int nr, int t, const short *T)
Definition ipshell.cc:6556
#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 1073 of file ipshell.cc.

1074{
1075#ifdef HAVE_SDB
1076 sdb_flags=1;
1077#endif
1078 Print("\n-- break point in %s --\n",VoiceName());
1080 char * s;
1082 s = (char *)omAlloc(BREAK_LINE_LENGTH+4);
1083 loop
1084 {
1085 memset(s,0,BREAK_LINE_LENGTH+4);
1087 if (s[BREAK_LINE_LENGTH-1]!='\0')
1088 {
1089 Print("line too long, max is %d chars\n",BREAK_LINE_LENGTH);
1090 }
1091 else
1092 break;
1093 }
1094 if (*s=='\n')
1095 {
1097 }
1098#if MDEBUG
1099 else if(strncmp(s,"cont;",5)==0)
1100 {
1102 }
1103#endif /* MDEBUG */
1104 else
1105 {
1106 strcat( s, "\n;~\n");
1108 }
1109}
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:1071
#define BREAK_LINE_LENGTH
Definition ipshell.cc:1072
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 1206 of file ipshell.cc.

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

◆ iiEStart()

BOOLEAN iiEStart ( char * example,
procinfo * pi )

Definition at line 763 of file iplib.cc.

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

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

◆ iiExport() [2/2]

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

Definition at line 1533 of file ipshell.cc.

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

◆ iiExprArith1()

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

◆ iiExprArith1Tab()

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

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

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

Definition at line 9237 of file iparith.cc.

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

9168{
9169 res->Init();
9170 leftv b=a->next;
9171 a->next=NULL;
9172 int bt=b->Typ();
9174 a->next=b;
9175 a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
9176 return bo;
9177}
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:9005

◆ iiExprArith3()

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

Definition at line 9577 of file iparith.cc.

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

9633{
9634 res->Init();
9635 leftv b=a->next;
9636 a->next=NULL;
9637 int bt=b->Typ();
9638 leftv c=b->next;
9639 b->next=NULL;
9640 int ct=c->Typ();
9641 BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
9642 b->next=c;
9643 a->next=b;
9644 a->CleanUp(); // to cleanup the chain, content already done
9645 return bo;
9646}

◆ iiExprArithM()

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

◆ iiGetLibName()

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 )

the largest monomial in R/I

Definition at line 1606 of file ipshell.cc.

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

◆ iiInternalExport()

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

Definition at line 1464 of file ipshell.cc.

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

◆ iiLibCmd()

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

Definition at line 894 of file iplib.cc.

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

◆ iiLoadLIB()

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

Definition at line 983 of file iplib.cc.

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

◆ iiLocateLib()

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

Definition at line 880 of file iplib.cc.

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

◆ iiMake_proc()

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

Definition at line 513 of file iplib.cc.

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

◆ iiMakeResolv()

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

Definition at line 854 of file ipshell.cc.

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

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

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char * s)

Definition at line 122 of file ipshell.cc.

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

◆ iiParameter()

BOOLEAN iiParameter ( leftv p)

Definition at line 1384 of file ipshell.cc.

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

◆ iiProcArgs()

char * iiProcArgs ( char * e,
BOOLEAN withParenth )

Definition at line 114 of file iplib.cc.

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

◆ iiProcName()

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

Definition at line 100 of file iplib.cc.

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

◆ iiPStart()

BOOLEAN iiPStart ( idhdl pn,
leftv sl )

Definition at line 379 of file iplib.cc.

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

◆ iiRegularity()

int iiRegularity ( lists L)

Definition at line 1045 of file ipshell.cc.

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

◆ iiSetReturn()

void iiSetReturn ( const leftv h)

Definition at line 6634 of file ipshell.cc.

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

◆ iiTestAssume()

BOOLEAN iiTestAssume ( leftv a,
leftv b )

Definition at line 6453 of file ipshell.cc.

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

◆ iiTokType()

int iiTokType ( int op)

Definition at line 230 of file iparith.cc.

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

◆ iiTryLoadLib()

BOOLEAN iiTryLoadLib ( leftv v,
const char * id )

Definition at line 832 of file iplib.cc.

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

◆ iiTwoOps()

const char * iiTwoOps ( int t)

Definition at line 258 of file gentable.cc.

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

◆ iiWRITE()

BOOLEAN iiWRITE ( leftv res,
leftv exprlist )

Definition at line 587 of file ipshell.cc.

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

◆ IsCmd()

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

Definition at line 9775 of file iparith.cc.

9776{
9777 int i;
9778 int an=1;
9779 int en=sArithBase.nLastIdentifier;
9780
9781 loop
9782 //for(an=0; an<sArithBase.nCmdUsed; )
9783 {
9784 if(an>=en-1)
9785 {
9786 if (strcmp(n, sArithBase.sCmds[an].name) == 0)
9787 {
9788 i=an;
9789 break;
9790 }
9791 else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
9792 {
9793 i=en;
9794 break;
9795 }
9796 else
9797 {
9798 // -- blackbox extensions:
9799 // return 0;
9800 return blackboxIsCmd(n,tok);
9801 }
9802 }
9803 i=(an+en)/2;
9804 if (*n < *(sArithBase.sCmds[i].name))
9805 {
9806 en=i-1;
9807 }
9808 else if (*n > *(sArithBase.sCmds[i].name))
9809 {
9810 an=i+1;
9811 }
9812 else
9813 {
9814 int v=strcmp(n,sArithBase.sCmds[i].name);
9815 if(v<0)
9816 {
9817 en=i-1;
9818 }
9819 else if(v>0)
9820 {
9821 an=i+1;
9822 }
9823 else /*v==0*/
9824 {
9825 break;
9826 }
9827 }
9828 }
9829 lastreserved=sArithBase.sCmds[i].name;
9830 tok=sArithBase.sCmds[i].tokval;
9831 if(sArithBase.sCmds[i].alias==2)
9832 {
9833 Warn("outdated identifier `%s` used - please change your code",
9834 sArithBase.sCmds[i].name);
9835 sArithBase.sCmds[i].alias=1;
9836 }
9837 #if 0
9838 if (currRingHdl==NULL)
9839 {
9840 #ifdef SIQ
9841 if (siq<=0)
9842 {
9843 #endif
9844 if ((tok>=BEGIN_RING) && (tok<=END_RING))
9845 {
9846 WerrorS("no ring active");
9847 return 0;
9848 }
9849 #ifdef SIQ
9850 }
9851 #endif
9852 }
9853 #endif
9854 if (!expected_parms)
9855 {
9856 switch (tok)
9857 {
9858 case IDEAL_CMD:
9859 case INT_CMD:
9860 case INTVEC_CMD:
9861 case MAP_CMD:
9862 case MATRIX_CMD:
9863 case MODUL_CMD:
9864 case POLY_CMD:
9865 case PROC_CMD:
9866 case RING_CMD:
9867 case STRING_CMD:
9868 cmdtok = tok;
9869 break;
9870 }
9871 }
9872 return sArithBase.sCmds[i].toktype;
9873}
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition blackbox.cc:219
@ END_RING
Definition grammar.cc:311
@ BEGIN_RING
Definition grammar.cc:283
int cmdtok
Definition grammar.cc:174
BOOLEAN expected_parms
Definition grammar.cc:173
const char * lastreserved
Definition ipshell.cc:83

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv res,
leftv v )

Definition at line 975 of file ipshell.cc.

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

◆ jjBETTI2()

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

Definition at line 1009 of file ipshell.cc.

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

◆ jjBETTI2_ID()

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

Definition at line 988 of file ipshell.cc.

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

◆ jjCHARSERIES()

BOOLEAN jjCHARSERIES ( leftv res,
leftv u )

Definition at line 3349 of file ipshell.cc.

3350{
3351 res->data=singclap_irrCharSeries((ideal)u->Data(), currRing);
3352 return (res->data==NULL);
3353}
matrix singclap_irrCharSeries(ideal I, const ring r)
Definition clapsing.cc:1614

◆ jjIMPORTFROM()

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

Definition at line 2512 of file ipassign.cc.

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

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv res,
leftv v )

Definition at line 8252 of file iparith.cc.

8253{
8254 int sl=0;
8255 if (v!=NULL) sl = v->listLength();
8256 lists L;
8257 if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
8258 {
8259 int add_row_shift = 0;
8260 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
8261 if (weights!=NULL) add_row_shift=weights->min_in();
8262 L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
8263 }
8264 else
8265 {
8267 leftv h=NULL;
8268 int i;
8269 int rt;
8270
8271 L->Init(sl);
8272 for (i=0;i<sl;i++)
8273 {
8274 if (h!=NULL)
8275 { /* e.g. not in the first step:
8276 * h is the pointer to the old sleftv,
8277 * v is the pointer to the next sleftv
8278 * (in this moment) */
8279 h->next=v;
8280 }
8281 h=v;
8282 v=v->next;
8283 h->next=NULL;
8284 rt=h->Typ();
8285 if (rt==0)
8286 {
8287 L->Clean();
8288 Werror("`%s` is undefined",h->Fullname());
8289 return TRUE;
8290 }
8291 if (rt==RING_CMD)
8292 {
8293 L->m[i].rtyp=rt;
8294 L->m[i].data=rIncRefCnt(((ring)h->Data()));
8295 }
8296 else
8297 L->m[i].Copy(h);
8298 }
8299 }
8300 res->data=(char *)L;
8301 return FALSE;
8302}
void Copy(leftv e)
Definition subexpr.cc:689
void Clean(ring r=currRing)
Definition lists.h:26
INLINE_THIS void Init(int l=0)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition ipshell.cc:3178
static ring rIncRefCnt(ring r)
Definition ring.h:854
ssyStrategy * syStrategy
Definition syz.h:36

◆ jjLOAD()

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

load lib/module given in v

Definition at line 5593 of file iparith.cc.

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

5670{
5671 if (!iiGetLibStatus(s))
5672 {
5673 void (*WerrorS_save)(const char *s) = WerrorS_callback;
5676 BOOLEAN bo=jjLOAD(s,TRUE);
5677 if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5678 Print("loading of >%s< failed\n",s);
5679 WerrorS_callback=WerrorS_save;
5680 errorreported=0;
5681 }
5682 return FALSE;
5683}
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:5593
STATIC_VAR int WerrorS_dummy_cnt
Definition iparith.cc:5664
static void WerrorS_dummy(const char *)
Definition iparith.cc:5665
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 954 of file ipshell.cc.

955{
956 int len=0;
957 int typ0;
958 lists L=(lists)v->Data();
959 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
960 int add_row_shift = 0;
961 if (weights==NULL)
962 weights=(intvec*)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
963 if (weights!=NULL) add_row_shift=weights->min_in();
964 resolvente rr=liFindRes(L,&len,&typ0);
965 if (rr==NULL) return TRUE;
966 resolvente r=iiCopyRes(rr,len);
967
968 syMinimizeResolvente(r,len,0);
969 omFreeSize((ADDRESS)rr,len*sizeof(ideal));
970 len++;
971 res->data=(char *)liMakeResolv(r,len,-1,typ0,NULL,add_row_shift);
972 return FALSE;
973}
static resolvente iiCopyRes(resolvente r, int l)
Definition ipshell.cc:944
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 3342 of file ipshell.cc.

3343{
3344 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(),
3345 (poly)w->CopyD(), currRing);
3346 return errorreported;
3347}
poly singclap_resultant(poly f, poly g, poly x, const ring r)
Definition clapsing.cc:357

◆ jjSetMinpoly()

coeffs jjSetMinpoly ( coeffs cf,
number a )

Definition at line 176 of file ipassign.cc.

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

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

◆ jjVARIABLES_ID()

BOOLEAN jjVARIABLES_ID ( leftv res,
leftv u )

Definition at line 6318 of file ipshell.cc.

6319{
6320 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6321 ideal I=(ideal)u->Data();
6322 int i;
6323 int n=0;
6324 for(i=I->nrows*I->ncols-1;i>=0;i--)
6325 {
6326 int n0=pGetVariables(I->m[i],e);
6327 if (n0>n) n=n0;
6328 }
6329 jjINT_S_TO_ID(n,e,res);
6330 return FALSE;
6331}
static void jjINT_S_TO_ID(int n, int *e, leftv res)
Definition ipshell.cc:6288
#define omAlloc0(size)
#define pGetVariables(p, e)
Definition polys.h:252

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv res,
leftv u )

Definition at line 6310 of file ipshell.cc.

6311{
6312 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6313 int n=pGetVariables((poly)u->Data(),e);
6314 jjINT_S_TO_ID(n,e,res);
6315 return FALSE;
6316}

◆ killlocals()

void killlocals ( int v)

Definition at line 387 of file ipshell.cc.

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

◆ kQHWeight()

BOOLEAN kQHWeight ( leftv res,
leftv v )

Definition at line 3325 of file ipshell.cc.

3326{
3327 res->data=(char *)id_QHomWeight((ideal)v->Data(), currRing);
3328 if (res->data==NULL)
3329 res->data=(char *)new intvec(rVar(currRing));
3330 return FALSE;
3331}
intvec * id_QHomWeight(ideal id, const ring r)

◆ kWeight()

BOOLEAN kWeight ( leftv res,
leftv id )

Definition at line 3297 of file ipshell.cc.

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

◆ list_cmd()

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

Definition at line 426 of file ipshell.cc.

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

◆ loNewtonP()

BOOLEAN loNewtonP ( leftv res,
leftv arg1 )

compute Newton Polytopes of input polynomials

Definition at line 4566 of file ipshell.cc.

4567{
4568 res->data= (void*)loNewtonPolytope( (ideal)arg1->Data() );
4569 return FALSE;
4570}
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 4572 of file ipshell.cc.

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

◆ mpJacobi()

BOOLEAN mpJacobi ( leftv res,
leftv a )

Definition at line 3064 of file ipshell.cc.

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

◆ mpKoszul()

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

Definition at line 3086 of file ipshell.cc.

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

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

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

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

4659{
4660 ideal gls = (ideal)(arg1->Data());
4661 int imtype= (int)(long)arg2->Data();
4662
4663 uResultant::resMatType mtype= determineMType( imtype );
4664
4665 // check input ideal ( = polynomial system )
4666 if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
4667 {
4668 return TRUE;
4669 }
4670
4671 uResultant *resMat= new uResultant( gls, mtype, false );
4672 if (resMat!=NULL)
4673 {
4674 res->rtyp = MODUL_CMD;
4675 res->data= (void*)resMat->accessResMat()->getMatrix();
4676 if (!errorreported) delete resMat;
4677 }
4678 return errorreported;
4679}
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 4925 of file ipshell.cc.

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

◆ nuVanderSys()

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

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

Definition at line 4824 of file ipshell.cc.

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

6334{
6335 Print(" %s (",n);
6336 switch (p->language)
6337 {
6338 case LANG_SINGULAR: PrintS("S"); break;
6339 case LANG_C: PrintS("C"); break;
6340 case LANG_TOP: PrintS("T"); break;
6341 case LANG_MAX: PrintS("M"); break;
6342 case LANG_NONE: PrintS("N"); break;
6343 default: PrintS("U");
6344 }
6345 if(p->libname!=NULL)
6346 Print(",%s", p->libname);
6347 PrintS(")");
6348}
@ 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 2782 of file ipshell.cc.

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

◆ rDecompose()

lists rDecompose ( const ring r)

Definition at line 2153 of file ipshell.cc.

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

◆ rDecompose_CF()

BOOLEAN rDecompose_CF ( leftv res,
const coeffs C )

Definition at line 1943 of file ipshell.cc.

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

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring r)

Definition at line 2114 of file ipshell.cc.

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

◆ rDefault()

idhdl rDefault ( const char * s)

Definition at line 1645 of file ipshell.cc.

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

◆ rFindHdl()

idhdl rFindHdl ( ring r,
idhdl n )

Definition at line 1701 of file ipshell.cc.

1702{
1703 if ((r==NULL)||(r->VarOffset==NULL))
1704 return NULL;
1706 if (h!=NULL) return h;
1707 if (IDROOT!=basePack->idroot) h=rSimpleFindHdl(r,basePack->idroot,n);
1708 if (h!=NULL) return h;
1710 while(p!=NULL)
1711 {
1712 if ((p->cPack!=basePack)
1713 && (p->cPack!=currPack))
1714 h=rSimpleFindHdl(r,p->cPack->idroot,n);
1715 if (h!=NULL) return h;
1716 p=p->next;
1717 }
1718 idhdl tmp=basePack->idroot;
1719 while (tmp!=NULL)
1720 {
1721 if (IDTYP(tmp)==PACKAGE_CMD)
1722 h=rSimpleFindHdl(r,IDPACKAGE(tmp)->idroot,n);
1723 if (h!=NULL) return h;
1724 tmp=IDNEXT(tmp);
1725 }
1726 return NULL;
1727}
static idhdl rSimpleFindHdl(const ring r, const idhdl root, const idhdl n)
Definition ipshell.cc:6269

◆ rInit()

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

Definition at line 5628 of file ipshell.cc.

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

◆ rKill() [1/2]

void rKill ( idhdl h)

Definition at line 6226 of file ipshell.cc.

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

◆ rKill() [2/2]

void rKill ( ring r)

Definition at line 6181 of file ipshell.cc.

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

◆ rSetHdl()

void rSetHdl ( idhdl h)

Definition at line 5129 of file ipshell.cc.

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

◆ scIndIndset()

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

Definition at line 1111 of file ipshell.cc.

1113{
1114 int i;
1115 indset save;
1117
1118 hexist = hInit(S, Q, &hNexist);
1119 if (hNexist == 0)
1120 {
1121 intvec *iv=new intvec(rVar(currRing));
1122 for(i=0; i<rVar(currRing); i++) (*iv)[i]=1;
1123 res->Init(1);
1124 res->m[0].rtyp=INTVEC_CMD;
1125 res->m[0].data=(intvec*)iv;
1126 return res;
1127 }
1129 hMu = 0;
1130 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
1131 hvar = (varset)omAlloc((rVar(currRing) + 1) * sizeof(int));
1132 hpure = (scmon)omAlloc0((1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1133 hrad = hexist;
1134 hNrad = hNexist;
1135 radmem = hCreate(rVar(currRing) - 1);
1136 hCo = rVar(currRing) + 1;
1137 hNvar = rVar(currRing);
1139 hSupp(hrad, hNrad, hvar, &hNvar);
1140 if (hNvar)
1141 {
1142 hCo = hNvar;
1143 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
1146 }
1147 if (hCo && (hCo < rVar(currRing)))
1148 {
1150 }
1151 if (hMu!=0)
1152 {
1153 ISet = save;
1154 hMu2 = 0;
1155 if (all && (hCo+1 < rVar(currRing)))
1156 {
1159 i=hMu+hMu2;
1160 res->Init(i);
1161 if (hMu2 == 0)
1162 {
1164 }
1165 }
1166 else
1167 {
1168 res->Init(hMu);
1169 }
1170 for (i=0;i<hMu;i++)
1171 {
1172 res->m[i].data = (void *)save->set;
1173 res->m[i].rtyp = INTVEC_CMD;
1174 ISet = save;
1175 save = save->nx;
1177 }
1179 if (hMu2 != 0)
1180 {
1181 save = JSet;
1182 for (i=hMu;i<hMu+hMu2;i++)
1183 {
1184 res->m[i].data = (void *)save->set;
1185 res->m[i].rtyp = INTVEC_CMD;
1186 JSet = save;
1187 save = save->nx;
1189 }
1191 }
1192 }
1193 else
1194 {
1195 res->Init(0);
1197 }
1198 hKill(radmem, rVar(currRing) - 1);
1199 omFreeSize((ADDRESS)hpure, (1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1200 omFreeSize((ADDRESS)hvar, (rVar(currRing) + 1) * sizeof(int));
1201 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
1203 return res;
1204}
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 4554 of file ipshell.cc.

4555{
4556 sleftv tmp;
4557 tmp.Init();
4558 tmp.rtyp=INT_CMD;
4559 /* tmp.data = (void *)0; -- done by Init */
4560
4561 return semicProc3(res,u,v,&tmp);
4562}

◆ semicProc3()

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

Definition at line 4514 of file ipshell.cc.

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

◆ setOption()

BOOLEAN setOption ( leftv res,
leftv v )

Definition at line 570 of file misc_ip.cc.

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

◆ showOption()

char * showOption ( )

Definition at line 713 of file misc_ip.cc.

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

◆ singular_example()

void singular_example ( char * str)

Definition at line 431 of file misc_ip.cc.

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

◆ singular_system()

leftv singular_system ( sleftv h)

◆ siSetCpus()

int siSetCpus ( int cpu)

Definition at line 6665 of file ipshell.cc.

6666{
6667 int old=(int)(long)feOptValue(FE_OPT_CPUS);
6668 feSetOptValue(FE_OPT_CPUS,cpu);
6669 return old;
6670}

◆ spaddProc()

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

Definition at line 4431 of file ipshell.cc.

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

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv result,
leftv first )

Definition at line 4187 of file ipshell.cc.

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

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv result,
leftv first )

Definition at line 4136 of file ipshell.cc.

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

◆ spmulProc()

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

Definition at line 4473 of file ipshell.cc.

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

◆ syBetti1()

BOOLEAN syBetti1 ( leftv res,
leftv u )

Definition at line 3166 of file ipshell.cc.

3167{
3168 sleftv tmp;
3169 tmp.Init();
3170 tmp.rtyp=INT_CMD;
3171 tmp.data=(void *)1;
3172 return syBetti2(res,u,&tmp);
3173}
BOOLEAN syBetti2(leftv res, leftv u, leftv w)
Definition ipshell.cc:3142

◆ syBetti2()

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

Definition at line 3142 of file ipshell.cc.

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

◆ syConvList()

syStrategy syConvList ( lists li)

Definition at line 3250 of file ipshell.cc.

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

◆ syConvRes()

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

Definition at line 3178 of file ipshell.cc.

3179{
3180 resolvente fullres = syzstr->fullres;
3181 resolvente minres = syzstr->minres;
3182
3183 const int length = syzstr->length;
3184
3185 if ((fullres==NULL) && (minres==NULL))
3186 {
3187 if (syzstr->hilb_coeffs==NULL)
3188 { // La Scala
3189 fullres = syReorder(syzstr->res, length, syzstr);
3190 }
3191 else
3192 { // HRES
3193 minres = syReorder(syzstr->orderedRes, length, syzstr);
3194 syKillEmptyEntres(minres, length);
3195 }
3196 }
3197
3198 resolvente tr;
3199 int typ0=IDEAL_CMD;
3200
3201 if (minres!=NULL)
3202 tr = minres;
3203 else
3204 tr = fullres;
3205
3206 resolvente trueres=NULL;
3207 intvec ** w=NULL;
3208
3209 if (length>0)
3210 {
3211 trueres = (resolvente)omAlloc0((length)*sizeof(ideal));
3212 for (int i=length-1;i>=0;i--)
3213 {
3214 if (tr[i]!=NULL)
3215 {
3216 trueres[i] = idCopy(tr[i]);
3217 }
3218 }
3219 if ( id_RankFreeModule(trueres[0], currRing) > 0)
3220 typ0 = MODUL_CMD;
3221 if (syzstr->weights!=NULL)
3222 {
3223 w = (intvec**)omAlloc0(length*sizeof(intvec*));
3224 for (int i=length-1;i>=0;i--)
3225 {
3226 if (syzstr->weights[i]!=NULL) w[i] = ivCopy(syzstr->weights[i]);
3227 }
3228 }
3229 }
3230
3231 lists li = liMakeResolv(trueres, length, syzstr->list_length,typ0,
3232 w, add_row_shift);
3233
3234 if (toDel)
3235 syKillComputation(syzstr);
3236 else
3237 {
3238 if( fullres != NULL && syzstr->fullres == NULL )
3239 syzstr->fullres = fullres;
3240
3241 if( minres != NULL && syzstr->minres == NULL )
3242 syzstr->minres = minres;
3243 }
3244 return li;
3245}
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:1496
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy=TRUE, resolvente totake=NULL)
Definition syz1.cc:1642
void syKillEmptyEntres(resolvente res, int length)
Definition syz1.cc:2200
short list_length
Definition syz.h:62
resolvente res
Definition syz.h:47
resolvente fullres
Definition syz.h:57
intvec ** weights
Definition syz.h:45
resolvente orderedRes
Definition syz.h:48
int length
Definition syz.h:60

◆ test_cmd()

void test_cmd ( int i)

Definition at line 513 of file ipshell.cc.

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

◆ Tok2Cmdname()

const char * Tok2Cmdname ( int i)

Definition at line 137 of file gentable.cc.

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

◆ type_cmd()

void type_cmd ( leftv v)

Definition at line 255 of file ipshell.cc.

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

◆ versionString()

char * versionString ( )

Definition at line 771 of file misc_ip.cc.

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

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.

38 {
39// operationsi
40// proc cmd res arg context
46#ifdef SINGULAR_4_2
47,{D(jjNUMBER2_OP1),'-', CNUMBER_CMD, CNUMBER_CMD , ALLOW_NC |ALLOW_RING}
48,{D(jjPOLY2_OP1), '-', CPOLY_CMD, CPOLY_CMD , ALLOW_NC |ALLOW_RING}
49#endif
56#ifdef SINGULAR_4_2
58#endif
59,{D(jjPROC1), '(', ANY_TYPE/*set by p*/,PROC_CMD , ALLOW_NC |ALLOW_RING}
60// and the procedures with 1 argument:
77#ifdef SINGULAR_4_2
79#endif
80//,{ jjWRONG , COLS_CMD, 0, VECTOR_CMD , ALLOW_NC |ALLOW_RING}
88#ifdef SINGULAR_4_2
90#endif
91//,{ jjWRONG , COLS_CMD, 0, INTVEC_CMD , ALLOW_NC |ALLOW_RING}
120#ifdef SINGULAR_4_2
122#endif
172,{D(jjKBASE), KBASE_CMD, IDEAL_CMD, IDEAL_CMD , ALLOW_PLURAL |ALLOW_RING|WARN_RING} /*ring-cf: warning at top level*/
173,{D(jjKBASE), KBASE_CMD, MODUL_CMD, MODUL_CMD , ALLOW_PLURAL |ALLOW_RING|WARN_RING} /*ring-cf: warning at top level*/
213#ifdef SINGULAR_4_2
215#endif
229#ifdef SINGULAR_4_2
234#endif
261//,{ jjWRONG , ROWS_CMD, 0, POLY_CMD , ALLOW_NC |ALLOW_RING}
268#ifdef SINGULAR_4_2
270#endif
291//,{ jjWRONG , TRACE_CMD, 0, INTVEC_CMD , ALLOW_NC |ALLOW_RING}
292//,{ jjWRONG , TRACE_CMD, 0, IDEAL_CMD , ALLOW_NC |ALLOW_RING}
298#ifdef SINGULAR_4_2
300#endif
310,{D(jjVDIM), VDIM_CMD, INT_CMD, IDEAL_CMD , ALLOW_NC |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
311,{D(jjVDIM), VDIM_CMD, INT_CMD, MODUL_CMD , ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
321,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
322};
BOOLEAN atKILLATTR1(leftv, leftv a)
Definition attrib.cc:476
BOOLEAN atATTRIB1(leftv res, leftv v)
Definition attrib.cc:234
BOOLEAN findUniProc(leftv result, leftv first)
Definition fglm.cc:541
#define NO_ZERODIVISOR
Definition gentable.cc:42
#define ALLOW_ZZ
Definition gentable.cc:46
#define ALLOW_RING
Definition gentable.cc:38
#define NO_LRING
Definition gentable.cc:54
#define ALLOW_LP
Definition gentable.cc:33
#define NO_RING
Definition gentable.cc:39
#define D(A)
Definition gentable.cc:128
#define WARN_RING
Definition gentable.cc:49
#define ALLOW_NC
Definition gentable.cc:35
#define ALLOW_PLURAL
Definition gentable.cc:30
#define NO_NC
Definition gentable.cc:29
#define NULL_VAL
Definition gentable.cc:129
@ NOT
Definition grammar.cc:272
@ PAR_CMD
Definition grammar.cc:303
@ PREIMAGE_CMD
Definition grammar.cc:304
@ SETRING_CMD
Definition grammar.cc:330
@ MONOM_CMD
Definition grammar.cc:302
@ VAR_CMD
Definition grammar.cc:305
@ MAXID_CMD
Definition grammar.cc:301
@ E_CMD
Definition grammar.cc:295
@ FREEMODULE_CMD
Definition grammar.cc:297
@ BETTI_CMD
Definition grammar.cc:294
static BOOLEAN jjUMINUS_MA(leftv res, leftv u)
Definition iparith.cc:3834
static BOOLEAN jjRANK1(leftv res, leftv v)
Definition iparith.cc:4966
static BOOLEAN jjIMPART(leftv res, leftv v)
Definition iparith.cc:4461
static BOOLEAN jjIm2Iv(leftv res, leftv v)
Definition iparith.cc:4454
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
Definition iparith.cc:3840
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
Definition iparith.cc:5312
BOOLEAN jjWAITALL1(leftv res, leftv u)
Definition iparith.cc:5558
static BOOLEAN jjRESTART(leftv, leftv u)
Definition iparith.cc:8979
static BOOLEAN jjidHead(leftv res, leftv v)
Definition iparith.cc:5720
static BOOLEAN jjHILBERT(leftv, leftv v)
Definition iparith.cc:4345
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
Definition iparith.cc:4620
static BOOLEAN jjstrlen(leftv res, leftv v)
Definition iparith.cc:5685
static BOOLEAN jjDET_BI(leftv res, leftv v)
Definition iparith.cc:4102
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
Definition iparith.cc:5543
static BOOLEAN jjP2I(leftv res, leftv v)
Definition iparith.cc:4880
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
Definition iparith.cc:4488
static BOOLEAN jjREPART(leftv res, leftv v)
Definition iparith.cc:4982
static BOOLEAN jjN2BI(leftv res, leftv v)
Definition iparith.cc:4763
static BOOLEAN jjCHAR(leftv res, leftv v)
Definition iparith.cc:3949
static BOOLEAN jjROWS_IV(leftv res, leftv v)
Definition iparith.cc:5027
static BOOLEAN jjNULL(leftv, leftv)
Definition iparith.cc:3784
static BOOLEAN jjBIV2IV(leftv res, leftv v)
Definition iparith.cc:4479
static BOOLEAN jjDIM(leftv res, leftv v)
Definition iparith.cc:4158
static BOOLEAN jjCOUNT_BIM(leftv res, leftv v)
Definition iparith.cc:3989
static BOOLEAN jjCOLS_IV(leftv res, leftv v)
Definition iparith.cc:3971
static BOOLEAN jjNAMES_I(leftv res, leftv v)
Definition iparith.cc:4793
static BOOLEAN jjMULT(leftv res, leftv v)
Definition iparith.cc:4743
static BOOLEAN jjPARDEG(leftv res, leftv v)
Definition iparith.cc:4836
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number.
Definition iparith.cc:4079
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
Definition iparith.cc:4418
static BOOLEAN jjmpTransp(leftv res, leftv v)
Definition iparith.cc:5748
static BOOLEAN jjDET_S(leftv res, leftv v)
Definition iparith.cc:4152
static BOOLEAN jjL2R(leftv res, leftv v)
Definition iparith.cc:4580
static BOOLEAN jjrCharStr(leftv res, leftv v)
Definition iparith.cc:5710
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
Definition iparith.cc:4358
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
Definition iparith.cc:4437
static BOOLEAN jjINDEPSET(leftv res, leftv v)
Definition iparith.cc:4466
static BOOLEAN jjTYPEOF(leftv res, leftv v)
Definition iparith.cc:5428
static BOOLEAN jjFACSTD(leftv res, leftv v)
Definition iparith.cc:4221
static BOOLEAN jjMEMORY(leftv res, leftv v)
Definition iparith.cc:4696
static BOOLEAN jjidTransp(leftv res, leftv v)
Definition iparith.cc:5778
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
Definition iparith.cc:3847
static BOOLEAN jjDIM_R(leftv res, leftv v)
Definition iparith.cc:5773
static BOOLEAN jjDUMP(leftv, leftv v)
Definition iparith.cc:4186
static BOOLEAN jjpMaxComp(leftv res, leftv v)
Definition iparith.cc:5738
static BOOLEAN jjCOEFFS1(leftv res, leftv v)
Definition iparith.cc:3954
static BOOLEAN jjNAMEOF(leftv res, leftv v)
Definition iparith.cc:4775
static BOOLEAN jjPRIME(leftv res, leftv v)
Definition iparith.cc:4898
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
Definition iparith.cc:5705
static BOOLEAN jjJACOB_P(leftv res, leftv v)
Definition iparith.cc:4504
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
Definition iparith.cc:5199
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
Definition iparith.cc:3945
static BOOLEAN jjINTERRED(leftv res, leftv v)
Definition iparith.cc:4472
static BOOLEAN jjJACOB_M(leftv res, leftv a)
Definition iparith.cc:4535
static BOOLEAN jjBAREISS(leftv res, leftv v)
Definition iparith.cc:3879
static BOOLEAN jjREAD(leftv res, leftv v)
Definition iparith.cc:4973
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
Definition iparith.cc:4493
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
Definition iparith.cc:5022
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
Definition iparith.cc:5042
static BOOLEAN jjMSTD(leftv res, leftv v)
Definition iparith.cc:4728
static BOOLEAN jjnInt(leftv res, leftv u)
Definition iparith.cc:5783
static BOOLEAN jjREGULARITY(leftv res, leftv v)
Definition iparith.cc:4977
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
Definition iparith.cc:5297
static BOOLEAN jjMONOM(leftv res, leftv v)
Definition iparith.cc:2783
static BOOLEAN jjSort_Id(leftv res, leftv v)
Definition iparith.cc:5194
static BOOLEAN jjidMinBase(leftv res, leftv v)
Definition iparith.cc:5726
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
Definition iparith.cc:4892
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
Definition iparith.cc:4401
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
Definition iparith.cc:3984
static BOOLEAN jjKERNEL_M(leftv res, leftv v)
Definition iparith.cc:4556
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
Definition iparith.cc:3966
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
Definition iparith.cc:4427
static BOOLEAN jjEXECUTE(leftv, leftv v)
Definition iparith.cc:4212
static BOOLEAN jjLEADEXP(leftv res, leftv v)
Definition iparith.cc:4602
static BOOLEAN jjDEG_M(leftv res, leftv u)
Definition iparith.cc:4039
static BOOLEAN jjPAR1(leftv res, leftv v)
Definition iparith.cc:4820
static BOOLEAN jjnlInt(leftv res, leftv u)
Definition iparith.cc:5790
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
Definition iparith.cc:3798
static BOOLEAN jjROWS(leftv res, leftv v)
Definition iparith.cc:5016
static BOOLEAN jjSBA(leftv res, leftv v)
Definition iparith.cc:5084
static BOOLEAN jjJanetBasis(leftv res, leftv v)
Definition iparith.cc:2545
static BOOLEAN jjKBASE(leftv res, leftv v)
Definition iparith.cc:4574
static BOOLEAN jjmpTrace(leftv res, leftv v)
Definition iparith.cc:5743
static BOOLEAN jjPRUNE(leftv res, leftv v)
Definition iparith.cc:4904
static BOOLEAN jjDEFINED(leftv res, leftv v)
Definition iparith.cc:4067
static BOOLEAN jjLagSolve(leftv res, leftv v)
Definition iparith.cc:4657
static BOOLEAN jjVDIM(leftv res, leftv v)
Definition iparith.cc:5516
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
Definition iparith.cc:3995
static BOOLEAN jjP2N(leftv res, leftv v)
Definition iparith.cc:4928
static BOOLEAN jjE(leftv res, leftv v)
Definition iparith.cc:4200
static BOOLEAN jjLISTRING(leftv res, leftv v)
Definition iparith.cc:4639
static BOOLEAN jjVAR1(leftv res, leftv v)
Definition iparith.cc:5482
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
Definition iparith.cc:4588
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
Definition iparith.cc:3810
static BOOLEAN jjpLength(leftv res, leftv v)
Definition iparith.cc:5690
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
Definition iparith.cc:4499
static BOOLEAN jjBI2P(leftv res, leftv u)
Definition iparith.cc:3930
static BOOLEAN jjTWOSTD(leftv res, leftv a)
Definition iparith.cc:5346
static BOOLEAN jjFAC_P(leftv res, leftv u)
Definition iparith.cc:4261
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
Definition iparith.cc:5302
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
Definition iparith.cc:5768
static BOOLEAN jjrOrdStr(leftv res, leftv v)
Definition iparith.cc:5753
static BOOLEAN jjpHead(leftv res, leftv v)
Definition iparith.cc:5715
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
Definition iparith.cc:4000
static BOOLEAN jjDET_I(leftv res, leftv v)
Definition iparith.cc:4138
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
Definition iparith.cc:4017
static BOOLEAN jjrVarStr(leftv res, leftv v)
Definition iparith.cc:5758
static BOOLEAN jjMONITOR1(leftv res, leftv v)
Definition iparith.cc:2738
static BOOLEAN jjUMINUS_N(leftv res, leftv u)
Definition iparith.cc:3822
static BOOLEAN jjNUMERATOR(leftv res, leftv v)
Return the numerator of the input number.
Definition iparith.cc:4088
static BOOLEAN jjORD(leftv res, leftv v)
Definition iparith.cc:4814
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
Definition iparith.cc:3817
static BOOLEAN jjENVELOPE(leftv res, leftv a)
Definition iparith.cc:5331
static BOOLEAN jjSetRing(leftv, leftv u)
Definition iparith.cc:3855
static BOOLEAN jjMINRES_R(leftv res, leftv v)
Definition iparith.cc:4749
static BOOLEAN jjCOLS(leftv res, leftv v)
Definition iparith.cc:3961
static BOOLEAN jjP2BI(leftv res, leftv v)
Definition iparith.cc:4860
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
Definition iparith.cc:5307
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
Definition iparith.cc:5477
static BOOLEAN jjBAREISS_BIM(leftv res, leftv v)
Definition iparith.cc:3902
static BOOLEAN jjPFAC1(leftv res, leftv v)
Definition iparith.cc:4648
static BOOLEAN jjCONTENT(leftv res, leftv v)
Definition iparith.cc:3976
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5165
static BOOLEAN jjCOUNT_IV(leftv res, leftv v)
Definition iparith.cc:4012
static BOOLEAN jjDUMMY(leftv res, leftv u)
Definition iparith.cc:3777
static BOOLEAN jjS2I(leftv res, leftv v)
Definition iparith.cc:5037
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3909
static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
Definition iparith.cc:5365
static BOOLEAN jjGETDUMP(leftv, leftv v)
Definition iparith.cc:4277
static BOOLEAN jjidFreeModule(leftv res, leftv v)
Definition iparith.cc:5700
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
Definition iparith.cc:4944
static BOOLEAN jjRPAR(leftv res, leftv v)
Definition iparith.cc:5032
static BOOLEAN jjLOAD1(leftv, leftv v)
Definition iparith.cc:4635
static BOOLEAN jjKERNEL_SM(leftv res, leftv v)
Definition iparith.cc:4565
static BOOLEAN jjrParStr(leftv res, leftv v)
Definition iparith.cc:5763
static BOOLEAN jjDEG(leftv res, leftv v)
Definition iparith.cc:4031
static BOOLEAN jjRINGLIST(leftv res, leftv v)
Definition iparith.cc:4987
static BOOLEAN jjidElem(leftv res, leftv v)
Definition iparith.cc:5695
static BOOLEAN jjBI2IM(leftv res, leftv u)
Definition iparith.cc:3924
static BOOLEAN jjDEGREE(leftv res, leftv v)
Definition iparith.cc:4050
static BOOLEAN jjOpenClose(leftv, leftv v)
Definition iparith.cc:4808
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
Definition iparith.cc:3829
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
Definition iparith.cc:4298
static BOOLEAN jjNAMES(leftv res, leftv v)
Definition iparith.cc:4788
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
Definition iparith.cc:4291
static BOOLEAN jjPROC1(leftv res, leftv u)
Definition iparith.cc:3875
static BOOLEAN jjNOT(leftv res, leftv v)
Definition iparith.cc:4798
static BOOLEAN jjPARSTR1(leftv res, leftv v)
Definition iparith.cc:4842
static BOOLEAN jjHOMOG1(leftv res, leftv v)
Definition iparith.cc:4368
static BOOLEAN jjDET(leftv res, leftv v)
Definition iparith.cc:4096
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
Definition iparith.cc:4006
static BOOLEAN jjRING_LIST(leftv res, leftv v)
Definition iparith.cc:5009
static BOOLEAN jjVARSTR1(leftv res, leftv v)
Definition iparith.cc:5499
static BOOLEAN jjSYZYGY(leftv res, leftv v)
Definition iparith.cc:5226
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
Definition iparith.cc:4666
static BOOLEAN jjNVARS(leftv res, leftv v)
Definition iparith.cc:4803
static BOOLEAN jjERROR(leftv, leftv u)
Definition iparith.cc:1999
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
Definition iparith.cc:5002
BOOLEAN jjPRINT(leftv res, leftv u)
Definition ipprint.cc:252
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
Definition ipshell.cc:6310
BOOLEAN jjMINRES(leftv res, leftv v)
Definition ipshell.cc:954
BOOLEAN syBetti1(leftv res, leftv u)
Definition ipshell.cc:3166
BOOLEAN jjCHARSERIES(leftv res, leftv u)
Definition ipshell.cc:3349
BOOLEAN mpJacobi(leftv res, leftv a)
Definition ipshell.cc:3064
BOOLEAN kWeight(leftv res, leftv id)
Definition ipshell.cc:3297
BOOLEAN kQHWeight(leftv res, leftv v)
Definition ipshell.cc:3325
BOOLEAN jjBETTI(leftv res, leftv u)
Definition ipshell.cc:975
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
Definition ipshell.cc:6318
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
Definition ipshell.cc:4566
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.

325 {
326// operations:
327// proc cmd res arg1 arg2 context
357#ifdef SINGULAR_4_2
358,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
359,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, DEF_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
360,{D(jjNUMBER2_OP2),'+', CNUMBER_CMD, CNUMBER_CMD,DEF_CMD, ALLOW_NC | ALLOW_RING}
361,{D(jjPOLY2_OP2), '+', CPOLY_CMD, CPOLY_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
362,{D(jjPOLY2_OP2), '+', CPOLY_CMD, DEF_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
364#endif
393#ifdef SINGULAR_4_2
394,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NALLOW_NC | ALLOW_RING}
395,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
396,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
397,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
398,{D(jjNUMBER2_OP2),'-', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
399,{D(jjPOLY2_OP2), '-', CPOLY_CMD, CPOLY_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
400,{D(jjPOLY2_OP2), '-', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
401,{D(jjPOLY2_OP2), '-', CPOLY_CMD, INT_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
403#endif
449#ifdef SINGULAR_4_2
450,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
451,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
452,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
453,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
454,{D(jjNUMBER2_OP2),'*', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
455,{D(jjPOLY2_OP2), '*', CPOLY_CMD, CPOLY_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
456,{D(jjPOLY2_OP2), '*', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
457,{D(jjPOLY2_OP2), '*', CPOLY_CMD, INT_CMD, CPOLY_CMD, ALLOW_NC | ALLOW_RING}
459#endif
471#ifdef SINGULAR_4_2
472,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
473,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
474,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
475,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
476,{D(jjNUMBER2_OP2),'/', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
477#endif
490#ifdef SINGULAR_4_2
491,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
492,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, INT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
493,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
494,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, BIGINT_CMD, CNUMBER_CMD, ALLOW_NC | ALLOW_RING}
495,{D(jjNUMBER2_OP2),'%', CNUMBER_CMD, CNUMBER_CMD,BIGINT_CMD, ALLOW_NC | ALLOW_RING}
496#endif
502#ifdef SINGULAR_4_2
503,{D(jjNUMBER2_POW),'^', CNUMBER_CMD, CNUMBER_CMD,INT_CMD, ALLOW_NC | ALLOW_RING}
504,{D(jjPOLY2_POW), '^', CPOLY_CMD, CPOLY_CMD, INT_CMD, ALLOW_PLURAL | ALLOW_RING}
505#endif
557#ifdef SINGULAR_4_2
559#endif
598,{D(jjINDEX_I), '[', ANY_TYPE/*set by p*/,LIST_CMD, INT_CMD, ALLOW_NC | ALLOW_RING}
606,{D(jjPROC), '(', ANY_TYPE/*set by p*/,PROC_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
607,{D(jjMAP), '(', ANY_TYPE/*set by p*/,MAP_CMD, DEF_CMD, ALLOW_NC | ALLOW_RING}
609,{D(jjKLAMMER), '(', ANY_TYPE/*set by p*/,ANY_TYPE, INT_CMD, ALLOW_NC | ALLOW_RING}
612// and the procedures with 2 arguments:
620#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
622#endif
624//,{D(jjCHINREM_P), CHINREM_CMD, POLY_CMD, LIST_CMD, INTVEC_CMD, ALLOW_PLURAL}
627#ifdef SINGULAR_4_2
631#endif
711,{D(jjKBASE2), KBASE_CMD, IDEAL_CMD, IDEAL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
712,{D(jjKBASE2), KBASE_CMD, MODUL_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
729//,{D(jjRES), MRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
730//,{D(jjRES), MRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
733#ifdef SINGULAR_4_2
738#endif
741#ifdef HAVE_PLURAL
751#endif
778//,{D(jjRES), SRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
779//,{D(jjRES), SRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
797,{NULL_VAL, 0, 0, 0, 0, NO_NC |NO_RING}
798};
BOOLEAN atKILLATTR2(leftv, leftv a, leftv b)
Definition attrib.cc:493
BOOLEAN atATTRIB2(leftv res, leftv v, leftv b)
Definition attrib.cc:282
BOOLEAN fglmProc(leftv result, leftv first, leftv second)
Definition fglm.cc:277
BOOLEAN fglmQuotProc(leftv result, leftv first, leftv second)
Definition fglm.cc:411
#define jjWRONG2
Definition gentable.cc:125
@ BUCKET_CMD
Definition grammar.cc:284
@ KOSZUL_CMD
Definition grammar.cc:300
@ IMAP_CMD
Definition grammar.cc:299
@ LIB_CMD
Definition grammar.cc:328
@ FETCH_CMD
Definition grammar.cc:296
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:244
static BOOLEAN jjINDEX_V_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1524
static BOOLEAN jjQUOT(leftv res, leftv u, leftv v)
Definition iparith.cc:3105
static BOOLEAN jjTIMES_MA_P1(leftv res, leftv u, leftv v)
Definition iparith.cc:1100
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:280
static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2048
static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
Definition iparith.cc:333
static BOOLEAN jjTIMES_MA_BI2(leftv res, leftv u, leftv v)
Definition iparith.cc:1096
static BOOLEAN jjMAP(leftv res, leftv u, leftv v)
Definition iparith.cc:1653
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1184
static BOOLEAN jjOP_I_IM(leftv res, leftv u, leftv v)
Definition iparith.cc:316
static BOOLEAN jjLIFTSTD(leftv res, leftv u, leftv v)
Definition iparith.cc:2609
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
Definition iparith.cc:2807
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2742
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
Definition iparith.cc:2918
static BOOLEAN jjHOMOG1_WI(leftv res, leftv v, leftv u)
Definition iparith.cc:2507
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
Definition iparith.cc:3112
static BOOLEAN jjDIVISION(leftv res, leftv u, leftv v)
Definition iparith.cc:1954
static BOOLEAN jjOP_I_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:297
static BOOLEAN jjEQUAL_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1323
static BOOLEAN jjMINUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:909
static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
Definition iparith.cc:2589
static BOOLEAN jjTIMES_MA_N2(leftv res, leftv u, leftv v)
Definition iparith.cc:1125
static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2878
static BOOLEAN jjTIMES_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1152
static BOOLEAN jjMOD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2697
static BOOLEAN jjTIMES_MA_I2(leftv res, leftv u, leftv v)
Definition iparith.cc:1134
static BOOLEAN jjSTATUS2L(leftv res, leftv u, leftv v)
Definition iparith.cc:3446
static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1191
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition iparith.cc:3298
static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1329
static BOOLEAN jjTIMES_MA_P2(leftv res, leftv u, leftv v)
Definition iparith.cc:1109
static BOOLEAN jjSBA_1(leftv res, leftv v, leftv u)
Definition iparith.cc:5111
static BOOLEAN jjPLUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:824
static BOOLEAN jjMINUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:904
static BOOLEAN jjTIMES_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1055
static BOOLEAN jjLT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1223
static BOOLEAN jjMINUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:952
static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2020
static BOOLEAN jjDelete_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1869
static BOOLEAN jjLE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1210
static BOOLEAN jjCOMPARE_S(leftv res, leftv u, leftv v)
Definition iparith.cc:479
static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1385
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition iparith.cc:1129
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition iparith.cc:1118
static BOOLEAN jjMINUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:942
static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:3394
static BOOLEAN jjMINUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:899
static BOOLEAN jjDEG_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1848
static BOOLEAN jjMINUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:932
static BOOLEAN jjHOMOG_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2448
static BOOLEAN jjLE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1201
static BOOLEAN jjPLUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:795
static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2898
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2821
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
Definition iparith.cc:2577
static BOOLEAN jjTIMES_N(leftv res, leftv u, leftv v)
Definition iparith.cc:998
static BOOLEAN jjTIMES_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:1138
static BOOLEAN jjTIMES_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1062
static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:755
static BOOLEAN jjREDUCE_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3153
static BOOLEAN jjCOEF(leftv res, leftv u, leftv v)
Definition iparith.cc:1793
static BOOLEAN jjDEG_M_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1837
static BOOLEAN jjPLUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:804
static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
Definition iparith.cc:4516
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1178
static BOOLEAN jjEQUAL_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1341
static BOOLEAN jjINTERPOLATION(leftv res, leftv l, leftv v)
Definition iparith.cc:2527
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3357
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3145
static BOOLEAN jjDIV_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1294
static BOOLEAN jjMODULO(leftv res, leftv u, leftv v)
Definition iparith.cc:2644
static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:339
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition iparith.cc:3129
static BOOLEAN jjFAREY_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2145
static BOOLEAN jjPLUS_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:873
static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2387
static BOOLEAN jjELIMIN(leftv res, leftv u, leftv v)
Definition iparith.cc:1974
static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1682
static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2555
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:301
static BOOLEAN jjTENSOR(leftv res, leftv u, leftv v)
Definition iparith.cc:3644
static BOOLEAN jjFWALK(leftv res, leftv u, leftv v)
Definition iparith.cc:2361
static BOOLEAN jjDIFF_ID_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1932
static BOOLEAN jjSYZ_2(leftv res, leftv u, leftv v)
Definition iparith.cc:3572
static BOOLEAN jjRING_1(leftv res, leftv u, leftv v)
Definition iparith.cc:1673
static BOOLEAN jjOP_I_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:259
static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v)
Definition iparith.cc:2410
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:1800
static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:625
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition iparith.cc:1086
static BOOLEAN jjCOEFFS2_KB(leftv res, leftv u, leftv v)
Definition iparith.cc:1818
static BOOLEAN jjVARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:3670
static BOOLEAN jjPLUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:772
static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1218
static BOOLEAN jjEXTGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2006
static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2367
static BOOLEAN jjCONTRACT(leftv res, leftv u, leftv v)
Definition iparith.cc:1832
static BOOLEAN jjFAREY_LI(leftv res, leftv u, leftv v)
Definition iparith.cc:10430
static BOOLEAN jjDelete_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1862
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1166
static BOOLEAN jjKERNEL(leftv res, leftv u, leftv v)
Definition iparith.cc:2573
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2708
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
Definition iparith.cc:2633
static BOOLEAN jjEQUAL_R(leftv res, leftv u, leftv v)
Definition iparith.cc:1347
static BOOLEAN jjINTERSECT(leftv res, leftv u, leftv v)
Definition iparith.cc:2521
static BOOLEAN jjOP_BI_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:276
static BOOLEAN jjDIFF_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1910
static BOOLEAN jjMINUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:919
static BOOLEAN jjRSUM(leftv res, leftv u, leftv v)
Definition iparith.cc:3343
static BOOLEAN jjINDEX_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1390
static BOOLEAN jjPOWER_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:568
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1572
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:3496
static BOOLEAN jjTIMES_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1008
static BOOLEAN jjPLUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:836
static BOOLEAN jjMINUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:894
static BOOLEAN jjTIMES_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:991
static BOOLEAN jjFACSTD2(leftv res, leftv v, leftv w)
Definition iparith.cc:2112
static BOOLEAN jjEXPORTTO(leftv, leftv u, leftv v)
Definition iparith.cc:1994
static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2838
static BOOLEAN jjDIV_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1276
static BOOLEAN jjKBASE2(leftv res, leftv u, leftv v)
Definition iparith.cc:2560
static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
Definition iparith.cc:522
static BOOLEAN jjRES(leftv res, leftv u, leftv v)
Definition iparith.cc:3162
static BOOLEAN jjPLUS_P_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:859
static BOOLEAN jjPLUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:814
static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1173
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1196
static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
Definition iparith.cc:3755
static BOOLEAN jjCOMPARE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:452
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition iparith.cc:848
static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3452
static BOOLEAN jjELIMIN_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1980
static BOOLEAN jjDIFF_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1921
static BOOLEAN jjTIMES_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:1074
static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
Definition iparith.cc:978
static BOOLEAN jjDIV_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1263
static BOOLEAN jjFRES(leftv res, leftv u, leftv v)
Definition iparith.cc:2351
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition iparith.cc:1560
static BOOLEAN jjCOMPARE_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:424
static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2134
static BOOLEAN jjCOMPARE_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:397
static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1227
static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1205
static BOOLEAN jjTENSOR_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:3651
static BOOLEAN jjRMINUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3324
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition iparith.cc:1617
static BOOLEAN jjPLUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:767
static BOOLEAN jjDET2(leftv res, leftv u, leftv v)
Definition iparith.cc:1896
static BOOLEAN jjSTD_HILB(leftv res, leftv u, leftv v)
Definition iparith.cc:3468
static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1380
static BOOLEAN jjINDEX_P_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1488
static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
Definition iparith.cc:2539
static BOOLEAN jjCOLON(leftv res, leftv u, leftv v)
Definition iparith.cc:320
static BOOLEAN jjRPLUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3330
static BOOLEAN jjCOLCOL(leftv res, leftv u, leftv v)
Definition iparith.cc:693
static BOOLEAN jjFAC_P2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:2065
static BOOLEAN jjHOMOG_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2465
static BOOLEAN jjINDEX_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1517
static BOOLEAN jjDIM2(leftv res, leftv v, leftv w)
Definition iparith.cc:1937
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:263
static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2380
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
Definition iparith.cc:3120
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
Definition iparith.cc:2514
static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
Definition iparith.cc:3707
static BOOLEAN jjMINUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:965
static BOOLEAN jjINDEX_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1448
static BOOLEAN jjEQUAL_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1335
static BOOLEAN jjLOAD2(leftv, leftv, leftv v)
Definition iparith.cc:2629
static BOOLEAN jjALIGN_M(leftv res, leftv u, leftv v)
Definition iparith.cc:1779
static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
Definition iparith.cc:3683
static BOOLEAN jjDIV_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1250
static BOOLEAN jjCOMPARE_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:367
static BOOLEAN jjEQUAL_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1353
static BOOLEAN jjDelete_ID_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1876
static BOOLEAN jjDET2_S(leftv res, leftv u, leftv v)
Definition iparith.cc:1903
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1807
static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b)
Definition iparith.cc:2986
static BOOLEAN jjMOD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2719
static BOOLEAN jjPLUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:782
static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2404
static BOOLEAN jjPLUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:777
static BOOLEAN jjKoszul_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:2581
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:10231
static BOOLEAN jjPLUS_S(leftv res, leftv u, leftv v)
Definition iparith.cc:863
static BOOLEAN jjHOMOG1_W(leftv res, leftv v, leftv u)
Definition iparith.cc:2487
static BOOLEAN jjINDEX_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1412
static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:878
static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2550
static BOOLEAN jjPRUNE_MAP(leftv res, leftv v, leftv ma)
Definition iparith.cc:3059
static BOOLEAN jjLT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1214
static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
Definition iparith.cc:602
static BOOLEAN jjINDEX_PBu(leftv res, leftv u, leftv v)
Definition iparith.cc:1465
static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
Definition iparith.cc:584
static BOOLEAN jjEQUAL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1359
static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2858
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3441
static BOOLEAN jjALIGN_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1769
BOOLEAN jjIMPORTFROM(leftv, leftv u, leftv v)
Definition ipassign.cc:2512
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:4658
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.

801 {
802// operations:
803// proc cmd res arg1 arg2 arg3 context
819#ifdef SINGULAR_4_2
821#endif
825#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
827#endif
834#ifdef SINGULAR_4_2
836#endif
887#ifdef OLD_RES
890#endif
894#ifdef SINGULAR_4_2
896#endif
907#ifdef OLD_RES
910#endif
913#ifdef OLD_RES
916#endif
932,{NULL_VAL, 0, 0, 0, 0, 0 , NO_NC |NO_RING}
933};
BOOLEAN atATTRIB3(leftv, leftv v, leftv b, leftv c)
Definition attrib.cc:374
#define jjWRONG3
Definition gentable.cc:126
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5842
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6975
static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6217
static BOOLEAN jjBRACK_Ma_IV_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5978
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6934
static BOOLEAN jjSUBST_Bu(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6838
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7227
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6177
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7290
static BOOLEAN jjMODULO3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7014
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6142
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6374
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6952
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6851
static BOOLEAN jjLIFTSTD_SYZ(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7151
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6097
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6380
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6122
static BOOLEAN jjHOMOG_W_M(leftv res, leftv v1, leftv v2, leftv v3)
Definition iparith.cc:6314
static BOOLEAN jjRING_2(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6085
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5815
static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6988
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6078
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7196
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5928
static BOOLEAN jjINTERSEC3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6349
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7235
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6357
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7281
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7276
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:7220
static BOOLEAN jjHILBERT3Qt(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6256
static BOOLEAN jjELIMIN_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6169
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6364
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7208
static BOOLEAN jjINTERSECT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6336
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5870
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6670
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6296
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6884
static BOOLEAN jjSMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7116
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6680
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6027
static BOOLEAN jjMRES_MAP(leftv res, leftv u, leftv v, leftv ma)
Definition iparith.cc:6587
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7129
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6278
static BOOLEAN jjFIND3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6186
static BOOLEAN jjMODULO3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7065
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6322
static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
Definition iparith.cc:2945
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6763
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6136
static BOOLEAN jjHILBERT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6226
static BOOLEAN jjLIFTSTD_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7174
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5799
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6938
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
Definition iparith.cc:5138
static BOOLEAN jjBRACK_SM(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5899
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3086
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:3342
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:4681
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:4824
@ 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.

937 {
938// operations:
939// proc cmd res number_of_args context
941,{D(jjRING_PL), '[', RING_CMD, -2 , ALLOW_NC |ALLOW_RING}
947#ifdef SINGULAR_4_2
950#endif
957//,{D(jjEXPORTTO_M), EXPORTTO_CMD, NONE, -2 , ALLOW_NC |ALLOW_RING}
958,{D(jjCALL2ARG), FETCH_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
959,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_PLURAL |ALLOW_RING}
960,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,4 , ALLOW_PLURAL |ALLOW_RING}
961,{D(jjCALL1ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,1 , ALLOW_NC |ALLOW_RING}
962,{D(jjCALL2ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
963,{D(jjCALL3ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_NC |ALLOW_RING}
971,{D(jjCALL2ARG), JET_CMD, POLY_CMD,/*or set by p*/ 2 , ALLOW_PLURAL |ALLOW_RING}
972,{D(jjCALL3ARG), JET_CMD, POLY_CMD,/*or set by p*/ 3 , ALLOW_PLURAL |ALLOW_RING}
973,{D(jjJET4), JET_CMD, POLY_CMD,/*or set by p*/ 4 , ALLOW_PLURAL |ALLOW_RING}
995,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING}
996,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING}
997,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_NC |ALLOW_RING}
998,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING}
999,{D(jjREDUCE5), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 5, ALLOW_PLURAL |ALLOW_RING}
1002//,{D(jjCALL1ARG), RESERVEDNAMELIST_CMD, LIST_CMD, 1 , ALLOW_NC |ALLOW_RING}
1005,{D(jjCALL3ARG), SUBST_CMD, NONE/*set by p*/, 3 , ALLOW_NC |ALLOW_RING}
1006,{D(jjSUBST_M), SUBST_CMD, NONE/*set by p*/, -2 , ALLOW_NC |ALLOW_RING}
1007,{D(jjSYSTEM), SYSTEM_CMD, NONE/*or set by p*/,-2 , ALLOW_NC |ALLOW_RING}
1015,{D(jjCALL1ARG), STD_CMD, IDEAL_CMD/* or set by p*/,1 , ALLOW_NC |ALLOW_RING}
1021,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
1022};
BOOLEAN jjSYSTEM(leftv res, leftv args)
Definition extra.cc:227
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8526
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8375
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8456
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7821
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8659
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8504
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8131
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7341
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7334
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7382
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6391
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7666
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7934
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8950
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8385
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8640
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7399
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8866
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8162
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8606
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7370
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7902
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8303
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7740
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8849
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7541
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8370
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:7995
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8791
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7358
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8252
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7362
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8078
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8822
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7498
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1281
BOOLEAN iiWRITE(leftv res, leftv v)
Definition ipshell.cc:587
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4572
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:4925
@ SIMPLEX_CMD
Definition tok.h:179
@ LUS_CMD
Definition tok.h:123
@ BRANCHTO_CMD
Definition tok.h:39
@ BREAKPOINT_CMD
Definition tok.h:41
@ QRDS_CMD
Definition tok.h:161
@ DBPRINT_CMD
Definition tok.h:57
@ URSOLVE_CMD
Definition tok.h:199
@ FMD_CMD
Definition tok.h:80
@ WRITE_CMD
Definition tok.h:208
@ RESERVEDNAMELIST_CMD
Definition tok.h:171
@ MINOR_CMD
Definition tok.h:126
@ LUI_CMD
Definition tok.h:122
@ TEST_CMD
Definition tok.h:192
@ SYSTEM_CMD
Definition tok.h:189

◆ iiCurrArgs

EXTERN_VAR leftv iiCurrArgs

Definition at line 29 of file ipshell.h.

◆ iiCurrProc

EXTERN_VAR idhdl iiCurrProc

Definition at line 30 of file ipshell.h.

◆ iiLocalRing

EXTERN_VAR ring* iiLocalRing

Definition at line 35 of file ipshell.h.

◆ iiOp

EXTERN_VAR int iiOp

Definition at line 31 of file ipshell.h.

◆ iiRETURNEXPR

EXTERN_INST_VAR sleftv iiRETURNEXPR

Definition at line 34 of file ipshell.h.

◆ iiRETURNEXPR_len

EXTERN_VAR int iiRETURNEXPR_len

Definition at line 33 of file ipshell.h.

◆ lastreserved

const char* lastreserved
extern

Definition at line 83 of file ipshell.cc.

◆ myynest

EXTERN_VAR int myynest

Definition at line 38 of file ipshell.h.

◆ printlevel

EXTERN_VAR int printlevel

Definition at line 39 of file ipshell.h.

◆ si_echo

EXTERN_VAR int si_echo

Definition at line 40 of file ipshell.h.

◆ yyInRingConstruction

EXTERN_VAR BOOLEAN yyInRingConstruction

Definition at line 43 of file ipshell.h.