My Project
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions | Variables
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 charTok2Cmdname (int i)
 
const chariiTwoOps (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 chariiGetLibName (const procinfov pi)
 find the library of an proc
 
chariiGetLibProcBuffer (procinfov pi, int part=1)
 
chariiProcName (char *buf, char &ct, char *&e)
 
chariiProcArgs (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)
 
chariiConvName (const char *libname)
 
BOOLEAN iiGetLibStatus (const char *lib)
 
BOOLEAN iiLoadLIB (FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
 
lists syConvRes (syStrategy syzstr, BOOLEAN toDel=FALSE, int add_row_shift=0)
 
syStrategy syConvList (lists li)
 
BOOLEAN syBetti1 (leftv res, leftv u)
 
BOOLEAN syBetti2 (leftv res, leftv u, leftv w)
 
BOOLEAN iiExprArith1 (leftv res, sleftv *a, int op)
 
BOOLEAN iiExprArith2 (leftv res, sleftv *a, int op, sleftv *b, BOOLEAN proccall=FALSE)
 
BOOLEAN iiExprArith3 (leftv res, int op, leftv a, leftv b, leftv c)
 
BOOLEAN iiExprArithM (leftv res, sleftv *a, int op)
 
BOOLEAN iiApply (leftv res, leftv a, int op, leftv proc)
 
BOOLEAN iiAssign (leftv left, leftv right, BOOLEAN toplevel=TRUE)
 
coeffs jjSetMinpoly (coeffs cf, number a)
 
BOOLEAN iiParameter (leftv p)
 
BOOLEAN iiAlias (leftv p)
 
int iiTokType (int op)
 
int iiDeclCommand (leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring=FALSE, BOOLEAN init_b=TRUE)
 
BOOLEAN iiMake_proc (idhdl pn, package pack, leftv sl)
 
voidiiCallLibProc1 (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)
 
charshowOption ()
 
BOOLEAN setOption (leftv res, leftv v)
 
charversionString ()
 
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 charcurrid
 
EXTERN_VAR int iiRETURNEXPR_len
 
EXTERN_INST_VAR sleftv iiRETURNEXPR
 
EXTERN_VAR ringiiLocalRing
 
const charlastreserved
 
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 78 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 69 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 86 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 96 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 104 of file gentable.cc.

Data Fields
short arg
int p
proc1 p
short res

◆ sValAssign

struct sValAssign

Definition at line 111 of file gentable.cc.

Data Fields
short arg
int p
proci p
short res

Typedef Documentation

◆ proc1

typedef BOOLEAN(* proc1) (leftv, leftv)

Definition at line 122 of file ipshell.h.

◆ proc2

Definition at line 134 of file ipshell.h.

◆ proc3

Definition at line 145 of file ipshell.h.

◆ proci

Definition at line 175 of file ipshell.h.

Function Documentation

◆ exprlist_length()

int exprlist_length ( leftv  v)

Definition at line 552 of file ipshell.cc.

553{
554 int rc = 0;
555 while (v!=NULL)
556 {
557 switch (v->Typ())
558 {
559 case INT_CMD:
560 case POLY_CMD:
561 case VECTOR_CMD:
562 case NUMBER_CMD:
563 rc++;
564 break;
565 case INTVEC_CMD:
566 case INTMAT_CMD:
567 rc += ((intvec *)(v->Data()))->length();
568 break;
569 case MATRIX_CMD:
570 case IDEAL_CMD:
571 case MODUL_CMD:
572 {
573 matrix mm = (matrix)(v->Data());
574 rc += mm->rows() * mm->cols();
575 }
576 break;
577 case LIST_CMD:
578 rc+=((lists)v->Data())->nr+1;
579 break;
580 default:
581 rc++;
582 }
583 v = v->next;
584 }
585 return rc;
586}
int length() const
Variable next() const
Definition factory.h:146
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 709 of file iplib.cc.

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

◆ ii_CallProcId2Id()

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

Definition at line 669 of file iplib.cc.

670{
671 char *plib = iiConvName(lib);
674 if (h==NULL)
675 {
677 if (bo) return NULL;
678 }
681 BOOLEAN err;
684 if (err) return NULL;
685 return I;
686}
int BOOLEAN
Definition auxiliary.h:87
#define TRUE
Definition auxiliary.h:100
unsigned char * proc[NUM_PROC]
Definition checklibs.c:16
ideal idCopy(ideal A)
Definition ideals.h:60
char * iiConvName(const char *libname)
Definition iplib.cc:1438
BOOLEAN iiLibCmd(const char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition iplib.cc:893
void * iiCallLibProc1(const char *n, void *arg, int arg_type, BOOLEAN &err)
Definition iplib.cc:635
#define omFreeBinAddr(addr)

◆ ii_CallProcId2Int()

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

Definition at line 688 of file iplib.cc.

689{
690 char *plib = iiConvName(lib);
693 if (h==NULL)
694 {
696 if (bo) return 0;
697 }
698 BOOLEAN err;
701 int I=(int)(long)iiCallLibProc1(proc,idCopy(arg),IDEAL_CMD,err);
703 if (err) return 0;
704 return I;
705}

◆ iiAddCproc()

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

Definition at line 1072 of file iplib.cc.

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

◆ iiAlias()

BOOLEAN iiAlias ( leftv  p)

Definition at line 846 of file ipid.cc.

847{
848 if (iiCurrArgs==NULL)
849 {
850 Werror("not enough arguments for proc %s",VoiceName());
851 p->CleanUp();
852 return TRUE;
853 }
855 iiCurrArgs=h->next;
856 h->next=NULL;
857 if (h->rtyp!=IDHDL)
858 {
860 h->CleanUp();
862 return res;
863 }
864 if ((h->Typ()!=p->Typ()) &&(p->Typ()!=DEF_CMD))
865 {
866 WerrorS("type mismatch");
867 return TRUE;
868 }
869 idhdl pp=(idhdl)p->data;
870 switch(pp->typ)
871 {
872 case CRING_CMD:
874 break;
875 case DEF_CMD:
876 case INT_CMD:
877 break;
878 case INTVEC_CMD:
879 case INTMAT_CMD:
880 delete IDINTVEC(pp);
881 break;
882 case NUMBER_CMD:
884 break;
885 case BIGINT_CMD:
887 break;
888 case MAP_CMD:
889 {
890 map im = IDMAP(pp);
891 omFreeBinAddr((ADDRESS)im->preimage);
892 im->preimage=NULL;// and continue
893 }
894 // continue as ideal:
895 case IDEAL_CMD:
896 case MODUL_CMD:
897 case MATRIX_CMD:
899 break;
900 case PROC_CMD:
901 case RESOLUTION_CMD:
902 case STRING_CMD:
904 break;
905 case LIST_CMD:
906 IDLIST(pp)->Clean();
907 break;
908 case LINK_CMD:
910 break;
911 // case ring: cannot happen
912 default:
913 Werror("unknown type %d",p->Typ());
914 return TRUE;
915 }
916 pp->typ=ALIAS_CMD;
917 IDDATA(pp)=(char*)h->data;
918 int eff_typ=h->Typ();
920 || ((eff_typ==LIST_CMD) && (lRingDependend((lists)h->Data()))))
921 {
922 ipSwapId(pp,IDROOT,currRing->idroot);
923 }
924 h->CleanUp();
926 return FALSE;
927}
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition cf_gcd.cc:676
int p
Definition cfModGcd.cc:4086
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition lists.h:24
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:459
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:574
CanonicalForm res
Definition facAbsFact.cc:60
void WerrorS(const char *s)
Definition feFopen.cc:24
const char * VoiceName()
Definition fevoices.cc:58
static int RingDependend(int t)
Definition gentable.cc:28
@ 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:2034
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc:681
VAR coeffs coeffs_BIGINT
Definition ipid.cc:50
#define IDMAP(a)
Definition ipid.h:135
#define IDSTRING(a)
Definition ipid.h:136
#define IDDATA(a)
Definition ipid.h:126
#define IDINTVEC(a)
Definition ipid.h:128
#define IDLINK(a)
Definition ipid.h:138
#define IDIDEAL(a)
Definition ipid.h:133
#define IDNUMBER(a)
Definition ipid.h:132
#define IDLIST(a)
Definition ipid.h:137
VAR leftv iiCurrArgs
Definition ipshell.cc:80
BOOLEAN lRingDependend(lists L)
Definition lists.cc:222
The main handler for Singular numbers which are suitable for Singular polynomials.
#define nDelete(n)
Definition numbers.h:16
#define omFree(addr)
#define omFreeBin(addr, bin)
idrec * idhdl
Definition ring.h:21
#define IDHDL
Definition tok.h:31
@ ALIAS_CMD
Definition tok.h:34
@ BIGINT_CMD
Definition tok.h:38
@ CRING_CMD
Definition tok.h:56
@ DEF_CMD
Definition tok.h:58
@ LINK_CMD
Definition tok.h:117
@ STRING_CMD
Definition tok.h:187

◆ iiAllStart()

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

Definition at line 306 of file iplib.cc.

307{
309 int restore_traceit=0;
310 if (traceit_stop
312 {
313 traceit &=(~TRACE_SHOW_LINE);
314 traceit_stop=0;
316 }
317 // see below:
320 newBuffer( omStrDup(p /*pi->data.s.body*/), t /*BT_proc*/,
321 pi, l );
322 BOOLEAN err=yyparse();
323
324 if (sLastPrinted.rtyp!=0)
325 {
327 }
328
330
331 // the access to optionStruct and verboseStruct do not work
332 // on x86_64-Linux for pic-code
333 if ((TEST_V_ALLWARN) &&
334 (t==BT_proc) &&
335 ((save1!=si_opt_1)||(save2!=si_opt_2)) &&
336 (pi->libname!=NULL) && (pi->libname[0]!='\0'))
337 {
338 if ((pi->libname!=NULL) && (pi->libname[0]!='\0'))
339 Warn("option changed in proc %s from %s",pi->procname,pi->libname);
340 else
341 Warn("option changed in proc %s",pi->procname);
342 int i;
343 for (i=0; optionStruct[i].setval!=0; i++)
344 {
345 if ((optionStruct[i].setval & si_opt_1)
346 && (!(optionStruct[i].setval & save1)))
347 {
348 Print(" +%s",optionStruct[i].name);
349 }
350 if (!(optionStruct[i].setval & si_opt_1)
351 && ((optionStruct[i].setval & save1)))
352 {
353 Print(" -%s",optionStruct[i].name);
354 }
355 }
356 for (i=0; verboseStruct[i].setval!=0; i++)
357 {
358 if ((verboseStruct[i].setval & si_opt_2)
359 && (!(verboseStruct[i].setval & save2)))
360 {
361 Print(" +%s",verboseStruct[i].name);
362 }
363 if (!(verboseStruct[i].setval & si_opt_2)
364 && ((verboseStruct[i].setval & save2)))
365 {
366 Print(" -%s",verboseStruct[i].name);
367 }
368 }
369 PrintLn();
370 }
371 return err;
372}
int l
Definition cfEzgcd.cc:100
int rtyp
Definition subexpr.h:91
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
#define Print
Definition emacs.cc:80
char name(const Variable &v)
Definition factory.h:189
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:538
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:507
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:142
void PrintLn()
Definition reporter.cc:310
#define TRACE_SHOW_LINE
Definition reporter.h:33
EXTERN_VAR int traceit
Definition reporter.h:24
EXTERN_VAR int traceit_stop
Definition reporter.h:25
#define BITSET
Definition structs.h:16
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46

◆ iiApply()

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

Definition at line 6440 of file ipshell.cc.

6441{
6442 res->Init();
6443 res->rtyp=a->Typ();
6444 switch (res->rtyp /*a->Typ()*/)
6445 {
6446 case INTVEC_CMD:
6447 case INTMAT_CMD:
6448 return iiApplyINTVEC(res,a,op,proc);
6449 case BIGINTMAT_CMD:
6450 return iiApplyBIGINTMAT(res,a,op,proc);
6451 case IDEAL_CMD:
6452 case MODUL_CMD:
6453 case MATRIX_CMD:
6454 return iiApplyIDEAL(res,a,op,proc);
6455 case LIST_CMD:
6456 return iiApplyLIST(res,a,op,proc);
6457 }
6458 WerrorS("first argument to `apply` must allow an index");
6459 return TRUE;
6460}
int Typ()
Definition subexpr.cc:1049
@ BIGINTMAT_CMD
Definition grammar.cc:278
BOOLEAN iiApplyINTVEC(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6359
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6401
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
Definition ipshell.cc:6396
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
Definition ipshell.cc:6391

◆ iiARROW()

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

Definition at line 6489 of file ipshell.cc.

6490{
6491 size_t len=strlen(a)+strlen(s)+30; /* max. 27 currently */
6492 char *ss=(char*)omAlloc(len);
6493 // find end of s:
6494 int end_s=strlen(s);
6495 while ((end_s>0) && ((s[end_s]<=' ')||(s[end_s]==';'))) end_s--;
6496 s[end_s+1]='\0';
6497 char *name=(char *)omAlloc(len);
6498 snprintf(name,len,"%s->%s",a,s);
6499 // find start of last expression
6500 int start_s=end_s-1;
6501 while ((start_s>=0) && (s[start_s]!=';')) start_s--;
6502 if (start_s<0) // ';' not found
6503 {
6504 snprintf(ss,len,"parameter def %s;return(%s);\n",a,s);
6505 }
6506 else // s[start_s] is ';'
6507 {
6508 s[start_s]='\0';
6509 snprintf(ss,len,"parameter def %s;%s;return(%s);\n",a,s,s+start_s+1);
6510 }
6511 r->Init();
6512 // now produce procinfo for PROC_CMD:
6513 r->data = (void *)omAlloc0Bin(procinfo_bin);
6514 ((procinfo *)(r->data))->language=LANG_NONE;
6516 ((procinfo *)r->data)->data.s.body=ss;
6517 omFree(name);
6518 r->rtyp=PROC_CMD;
6519 //r->rtyp=STRING_CMD;
6520 //r->data=ss;
6521 return FALSE;
6522}
void * data
Definition subexpr.h:88
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:1058
#define omAlloc(size)
VAR omBin procinfo_bin
Definition subexpr.cc:42

◆ iiAssign()

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

Definition at line 2034 of file ipassign.cc.

2035{
2036 if (errorreported) return TRUE;
2037 int ll=l->listLength();
2038 int rl;
2039 int lt=l->Typ();
2040 int rt=NONE;
2041 int is_qring=FALSE;
2042 BOOLEAN b=FALSE;
2043 if (l->rtyp==ALIAS_CMD)
2044 {
2045 Werror("`%s` is read-only",l->Name());
2046 }
2047
2048 if (l->rtyp==IDHDL)
2049 {
2050 atKillAll((idhdl)l->data);
2052 IDFLAG((idhdl)l->data)=0;
2053 l->attribute=NULL;
2055 }
2056 else if (l->attribute!=NULL)
2057 atKillAll((idhdl)l);
2058 if (ll==1)
2059 {
2060 /* l[..] = ... */
2061 if(l->e!=NULL)
2062 {
2064 blackbox *bb=NULL;
2065 int bt;
2066 if (((bt=l->rtyp)>MAX_TOK)
2067 || ((l->rtyp==IDHDL) && ((bt=IDTYP((idhdl)l->data))>MAX_TOK)))
2068 {
2070 like_lists=BB_LIKE_LIST(bb); // bb like a list
2071 }
2072 else if (((l->rtyp==IDHDL) && (IDTYP((idhdl)l->data)==LIST_CMD))
2073 || (l->rtyp==LIST_CMD))
2074 {
2075 like_lists=2; // bb in a list
2076 }
2077 if(like_lists)
2078 {
2079 if (traceit&TRACE_ASSIGN) PrintS("assign list[..]=...or similar\n");
2080 if (like_lists==1)
2081 {
2082 // check blackbox/newtype type:
2083 if(bb->blackbox_CheckAssign(bb,l,r)) return TRUE;
2084 }
2085 b=jiAssign_list(l,r);
2086 if((!b) && (like_lists==2))
2087 {
2088 //Print("jjA_L_LIST: - 2 \n");
2089 if((l->rtyp==IDHDL) && (l->data!=NULL))
2090 {
2091 ipMoveId((idhdl)l->data);
2092 l->attribute=IDATTR((idhdl)l->data);
2093 l->flag=IDFLAG((idhdl)l->data);
2094 }
2095 }
2096 r->CleanUp();
2097 Subexpr h;
2098 while (l->e!=NULL)
2099 {
2100 h=l->e->next;
2102 l->e=h;
2103 }
2104 return b;
2105 }
2106 }
2107 if (lt>MAX_TOK)
2108 {
2110#ifdef BLACKBOX_DEVEL
2111 Print("bb-assign: bb=%lx\n",bb);
2112#endif
2113 return (bb==NULL) || bb->blackbox_Assign(l,r);
2114 }
2115 // end of handling elems of list and similar
2116 rl=r->listLength();
2117 if (rl==1)
2118 {
2119 /* system variables = ... */
2120 if(((l->rtyp>=VECHO)&&(l->rtyp<=VPRINTLEVEL))
2121 ||((l->rtyp>=VALTVARS)&&(l->rtyp<=VMINPOLY)))
2122 {
2123 b=iiAssign_sys(l,r);
2124 r->CleanUp();
2125 //l->CleanUp();
2126 return b;
2127 }
2128 rt=r->Typ();
2129 /* a = ... */
2130 if ((lt!=MATRIX_CMD)
2131 &&(lt!=BIGINTMAT_CMD)
2132 &&(lt!=BIGINTVEC_CMD)
2133 &&(lt!=CMATRIX_CMD)
2134 &&(lt!=INTMAT_CMD)
2135 &&((lt==rt)||(lt!=LIST_CMD)))
2136 {
2138 if (l->rtyp==IDHDL)
2139 {
2140 if ((lt==DEF_CMD)||(lt==LIST_CMD))
2141 {
2142 ipMoveId((idhdl)l->data);
2143 }
2144 l->attribute=IDATTR((idhdl)l->data);
2145 l->flag=IDFLAG((idhdl)l->data);
2146 l->CleanUp();
2147 }
2148 r->CleanUp();
2149 return b;
2150 }
2151 if (((lt!=LIST_CMD)
2152 &&((rt==MATRIX_CMD)
2153 ||(rt==BIGINTMAT_CMD)
2154 ||(rt==BIGINTVEC_CMD)
2155 ||(rt==CMATRIX_CMD)
2156 ||(rt==INTMAT_CMD)
2157 ||(rt==INTVEC_CMD)
2158 ||(rt==MODUL_CMD)))
2159 ||((lt==LIST_CMD)
2160 &&(rt==RESOLUTION_CMD))
2161 )
2162 {
2163 b=jiAssign_1(l,r,rt,toplevel);
2164 if((l->rtyp==IDHDL)&&(l->data!=NULL))
2165 {
2166 if ((lt==DEF_CMD) || (lt==LIST_CMD))
2167 {
2168 //Print("ipAssign - 3.0\n");
2169 ipMoveId((idhdl)l->data);
2170 }
2171 l->attribute=IDATTR((idhdl)l->data);
2172 l->flag=IDFLAG((idhdl)l->data);
2173 }
2174 r->CleanUp();
2175 Subexpr h;
2176 while (l->e!=NULL)
2177 {
2178 h=l->e->next;
2180 l->e=h;
2181 }
2182 return b;
2183 }
2184 }
2185 if (rt==NONE) rt=r->Typ();
2186 }
2187 else if (ll==(rl=r->listLength()))
2188 {
2189 b=jiAssign_rec(l,r);
2190 return b;
2191 }
2192 else
2193 {
2194 if (rt==NONE) rt=r->Typ();
2195 if (rt==INTVEC_CMD)
2196 return jiA_INTVEC_L(l,r);
2197 else if (rt==VECTOR_CMD)
2198 return jiA_VECTOR_L(l,r);
2199 else if ((rt==IDEAL_CMD)||(rt==MATRIX_CMD))
2200 return jiA_MATRIX_L(l,r);
2201 else if ((rt==STRING_CMD)&&(rl==1))
2202 return jiA_STRING_L(l,r);
2203 Werror("length of lists in assignment does not match (l:%d,r:%d)",
2204 ll,rl);
2205 return TRUE;
2206 }
2207
2208 leftv hh=r;
2210 switch (lt)
2211 {
2212 case INTVEC_CMD:
2214 break;
2215 case INTMAT_CMD:
2216 {
2217 b=jjA_L_INTVEC(l,r,new intvec(IDINTVEC((idhdl)l->data)));
2218 break;
2219 }
2220 case BIGINTVEC_CMD:
2221 {
2222 b=jjA_L_BIGINTVEC(l, r, new bigintmat(IDBIMAT((idhdl)l->data)));
2223 break;
2224 }
2225 case BIGINTMAT_CMD:
2226 {
2227 b=jjA_L_BIGINTMAT(l, r, new bigintmat(IDBIMAT((idhdl)l->data)));
2228 break;
2229 }
2230 case MAP_CMD:
2231 {
2232 // first element in the list sl (r) must be a ring
2233 if ((rt == RING_CMD)&&(r->e==NULL))
2234 {
2235 omFreeBinAddr((ADDRESS)IDMAP((idhdl)l->data)->preimage);
2236 IDMAP((idhdl)l->data)->preimage = omStrDup (r->Fullname());
2237 /* advance the expressionlist to get the next element after the ring */
2238 hh = r->next;
2239 }
2240 else
2241 {
2242 WerrorS("expected ring-name");
2243 b=TRUE;
2244 break;
2245 }
2246 if (hh==NULL) /* map-assign: map f=r; */
2247 {
2248 WerrorS("expected image ideal");
2249 b=TRUE;
2250 break;
2251 }
2252 if ((hh->next==NULL)&&(hh->Typ()==IDEAL_CMD))
2253 {
2254 b=jiAssign_1(l,hh,IDEAL_CMD,toplevel); /* map-assign: map f=r,i; */
2256 return b;
2257 }
2258 //no break, handle the rest like an ideal:
2259 map_assign=TRUE; // and continue
2260 }
2261 case MATRIX_CMD:
2262 case IDEAL_CMD:
2263 case MODUL_CMD:
2264 {
2265 sleftv t;
2266 matrix olm = (matrix)l->Data();
2267 long rk;
2268 char *pr=((map)olm)->preimage;
2269 BOOLEAN module_assign=(/*l->Typ()*/ lt==MODUL_CMD);
2270 matrix lm ;
2271 long num;
2272 int j,k;
2273 int i=0;
2274 int mtyp=MATRIX_CMD; /*Type of left side object*/
2275 int etyp=POLY_CMD; /*Type of elements of left side object*/
2276
2277 if (lt /*l->Typ()*/==MATRIX_CMD)
2278 {
2279 rk=olm->rows();
2280 num=olm->cols()*rk /*olm->rows()*/;
2281 lm=mpNew(olm->rows(),olm->cols());
2282 int el;
2284 {
2285 Warn("expression list length(%d) does not match matrix size(%d)",el,num);
2286 }
2287 }
2288 else /* IDEAL_CMD or MODUL_CMD */
2289 {
2291 lm=(matrix)idInit(num,1);
2292 if (module_assign)
2293 {
2294 rk=0;
2297 }
2298 else
2299 rk=1;
2300 }
2301
2302 int ht;
2303 loop
2304 {
2305 if (hh==NULL)
2306 break;
2307 else
2308 {
2309 matrix rm;
2310 ht=hh->Typ();
2311 if ((j=iiTestConvert(ht,etyp))!=0)
2312 {
2313 b=iiConvert(ht,etyp,j,hh,&t);
2314 hh->next=t.next;
2315 if (b)
2316 { Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(etyp));
2317 break;
2318 }
2319 lm->m[i]=(poly)t.CopyD(etyp);
2320 pNormalize(lm->m[i]);
2321 if (module_assign) rk=si_max(rk,pMaxComp(lm->m[i]));
2322 i++;
2323 }
2324 else
2325 if ((j=iiTestConvert(ht,mtyp))!=0)
2326 {
2327 b=iiConvert(ht,mtyp,j,hh,&t);
2328 hh->next=t.next;
2329 if (b)
2330 { Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(mtyp));
2331 break;
2332 }
2333 rm = (matrix)t.CopyD(mtyp);
2334 if (module_assign)
2335 {
2336 j = si_min((int)num,rm->cols());
2337 rk=si_max(rk,rm->rank);
2338 }
2339 else
2340 j = si_min(num-i,(long)rm->rows() * (long)rm->cols());
2341 for(k=0;k<j;k++,i++)
2342 {
2343 lm->m[i]=rm->m[k];
2344 pNormalize(lm->m[i]);
2345 rm->m[k]=NULL;
2346 }
2347 idDelete((ideal *)&rm);
2348 }
2349 else
2350 {
2351 b=TRUE;
2352 Werror("can not convert %s(%s) -> %s",Tok2Cmdname(ht),hh->Name(),Tok2Cmdname(mtyp));
2353 break;
2354 }
2355 t.next=NULL;t.CleanUp();
2356 if (i==num) break;
2357 hh=hh->next;
2358 }
2359 }
2360 if (b)
2361 idDelete((ideal *)&lm);
2362 else
2363 {
2364 idDelete((ideal *)&olm);
2365 if (module_assign) lm->rank=rk;
2366 else if (map_assign) ((map)lm)->preimage=pr;
2367 l=l->LData();
2368 if (l->rtyp==IDHDL)
2369 IDMATRIX((idhdl)l->data)=lm;
2370 else
2371 l->data=(char *)lm;
2372 }
2373 break;
2374 }
2375 case STRING_CMD:
2376 b=jjA_L_STRING(l,r);
2377 break;
2378 //case DEF_CMD:
2379 case LIST_CMD:
2380 b=jjA_L_LIST(l,r);
2381 break;
2382 case NONE:
2383 case 0:
2384 Werror("cannot assign to %s",l->Fullname());
2385 b=TRUE;
2386 break;
2387 default:
2388 WerrorS("assign not impl.");
2389 b=TRUE;
2390 break;
2391 } /* end switch: typ */
2392 if (b && (!errorreported)) WerrorS("incompatible type in list assignment");
2393 r->CleanUp();
2394 return b;
2395}
#define atKillAll(H)
Definition attrib.h:47
static int si_max(const int a, const int b)
Definition auxiliary.h:124
static int si_min(const int a, const int b)
Definition auxiliary.h:125
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
#define BB_LIKE_LIST(B)
Definition blackbox.h:53
CanonicalForm num(const CanonicalForm &f)
int k
Definition cfEzgcd.cc:99
CanonicalForm b
Definition cfModGcd.cc:4111
Matrices of numbers.
Definition bigintmat.h:51
void * CopyD(int t)
Definition subexpr.cc:715
leftv next
Definition subexpr.h:86
int j
Definition facHensel.cc:110
VAR short errorreported
Definition feFopen.cc:23
int iiTestConvert(int inputType, int outputType)
Definition gentable.cc:301
const char * Tok2Cmdname(int tok)
Definition gentable.cc:140
@ 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:1754
static BOOLEAN jiA_MATRIX_L(leftv l, leftv r)
Definition ipassign.cc:1827
static BOOLEAN jiA_VECTOR_L(leftv l, leftv r)
Definition ipassign.cc:1550
static BOOLEAN iiAssign_sys(leftv l, leftv r)
Definition ipassign.cc:1450
static BOOLEAN jiAssign_rec(leftv l, leftv r)
Definition ipassign.cc:2011
static BOOLEAN jiAssign_1(leftv l, leftv r, int rt, BOOLEAN toplevel, BOOLEAN is_qring=FALSE)
Definition ipassign.cc:1267
static BOOLEAN jjA_L_LIST(leftv l, leftv r)
Definition ipassign.cc:1591
static BOOLEAN jiA_STRING_L(leftv l, leftv r)
Definition ipassign.cc:1903
static BOOLEAN jjA_L_BIGINTMAT(leftv l, leftv r, bigintmat *bim)
Definition ipassign.cc:1705
static BOOLEAN jiAssign_list(leftv l, leftv r)
Definition ipassign.cc:1939
static BOOLEAN jjA_L_STRING(leftv l, leftv r)
Definition ipassign.cc:1793
static BOOLEAN jiA_INTVEC_L(leftv l, leftv r)
Definition ipassign.cc:1524
static BOOLEAN jjA_L_INTVEC(leftv l, leftv r, intvec *iv)
Definition ipassign.cc:1656
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition ipconv.cc:449
void ipMoveId(idhdl tomove)
Definition ipid.cc:706
#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:552
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
#define pMaxComp(p)
Definition polys.h:299
#define pNormalize(p)
Definition polys.h:317
void PrintS(const char *s)
Definition reporter.cc:284
#define TRACE_ASSIGN
Definition reporter.h:46
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define loop
Definition structs.h:75
VAR omBin sSubexpr_bin
Definition subexpr.cc:40
@ VPRINTLEVEL
Definition tok.h:217
@ CMATRIX_CMD
Definition tok.h:46
@ VECHO
Definition tok.h:210
@ MAX_TOK
Definition tok.h:220
#define NONE
Definition tok.h:223

◆ iiAssignCR()

BOOLEAN iiAssignCR ( leftv  r,
leftv  arg 
)

Definition at line 6524 of file ipshell.cc.

6525{
6526 char* ring_name=omStrDup((char*)r->Name());
6527 int t=arg->Typ();
6528 if (t==RING_CMD)
6529 {
6530 sleftv tmp;
6531 tmp.Init();
6532 tmp.rtyp=IDHDL;
6534 tmp.data=(char*)h;
6535 if (h!=NULL)
6536 {
6537 tmp.name=h->id;
6538 BOOLEAN b=iiAssign(&tmp,arg);
6539 if (b) return TRUE;
6542 return FALSE;
6543 }
6544 else
6545 return TRUE;
6546 }
6547 else if (t==CRING_CMD)
6548 {
6549 sleftv tmp;
6550 sleftv n;
6551 n.Init();
6552 n.name=ring_name;
6553 if (iiDeclCommand(&tmp,&n,myynest,CRING_CMD,&IDROOT)) return TRUE;
6554 if (iiAssign(&tmp,arg)) return TRUE;
6555 //Print("create %s\n",r->Name());
6556 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6557 return FALSE;
6558 }
6559 //Print("create %s\n",r->Name());
6560 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6561 return TRUE;// not handled -> error for now
6562}
const char * name
Definition subexpr.h:87
const char * Name()
Definition subexpr.h:120
VAR int myynest
Definition febase.cc:41
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
Definition ipshell.cc:1199
idhdl rDefault(const char *s)
Definition ipshell.cc:1645
void rSetHdl(idhdl h)
Definition ipshell.cc:5135

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv  r,
leftv  args 
)

Definition at line 1274 of file ipshell.cc.

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

◆ iiCallLibProc1()

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

Definition at line 635 of file iplib.cc.

636{
637 idhdl h=ggetid(n);
638 if ((h==NULL)
639 || (IDTYP(h)!=PROC_CMD))
640 {
641 err=2;
642 return NULL;
643 }
644 // ring handling
648 // argument:
649 sleftv tmp;
650 tmp.Init();
651 tmp.data=arg;
652 tmp.rtyp=arg_type;
653 // call proc
655 // clean up ring
657 // return
658 if (err==FALSE)
659 {
660 void*r=iiRETURNEXPR.data;
663 return r;
664 }
665 return NULL;
666}

◆ 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:58
#define IDPACKAGE(a)
Definition ipid.h:139
@ PACKAGE_CMD
Definition tok.h:150

◆ iiCheckRing()

BOOLEAN iiCheckRing ( int  i)

Definition at line 1587 of file ipshell.cc.

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

6583{
6584 int l=0;
6585 if (args==NULL)
6586 {
6587 if (type_list[0]==0) return TRUE;
6588 }
6589 else l=args->listLength();
6590 if (l!=(int)type_list[0])
6591 {
6592 if (report) iiReportTypes(0,l,type_list);
6593 return FALSE;
6594 }
6595 for(int i=1;i<=l;i++,args=args->next)
6596 {
6597 short t=type_list[i];
6598 if (t!=ANY_TYPE)
6599 {
6600 if (((t==IDHDL)&&(args->rtyp!=IDHDL))
6601 || (t!=args->Typ()))
6602 {
6603 if (report) iiReportTypes(i,args->Typ(),type_list);
6604 return FALSE;
6605 }
6606 }
6607 }
6608 return TRUE;
6609}
static void iiReportTypes(int nr, int t, const short *T)
Definition ipshell.cc:6564
#define ANY_TYPE
Definition tok.h:30

◆ iiConvName()

char * iiConvName ( const char libname)

Definition at line 1438 of file iplib.cc.

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

◆ iiDebug()

void iiDebug ( )

Definition at line 1066 of file ipshell.cc.

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

1200{
1203 const char *id = name->name;
1204
1205 sy->Init();
1206 if ((name->name==NULL)||(isdigit(name->name[0])))
1207 {
1208 WerrorS("object to declare is not a name");
1209 res=TRUE;
1210 }
1211 else
1212 {
1213 if (root==NULL) return TRUE;
1214 if (*root!=IDROOT)
1215 {
1216 if ((currRing==NULL) || (*root!=currRing->idroot))
1217 {
1218 Werror("can not define `%s` in other package",name->name);
1219 return TRUE;
1220 }
1221 }
1222 if (t==QRING_CMD)
1223 {
1224 t=RING_CMD; // qring is always RING_CMD
1225 is_qring=TRUE;
1226 }
1227
1228 if (TEST_V_ALLWARN
1229 && (name->rtyp!=0)
1230 && (name->rtyp!=IDHDL)
1232 {
1233 Warn("`%s` is %s in %s:%d:%s",name->name,Tok2Cmdname(name->rtyp),
1235 }
1236 {
1237 sy->data = (char *)enterid(id,lev,t,root,init_b);
1238 }
1239 if (sy->data!=NULL)
1240 {
1241 sy->rtyp=IDHDL;
1242 currid=sy->name=IDID((idhdl)sy->data);
1243 if (is_qring)
1244 {
1245 IDFLAG((idhdl)sy->data)=sy->flag=Sy_bit(FLAG_QRING_DEF);
1246 }
1247 // name->name=NULL; /* used in enterid */
1248 //sy->e = NULL;
1249 if (name->next!=NULL)
1250 {
1251 sy->next=(leftv)omAllocBin(sleftv_bin);
1252 res=iiDeclCommand(sy->next,name->next,lev,t,root, isring);
1253 }
1254 }
1255 else res=TRUE;
1256 }
1257 name->CleanUp();
1258 return res;
1259}
char * filename
Definition fevoices.h:63
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 762 of file iplib.cc.

763{
764 BOOLEAN err;
765 int old_echo=si_echo;
766
767 iiCheckNest();
768 procstack->push(example);
771 {
773 printf("entering example (level %d)\n",myynest);
774 }
775 myynest++;
776
777 err=iiAllStart(pi,example,BT_example,(pi != NULL ? pi->data.s.example_lineno: 0));
778
780 myynest--;
783 {
785 printf("leaving -example- (level %d)\n",myynest);
786 }
788 {
790 {
793 }
794 else
795 {
798 }
799 }
800 procstack->pop();
801 return err;
802}
void pop()
Definition ipid.cc:815
void push(char *)
Definition ipid.cc:805
VAR int si_echo
Definition febase.cc:35
@ BT_example
Definition fevoices.h:21
VAR proclevel * procstack
Definition ipid.cc:52
static void iiCheckNest()
Definition iplib.cc:501
VAR ring * iiLocalRing
Definition iplib.cc:481
BOOLEAN iiAllStart(procinfov pi, const char *p, feBufferTypes t, int l)
Definition iplib.cc:306
idhdl rFindHdl(ring r, idhdl n)
Definition ipshell.cc:1702
#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 1512 of file ipshell.cc.

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

◆ iiExport() [2/2]

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

Definition at line 1535 of file ipshell.cc.

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

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

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

9172{
9173 res->Init();
9174 leftv b=a->next;
9175 a->next=NULL;
9176 int bt=b->Typ();
9178 a->next=b;
9179 a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
9180 return bo;
9181}
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:9009

◆ iiExprArith3()

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

Definition at line 9581 of file iparith.cc.

9582{
9583 res->Init();
9584
9585 if (!errorreported)
9586 {
9587#ifdef SIQ
9588 if (siq>0)
9589 {
9590 //Print("siq:%d\n",siq);
9592 memcpy(&d->arg1,a,sizeof(sleftv));
9593 a->Init();
9594 memcpy(&d->arg2,b,sizeof(sleftv));
9595 b->Init();
9596 memcpy(&d->arg3,c,sizeof(sleftv));
9597 c->Init();
9598 d->op=op;
9599 d->argc=3;
9600 res->data=(char *)d;
9601 res->rtyp=COMMAND;
9602 return FALSE;
9603 }
9604#endif
9605 int at=a->Typ();
9606 // handling bb-objects ----------------------------------------------
9607 if (at>MAX_TOK)
9608 {
9610 if (bb!=NULL)
9611 {
9612 if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
9613 // otherwise, try defaul (attrib,..)
9614 }
9615 else
9616 return TRUE;
9617 if (errorreported) return TRUE;
9618 }
9619 int bt=b->Typ();
9620 int ct=c->Typ();
9621
9622 iiOp=op;
9623 int i=0;
9624 while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
9626 }
9627 a->CleanUp();
9628 b->CleanUp();
9629 c->CleanUp();
9630 //Print("op: %d,result typ:%d\n",op,res->rtyp);
9631 return TRUE;
9632}
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:9428
VAR omBin sip_command_bin
Definition ipid.cc:45
ip_command * command
Definition ipid.h:23
const struct sValCmd3 dArith3[]
Definition table.h:802
#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 9633 of file iparith.cc.

9637{
9638 res->Init();
9639 leftv b=a->next;
9640 a->next=NULL;
9641 int bt=b->Typ();
9642 leftv c=b->next;
9643 b->next=NULL;
9644 int ct=c->Typ();
9646 b->next=c;
9647 a->next=b;
9648 a->CleanUp(); // to cleanup the chain, content already done
9649 return bo;
9650}

◆ iiExprArithM()

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

◆ iiGetLibName()

static char * iiGetLibName ( const procinfov  pi)
inlinestatic

find the library of an proc

Definition at line 66 of file ipshell.h.

66{ return pi->libname; }

◆ iiGetLibProcBuffer()

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

◆ iiGetLibStatus()

BOOLEAN iiGetLibStatus ( const char lib)

Definition at line 77 of file iplib.cc.

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

◆ iiHighCorner()

poly iiHighCorner ( ideal  i,
int  ak 
)

Definition at line 1607 of file ipshell.cc.

1608{
1609 int i;
1610 if(!idIsZeroDim(I)) return NULL; // not zero-dim.
1611 poly po=NULL;
1613 {
1614 scComputeHC(I,currRing->qideal,ak,po);
1615 if (po!=NULL)
1616 {
1617 pGetCoeff(po)=nInit(1);
1618 for (i=rVar(currRing); i>0; i--)
1619 {
1620 if (pGetExp(po, i) > 0) pDecrExp(po,i);
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:1076
static BOOLEAN idIsZeroDim(ideal i)
Definition ideals.h:179
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
#define nInit(i)
Definition numbers.h:24
#define pSetm(p)
Definition polys.h:271
#define pSetComp(p, v)
Definition polys.h:38
#define pGetExp(p, i)
Exponent.
Definition polys.h:41
#define pOne()
Definition polys.h:315
#define pDecrExp(p, i)
Definition polys.h:44
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition ring.h:597
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:767

◆ iiInternalExport()

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

Definition at line 1466 of file ipshell.cc.

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

◆ iiLibCmd()

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

Definition at line 893 of file iplib.cc.

894{
895 if (strcmp(newlib,"Singular")==0) return FALSE;
896 char libnamebuf[1024];
897 idhdl pl;
898 char *plib = iiConvName(newlib);
900 // int lines = 1;
902
903 if (fp==NULL)
904 {
905 return TRUE;
906 }
907 pl = basePack->idroot->get(plib,0);
908 if (pl==NULL)
909 {
910 pl = enterid( plib,0, PACKAGE_CMD,
911 &(basePack->idroot), TRUE );
912 IDPACKAGE(pl)->language = LANG_SINGULAR;
913 IDPACKAGE(pl)->libname=omStrDup(newlib);
914 }
915 else
916 {
917 if(IDTYP(pl)!=PACKAGE_CMD)
918 {
920 WarnS("not of type package.");
921 fclose(fp);
922 return TRUE;
923 }
924 if (!force)
925 {
927 return FALSE;
928 }
929 }
931
932 if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
934 return LoadResult;
935}
CanonicalForm fp
Definition cfModGcd.cc:4110
idhdl get(const char *s, int lev)
Definition ipid.cc:72
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:982
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 982 of file iplib.cc.

984{
988
989 yylpin = fp;
990 #if YYLPDEBUG > 1
991 print_init();
992 #endif
995 else lpverbose=0;
996 // yylplex sets also text_buffer
997 if (text_buffer!=NULL) *text_buffer='\0';
999 if(yylp_errno)
1000 {
1001 Werror("Library %s: ERROR occurred: in line %d, %d.", newlib, yylplineno,
1002 current_pos(0));
1004 {
1008 }
1009 else
1011 WerrorS("Cannot load library,... aborting.");
1012 reinit_yylp();
1013 fclose( yylpin );
1015 return TRUE;
1016 }
1017 if (BVERBOSE(V_LOAD_LIB))
1018 Print( "// ** loaded %s %s\n", libnamebuf, text_buffer);
1020 {
1021 Warn( "library %s has old format. This format is still accepted,", newlib);
1022 WarnS( "but for functionality you may wish to change to the new");
1023 WarnS( "format. Please refer to the manual for further information.");
1024 }
1025 reinit_yylp();
1026 fclose( yylpin );
1027 fp = NULL;
1028 iiRunInit(IDPACKAGE(pl));
1029
1030 {
1031 libstackv ls;
1032 for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
1033 {
1034 if(ls->to_be_done)
1035 {
1036 ls->to_be_done=FALSE;
1038 ls = ls->pop(newlib);
1039 }
1040 }
1041#if 0
1042 PrintS("--------------------\n");
1043 for(ls = library_stack; ls != NULL; ls = ls->next)
1044 {
1045 Print("%s: LIB-stack:(%d), %s %s\n", newlib, ls->cnt, ls->get(),
1046 ls->to_be_done ? "not loaded" : "loaded");
1047 }
1048 PrintS("--------------------\n");
1049#endif
1050 }
1051
1052 if(fp != NULL) fclose(fp);
1053 return FALSE;
1054}
#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:937
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:966
EXTERN_VAR int yylp_errno
Definition iplib.cc:64
void reinit_yylp()
Definition libparse.cc:3376
VAR char * text_buffer
Definition libparse.cc:1099
VAR int lpverbose
Definition libparse.cc:1106
lib_style_types
Definition libparse.h:9
@ OLD_LIBSTYLE
Definition libparse.h:9
#define YYLP_BAD_CHAR
Definition libparse.h:93
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
#define V_DEBUG_LIB
Definition options.h:48
#define V_LOAD_LIB
Definition options.h:47

◆ iiLocateLib()

BOOLEAN iiLocateLib ( const char lib,
char where 
)

Definition at line 879 of file iplib.cc.

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

◆ iiMake_proc()

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

Definition at line 512 of file iplib.cc.

513{
514 int err;
516 if(pi->is_static && myynest==0)
517 {
518 Werror("'%s::%s()' is a local procedure and cannot be accessed by an user.",
519 pi->libname, pi->procname);
520 return TRUE;
521 }
522 iiCheckNest();
524 //Print("currRing(%d):%s(%x) in %s\n",myynest,IDID(currRingHdl),currRing,IDID(pn));
526 procstack->push(pi->procname);
528 || (pi->trace_flag&TRACE_SHOW_PROC))
529 {
531 Print("entering%-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
532 }
533#ifdef RDEBUG
535#endif
536 switch (pi->language)
537 {
538 default:
539 case LANG_NONE:
540 WerrorS("undefined proc");
541 err=TRUE;
542 break;
543
544 case LANG_SINGULAR:
545 if ((pi->pack!=NULL)&&(currPack!=pi->pack))
546 {
547 currPack=pi->pack;
550 //Print("set pack=%s\n",IDID(currPackHdl));
551 }
552 else if ((pack!=NULL)&&(currPack!=pack))
553 {
554 currPack=pack;
557 //Print("set pack=%s\n",IDID(currPackHdl));
558 }
559 err=iiPStart(pn,args);
560 break;
561 case LANG_C:
563 err = (pi->data.o.function)(res, args);
566 break;
567 }
569 || (pi->trace_flag&TRACE_SHOW_PROC))
570 {
572 Print("leaving %-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
573 }
574 //const char *n="NULL";
575 //if (currRingHdl!=NULL) n=IDID(currRingHdl);
576 //Print("currRing(%d):%s(%x) after %s\n",myynest,n,currRing,IDID(pn));
577#ifdef RDEBUG
579#endif
580 if (err)
581 {
583 //iiRETURNEXPR.Init(); //done by CleanUp
584 }
585 if (iiCurrArgs!=NULL)
586 {
587 if (!err) Warn("too many arguments for %s",IDID(pn));
591 }
592 procstack->pop();
593 if (err)
594 return TRUE;
595 return FALSE;
596}
static void iiShowLevRings()
Definition iplib.cc:486
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 847 of file ipshell.cc.

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

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

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char s)

Definition at line 121 of file ipshell.cc.

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

◆ iiParameter()

BOOLEAN iiParameter ( leftv  p)

Definition at line 1377 of file ipshell.cc.

1378{
1379 if (iiCurrArgs==NULL)
1380 {
1381 if (strcmp(p->name,"#")==0)
1382 return iiDefaultParameter(p);
1383 Werror("not enough arguments for proc %s",VoiceName());
1384 p->CleanUp();
1385 return TRUE;
1386 }
1388 leftv rest=h->next; /*iiCurrArgs is not NULL here*/
1390 if (strcmp(p->name,"#")==0)
1391 {
1393 rest=NULL;
1394 }
1395 else
1396 {
1397 h->next=NULL;
1398 }
1400 if (is_default_list)
1401 {
1403 }
1404 else
1405 {
1407 }
1408 h->CleanUp();
1410 return res;
1411}
BOOLEAN iiDefaultParameter(leftv p)
Definition ipshell.cc:1261

◆ 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 }
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 {
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);
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:59

◆ 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 {
417 }
418 /* start interpreter ======================================*/
419 myynest++;
420 if (myynest > SI_MAX_NEST)
421 {
422 WerrorS("nesting too deep");
423 err=TRUE;
424 }
425 else
426 {
428 err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(v!=NULL));
430
431 if (iiLocalRing[myynest-1] != currRing)
432 {
434 {
435 //idhdl hn;
436 const char *n;
437 const char *o;
439 if (iiLocalRing[myynest-1]!=NULL)
441 if (oh!=NULL) o=oh->id;
442 else o="none";
443 if (currRing!=NULL)
445 if (nh!=NULL) n=nh->id;
446 else n="none";
447 Werror("ring change during procedure call %s: %s -> %s (level %d)",pi->procname,o,n,myynest);
449 err=TRUE;
450 }
452 }
453 if ((currRing==NULL)
454 && (currRingHdl!=NULL))
456 else
457 if ((currRing!=NULL) &&
459 ||(IDLEV(currRingHdl)>=myynest-1)))
460 {
463 }
464 //Print("kill locals for %s (level %d)\n",IDID(pn),myynest);
466#ifndef SING_NDEBUG
467 checkall();
468#endif
469 //Print("end kill locals for %s (%d)\n",IDID(pn),myynest);
470 }
471 myynest--;
473 if (pi!=NULL)
474 pi->trace_flag=save_flags;
475// omUpdateInfo();
476// int m=om_Info.UsedBytes;
477// Print("exit %s, mem=%d\n",IDID(pn),m);
478 return err;
479}
BOOLEAN RingDependend()
Definition subexpr.cc:421
#define SI_MAX_NEST
Definition iplib.cc:27

◆ iiRegularity()

int iiRegularity ( lists  L)

Definition at line 1038 of file ipshell.cc.

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

◆ iiSetReturn()

void iiSetReturn ( const leftv  h)

Definition at line 6640 of file ipshell.cc.

6641{
6642 if ((source->next==NULL)&&(source->e==NULL))
6643 {
6644 if ((source->rtyp!=IDHDL)&&(source->rtyp!=ALIAS_CMD))
6645 {
6646 memcpy(&iiRETURNEXPR,source,sizeof(sleftv));
6647 source->Init();
6648 return;
6649 }
6650 if (source->rtyp==IDHDL)
6651 {
6652 if ((IDLEV((idhdl)source->data)==myynest)
6653 &&(IDTYP((idhdl)source->data)!=RING_CMD))
6654 {
6660 IDATTR((idhdl)source->data)=NULL;
6661 IDDATA((idhdl)source->data)=NULL;
6662 source->name=NULL;
6663 source->attribute=NULL;
6664 return;
6665 }
6666 }
6667 }
6669}
void Copy(leftv e)
Definition subexpr.cc:690
BITSET flag
Definition subexpr.h:90

◆ iiTestAssume()

BOOLEAN iiTestAssume ( leftv  a,
leftv  b 
)

Definition at line 6462 of file ipshell.cc.

6463{
6464 // assume a: level
6465 if ((a->Typ()==INT_CMD)&&((long)a->Data()>=0))
6466 {
6467 if ((TEST_V_ALLWARN) && (myynest==0)) WarnS("ASSUME at top level is of no use: see documentation");
6468 char assume_yylinebuf[80];
6470 int lev=(long)a->Data();
6471 int startlev=0;
6472 idhdl h=ggetid("assumeLevel");
6473 if ((h!=NULL)&&(IDTYP(h)==INT_CMD)) startlev=(long)IDINT(h);
6474 if(lev <=startlev)
6475 {
6476 BOOLEAN bo=b->Eval();
6477 if (bo) { WerrorS("syntax error in ASSUME");return TRUE;}
6478 if (b->Typ()!=INT_CMD) { WerrorS("ASUMME(<level>,<int expr>)");return TRUE; }
6479 if (b->Data()==NULL) { Werror("ASSUME failed:%s",assume_yylinebuf);return TRUE;}
6480 }
6481 }
6482 b->CleanUp();
6483 a->CleanUp();
6484 return FALSE;
6485}
void * Data()
Definition subexpr.cc:1193
#define IDINT(a)
Definition ipid.h:125

◆ iiTokType()

int iiTokType ( int  op)

Definition at line 233 of file iparith.cc.

234{
235 for (unsigned i=0;i<sArithBase.nCmdUsed;i++)
236 {
237 if (sArithBase.sCmds[i].tokval==op)
238 return sArithBase.sCmds[i].toktype;
239 }
240 return 0;
241}
cmdnames * sCmds
array of existing commands
Definition iparith.cc:186
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
Definition iparith.cc:201
unsigned nCmdUsed
number of commands used
Definition iparith.cc:191

◆ iiTryLoadLib()

BOOLEAN iiTryLoadLib ( leftv  v,
const char id 
)

Definition at line 831 of file iplib.cc.

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

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

◆ iiWRITE()

BOOLEAN iiWRITE ( leftv  res,
leftv  exprlist 
)

Definition at line 588 of file ipshell.cc.

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

◆ IsCmd()

int IsCmd ( const char n,
int tok 
)

Definition at line 9781 of file iparith.cc.

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

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv  res,
leftv  v 
)

Definition at line 968 of file ipshell.cc.

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

◆ jjBETTI2()

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

Definition at line 1002 of file ipshell.cc.

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

◆ jjBETTI2_ID()

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

Definition at line 981 of file ipshell.cc.

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

◆ jjCHARSERIES()

BOOLEAN jjCHARSERIES ( leftv  res,
leftv  u 
)

Definition at line 3356 of file ipshell.cc.

3357{
3359 return (res->data==NULL);
3360}
matrix singclap_irrCharSeries(ideal I, const ring r)
Definition clapsing.cc:1571

◆ jjIMPORTFROM()

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

Definition at line 2447 of file ipassign.cc.

2448{
2449 //Print("importfrom %s::%s ->.\n",v->Name(),u->Name() );
2450 assume(u->Typ()==PACKAGE_CMD);
2451 char *vn=(char *)v->Name();
2452 idhdl h=((package)(u->Data()))->idroot->get(vn /*v->Name()*/, myynest);
2453 if (h!=NULL)
2454 {
2455 //check for existence
2456 if (((package)(u->Data()))==basePack)
2457 {
2458 WarnS("source and destination packages are identical");
2459 return FALSE;
2460 }
2461 idhdl t=basePack->idroot->get(vn /*v->Name()*/, myynest);
2462 if (t!=NULL)
2463 {
2464 if (BVERBOSE(V_REDEFINE)) Warn("redefining %s (%s)",vn,my_yylinebuf);
2465 killhdl(t);
2466 }
2469 sleftv h_expr;
2470 memset(&h_expr,0,sizeof(h_expr));
2471 h_expr.rtyp=IDHDL;
2472 h_expr.data=h;
2473 h_expr.name=vn;
2474 return iiAssign(&tmp_expr,&h_expr);
2475 }
2476 else
2477 {
2478 Werror("`%s` not found in `%s`",v->Name(), u->Name());
2479 return TRUE;
2480 }
2481 return FALSE;
2482}
void killhdl(idhdl h, package proot)
Definition ipid.cc:416
#define assume(x)
Definition mod2.h:387
ip_package * package
Definition structs.h:43

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv  res,
leftv  v 
)

Definition at line 8257 of file iparith.cc.

8258{
8259 int sl=0;
8260 if (v!=NULL) sl = v->listLength();
8261 lists L;
8262 if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
8263 {
8264 int add_row_shift = 0;
8265 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
8266 if (weights!=NULL) add_row_shift=weights->min_in();
8268 }
8269 else
8270 {
8272 leftv h=NULL;
8273 int i;
8274 int rt;
8275
8276 L->Init(sl);
8277 for (i=0;i<sl;i++)
8278 {
8279 if (h!=NULL)
8280 { /* e.g. not in the first step:
8281 * h is the pointer to the old sleftv,
8282 * v is the pointer to the next sleftv
8283 * (in this moment) */
8284 h->next=v;
8285 }
8286 h=v;
8287 v=v->next;
8288 h->next=NULL;
8289 rt=h->Typ();
8290 if (rt==0)
8291 {
8292 L->Clean();
8293 Werror("`%s` is undefined",h->Fullname());
8294 return TRUE;
8295 }
8296 if (rt==RING_CMD)
8297 {
8298 L->m[i].rtyp=rt;
8299 L->m[i].data=rIncRefCnt(((ring)h->Data()));
8300 }
8301 else
8302 L->m[i].Copy(h);
8303 }
8304 }
8305 res->data=(char *)L;
8306 return FALSE;
8307}
int min_in()
Definition intvec.h:121
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:3191
static ring rIncRefCnt(ring r)
Definition ring.h:846

◆ jjLOAD()

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

load lib/module given in v

Definition at line 5587 of file iparith.cc.

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

5664{
5665 if (!iiGetLibStatus(s))
5666 {
5667 void (*WerrorS_save)(const char *s) = WerrorS_callback;
5671 if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5672 Print("loading of >%s< failed\n",s);
5674 errorreported=0;
5675 }
5676 return FALSE;
5677}
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:5587
STATIC_VAR int WerrorS_dummy_cnt
Definition iparith.cc:5658
static void WerrorS_dummy(const char *)
Definition iparith.cc:5659
BOOLEAN iiGetLibStatus(const char *lib)
Definition iplib.cc:77
#define TEST_OPT_PROT
Definition options.h:103

◆ jjMINRES()

BOOLEAN jjMINRES ( leftv  res,
leftv  v 
)

Definition at line 947 of file ipshell.cc.

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

3350{
3351 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(),
3352 (poly)w->CopyD(), currRing);
3353 return errorreported;
3354}
poly singclap_resultant(poly f, poly g, poly x, const ring r)
Definition clapsing.cc:345

◆ jjSetMinpoly()

coeffs jjSetMinpoly ( coeffs  cf,
number  a 
)

Definition at line 175 of file ipassign.cc.

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

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

◆ jjVARIABLES_ID()

BOOLEAN jjVARIABLES_ID ( leftv  res,
leftv  u 
)

Definition at line 6327 of file ipshell.cc.

6328{
6329 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6330 ideal I=(ideal)u->Data();
6331 int i;
6332 int n=0;
6333 for(i=I->nrows*I->ncols-1;i>=0;i--)
6334 {
6335 int n0=pGetVariables(I->m[i],e);
6336 if (n0>n) n=n0;
6337 }
6338 jjINT_S_TO_ID(n,e,res);
6339 return FALSE;
6340}
static void jjINT_S_TO_ID(int n, int *e, leftv res)
Definition ipshell.cc:6297
#define omAlloc0(size)
#define pGetVariables(p, e)
Definition polys.h:251

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv  res,
leftv  u 
)

Definition at line 6319 of file ipshell.cc.

6320{
6321 int *e=(int *)omAlloc0((rVar(currRing)+1)*sizeof(int));
6322 int n=pGetVariables((poly)u->Data(),e);
6323 jjINT_S_TO_ID(n,e,res);
6324 return FALSE;
6325}

◆ killlocals()

void killlocals ( int  v)

Definition at line 386 of file ipshell.cc.

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

◆ kQHWeight()

BOOLEAN kQHWeight ( leftv  res,
leftv  v 
)

Definition at line 3332 of file ipshell.cc.

3333{
3334 res->data=(char *)id_QHomWeight((ideal)v->Data(), currRing);
3335 if (res->data==NULL)
3336 res->data=(char *)new intvec(rVar(currRing));
3337 return FALSE;
3338}
intvec * id_QHomWeight(ideal id, const ring r)

◆ kWeight()

BOOLEAN kWeight ( leftv  res,
leftv  id 
)

Definition at line 3310 of file ipshell.cc.

3311{
3312 ideal F=(ideal)id->Data();
3313 intvec * iv = new intvec(rVar(currRing));
3314 polyset s;
3315 int sl, n, i;
3316 int *x;
3317
3318 res->data=(char *)iv;
3319 s = F->m;
3320 sl = IDELEMS(F) - 1;
3321 n = rVar(currRing);
3322 double wNsqr = (double)2.0 / (double)n;
3324 x = (int * )omAlloc(2 * (n + 1) * sizeof(int));
3325 wCall(s, sl, x, wNsqr, currRing);
3326 for (i = n; i!=0; i--)
3327 (*iv)[i-1] = x[i + n + 1];
3328 omFreeSize((ADDRESS)x, 2 * (n + 1) * sizeof(int));
3329 return FALSE;
3330}
Variable x
Definition cfModGcd.cc:4090
THREAD_VAR double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
Definition weight.cc:20
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
Definition weight.cc:108
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
Definition weight0.cc:78

◆ list_cmd()

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

Definition at line 425 of file ipshell.cc.

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

◆ loNewtonP()

BOOLEAN loNewtonP ( leftv  res,
leftv  arg1 
)

compute Newton Polytopes of input polynomials

Definition at line 4572 of file ipshell.cc.

4573{
4574 res->data= (void*)loNewtonPolytope( (ideal)arg1->Data() );
4575 return FALSE;
4576}
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 4578 of file ipshell.cc.

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

◆ mpJacobi()

BOOLEAN mpJacobi ( leftv  res,
leftv  a 
)

Definition at line 3078 of file ipshell.cc.

3079{
3080 int i,j;
3081 matrix result;
3082 ideal id=(ideal)a->Data();
3083
3085 for (i=1; i<=IDELEMS(id); i++)
3086 {
3087 for (j=1; j<=rVar(currRing); j++)
3088 {
3089 MATELEM(result,i,j) = pDiff(id->m[i-1],j);
3090 }
3091 }
3092 res->data=(char *)result;
3093 return FALSE;
3094}
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
#define pDiff(a, b)
Definition polys.h:296

◆ mpKoszul()

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

Definition at line 3100 of file ipshell.cc.

3101{
3102 int n=(int)(long)b->Data();
3103 int d=(int)(long)c->Data();
3104 int k,l,sign,row,col;
3105 matrix result;
3106 ideal temp;
3107 BOOLEAN bo;
3108 poly p;
3109
3110 if ((d>n) || (d<1) || (n<1))
3111 {
3112 res->data=(char *)mpNew(1,1);
3113 return FALSE;
3114 }
3115 int *choise = (int*)omAlloc(d*sizeof(int));
3116 if (id==NULL)
3117 temp=idMaxIdeal(1);
3118 else
3119 temp=(ideal)id->Data();
3120
3121 k = binom(n,d);
3122 l = k*d;
3123 l /= n-d+1;
3124 result =mpNew(l,k);
3125 col = 1;
3126 idInitChoise(d,1,n,&bo,choise);
3127 while (!bo)
3128 {
3129 sign = 1;
3130 for (l=1;l<=d;l++)
3131 {
3132 if (choise[l-1]<=IDELEMS(temp))
3133 {
3134 p = pCopy(temp->m[choise[l-1]-1]);
3135 if (sign == -1) p = pNeg(p);
3136 sign *= -1;
3137 row = idGetNumberOfChoise(l-1,d,1,n,choise);
3138 MATELEM(result,row,col) = p;
3139 }
3140 }
3141 col++;
3143 }
3144 omFreeSize(choise,d*sizeof(int));
3145 if (id==NULL) idDelete(&temp);
3146
3147 res->data=(char *)result;
3148 return FALSE;
3149}
int binom(int n, int r)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition ideals.h:33
int idGetNumberOfChoise(int t, int d, int begin, int end, int *choise)
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
#define pNeg(p)
Definition polys.h:198
#define pCopy(p)
return a copy of the poly
Definition polys.h:185
static int sign(int x)
Definition ring.cc:3443

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

4688{
4689 poly gls;
4690 gls= (poly)(arg1->Data());
4691 int howclean= (int)(long)arg3->Data();
4692
4693 if ( gls == NULL || pIsConstant( gls ) )
4694 {
4695 WerrorS("Input polynomial is constant!");
4696 return TRUE;
4697 }
4698
4700 {
4701 int* r=Zp_roots(gls, currRing);
4702 lists rlist;
4703 rlist= (lists)omAlloc( sizeof(slists) );
4704 rlist->Init( r[0] );
4705 for(int i=r[0];i>0;i--)
4706 {
4707 rlist->m[i-1].data=n_Init(r[i],currRing->cf);
4708 rlist->m[i-1].rtyp=NUMBER_CMD;
4709 }
4710 omFree(r);
4711 res->data=rlist;
4712 res->rtyp= LIST_CMD;
4713 return FALSE;
4714 }
4715 if ( !(rField_is_R(currRing) ||
4719 {
4720 WerrorS("Ground field not implemented!");
4721 return TRUE;
4722 }
4723
4726 {
4727 unsigned long int ii = (unsigned long int)arg2->Data();
4729 }
4730
4731 int ldummy;
4732 int deg= currRing->pLDeg( gls, &ldummy, currRing );
4733 int i,vpos=0;
4734 poly piter;
4735 lists elist;
4736
4737 elist= (lists)omAlloc( sizeof(slists) );
4738 elist->Init( 0 );
4739
4740 if ( rVar(currRing) > 1 )
4741 {
4742 piter= gls;
4743 for ( i= 1; i <= rVar(currRing); i++ )
4744 if ( pGetExp( piter, i ) )
4745 {
4746 vpos= i;
4747 break;
4748 }
4749 while ( piter )
4750 {
4751 for ( i= 1; i <= rVar(currRing); i++ )
4752 if ( (vpos != i) && (pGetExp( piter, i ) != 0) )
4753 {
4754 WerrorS("The input polynomial must be univariate!");
4755 return TRUE;
4756 }
4757 pIter( piter );
4758 }
4759 }
4760
4761 rootContainer * roots= new rootContainer();
4762 number * pcoeffs= (number *)omAlloc( (deg+1) * sizeof( number ) );
4763 piter= gls;
4764 for ( i= deg; i >= 0; i-- )
4765 {
4766 if ( piter && pTotaldegree(piter) == i )
4767 {
4768 pcoeffs[i]= nCopy( pGetCoeff( piter ) );
4769 //nPrint( pcoeffs[i] );PrintS(" ");
4770 pIter( piter );
4771 }
4772 else
4773 {
4774 pcoeffs[i]= nInit(0);
4775 }
4776 }
4777
4778#ifdef mprDEBUG_PROT
4779 for (i=deg; i >= 0; i--)
4780 {
4781 nPrint( pcoeffs[i] );PrintS(" ");
4782 }
4783 PrintLn();
4784#endif
4785
4786 roots->fillContainer( pcoeffs, NULL, 1, deg, rootContainer::onepoly, 1 );
4787 roots->solver( howclean );
4788
4789 int elem= roots->getAnzRoots();
4790 char *dummy;
4791 int j;
4792
4793 lists rlist;
4794 rlist= (lists)omAlloc( sizeof(slists) );
4795 rlist->Init( elem );
4796
4798 {
4799 for ( j= 0; j < elem; j++ )
4800 {
4801 rlist->m[j].rtyp=NUMBER_CMD;
4802 rlist->m[j].data=(void *)nCopy((number)(roots->getRoot(j)));
4803 //rlist->m[j].data=(void *)(number)(roots->getRoot(j));
4804 }
4805 }
4806 else
4807 {
4808 for ( j= 0; j < elem; j++ )
4809 {
4810 dummy = complexToStr( (*roots)[j], gmp_output_digits, currRing->cf );
4811 rlist->m[j].rtyp=STRING_CMD;
4812 rlist->m[j].data=(void *)dummy;
4813 }
4814 }
4815
4816 elist->Clean();
4817 //omFreeSize( (ADDRESS) elist, sizeof(slists) );
4818
4819 // this is (via fillContainer) the same data as in root
4820 //for ( i= deg; i >= 0; i-- ) nDelete( &pcoeffs[i] );
4821 //omFreeSize( (ADDRESS) pcoeffs, (deg+1) * sizeof( number ) );
4822
4823 delete roots;
4824
4825 res->data= (void*)rlist;
4826
4827 return FALSE;
4828}
int * Zp_roots(poly p, const ring r)
Definition clapsing.cc:2188
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 initalized currRing
Definition numbers.h:46
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:238
static BOOLEAN rField_is_R(const ring r)
Definition ring.h:523
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:505
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:511

◆ nuMPResMat()

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

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

Definition at line 4664 of file ipshell.cc.

4665{
4666 ideal gls = (ideal)(arg1->Data());
4667 int imtype= (int)(long)arg2->Data();
4668
4670
4671 // check input ideal ( = polynomial system )
4672 if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
4673 {
4674 return TRUE;
4675 }
4676
4677 uResultant *resMat= new uResultant( gls, mtype, false );
4678 if (resMat!=NULL)
4679 {
4680 res->rtyp = MODUL_CMD;
4681 res->data= (void*)resMat->accessResMat()->getMatrix();
4682 if (!errorreported) delete resMat;
4683 }
4684 return errorreported;
4685}
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 4931 of file ipshell.cc.

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

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

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

6343{
6344 Print(" %s (",n);
6345 switch (p->language)
6346 {
6347 case LANG_SINGULAR: PrintS("S"); break;
6348 case LANG_C: PrintS("C"); break;
6349 case LANG_TOP: PrintS("T"); break;
6350 case LANG_MAX: PrintS("M"); break;
6351 case LANG_NONE: PrintS("N"); break;
6352 default: PrintS("U");
6353 }
6354 if(p->libname!=NULL)
6355 Print(",%s", p->libname);
6356 PrintS(")");
6357}
@ 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 2792 of file ipshell.cc.

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

◆ rDecompose()

lists rDecompose ( const ring  r)

Definition at line 2162 of file ipshell.cc.

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

◆ rDecompose_CF()

BOOLEAN rDecompose_CF ( leftv  res,
const coeffs  C 
)

Definition at line 1950 of file ipshell.cc.

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

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring  r)

Definition at line 2123 of file ipshell.cc.

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

◆ 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 ((currRing->ppNoether)!=NULL) pDelete(&(currRing->ppNoether));
1654 {
1656 }
1657
1659
1660 #ifndef TEST_ZN_AS_ZP
1661 r->cf = nInitChar(n_Zp, (void*)32003); // r->cf->ch = 32003;
1662 #else
1663 mpz_t modBase;
1664 mpz_init_set_ui(modBase, (long)32003);
1665 ZnmInfo info;
1666 info.base= modBase;
1667 info.exp= 1;
1668 r->cf=nInitChar(n_Zn,(void*) &info);
1669 r->cf->is_field=1;
1670 r->cf->is_domain=1;
1671 r->cf->has_simple_Inverse=1;
1672 #endif
1673 r->N = 3;
1674 /*r->P = 0; Alloc0 in idhdl::set, ipid.cc*/
1675 /*names*/
1676 r->names = (char **) omAlloc0(3 * sizeof(char_ptr));
1677 r->names[0] = omStrDup("x");
1678 r->names[1] = omStrDup("y");
1679 r->names[2] = omStrDup("z");
1680 /*weights: entries for 3 blocks: NULL*/
1681 r->wvhdl = (int **)omAlloc0(3 * sizeof(int_ptr));
1682 /*order: dp,C,0*/
1683 r->order = (rRingOrder_t *) omAlloc(3 * sizeof(rRingOrder_t *));
1684 r->block0 = (int *)omAlloc0(3 * sizeof(int *));
1685 r->block1 = (int *)omAlloc0(3 * sizeof(int *));
1686 /* ringorder dp for the first block: var 1..3 */
1687 r->order[0] = ringorder_dp;
1688 r->block0[0] = 1;
1689 r->block1[0] = 3;
1690 /* ringorder C for the second block: no vars */
1691 r->order[1] = ringorder_C;
1692 /* the last block: everything is 0 */
1693 r->order[2] = (rRingOrder_t)0;
1694
1695 /* complete ring intializations */
1696 rComplete(r);
1697 rSetHdl(tmp);
1698 return currRingHdl;
1699}
rRingOrder_t
order stuff
Definition ring.h:68
@ ringorder_C
Definition ring.h:73
@ ringorder_dp
Definition ring.h:78

◆ rFindHdl()

idhdl rFindHdl ( ring  r,
idhdl  n 
)

Definition at line 1702 of file ipshell.cc.

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

◆ rInit()

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

Definition at line 5634 of file ipshell.cc.

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

◆ rKill() [1/2]

void rKill ( idhdl  h)

Definition at line 6235 of file ipshell.cc.

6236{
6237 ring r = IDRING(h);
6238 int ref=0;
6239 if (r!=NULL)
6240 {
6241 // avoid, that sLastPrinted is the last reference to the base ring:
6242 // clean up before killing the last "named" refrence:
6244 && (sLastPrinted.data==(void*)r))
6245 {
6247 }
6248 ref=r->ref;
6249 if ((ref<=0)&&(r==currRing))
6250 {
6251 // cleanup DENOMINATOR_LIST
6253 {
6255 if (TEST_V_ALLWARN)
6256 Warn("deleting denom_list for ring change from %s",IDID(h));
6257 do
6258 {
6259 n_Delete(&(dd->n),currRing->cf);
6260 dd=dd->next;
6263 } while(DENOMINATOR_LIST!=NULL);
6264 }
6265 }
6266 rKill(r);
6267 }
6268 if (h==currRingHdl)
6269 {
6270 if (ref<=0) { currRing=NULL; currRingHdl=NULL;}
6271 else
6272 {
6274 }
6275 }
6276}
void rKill(ring r)
Definition ipshell.cc:6189
VAR denominator_list DENOMINATOR_LIST
Definition kutil.cc:84

◆ rKill() [2/2]

void rKill ( ring  r)

Definition at line 6189 of file ipshell.cc.

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

◆ rSetHdl()

void rSetHdl ( idhdl  h)

Definition at line 5135 of file ipshell.cc.

5136{
5137 ring rg = NULL;
5138 if (h!=NULL)
5139 {
5140// Print(" new ring:%s (l:%d)\n",IDID(h),IDLEV(h));
5141 rg = IDRING(h);
5142 if (rg==NULL) return; //id <>NULL, ring==NULL
5143 omCheckAddrSize((ADDRESS)h,sizeof(idrec));
5144 if (IDID(h)) // OB: ????
5146 rTest(rg);
5147 }
5148 else return;
5149
5150 // clean up history
5151 if (currRing!=NULL)
5152 {
5154 {
5156 }
5157
5158 if (rg!=currRing)/*&&(currRing!=NULL)*/
5159 {
5160 if (rg->cf!=currRing->cf)
5161 {
5164 {
5165 if (TEST_V_ALLWARN)
5166 Warn("deleting denom_list for ring change to %s",IDID(h));
5167 do
5168 {
5169 n_Delete(&(dd->n),currRing->cf);
5170 dd=dd->next;
5173 } while(DENOMINATOR_LIST!=NULL);
5174 }
5175 }
5176 }
5177 }
5178
5179 // test for valid "currRing":
5180 if ((rg!=NULL) && (rg->idroot==NULL))
5181 {
5182 ring old=rg;
5184 if (old!=rg)
5185 {
5186 rKill(old);
5187 IDRING(h)=rg;
5188 }
5189 }
5190 /*------------ change the global ring -----------------------*/
5192 currRingHdl = h;
5193}
#define omCheckAddr(addr)
#define omCheckAddrSize(addr, size)
ring rAssure_HasComp(const ring r)
Definition ring.cc:4657

◆ scIndIndset()

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

Definition at line 1104 of file ipshell.cc.

1106{
1107 int i;
1108 indset save;
1110
1111 hexist = hInit(S, Q, &hNexist);
1112 if (hNexist == 0)
1113 {
1114 intvec *iv=new intvec(rVar(currRing));
1115 for(i=0; i<rVar(currRing); i++) (*iv)[i]=1;
1116 res->Init(1);
1117 res->m[0].rtyp=INTVEC_CMD;
1118 res->m[0].data=(intvec*)iv;
1119 return res;
1120 }
1122 hMu = 0;
1123 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
1124 hvar = (varset)omAlloc((rVar(currRing) + 1) * sizeof(int));
1125 hpure = (scmon)omAlloc0((1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1126 hrad = hexist;
1127 hNrad = hNexist;
1128 radmem = hCreate(rVar(currRing) - 1);
1129 hCo = rVar(currRing) + 1;
1130 hNvar = rVar(currRing);
1132 hSupp(hrad, hNrad, hvar, &hNvar);
1133 if (hNvar)
1134 {
1135 hCo = hNvar;
1136 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
1139 }
1140 if (hCo && (hCo < rVar(currRing)))
1141 {
1143 }
1144 if (hMu!=0)
1145 {
1146 ISet = save;
1147 hMu2 = 0;
1148 if (all && (hCo+1 < rVar(currRing)))
1149 {
1152 i=hMu+hMu2;
1153 res->Init(i);
1154 if (hMu2 == 0)
1155 {
1157 }
1158 }
1159 else
1160 {
1161 res->Init(hMu);
1162 }
1163 for (i=0;i<hMu;i++)
1164 {
1165 res->m[i].data = (void *)save->set;
1166 res->m[i].rtyp = INTVEC_CMD;
1167 ISet = save;
1168 save = save->nx;
1170 }
1172 if (hMu2 != 0)
1173 {
1174 save = JSet;
1175 for (i=hMu;i<hMu+hMu2;i++)
1176 {
1177 res->m[i].data = (void *)save->set;
1178 res->m[i].rtyp = INTVEC_CMD;
1179 JSet = save;
1180 save = save->nx;
1182 }
1184 }
1185 }
1186 else
1187 {
1188 res->Init(0);
1190 }
1191 hKill(radmem, rVar(currRing) - 1);
1192 omFreeSize((ADDRESS)hpure, (1 + (rVar(currRing) * rVar(currRing))) * sizeof(long));
1193 omFreeSize((ADDRESS)hvar, (rVar(currRing) + 1) * sizeof(int));
1194 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
1196 return res;
1197}
void hIndMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
Definition hdegree.cc:384
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:353
VAR long hMu
Definition hdegree.cc:28
VAR indset JSet
Definition hdegree.cc:353
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:564
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 4560 of file ipshell.cc.

4561{
4562 sleftv tmp;
4563 tmp.Init();
4564 tmp.rtyp=INT_CMD;
4565 /* tmp.data = (void *)0; -- done by Init */
4566
4567 return semicProc3(res,u,v,&tmp);
4568}

◆ semicProc3()

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

Definition at line 4520 of file ipshell.cc.

4521{
4522 semicState state;
4523 BOOLEAN qh=(((int)(long)w->Data())==1);
4524
4525 // -----------------
4526 // check arguments
4527 // -----------------
4528
4529 lists l1 = (lists)u->Data( );
4530 lists l2 = (lists)v->Data( );
4531
4532 if( (state=list_is_spectrum( l1 ))!=semicOK )
4533 {
4534 WerrorS( "first argument is not a spectrum" );
4535 list_error( state );
4536 }
4537 else if( (state=list_is_spectrum( l2 ))!=semicOK )
4538 {
4539 WerrorS( "second argument is not a spectrum" );
4540 list_error( state );
4541 }
4542 else
4543 {
4546
4547 res->rtyp = INT_CMD;
4548 if (qh)
4549 res->data = (void*)(long)(s1.mult_spectrumh( s2 ));
4550 else
4551 res->data = (void*)(long)(s1.mult_spectrum( s2 ));
4552 }
4553
4554 // -----------------
4555 // check status
4556 // -----------------
4557
4558 return (state!=semicOK);
4559}
semicState
Definition ipshell.cc:3444
@ semicOK
Definition ipshell.cc:3445
void list_error(semicState state)
Definition ipshell.cc:3477
spectrum spectrumFromList(lists l)
Definition ipshell.cc:3393
semicState list_is_spectrum(lists l)
Definition ipshell.cc:4262

◆ setOption()

BOOLEAN setOption ( leftv  res,
leftv  v 
)

Definition at line 568 of file misc_ip.cc.

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

◆ showOption()

char * showOption ( )

Definition at line 709 of file misc_ip.cc.

710{
711 int i;
712 BITSET tmp;
713
714 StringSetS("//options:");
715 if ((si_opt_1!=0)||(si_opt_2!=0))
716 {
718 if(tmp)
719 {
720 for (i=0; optionStruct[i].setval!=0; i++)
721 {
722 if (optionStruct[i].setval & tmp)
723 {
725 tmp &=optionStruct[i].resetval;
726 }
727 }
728 for (i=0; i<32; i++)
729 {
730 if (tmp & Sy_bit(i)) StringAppend(" %d",i);
731 }
732 }
734 if (tmp)
735 {
736 for (i=0; verboseStruct[i].setval!=0; i++)
737 {
738 if (verboseStruct[i].setval & tmp)
739 {
741 tmp &=verboseStruct[i].resetval;
742 }
743 }
744 for (i=1; i<32; i++)
745 {
746 if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
747 }
748 }
749 return StringEndS();
750 }
751 StringAppendS(" none");
752 return StringEndS();
753}
#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 430 of file misc_ip.cc.

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

◆ singular_system()

leftv singular_system ( sleftv  h)

◆ spaddProc()

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

Definition at line 4437 of file ipshell.cc.

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

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv  result,
leftv  first 
)

Definition at line 4193 of file ipshell.cc.

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

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv  result,
leftv  first 
)

Definition at line 4142 of file ipshell.cc.

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

◆ spmulProc()

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

Definition at line 4479 of file ipshell.cc.

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

◆ syBetti1()

BOOLEAN syBetti1 ( leftv  res,
leftv  u 
)

Definition at line 3179 of file ipshell.cc.

3180{
3181 sleftv tmp;
3182 tmp.Init();
3183 tmp.rtyp=INT_CMD;
3184 tmp.data=(void *)1;
3185 return syBetti2(res,u,&tmp);
3186}
BOOLEAN syBetti2(leftv res, leftv u, leftv w)
Definition ipshell.cc:3156

◆ syBetti2()

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

Definition at line 3156 of file ipshell.cc.

3157{
3159
3160 BOOLEAN minim=(int)(long)w->Data();
3161 int row_shift=0;
3162 int add_row_shift=0;
3163 intvec *weights=NULL;
3164 intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3165 if (ww!=NULL)
3166 {
3167 weights=ivCopy(ww);
3168 add_row_shift = ww->min_in();
3169 (*weights) -= add_row_shift;
3170 }
3171
3172 res->data=(void *)syBettiOfComputation(syzstr,minim,&row_shift,weights);
3173 //row_shift += add_row_shift;
3174 //Print("row_shift=%d, add_row_shift=%d\n",row_shift,add_row_shift);
3175 atSet(res,omStrDup("rowShift"),(void*)(long)add_row_shift,INT_CMD);
3176
3177 return FALSE;
3178}
intvec * syBettiOfComputation(syStrategy syzstr, BOOLEAN minim=TRUE, int *row_shift=NULL, intvec *weights=NULL)
Definition syz1.cc:1756
ssyStrategy * syStrategy
Definition syz.h:36

◆ syConvList()

syStrategy syConvList ( lists  li)

Definition at line 3263 of file ipshell.cc.

3264{
3265 int typ0;
3267
3268 resolvente fr = liFindRes(li,&(result->length),&typ0,&(result->weights));
3269 if (fr != NULL)
3270 {
3271
3272 result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
3273 for (int i=result->length-1;i>=0;i--)
3274 {
3275 if (fr[i]!=NULL)
3276 result->fullres[i] = idCopy(fr[i]);
3277 }
3278 result->list_length=result->length;
3279 omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal));
3280 }
3281 else
3282 {
3283 omFreeSize(result, sizeof(ssyStrategy));
3284 result = NULL;
3285 }
3286 return result;
3287}

◆ syConvRes()

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

Definition at line 3191 of file ipshell.cc.

3192{
3193 resolvente fullres = syzstr->fullres;
3194 resolvente minres = syzstr->minres;
3195
3196 const int length = syzstr->length;
3197
3198 if ((fullres==NULL) && (minres==NULL))
3199 {
3200 if (syzstr->hilb_coeffs==NULL)
3201 { // La Scala
3202 fullres = syReorder(syzstr->res, length, syzstr);
3203 }
3204 else
3205 { // HRES
3206 minres = syReorder(syzstr->orderedRes, length, syzstr);
3207 syKillEmptyEntres(minres, length);
3208 }
3209 }
3210
3211 resolvente tr;
3212 int typ0=IDEAL_CMD;
3213
3214 if (minres!=NULL)
3215 tr = minres;
3216 else
3217 tr = fullres;
3218
3220 intvec ** w=NULL;
3221
3222 if (length>0)
3223 {
3224 trueres = (resolvente)omAlloc0((length)*sizeof(ideal));
3225 for (int i=length-1;i>=0;i--)
3226 {
3227 if (tr[i]!=NULL)
3228 {
3229 trueres[i] = idCopy(tr[i]);
3230 }
3231 }
3232 if ( id_RankFreeModule(trueres[0], currRing) > 0)
3233 typ0 = MODUL_CMD;
3234 if (syzstr->weights!=NULL)
3235 {
3236 w = (intvec**)omAlloc0(length*sizeof(intvec*));
3237 for (int i=length-1;i>=0;i--)
3238 {
3239 if (syzstr->weights[i]!=NULL) w[i] = ivCopy(syzstr->weights[i]);
3240 }
3241 }
3242 }
3243
3244 lists li = liMakeResolv(trueres, length, syzstr->list_length,typ0,
3245 w, add_row_shift);
3246
3247 if (toDel)
3249 else
3250 {
3251 if( fullres != NULL && syzstr->fullres == NULL )
3252 syzstr->fullres = fullres;
3253
3254 if( minres != NULL && syzstr->minres == NULL )
3255 syzstr->minres = minres;
3256 }
3257 return li;
3258}
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition syz1.cc:1495
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy=TRUE, resolvente totake=NULL)
Definition syz1.cc:1641
void syKillEmptyEntres(resolvente res, int length)
Definition syz1.cc:2199

◆ test_cmd()

void test_cmd ( int  i)

Definition at line 514 of file ipshell.cc.

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

◆ Tok2Cmdname()

const char * Tok2Cmdname ( int  i)

Definition at line 140 of file gentable.cc.

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

◆ type_cmd()

void type_cmd ( leftv  v)

Definition at line 254 of file ipshell.cc.

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

◆ versionString()

char * versionString ( )

Definition at line 770 of file misc_ip.cc.

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

Variable Documentation

◆ currid

const char* currid
extern

Definition at line 171 of file grammar.cc.

◆ dArith1

const struct sValCmd1 dArith1[]
extern

Definition at line 37 of file table.h.

38{
39// operationsi
40// proc cmd res arg context
46#ifdef SINGULAR_4_2
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:470
BOOLEAN atATTRIB1(leftv res, leftv v)
Definition attrib.cc:234
BOOLEAN findUniProc(leftv result, leftv first)
Definition fglm.cc:541
#define NO_ZERODIVISOR
Definition gentable.cc:47
#define ALLOW_ZZ
Definition gentable.cc:51
#define ALLOW_RING
Definition gentable.cc:43
#define NO_CONVERSION
Definition gentable.cc:56
#define ALLOW_LP
Definition gentable.cc:38
#define NO_RING
Definition gentable.cc:44
#define D(A)
Definition gentable.cc:131
#define WARN_RING
Definition gentable.cc:54
#define ALLOW_NC
Definition gentable.cc:40
#define ALLOW_PLURAL
Definition gentable.cc:35
#define NO_NC
Definition gentable.cc:34
#define NULL_VAL
Definition gentable.cc:132
@ 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:4972
static BOOLEAN jjIMPART(leftv res, leftv v)
Definition iparith.cc:4469
static BOOLEAN jjIm2Iv(leftv res, leftv v)
Definition iparith.cc:4462
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
Definition iparith.cc:3840
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
Definition iparith.cc:5314
BOOLEAN jjWAITALL1(leftv res, leftv u)
Definition iparith.cc:5556
static BOOLEAN jjRESTART(leftv, leftv u)
Definition iparith.cc:8983
static BOOLEAN jjidHead(leftv res, leftv v)
Definition iparith.cc:5714
static BOOLEAN jjHILBERT(leftv, leftv v)
Definition iparith.cc:4349
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
Definition iparith.cc:4628
static BOOLEAN jjstrlen(leftv res, leftv v)
Definition iparith.cc:5679
static BOOLEAN jjDET_BI(leftv res, leftv v)
Definition iparith.cc:4104
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
Definition iparith.cc:5541
static BOOLEAN jjP2I(leftv res, leftv v)
Definition iparith.cc:4886
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
Definition iparith.cc:4496
static BOOLEAN jjREPART(leftv res, leftv v)
Definition iparith.cc:4988
static BOOLEAN jjN2BI(leftv res, leftv v)
Definition iparith.cc:4769
static BOOLEAN jjCHAR(leftv res, leftv v)
Definition iparith.cc:3949
static BOOLEAN jjROWS_IV(leftv res, leftv v)
Definition iparith.cc:5033
static BOOLEAN jjNULL(leftv, leftv)
Definition iparith.cc:3784
static BOOLEAN jjBIV2IV(leftv res, leftv v)
Definition iparith.cc:4487
static BOOLEAN jjDIM(leftv res, leftv v)
Definition iparith.cc:4160
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:4799
static BOOLEAN jjMULT(leftv res, leftv v)
Definition iparith.cc:4749
static BOOLEAN jjPARDEG(leftv res, leftv v)
Definition iparith.cc:4842
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number.
Definition iparith.cc:4081
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
Definition iparith.cc:4426
static BOOLEAN jjmpTransp(leftv res, leftv v)
Definition iparith.cc:5742
static BOOLEAN jjDET_S(leftv res, leftv v)
Definition iparith.cc:4154
static BOOLEAN jjL2R(leftv res, leftv v)
Definition iparith.cc:4588
static BOOLEAN jjrCharStr(leftv res, leftv v)
Definition iparith.cc:5704
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
Definition iparith.cc:4364
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
Definition iparith.cc:4445
static BOOLEAN jjINDEPSET(leftv res, leftv v)
Definition iparith.cc:4474
static BOOLEAN jjTYPEOF(leftv res, leftv v)
Definition iparith.cc:5428
static BOOLEAN jjFACSTD(leftv res, leftv v)
Definition iparith.cc:4225
static BOOLEAN jjMEMORY(leftv res, leftv v)
Definition iparith.cc:4704
static BOOLEAN jjidTransp(leftv res, leftv v)
Definition iparith.cc:5772
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
Definition iparith.cc:3847
static BOOLEAN jjDIM_R(leftv res, leftv v)
Definition iparith.cc:5767
static BOOLEAN jjDUMP(leftv, leftv v)
Definition iparith.cc:4190
static BOOLEAN jjpMaxComp(leftv res, leftv v)
Definition iparith.cc:5732
static BOOLEAN jjCOEFFS1(leftv res, leftv v)
Definition iparith.cc:3954
static BOOLEAN jjNAMEOF(leftv res, leftv v)
Definition iparith.cc:4781
static BOOLEAN jjPRIME(leftv res, leftv v)
Definition iparith.cc:4904
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
Definition iparith.cc:5699
static BOOLEAN jjJACOB_P(leftv res, leftv v)
Definition iparith.cc:4512
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
Definition iparith.cc:5201
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
Definition iparith.cc:3945
static BOOLEAN jjINTERRED(leftv res, leftv v)
Definition iparith.cc:4480
static BOOLEAN jjJACOB_M(leftv res, leftv a)
Definition iparith.cc:4543
static BOOLEAN jjBAREISS(leftv res, leftv v)
Definition iparith.cc:3879
static BOOLEAN jjREAD(leftv res, leftv v)
Definition iparith.cc:4979
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
Definition iparith.cc:4501
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
Definition iparith.cc:5028
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
Definition iparith.cc:5048
static BOOLEAN jjMSTD(leftv res, leftv v)
Definition iparith.cc:4734
static BOOLEAN jjnInt(leftv res, leftv u)
Definition iparith.cc:5777
static BOOLEAN jjREGULARITY(leftv res, leftv v)
Definition iparith.cc:4983
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
Definition iparith.cc:5299
static BOOLEAN jjMONOM(leftv res, leftv v)
Definition iparith.cc:2787
static BOOLEAN jjSort_Id(leftv res, leftv v)
Definition iparith.cc:5196
static BOOLEAN jjidMinBase(leftv res, leftv v)
Definition iparith.cc:5720
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
Definition iparith.cc:4898
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
Definition iparith.cc:4409
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
Definition iparith.cc:3984
static BOOLEAN jjKERNEL_M(leftv res, leftv v)
Definition iparith.cc:4564
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
Definition iparith.cc:3966
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
Definition iparith.cc:4435
static BOOLEAN jjEXECUTE(leftv, leftv v)
Definition iparith.cc:4216
static BOOLEAN jjLEADEXP(leftv res, leftv v)
Definition iparith.cc:4610
static BOOLEAN jjDEG_M(leftv res, leftv u)
Definition iparith.cc:4039
static BOOLEAN jjPAR1(leftv res, leftv v)
Definition iparith.cc:4826
static BOOLEAN jjnlInt(leftv res, leftv u)
Definition iparith.cc:5784
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
Definition iparith.cc:3798
static BOOLEAN jjROWS(leftv res, leftv v)
Definition iparith.cc:5022
static BOOLEAN jjSBA(leftv res, leftv v)
Definition iparith.cc:5090
static BOOLEAN jjJanetBasis(leftv res, leftv v)
Definition iparith.cc:2549
static BOOLEAN jjKBASE(leftv res, leftv v)
Definition iparith.cc:4582
static BOOLEAN jjmpTrace(leftv res, leftv v)
Definition iparith.cc:5737
static BOOLEAN jjPRUNE(leftv res, leftv v)
Definition iparith.cc:4910
static BOOLEAN jjDEFINED(leftv res, leftv v)
Definition iparith.cc:4069
static BOOLEAN jjLagSolve(leftv res, leftv v)
Definition iparith.cc:4665
static BOOLEAN jjVDIM(leftv res, leftv v)
Definition iparith.cc:5512
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
Definition iparith.cc:3995
static BOOLEAN jjP2N(leftv res, leftv v)
Definition iparith.cc:4934
static BOOLEAN jjE(leftv res, leftv v)
Definition iparith.cc:4204
static BOOLEAN jjLISTRING(leftv res, leftv v)
Definition iparith.cc:4647
static BOOLEAN jjVAR1(leftv res, leftv v)
Definition iparith.cc:5478
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
Definition iparith.cc:4596
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
Definition iparith.cc:3810
static BOOLEAN jjpLength(leftv res, leftv v)
Definition iparith.cc:5684
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
Definition iparith.cc:4507
static BOOLEAN jjBI2P(leftv res, leftv u)
Definition iparith.cc:3930
static BOOLEAN jjTWOSTD(leftv res, leftv a)
Definition iparith.cc:5348
static BOOLEAN jjFAC_P(leftv res, leftv u)
Definition iparith.cc:4265
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
Definition iparith.cc:5304
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
Definition iparith.cc:5762
static BOOLEAN jjrOrdStr(leftv res, leftv v)
Definition iparith.cc:5747
static BOOLEAN jjpHead(leftv res, leftv v)
Definition iparith.cc:5709
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
Definition iparith.cc:4000
static BOOLEAN jjDET_I(leftv res, leftv v)
Definition iparith.cc:4140
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
Definition iparith.cc:4017
static BOOLEAN jjrVarStr(leftv res, leftv v)
Definition iparith.cc:5752
static BOOLEAN jjMONITOR1(leftv res, leftv v)
Definition iparith.cc:2742
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:4090
static BOOLEAN jjORD(leftv res, leftv v)
Definition iparith.cc:4820
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
Definition iparith.cc:3817
static BOOLEAN jjENVELOPE(leftv res, leftv a)
Definition iparith.cc:5333
static BOOLEAN jjSetRing(leftv, leftv u)
Definition iparith.cc:3855
static BOOLEAN jjMINRES_R(leftv res, leftv v)
Definition iparith.cc:4755
static BOOLEAN jjCOLS(leftv res, leftv v)
Definition iparith.cc:3961
static BOOLEAN jjP2BI(leftv res, leftv v)
Definition iparith.cc:4866
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
Definition iparith.cc:5309
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
Definition iparith.cc:5473
static BOOLEAN jjBAREISS_BIM(leftv res, leftv v)
Definition iparith.cc:3902
static BOOLEAN jjPFAC1(leftv res, leftv v)
Definition iparith.cc:4656
static BOOLEAN jjCONTENT(leftv res, leftv v)
Definition iparith.cc:3976
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5168
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:5043
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3909
static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
Definition iparith.cc:5367
static BOOLEAN jjGETDUMP(leftv, leftv v)
Definition iparith.cc:4281
static BOOLEAN jjidFreeModule(leftv res, leftv v)
Definition iparith.cc:5694
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
Definition iparith.cc:4950
static BOOLEAN jjRPAR(leftv res, leftv v)
Definition iparith.cc:5038
static BOOLEAN jjLOAD1(leftv, leftv v)
Definition iparith.cc:4643
static BOOLEAN jjKERNEL_SM(leftv res, leftv v)
Definition iparith.cc:4573
static BOOLEAN jjrParStr(leftv res, leftv v)
Definition iparith.cc:5757
static BOOLEAN jjDEG(leftv res, leftv v)
Definition iparith.cc:4031
static BOOLEAN jjRINGLIST(leftv res, leftv v)
Definition iparith.cc:4993
static BOOLEAN jjidElem(leftv res, leftv v)
Definition iparith.cc:5689
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:4814
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
Definition iparith.cc:3829
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
Definition iparith.cc:4302
static BOOLEAN jjNAMES(leftv res, leftv v)
Definition iparith.cc:4794
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
Definition iparith.cc:4295
static BOOLEAN jjPROC1(leftv res, leftv u)
Definition iparith.cc:3875
static BOOLEAN jjNOT(leftv res, leftv v)
Definition iparith.cc:4804
static BOOLEAN jjPARSTR1(leftv res, leftv v)
Definition iparith.cc:4848
static BOOLEAN jjHOMOG1(leftv res, leftv v)
Definition iparith.cc:4376
static BOOLEAN jjDET(leftv res, leftv v)
Definition iparith.cc:4098
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
Definition iparith.cc:4006
static BOOLEAN jjRING_LIST(leftv res, leftv v)
Definition iparith.cc:5015
static BOOLEAN jjVARSTR1(leftv res, leftv v)
Definition iparith.cc:5495
static BOOLEAN jjSYZYGY(leftv res, leftv v)
Definition iparith.cc:5228
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
Definition iparith.cc:4674
static BOOLEAN jjNVARS(leftv res, leftv v)
Definition iparith.cc:4809
static BOOLEAN jjERROR(leftv, leftv u)
Definition iparith.cc:2001
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
Definition iparith.cc:5008
BOOLEAN jjPRINT(leftv res, leftv u)
Definition ipprint.cc:252
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
Definition ipshell.cc:6319
BOOLEAN jjMINRES(leftv res, leftv v)
Definition ipshell.cc:947
BOOLEAN syBetti1(leftv res, leftv u)
Definition ipshell.cc:3179
BOOLEAN jjCHARSERIES(leftv res, leftv u)
Definition ipshell.cc:3356
BOOLEAN mpJacobi(leftv res, leftv a)
Definition ipshell.cc:3078
BOOLEAN kWeight(leftv res, leftv id)
Definition ipshell.cc:3310
BOOLEAN kQHWeight(leftv res, leftv v)
Definition ipshell.cc:3332
BOOLEAN jjBETTI(leftv res, leftv u)
Definition ipshell.cc:968
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
Definition ipshell.cc:6327
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
Definition ipshell.cc:4572
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 324 of file table.h.

325{
326// operations:
327// proc cmd res arg1 arg2 context
357#ifdef SINGULAR_4_2
364#endif
393#ifdef SINGULAR_4_2
403#endif
449#ifdef SINGULAR_4_2
459#endif
471#ifdef SINGULAR_4_2
477#endif
490#ifdef SINGULAR_4_2
496#endif
502#ifdef SINGULAR_4_2
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
691//,{D(jjHILBERT2), HILBERT_CMD, INTVEC_CMD, IDEAL_CMD, INT_CMD, ALLOW_PLURAL | ALLOW_RING | NO_ZERODIVISOR}
692//,{D(jjHILBERT2), HILBERT_CMD, INTVEC_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL | ALLOW_RING | NO_ZERODIVISOR}
713,{D(jjKBASE2), KBASE_CMD, IDEAL_CMD, IDEAL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
714,{D(jjKBASE2), KBASE_CMD, MODUL_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
731//,{D(jjRES), MRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
732//,{D(jjRES), MRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
735#ifdef SINGULAR_4_2
740#endif
743#ifdef HAVE_PLURAL
753#endif
780//,{D(jjRES), SRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
781//,{D(jjRES), SRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
799,{NULL_VAL, 0, 0, 0, 0, NO_NC |NO_RING}
800};
BOOLEAN atKILLATTR2(leftv, leftv a, leftv b)
Definition attrib.cc:487
BOOLEAN atATTRIB2(leftv res, leftv v, leftv b)
Definition attrib.cc:280
BOOLEAN fglmProc(leftv result, leftv first, leftv second)
Definition fglm.cc:277
BOOLEAN fglmQuotProc(leftv result, leftv first, leftv second)
Definition fglm.cc:411
#define jjWRONG2
Definition gentable.cc:128
@ 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:247
static BOOLEAN jjINDEX_V_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1526
static BOOLEAN jjQUOT(leftv res, leftv u, leftv v)
Definition iparith.cc:3107
static BOOLEAN jjTIMES_MA_P1(leftv res, leftv u, leftv v)
Definition iparith.cc:1102
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:283
static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2050
static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
Definition iparith.cc:336
static BOOLEAN jjTIMES_MA_BI2(leftv res, leftv u, leftv v)
Definition iparith.cc:1098
static BOOLEAN jjMAP(leftv res, leftv u, leftv v)
Definition iparith.cc:1655
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1186
static BOOLEAN jjOP_I_IM(leftv res, leftv u, leftv v)
Definition iparith.cc:319
static BOOLEAN jjLIFTSTD(leftv res, leftv u, leftv v)
Definition iparith.cc:2613
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
Definition iparith.cc:2811
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2746
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
Definition iparith.cc:2922
static BOOLEAN jjHOMOG1_WI(leftv res, leftv v, leftv u)
Definition iparith.cc:2511
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
Definition iparith.cc:3114
static BOOLEAN jjDIVISION(leftv res, leftv u, leftv v)
Definition iparith.cc:1956
static BOOLEAN jjOP_I_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:300
static BOOLEAN jjEQUAL_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1325
static BOOLEAN jjMINUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:912
static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
Definition iparith.cc:2593
static BOOLEAN jjTIMES_MA_N2(leftv res, leftv u, leftv v)
Definition iparith.cc:1127
static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2882
static BOOLEAN jjTIMES_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1154
static BOOLEAN jjMOD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2701
static BOOLEAN jjTIMES_MA_I2(leftv res, leftv u, leftv v)
Definition iparith.cc:1136
static BOOLEAN jjSTATUS2L(leftv res, leftv u, leftv v)
Definition iparith.cc:3442
static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1193
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition iparith.cc:3294
static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1331
static BOOLEAN jjTIMES_MA_P2(leftv res, leftv u, leftv v)
Definition iparith.cc:1111
static BOOLEAN jjSBA_1(leftv res, leftv v, leftv u)
Definition iparith.cc:5116
static BOOLEAN jjPLUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:827
static BOOLEAN jjMINUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:907
static BOOLEAN jjTIMES_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1057
static BOOLEAN jjLT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1225
static BOOLEAN jjMINUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:955
static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2022
static BOOLEAN jjDelete_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1871
static BOOLEAN jjLE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1212
static BOOLEAN jjCOMPARE_S(leftv res, leftv u, leftv v)
Definition iparith.cc:482
static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1387
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition iparith.cc:1131
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition iparith.cc:1120
static BOOLEAN jjMINUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:945
static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:3390
static BOOLEAN jjMINUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:902
static BOOLEAN jjDEG_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1850
static BOOLEAN jjMINUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:935
static BOOLEAN jjHOMOG_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2452
static BOOLEAN jjLE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1203
static BOOLEAN jjPLUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:798
static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2902
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2825
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
Definition iparith.cc:2581
static BOOLEAN jjTIMES_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1000
static BOOLEAN jjTIMES_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:1140
static BOOLEAN jjTIMES_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1064
static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:758
static BOOLEAN jjREDUCE_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3155
static BOOLEAN jjCOEF(leftv res, leftv u, leftv v)
Definition iparith.cc:1795
static BOOLEAN jjDEG_M_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1839
static BOOLEAN jjPLUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:807
static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
Definition iparith.cc:4524
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1180
static BOOLEAN jjEQUAL_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1343
static BOOLEAN jjINTERPOLATION(leftv res, leftv l, leftv v)
Definition iparith.cc:2531
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3353
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3147
static BOOLEAN jjDIV_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1296
static BOOLEAN jjMODULO(leftv res, leftv u, leftv v)
Definition iparith.cc:2648
static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:342
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition iparith.cc:3131
static BOOLEAN jjFAREY_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2147
static BOOLEAN jjPLUS_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:876
static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2389
static BOOLEAN jjELIMIN(leftv res, leftv u, leftv v)
Definition iparith.cc:1976
static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1684
static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2559
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:304
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:2363
static BOOLEAN jjDIFF_ID_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1934
static BOOLEAN jjSYZ_2(leftv res, leftv u, leftv v)
Definition iparith.cc:3581
static BOOLEAN jjRING_1(leftv res, leftv u, leftv v)
Definition iparith.cc:1675
static BOOLEAN jjOP_I_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:262
static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v)
Definition iparith.cc:2412
static BOOLEAN jjFIND2(leftv res, leftv u, leftv v)
Definition iparith.cc:2298
static BOOLEAN jjCOEF_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1802
static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:628
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition iparith.cc:1088
static BOOLEAN jjCOEFFS2_KB(leftv res, leftv u, leftv v)
Definition iparith.cc:1820
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:775
static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1220
static BOOLEAN jjEXTGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2008
static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2369
static BOOLEAN jjCONTRACT(leftv res, leftv u, leftv v)
Definition iparith.cc:1834
static BOOLEAN jjFAREY_LI(leftv res, leftv u, leftv v)
Definition iparith.cc:10431
static BOOLEAN jjDelete_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1864
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1168
static BOOLEAN jjKERNEL(leftv res, leftv u, leftv v)
Definition iparith.cc:2577
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2712
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
Definition iparith.cc:2637
static BOOLEAN jjEQUAL_R(leftv res, leftv u, leftv v)
Definition iparith.cc:1349
static BOOLEAN jjINTERSECT(leftv res, leftv u, leftv v)
Definition iparith.cc:2525
static BOOLEAN jjOP_BI_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:279
static BOOLEAN jjDIFF_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1912
static BOOLEAN jjMINUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:922
static BOOLEAN jjRSUM(leftv res, leftv u, leftv v)
Definition iparith.cc:3339
static BOOLEAN jjINDEX_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1392
static BOOLEAN jjPOWER_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:571
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1574
static BOOLEAN jjFETCH(leftv res, leftv u, leftv v)
Definition iparith.cc:2170
static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
Definition iparith.cc:3497
static BOOLEAN jjTIMES_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1010
static BOOLEAN jjPLUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:839
static BOOLEAN jjMINUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:897
static BOOLEAN jjTIMES_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:993
static BOOLEAN jjFACSTD2(leftv res, leftv v, leftv w)
Definition iparith.cc:2114
static BOOLEAN jjEXPORTTO(leftv, leftv u, leftv v)
Definition iparith.cc:1996
static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2842
static BOOLEAN jjDIV_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1278
static BOOLEAN jjKBASE2(leftv res, leftv u, leftv v)
Definition iparith.cc:2564
static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
Definition iparith.cc:525
static BOOLEAN jjRES(leftv res, leftv u, leftv v)
Definition iparith.cc:3164
static BOOLEAN jjPLUS_P_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:862
static BOOLEAN jjPLUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:817
static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1175
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1198
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:455
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition iparith.cc:851
static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3448
static BOOLEAN jjELIMIN_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1982
static BOOLEAN jjDIFF_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1923
static BOOLEAN jjTIMES_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:1076
static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
Definition iparith.cc:981
static BOOLEAN jjDIV_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1265
static BOOLEAN jjFRES(leftv res, leftv u, leftv v)
Definition iparith.cc:2353
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition iparith.cc:1562
static BOOLEAN jjCOMPARE_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:427
static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2136
static BOOLEAN jjCOMPARE_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:400
static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1229
static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1207
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:3320
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition iparith.cc:1619
static BOOLEAN jjPLUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:770
static BOOLEAN jjDET2(leftv res, leftv u, leftv v)
Definition iparith.cc:1898
static BOOLEAN jjSTD_HILB(leftv res, leftv u, leftv v)
Definition iparith.cc:3464
static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1382
static BOOLEAN jjINDEX_P_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1490
static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
Definition iparith.cc:2543
static BOOLEAN jjCOLON(leftv res, leftv u, leftv v)
Definition iparith.cc:323
static BOOLEAN jjRPLUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3326
static BOOLEAN jjCOLCOL(leftv res, leftv u, leftv v)
Definition iparith.cc:696
static BOOLEAN jjFAC_P2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:2067
static BOOLEAN jjHOMOG_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2469
static BOOLEAN jjINDEX_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1519
static BOOLEAN jjDIM2(leftv res, leftv v, leftv w)
Definition iparith.cc:1939
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:266
static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2382
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
Definition iparith.cc:3122
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
Definition iparith.cc:2518
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:968
static BOOLEAN jjINDEX_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1450
static BOOLEAN jjEQUAL_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1337
static BOOLEAN jjLOAD2(leftv, leftv, leftv v)
Definition iparith.cc:2633
static BOOLEAN jjALIGN_M(leftv res, leftv u, leftv v)
Definition iparith.cc:1781
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:1252
static BOOLEAN jjCOMPARE_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:370
static BOOLEAN jjEQUAL_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1355
static BOOLEAN jjDelete_ID_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1878
static BOOLEAN jjDET2_S(leftv res, leftv u, leftv v)
Definition iparith.cc:1905
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1809
static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b)
Definition iparith.cc:2990
static BOOLEAN jjMOD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2723
static BOOLEAN jjPLUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:785
static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2406
static BOOLEAN jjPLUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:780
static BOOLEAN jjKoszul_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:2585
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:10232
static BOOLEAN jjPLUS_S(leftv res, leftv u, leftv v)
Definition iparith.cc:866
static BOOLEAN jjHOMOG1_W(leftv res, leftv v, leftv u)
Definition iparith.cc:2491
static BOOLEAN jjINDEX_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1414
static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:881
static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2554
static BOOLEAN jjPRUNE_MAP(leftv res, leftv v, leftv ma)
Definition iparith.cc:3063
static BOOLEAN jjLT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1216
static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
Definition iparith.cc:605
static BOOLEAN jjINDEX_PBu(leftv res, leftv u, leftv v)
Definition iparith.cc:1467
static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
Definition iparith.cc:587
static BOOLEAN jjEQUAL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1361
static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2862
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3437
static BOOLEAN jjALIGN_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1771
BOOLEAN jjIMPORTFROM(leftv, leftv u, leftv v)
Definition ipassign.cc:2447
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:4664
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 802 of file table.h.

803{
804// operations:
805// proc cmd res arg1 arg2 arg3 context
821#ifdef SINGULAR_4_2
823#endif
827#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
829#endif
836#ifdef SINGULAR_4_2
838#endif
889#ifdef OLD_RES
892#endif
896#ifdef SINGULAR_4_2
898#endif
909#ifdef OLD_RES
912#endif
915#ifdef OLD_RES
918#endif
934,{NULL_VAL, 0, 0, 0, 0, 0 , NO_NC |NO_RING}
935};
BOOLEAN atATTRIB3(leftv, leftv v, leftv b, leftv c)
Definition attrib.cc:368
#define jjWRONG3
Definition gentable.cc:129
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5836
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6973
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:5972
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6932
static BOOLEAN jjSUBST_Bu(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6836
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7225
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6171
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7288
static BOOLEAN jjMODULO3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7012
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6136
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6381
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6950
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6849
static BOOLEAN jjLIFTSTD_SYZ(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7149
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6091
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6387
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6116
static BOOLEAN jjHOMOG_W_M(leftv res, leftv v1, leftv v2, leftv v3)
Definition iparith.cc:6321
static BOOLEAN jjRING_2(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6079
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5809
static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6986
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6072
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7194
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5922
static BOOLEAN jjINTERSEC3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6356
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7233
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6364
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7279
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7274
static BOOLEAN jjFRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:2316
static BOOLEAN jjREDUCE3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7218
static BOOLEAN jjELIMIN_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6163
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6371
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7206
static BOOLEAN jjINTERSECT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6343
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5864
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6677
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6303
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6882
static BOOLEAN jjSMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7114
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6687
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6021
static BOOLEAN jjMRES_MAP(leftv res, leftv u, leftv v, leftv ma)
Definition iparith.cc:6594
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7127
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6285
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:7063
static BOOLEAN jjHILBERT3Qt(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6261
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6329
static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
Definition iparith.cc:2949
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6761
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6130
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:7172
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5793
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6936
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
Definition iparith.cc:5142
static BOOLEAN jjBRACK_SM(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5893
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3100
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:3349
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:4687
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:4830
@ 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 938 of file table.h.

939{
940// operations:
941// proc cmd res number_of_args context
943,{D(jjRING_PL), '[', RING_CMD, -2 , ALLOW_NC |ALLOW_RING}
949#ifdef SINGULAR_4_2
952#endif
959//,{D(jjEXPORTTO_M), EXPORTTO_CMD, NONE, -2 , ALLOW_NC |ALLOW_RING}
960,{D(jjCALL2ARG), FETCH_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
961,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_PLURAL |ALLOW_RING}
962,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,4 , ALLOW_PLURAL |ALLOW_RING}
963,{D(jjCALL1ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,1 , ALLOW_NC |ALLOW_RING}
964,{D(jjCALL2ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
965,{D(jjCALL3ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_NC |ALLOW_RING}
973,{D(jjCALL2ARG), JET_CMD, POLY_CMD,/*or set by p*/ 2 , ALLOW_PLURAL |ALLOW_RING}
974,{D(jjCALL3ARG), JET_CMD, POLY_CMD,/*or set by p*/ 3 , ALLOW_PLURAL |ALLOW_RING}
975,{D(jjJET4), JET_CMD, POLY_CMD,/*or set by p*/ 4 , ALLOW_PLURAL |ALLOW_RING}
997,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING}
998,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING}
999,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_NC |ALLOW_RING}
1000,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING}
1001,{D(jjREDUCE5), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 5, ALLOW_PLURAL |ALLOW_RING}
1004//,{D(jjCALL1ARG), RESERVEDNAMELIST_CMD, LIST_CMD, 1 , ALLOW_NC |ALLOW_RING}
1007,{D(jjCALL3ARG), SUBST_CMD, NONE/*set by p*/, 3 , ALLOW_NC |ALLOW_RING}
1008,{D(jjSUBST_M), SUBST_CMD, NONE/*set by p*/, -2 , ALLOW_NC |ALLOW_RING}
1009,{D(jjSYSTEM), SYSTEM_CMD, NONE/*or set by p*/,-2 , ALLOW_NC |ALLOW_RING}
1017,{D(jjCALL1ARG), STD_CMD, IDEAL_CMD/* or set by p*/,1 , ALLOW_NC |ALLOW_RING}
1023,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
1024};
BOOLEAN jjSYSTEM(leftv res, leftv args)
Definition extra.cc:232
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8531
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8380
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8461
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7825
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8664
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8509
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8136
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7344
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7337
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7385
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6398
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7670
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7939
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8954
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8390
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8645
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7402
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8871
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8167
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8611
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7373
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7906
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8308
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7744
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8854
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7545
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8375
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:8000
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8796
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7361
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8257
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7365
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8083
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8827
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7501
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1274
BOOLEAN iiWRITE(leftv, leftv v)
Definition ipshell.cc:588
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4578
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:4931
@ 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

Definition at line 31 of file ipshell.h.

◆ iiRETURNEXPR

EXTERN_INST_VAR sleftv iiRETURNEXPR

Definition at line 34 of file ipshell.h.

◆ iiRETURNEXPR_len

EXTERN_VAR int iiRETURNEXPR_len

Definition at line 33 of file ipshell.h.

◆ lastreserved

const char* lastreserved
extern

Definition at line 82 of file ipshell.cc.

◆ myynest

EXTERN_VAR int myynest

Definition at line 38 of file ipshell.h.

◆ printlevel

EXTERN_VAR int printlevel

Definition at line 39 of file ipshell.h.

◆ si_echo

EXTERN_VAR int si_echo

Definition at line 40 of file ipshell.h.

◆ yyInRingConstruction

EXTERN_VAR BOOLEAN yyInRingConstruction

Definition at line 43 of file ipshell.h.