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 73 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 64 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 81 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 91 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 99 of file gentable.cc.

Data Fields
short arg
int p
proc1 p
short res

◆ sValAssign

struct sValAssign

Definition at line 106 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 550 of file ipshell.cc.

551{
552 int rc = 0;
553 while (v!=NULL)
554 {
555 switch (v->Typ())
556 {
557 case INT_CMD:
558 case POLY_CMD:
559 case VECTOR_CMD:
560 case NUMBER_CMD:
561 rc++;
562 break;
563 case INTVEC_CMD:
564 case INTMAT_CMD:
565 rc += ((intvec *)(v->Data()))->length();
566 break;
567 case MATRIX_CMD:
568 case IDEAL_CMD:
569 case MODUL_CMD:
570 {
571 matrix mm = (matrix)(v->Data());
572 rc += mm->rows() * mm->cols();
573 }
574 break;
575 case LIST_CMD:
576 rc+=((lists)v->Data())->nr+1;
577 break;
578 default:
579 rc++;
580 }
581 v = v->next;
582 }
583 return rc;
584}
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:9760
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:556
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:23
@ MAP_CMD
Definition grammar.cc:286
@ RESOLUTION_CMD
Definition grammar.cc:291
#define idDelete(H)
delete an ideal
Definition ideals.h:29
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition ipassign.cc:2097
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc: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 6423 of file ipshell.cc.

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

◆ iiARROW()

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

Definition at line 6472 of file ipshell.cc.

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

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

◆ iiAssignCR()

BOOLEAN iiAssignCR ( leftv  r,
leftv  arg 
)

Definition at line 6507 of file ipshell.cc.

6508{
6509 char* ring_name=omStrDup((char*)r->Name());
6510 int t=arg->Typ();
6511 if (t==RING_CMD)
6512 {
6513 sleftv tmp;
6514 tmp.Init();
6515 tmp.rtyp=IDHDL;
6517 tmp.data=(char*)h;
6518 if (h!=NULL)
6519 {
6520 tmp.name=h->id;
6521 BOOLEAN b=iiAssign(&tmp,arg);
6522 if (b) return TRUE;
6525 return FALSE;
6526 }
6527 else
6528 return TRUE;
6529 }
6530 else if (t==CRING_CMD)
6531 {
6532 sleftv tmp;
6533 sleftv n;
6534 n.Init();
6535 n.name=ring_name;
6536 if (iiDeclCommand(&tmp,&n,myynest,CRING_CMD,&IDROOT)) return TRUE;
6537 if (iiAssign(&tmp,arg)) return TRUE;
6538 //Print("create %s\n",r->Name());
6539 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6540 return FALSE;
6541 }
6542 //Print("create %s\n",r->Name());
6543 //Print("from %s(%d)\n",Tok2Cmdname(arg->Typ()),arg->Typ());
6544 return TRUE;// not handled -> error for now
6545}
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:1197
idhdl rDefault(const char *s)
Definition ipshell.cc:1643
void rSetHdl(idhdl h)
Definition ipshell.cc:5121

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv  r,
leftv  args 
)

Definition at line 1272 of file ipshell.cc.

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

1630{
1631 if (p!=basePack)
1632 {
1633 idhdl t=basePack->idroot;
1634 while ((t!=NULL) && (IDTYP(t)!=PACKAGE_CMD) && (IDPACKAGE(t)!=p)) t=t->next;
1635 if (t==NULL)
1636 {
1637 WarnS("package not found\n");
1638 p=basePack;
1639 }
1640 }
1641}
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 1585 of file ipshell.cc.

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

◆ iiCheckTypes()

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

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

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

Definition at line 6565 of file ipshell.cc.

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

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

◆ iiDeclCommand()

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

Definition at line 1197 of file ipshell.cc.

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

◆ iiExport() [1/2]

BOOLEAN iiExport ( leftv  v,
int  toLev 
)

Definition at line 1510 of file ipshell.cc.

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

◆ iiExport() [2/2]

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

Definition at line 1533 of file ipshell.cc.

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

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

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

◆ iiExprArith3()

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

Definition at line 9562 of file iparith.cc.

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

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

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

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

◆ iiInternalExport()

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

Definition at line 1464 of file ipshell.cc.

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

◆ iiLibCmd()

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

Definition at line 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 845 of file ipshell.cc.

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

◆ iiMap()

leftv iiMap ( map  theMap,
const char what 
)

Definition at line 613 of file ipshell.cc.

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

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char s)

Definition at line 121 of file ipshell.cc.

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

◆ iiParameter()

BOOLEAN iiParameter ( leftv  p)

Definition at line 1375 of file ipshell.cc.

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

◆ iiProcArgs()

char * iiProcArgs ( char e,
BOOLEAN  withParenth 
)

Definition at line 114 of file iplib.cc.

115{
116 while ((*e==' ') || (*e=='\t') || (*e=='(')) e++;
117 if (*e<' ')
118 {
119 if (withParenth)
120 {
121 // no argument list, allow list #
122 return omStrDup("parameter list #;");
123 }
124 else
125 {
126 // empty list
127 return omStrDup("");
128 }
129 }
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:69

◆ iiPStart()

BOOLEAN iiPStart ( idhdl  pn,
leftv  sl 
)

Definition at line 379 of file iplib.cc.

380{
382 int old_echo=si_echo;
383 BOOLEAN err=FALSE;
384 char save_flags=0;
385
386 /* init febase ======================================== */
387 /* we do not enter this case if filename != NULL !! */
388 if (pn!=NULL)
389 {
390 pi = IDPROC(pn);
391 if(pi!=NULL)
392 {
393 save_flags=pi->trace_flag;
394 if( pi->data.s.body==NULL )
395 {
397 if (pi->data.s.body==NULL) return TRUE;
398 }
399// omUpdateInfo();
400// int m=om_Info.UsedBytes;
401// Print("proc %s, mem=%d\n",IDID(pn),m);
402 }
403 }
404 else return TRUE;
405 /* generate argument list ======================================*/
406 //iiCurrArgs should be NULL here, as the assignment for the parameters
407 // of the prevouis call are already done befor calling another routine
408 if (v!=NULL)
409 {
411 memcpy(iiCurrArgs,v,sizeof(sleftv)); // keeps track of v->next etc.
412 v->Init();
413 }
414 else
415 {
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 1036 of file ipshell.cc.

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

6624{
6625 if ((source->next==NULL)&&(source->e==NULL))
6626 {
6627 if ((source->rtyp!=IDHDL)&&(source->rtyp!=ALIAS_CMD))
6628 {
6629 memcpy(&iiRETURNEXPR,source,sizeof(sleftv));
6630 source->Init();
6631 return;
6632 }
6633 if (source->rtyp==IDHDL)
6634 {
6635 if ((IDLEV((idhdl)source->data)==myynest)
6636 &&(IDTYP((idhdl)source->data)!=RING_CMD))
6637 {
6643 IDATTR((idhdl)source->data)=NULL;
6644 IDDATA((idhdl)source->data)=NULL;
6645 source->name=NULL;
6646 source->attribute=NULL;
6647 return;
6648 }
6649 }
6650 }
6652}
void Copy(leftv e)
Definition subexpr.cc:689
BITSET flag
Definition subexpr.h:90

◆ iiTestAssume()

BOOLEAN iiTestAssume ( leftv  a,
leftv  b 
)

Definition at line 6445 of file ipshell.cc.

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

◆ iiTokType()

int iiTokType ( int  op)

Definition at line 228 of file iparith.cc.

229{
230 for (unsigned i=0;i<sArithBase.nCmdUsed;i++)
231 {
232 if (sArithBase.sCmds[i].tokval==op)
233 return sArithBase.sCmds[i].toktype;
234 }
235 return 0;
236}
cmdnames * sCmds
array of existing commands
Definition iparith.cc:181
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
Definition iparith.cc:196
unsigned nCmdUsed
number of commands used
Definition iparith.cc:186

◆ 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 256 of file gentable.cc.

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

◆ iiWRITE()

BOOLEAN iiWRITE ( leftv  res,
leftv  exprlist 
)

Definition at line 586 of file ipshell.cc.

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

◆ IsCmd()

int IsCmd ( const char n,
int tok 
)

Definition at line 9760 of file iparith.cc.

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

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv  res,
leftv  v 
)

Definition at line 966 of file ipshell.cc.

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

◆ jjBETTI2()

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

Definition at line 1000 of file ipshell.cc.

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

◆ jjBETTI2_ID()

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

Definition at line 979 of file ipshell.cc.

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

◆ jjCHARSERIES()

BOOLEAN jjCHARSERIES ( leftv  res,
leftv  u 
)

Definition at line 3342 of file ipshell.cc.

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

◆ jjIMPORTFROM()

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

Definition at line 2510 of file ipassign.cc.

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

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

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

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

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

◆ jjRESULTANT()

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

Definition at line 3335 of file ipshell.cc.

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

◆ jjSetMinpoly()

coeffs jjSetMinpoly ( coeffs  cf,
number  a 
)

Definition at line 176 of file ipassign.cc.

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

◆ jjSYSTEM()

BOOLEAN jjSYSTEM ( leftv  res,
leftv  v 
)

Definition at line 230 of file extra.cc.

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

◆ jjVARIABLES_ID()

BOOLEAN jjVARIABLES_ID ( leftv  res,
leftv  u 
)

Definition at line 6310 of file ipshell.cc.

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

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv  res,
leftv  u 
)

Definition at line 6302 of file ipshell.cc.

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

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

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

◆ kWeight()

BOOLEAN kWeight ( leftv  res,
leftv  id 
)

Definition at line 3296 of file ipshell.cc.

3297{
3298 ideal F=(ideal)id->Data();
3299 intvec * iv = new intvec(rVar(currRing));
3300 polyset s;
3301 int sl, n, i;
3302 int *x;
3303
3304 res->data=(char *)iv;
3305 s = F->m;
3306 sl = IDELEMS(F) - 1;
3307 n = rVar(currRing);
3308 double wNsqr = (double)2.0 / (double)n;
3310 x = (int * )omAlloc(2 * (n + 1) * sizeof(int));
3311 wCall(s, sl, x, wNsqr, currRing);
3312 for (i = n; i!=0; i--)
3313 (*iv)[i-1] = x[i + n + 1];
3314 omFreeSize((ADDRESS)x, 2 * (n + 1) * sizeof(int));
3315 return FALSE;
3316}
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 {
450 h=IDRING(h)->idroot;
451 }
452 else if(IDTYP(h)==PACKAGE_CMD)
453 {
455 //Print("list_cmd:package\n");
457 h=IDPACKAGE(h)->idroot;
458 }
459 else
460 {
462 return;
463 }
464 }
465 else
466 {
467 Werror("%s is undefined",what);
469 return;
470 }
471 }
472 all=TRUE;
473 }
474 else if (RingDependend(typ))
475 {
476 h = currRing->idroot;
477 }
478 else
479 h = IDROOT;
480 start=h;
481 while (h!=NULL)
482 {
483 if ((all
484 && (IDTYP(h)!=PROC_CMD)
485 &&(IDTYP(h)!=PACKAGE_CMD)
486 &&(IDTYP(h)!=CRING_CMD)
487 )
488 || (typ == IDTYP(h))
489 || ((IDTYP(h)==CRING_CMD) && (typ==RING_CMD))
490 )
491 {
493 if ((IDTYP(h)==RING_CMD)
494 && (really_all || (all && (h==currRingHdl)))
495 && ((IDLEV(h)==0)||(IDLEV(h)==myynest)))
496 {
497 list_cmd(0,IDID(h),"// ",FALSE);
498 }
499 if (IDTYP(h)==PACKAGE_CMD && really_all)
500 {
501 package save_p=currPack;
503 list_cmd(0,IDID(h),"// ",FALSE);
505 }
506 }
507 h = IDNEXT(h);
508 }
510}
#define IDNEXT(a)
Definition ipid.h:118
void list_cmd(int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname)
Definition ipshell.cc:425
static void list1(const char *s, idhdl h, BOOLEAN c, BOOLEAN fullname)
Definition ipshell.cc:149

◆ loNewtonP()

BOOLEAN loNewtonP ( leftv  res,
leftv  arg1 
)

compute Newton Polytopes of input polynomials

Definition at line 4558 of file ipshell.cc.

4559{
4560 res->data= (void*)loNewtonPolytope( (ideal)arg1->Data() );
4561 return FALSE;
4562}
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 4564 of file ipshell.cc.

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

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

◆ mpKoszul()

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

Definition at line 3086 of file ipshell.cc.

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

◆ nuLagSolve()

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

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

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

Definition at line 4673 of file ipshell.cc.

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

4651{
4652 ideal gls = (ideal)(arg1->Data());
4653 int imtype= (int)(long)arg2->Data();
4654
4656
4657 // check input ideal ( = polynomial system )
4658 if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
4659 {
4660 return TRUE;
4661 }
4662
4663 uResultant *resMat= new uResultant( gls, mtype, false );
4664 if (resMat!=NULL)
4665 {
4666 res->rtyp = MODUL_CMD;
4667 res->data= (void*)resMat->accessResMat()->getMatrix();
4668 if (!errorreported) delete resMat;
4669 }
4670 return errorreported;
4671}
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 4917 of file ipshell.cc.

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

◆ nuVanderSys()

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

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

Definition at line 4816 of file ipshell.cc.

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

6326{
6327 Print(" %s (",n);
6328 switch (p->language)
6329 {
6330 case LANG_SINGULAR: PrintS("S"); break;
6331 case LANG_C: PrintS("C"); break;
6332 case LANG_TOP: PrintS("T"); break;
6333 case LANG_MAX: PrintS("M"); break;
6334 case LANG_NONE: PrintS("N"); break;
6335 default: PrintS("U");
6336 }
6337 if(p->libname!=NULL)
6338 Print(",%s", p->libname);
6339 PrintS(")");
6340}
@ 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 2780 of file ipshell.cc.

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

◆ rDecompose()

lists rDecompose ( const ring  r)

Definition at line 2151 of file ipshell.cc.

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

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

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring  r)

Definition at line 2112 of file ipshell.cc.

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

◆ rDefault()

idhdl rDefault ( const char s)

Definition at line 1643 of file ipshell.cc.

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

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

◆ rInit()

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

Definition at line 5620 of file ipshell.cc.

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

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

◆ rKill() [2/2]

void rKill ( ring  r)

Definition at line 6173 of file ipshell.cc.

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

◆ rSetHdl()

void rSetHdl ( idhdl  h)

Definition at line 5121 of file ipshell.cc.

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

◆ scIndIndset()

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

Definition at line 1102 of file ipshell.cc.

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

◆ semicProc()

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

Definition at line 4546 of file ipshell.cc.

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

◆ semicProc3()

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

Definition at line 4506 of file ipshell.cc.

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

◆ 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:69

◆ singular_system()

leftv singular_system ( sleftv  h)

◆ spaddProc()

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

Definition at line 4423 of file ipshell.cc.

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

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv  result,
leftv  first 
)

Definition at line 4179 of file ipshell.cc.

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

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv  result,
leftv  first 
)

Definition at line 4128 of file ipshell.cc.

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

◆ spmulProc()

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

Definition at line 4465 of file ipshell.cc.

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

◆ syBetti1()

BOOLEAN syBetti1 ( leftv  res,
leftv  u 
)

Definition at line 3165 of file ipshell.cc.

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

◆ syBetti2()

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

Definition at line 3142 of file ipshell.cc.

3143{
3145
3146 BOOLEAN minim=(int)(long)w->Data();
3147 int row_shift=0;
3148 int add_row_shift=0;
3149 intvec *weights=NULL;
3150 intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3151 if (ww!=NULL)
3152 {
3153 weights=ivCopy(ww);
3154 add_row_shift = ww->min_in();
3155 (*weights) -= add_row_shift;
3156 }
3157
3158 res->data=(void *)syBettiOfComputation(syzstr,minim,&row_shift,weights);
3159 //row_shift += add_row_shift;
3160 //Print("row_shift=%d, add_row_shift=%d\n",row_shift,add_row_shift);
3161 atSet(res,omStrDup("rowShift"),(void*)(long)add_row_shift,INT_CMD);
3162
3163 return FALSE;
3164}
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 3249 of file ipshell.cc.

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

◆ syConvRes()

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

Definition at line 3177 of file ipshell.cc.

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

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

◆ Tok2Cmdname()

const char * Tok2Cmdname ( int  i)

Definition at line 135 of file gentable.cc.

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

◆ 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:42
#define ALLOW_ZZ
Definition gentable.cc:46
#define ALLOW_RING
Definition gentable.cc:38
#define NO_CONVERSION
Definition gentable.cc:51
#define ALLOW_LP
Definition gentable.cc:33
#define NO_RING
Definition gentable.cc:39
#define D(A)
Definition gentable.cc:126
#define WARN_RING
Definition gentable.cc:49
#define ALLOW_NC
Definition gentable.cc:35
#define ALLOW_PLURAL
Definition gentable.cc:30
#define NO_NC
Definition gentable.cc:29
#define NULL_VAL
Definition gentable.cc:127
@ 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:3827
static BOOLEAN jjRANK1(leftv res, leftv v)
Definition iparith.cc:4957
static BOOLEAN jjIMPART(leftv res, leftv v)
Definition iparith.cc:4454
static BOOLEAN jjIm2Iv(leftv res, leftv v)
Definition iparith.cc:4447
static BOOLEAN jjUMINUS_IV(leftv res, leftv u)
Definition iparith.cc:3833
static BOOLEAN jjOPPOSITE(leftv res, leftv a)
Definition iparith.cc:5299
BOOLEAN jjWAITALL1(leftv res, leftv u)
Definition iparith.cc:5540
static BOOLEAN jjRESTART(leftv, leftv u)
Definition iparith.cc:8964
static BOOLEAN jjidHead(leftv res, leftv v)
Definition iparith.cc:5702
static BOOLEAN jjHILBERT(leftv, leftv v)
Definition iparith.cc:4338
static BOOLEAN jjLEADMONOM(leftv res, leftv v)
Definition iparith.cc:4613
static BOOLEAN jjstrlen(leftv res, leftv v)
Definition iparith.cc:5667
static BOOLEAN jjDET_BI(leftv res, leftv v)
Definition iparith.cc:4095
BOOLEAN jjWAIT1ST1(leftv res, leftv u)
Definition iparith.cc:5525
static BOOLEAN jjP2I(leftv res, leftv v)
Definition iparith.cc:4871
static BOOLEAN jjIS_RINGVAR_P(leftv res, leftv v)
Definition iparith.cc:4481
static BOOLEAN jjREPART(leftv res, leftv v)
Definition iparith.cc:4973
static BOOLEAN jjN2BI(leftv res, leftv v)
Definition iparith.cc:4754
static BOOLEAN jjCHAR(leftv res, leftv v)
Definition iparith.cc:3942
static BOOLEAN jjROWS_IV(leftv res, leftv v)
Definition iparith.cc:5018
static BOOLEAN jjNULL(leftv, leftv)
Definition iparith.cc:3777
static BOOLEAN jjBIV2IV(leftv res, leftv v)
Definition iparith.cc:4472
static BOOLEAN jjDIM(leftv res, leftv v)
Definition iparith.cc:4151
static BOOLEAN jjCOUNT_BIM(leftv res, leftv v)
Definition iparith.cc:3982
static BOOLEAN jjCOLS_IV(leftv res, leftv v)
Definition iparith.cc:3964
static BOOLEAN jjNAMES_I(leftv res, leftv v)
Definition iparith.cc:4784
static BOOLEAN jjMULT(leftv res, leftv v)
Definition iparith.cc:4734
static BOOLEAN jjPARDEG(leftv res, leftv v)
Definition iparith.cc:4827
static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
Return the denominator of the input number.
Definition iparith.cc:4072
static BOOLEAN jjIDEAL_Ma(leftv res, leftv v)
Definition iparith.cc:4411
static BOOLEAN jjmpTransp(leftv res, leftv v)
Definition iparith.cc:5730
static BOOLEAN jjDET_S(leftv res, leftv v)
Definition iparith.cc:4145
static BOOLEAN jjL2R(leftv res, leftv v)
Definition iparith.cc:4573
static BOOLEAN jjrCharStr(leftv res, leftv v)
Definition iparith.cc:5692
static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
Definition iparith.cc:4351
static BOOLEAN jjIDEAL_R(leftv res, leftv v)
Definition iparith.cc:4430
static BOOLEAN jjINDEPSET(leftv res, leftv v)
Definition iparith.cc:4459
static BOOLEAN jjTYPEOF(leftv res, leftv v)
Definition iparith.cc:5413
static BOOLEAN jjFACSTD(leftv res, leftv v)
Definition iparith.cc:4214
static BOOLEAN jjMEMORY(leftv res, leftv v)
Definition iparith.cc:4689
static BOOLEAN jjidTransp(leftv res, leftv v)
Definition iparith.cc:5760
static BOOLEAN jjUMINUS_BIM(leftv res, leftv u)
Definition iparith.cc:3840
static BOOLEAN jjDIM_R(leftv res, leftv v)
Definition iparith.cc:5755
static BOOLEAN jjDUMP(leftv, leftv v)
Definition iparith.cc:4179
static BOOLEAN jjpMaxComp(leftv res, leftv v)
Definition iparith.cc:5720
static BOOLEAN jjCOEFFS1(leftv res, leftv v)
Definition iparith.cc:3947
static BOOLEAN jjNAMEOF(leftv res, leftv v)
Definition iparith.cc:4766
static BOOLEAN jjPRIME(leftv res, leftv v)
Definition iparith.cc:4889
static BOOLEAN jjidVec2Ideal(leftv res, leftv v)
Definition iparith.cc:5687
static BOOLEAN jjJACOB_P(leftv res, leftv v)
Definition iparith.cc:4497
static BOOLEAN jjSQR_FREE(leftv res, leftv u)
Definition iparith.cc:5186
static BOOLEAN jjCALL1MANY(leftv res, leftv u)
Definition iparith.cc:3938
static BOOLEAN jjINTERRED(leftv res, leftv v)
Definition iparith.cc:4465
static BOOLEAN jjJACOB_M(leftv res, leftv a)
Definition iparith.cc:4528
static BOOLEAN jjBAREISS(leftv res, leftv v)
Definition iparith.cc:3872
static BOOLEAN jjREAD(leftv res, leftv v)
Definition iparith.cc:4964
static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
Definition iparith.cc:4486
static BOOLEAN jjROWS_BIM(leftv res, leftv v)
Definition iparith.cc:5013
static BOOLEAN jjSLIM_GB(leftv res, leftv u)
Definition iparith.cc:5033
static BOOLEAN jjMSTD(leftv res, leftv v)
Definition iparith.cc:4719
static BOOLEAN jjnInt(leftv res, leftv u)
Definition iparith.cc:5765
static BOOLEAN jjREGULARITY(leftv res, leftv v)
Definition iparith.cc:4968
static BOOLEAN jjTRACE_IV(leftv res, leftv v)
Definition iparith.cc:5284
static BOOLEAN jjMONOM(leftv res, leftv v)
Definition iparith.cc:2780
static BOOLEAN jjSort_Id(leftv res, leftv v)
Definition iparith.cc:5181
static BOOLEAN jjidMinBase(leftv res, leftv v)
Definition iparith.cc:5708
static BOOLEAN jjPREIMAGE_R(leftv res, leftv v)
Definition iparith.cc:4883
static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
Definition iparith.cc:4394
static BOOLEAN jjCOUNT_BI(leftv res, leftv v)
Definition iparith.cc:3977
static BOOLEAN jjKERNEL_M(leftv res, leftv v)
Definition iparith.cc:4549
static BOOLEAN jjCOLS_BIM(leftv res, leftv v)
Definition iparith.cc:3959
static BOOLEAN jjIDEAL_Map(leftv res, leftv v)
Definition iparith.cc:4420
static BOOLEAN jjEXECUTE(leftv, leftv v)
Definition iparith.cc:4205
static BOOLEAN jjLEADEXP(leftv res, leftv v)
Definition iparith.cc:4595
static BOOLEAN jjDEG_M(leftv res, leftv u)
Definition iparith.cc:4032
static BOOLEAN jjPAR1(leftv res, leftv v)
Definition iparith.cc:4811
static BOOLEAN jjnlInt(leftv res, leftv u)
Definition iparith.cc:5772
static BOOLEAN jjPLUSPLUS(leftv, leftv u)
Definition iparith.cc:3791
static BOOLEAN jjROWS(leftv res, leftv v)
Definition iparith.cc:5007
static BOOLEAN jjSBA(leftv res, leftv v)
Definition iparith.cc:5075
static BOOLEAN jjJanetBasis(leftv res, leftv v)
Definition iparith.cc:2542
static BOOLEAN jjKBASE(leftv res, leftv v)
Definition iparith.cc:4567
static BOOLEAN jjmpTrace(leftv res, leftv v)
Definition iparith.cc:5725
static BOOLEAN jjPRUNE(leftv res, leftv v)
Definition iparith.cc:4895
static BOOLEAN jjDEFINED(leftv res, leftv v)
Definition iparith.cc:4060
static BOOLEAN jjLagSolve(leftv res, leftv v)
Definition iparith.cc:4650
static BOOLEAN jjVDIM(leftv res, leftv v)
Definition iparith.cc:5498
static BOOLEAN jjCOUNT_N(leftv res, leftv v)
Definition iparith.cc:3988
static BOOLEAN jjP2N(leftv res, leftv v)
Definition iparith.cc:4919
static BOOLEAN jjE(leftv res, leftv v)
Definition iparith.cc:4193
static BOOLEAN jjLISTRING(leftv res, leftv v)
Definition iparith.cc:4632
static BOOLEAN jjVAR1(leftv res, leftv v)
Definition iparith.cc:5464
static BOOLEAN jjLEADCOEF(leftv res, leftv v)
Definition iparith.cc:4581
static BOOLEAN jjUMINUS_BI(leftv res, leftv u)
Definition iparith.cc:3803
static BOOLEAN jjpLength(leftv res, leftv v)
Definition iparith.cc:5672
static BOOLEAN jjIS_RINGVAR0(leftv res, leftv)
Definition iparith.cc:4492
static BOOLEAN jjBI2P(leftv res, leftv u)
Definition iparith.cc:3923
static BOOLEAN jjTWOSTD(leftv res, leftv a)
Definition iparith.cc:5333
static BOOLEAN jjFAC_P(leftv res, leftv u)
Definition iparith.cc:4254
static BOOLEAN jjTRANSP_BIM(leftv res, leftv v)
Definition iparith.cc:5289
static BOOLEAN jjCOUNT_RES(leftv res, leftv v)
Definition iparith.cc:5750
static BOOLEAN jjrOrdStr(leftv res, leftv v)
Definition iparith.cc:5735
static BOOLEAN jjpHead(leftv res, leftv v)
Definition iparith.cc:5697
static BOOLEAN jjCOUNT_L(leftv res, leftv v)
Definition iparith.cc:3993
static BOOLEAN jjDET_I(leftv res, leftv v)
Definition iparith.cc:4131
static BOOLEAN jjCOUNT_RG(leftv res, leftv v)
Definition iparith.cc:4010
static BOOLEAN jjrVarStr(leftv res, leftv v)
Definition iparith.cc:5740
static BOOLEAN jjMONITOR1(leftv res, leftv v)
Definition iparith.cc:2735
static BOOLEAN jjUMINUS_N(leftv res, leftv u)
Definition iparith.cc:3815
static BOOLEAN jjNUMERATOR(leftv res, leftv v)
Return the numerator of the input number.
Definition iparith.cc:4081
static BOOLEAN jjORD(leftv res, leftv v)
Definition iparith.cc:4805
static BOOLEAN jjUMINUS_I(leftv res, leftv u)
Definition iparith.cc:3810
static BOOLEAN jjENVELOPE(leftv res, leftv a)
Definition iparith.cc:5318
static BOOLEAN jjSetRing(leftv, leftv u)
Definition iparith.cc:3848
static BOOLEAN jjMINRES_R(leftv res, leftv v)
Definition iparith.cc:4740
static BOOLEAN jjCOLS(leftv res, leftv v)
Definition iparith.cc:3954
static BOOLEAN jjP2BI(leftv res, leftv v)
Definition iparith.cc:4851
static BOOLEAN jjTRANSP_IV(leftv res, leftv v)
Definition iparith.cc:5294
static BOOLEAN jjUNIVARIATE(leftv res, leftv v)
Definition iparith.cc:5459
static BOOLEAN jjBAREISS_BIM(leftv res, leftv v)
Definition iparith.cc:3895
static BOOLEAN jjPFAC1(leftv res, leftv v)
Definition iparith.cc:4641
static BOOLEAN jjCONTENT(leftv res, leftv v)
Definition iparith.cc:3969
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5153
static BOOLEAN jjCOUNT_IV(leftv res, leftv v)
Definition iparith.cc:4005
static BOOLEAN jjDUMMY(leftv res, leftv u)
Definition iparith.cc:3770
static BOOLEAN jjS2I(leftv res, leftv v)
Definition iparith.cc:5028
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3902
static BOOLEAN jjRIGHTSTD(leftv res, leftv v)
Definition iparith.cc:5352
static BOOLEAN jjGETDUMP(leftv, leftv v)
Definition iparith.cc:4270
static BOOLEAN jjidFreeModule(leftv res, leftv v)
Definition iparith.cc:5682
static BOOLEAN jjRESERVEDNAME(leftv res, leftv v)
Definition iparith.cc:4935
static BOOLEAN jjRPAR(leftv res, leftv v)
Definition iparith.cc:5023
static BOOLEAN jjLOAD1(leftv, leftv v)
Definition iparith.cc:4628
static BOOLEAN jjKERNEL_SM(leftv res, leftv v)
Definition iparith.cc:4558
static BOOLEAN jjrParStr(leftv res, leftv v)
Definition iparith.cc:5745
static BOOLEAN jjDEG(leftv res, leftv v)
Definition iparith.cc:4024
static BOOLEAN jjRINGLIST(leftv res, leftv v)
Definition iparith.cc:4978
static BOOLEAN jjidElem(leftv res, leftv v)
Definition iparith.cc:5677
static BOOLEAN jjBI2IM(leftv res, leftv u)
Definition iparith.cc:3917
static BOOLEAN jjDEGREE(leftv res, leftv v)
Definition iparith.cc:4043
static BOOLEAN jjOpenClose(leftv, leftv v)
Definition iparith.cc:4799
static BOOLEAN jjUMINUS_P(leftv res, leftv u)
Definition iparith.cc:3822
static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v)
Definition iparith.cc:4291
static BOOLEAN jjNAMES(leftv res, leftv v)
Definition iparith.cc:4779
static BOOLEAN jjHIGHCORNER(leftv res, leftv v)
Definition iparith.cc:4284
static BOOLEAN jjPROC1(leftv res, leftv u)
Definition iparith.cc:3868
static BOOLEAN jjNOT(leftv res, leftv v)
Definition iparith.cc:4789
static BOOLEAN jjPARSTR1(leftv res, leftv v)
Definition iparith.cc:4833
static BOOLEAN jjHOMOG1(leftv res, leftv v)
Definition iparith.cc:4361
static BOOLEAN jjDET(leftv res, leftv v)
Definition iparith.cc:4089
static BOOLEAN jjCOUNT_M(leftv res, leftv v)
Definition iparith.cc:3999
static BOOLEAN jjRING_LIST(leftv res, leftv v)
Definition iparith.cc:5000
static BOOLEAN jjVARSTR1(leftv res, leftv v)
Definition iparith.cc:5481
static BOOLEAN jjSYZYGY(leftv res, leftv v)
Definition iparith.cc:5213
static BOOLEAN jjLU_DECOMP(leftv res, leftv v)
Definition iparith.cc:4659
static BOOLEAN jjNVARS(leftv res, leftv v)
Definition iparith.cc:4794
static BOOLEAN jjERROR(leftv, leftv u)
Definition iparith.cc:1996
static BOOLEAN jjRINGLIST_C(leftv res, leftv v)
Definition iparith.cc:4993
BOOLEAN jjPRINT(leftv res, leftv u)
Definition ipprint.cc:252
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
Definition ipshell.cc:6302
BOOLEAN jjMINRES(leftv res, leftv v)
Definition ipshell.cc:945
BOOLEAN syBetti1(leftv res, leftv u)
Definition ipshell.cc:3165
BOOLEAN jjCHARSERIES(leftv res, leftv u)
Definition ipshell.cc:3342
BOOLEAN mpJacobi(leftv res, leftv a)
Definition ipshell.cc:3064
BOOLEAN kWeight(leftv res, leftv id)
Definition ipshell.cc:3296
BOOLEAN kQHWeight(leftv res, leftv v)
Definition ipshell.cc:3318
BOOLEAN jjBETTI(leftv res, leftv u)
Definition ipshell.cc:966
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
Definition ipshell.cc:6310
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
Definition ipshell.cc:4558
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
711,{D(jjKBASE2), KBASE_CMD, IDEAL_CMD, IDEAL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
712,{D(jjKBASE2), KBASE_CMD, MODUL_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING |WARN_RING} /*ring-cf: warning at top level*/
729//,{D(jjRES), MRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
730//,{D(jjRES), MRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
733#ifdef SINGULAR_4_2
738#endif
741#ifdef HAVE_PLURAL
751#endif
778//,{D(jjRES), SRES_CMD, LIST_CMD, IDEAL_CMD, INT_CMD, NO_NC |ALLOW_RING}
779//,{D(jjRES), SRES_CMD, LIST_CMD, MODUL_CMD, INT_CMD, NO_NC |ALLOW_RING}
797,{NULL_VAL, 0, 0, 0, 0, NO_NC |NO_RING}
798};
BOOLEAN atKILLATTR2(leftv, leftv a, leftv b)
Definition attrib.cc: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:123
@ 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:242
static BOOLEAN jjINDEX_V_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1521
static BOOLEAN jjQUOT(leftv res, leftv u, leftv v)
Definition iparith.cc:3100
static BOOLEAN jjTIMES_MA_P1(leftv res, leftv u, leftv v)
Definition iparith.cc:1097
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:278
static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2045
static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
Definition iparith.cc:331
static BOOLEAN jjTIMES_MA_BI2(leftv res, leftv u, leftv v)
Definition iparith.cc:1093
static BOOLEAN jjMAP(leftv res, leftv u, leftv v)
Definition iparith.cc:1650
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1181
static BOOLEAN jjOP_I_IM(leftv res, leftv u, leftv v)
Definition iparith.cc:314
static BOOLEAN jjLIFTSTD(leftv res, leftv u, leftv v)
Definition iparith.cc:2606
static BOOLEAN jjNEWSTRUCT2(leftv, leftv u, leftv v)
Definition iparith.cc:2804
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2739
static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b)
Definition iparith.cc:2915
static BOOLEAN jjHOMOG1_WI(leftv res, leftv v, leftv u)
Definition iparith.cc:2504
static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
Definition iparith.cc:3107
static BOOLEAN jjDIVISION(leftv res, leftv u, leftv v)
Definition iparith.cc:1951
static BOOLEAN jjOP_I_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:295
static BOOLEAN jjEQUAL_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1320
static BOOLEAN jjMINUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:907
static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
Definition iparith.cc:2586
static BOOLEAN jjTIMES_MA_N2(leftv res, leftv u, leftv v)
Definition iparith.cc:1122
static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2875
static BOOLEAN jjTIMES_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1149
static BOOLEAN jjMOD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2694
static BOOLEAN jjTIMES_MA_I2(leftv res, leftv u, leftv v)
Definition iparith.cc:1131
static BOOLEAN jjSTATUS2L(leftv res, leftv u, leftv v)
Definition iparith.cc:3435
static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1188
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition iparith.cc:3287
static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1326
static BOOLEAN jjTIMES_MA_P2(leftv res, leftv u, leftv v)
Definition iparith.cc:1106
static BOOLEAN jjSBA_1(leftv res, leftv v, leftv u)
Definition iparith.cc:5101
static BOOLEAN jjPLUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:822
static BOOLEAN jjMINUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:902
static BOOLEAN jjTIMES_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1052
static BOOLEAN jjLT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1220
static BOOLEAN jjMINUS_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:950
static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2017
static BOOLEAN jjDelete_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1866
static BOOLEAN jjLE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1207
static BOOLEAN jjCOMPARE_S(leftv res, leftv u, leftv v)
Definition iparith.cc:477
static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1382
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition iparith.cc:1126
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition iparith.cc:1115
static BOOLEAN jjMINUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:940
static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:3383
static BOOLEAN jjMINUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:897
static BOOLEAN jjDEG_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1845
static BOOLEAN jjMINUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:930
static BOOLEAN jjHOMOG_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2445
static BOOLEAN jjLE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1198
static BOOLEAN jjPLUS_B_P(leftv res, leftv u, leftv v)
Definition iparith.cc:793
static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2895
static BOOLEAN jjPARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2818
static BOOLEAN jjKoszul(leftv res, leftv u, leftv v)
Definition iparith.cc:2574
static BOOLEAN jjTIMES_N(leftv res, leftv u, leftv v)
Definition iparith.cc:995
static BOOLEAN jjTIMES_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:1135
static BOOLEAN jjTIMES_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1059
static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:753
static BOOLEAN jjREDUCE_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3148
static BOOLEAN jjCOEF(leftv res, leftv u, leftv v)
Definition iparith.cc:1790
static BOOLEAN jjDEG_M_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1834
static BOOLEAN jjPLUS_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:802
static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
Definition iparith.cc:4509
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1175
static BOOLEAN jjEQUAL_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:1338
static BOOLEAN jjINTERPOLATION(leftv res, leftv l, leftv v)
Definition iparith.cc:2524
static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:3346
static BOOLEAN jjREDUCE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3140
static BOOLEAN jjDIV_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1291
static BOOLEAN jjMODULO(leftv res, leftv u, leftv v)
Definition iparith.cc:2641
static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:337
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition iparith.cc:3124
static BOOLEAN jjFAREY_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2142
static BOOLEAN jjPLUS_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:871
static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2384
static BOOLEAN jjELIMIN(leftv res, leftv u, leftv v)
Definition iparith.cc:1971
static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1679
static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2552
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:299
static BOOLEAN jjTENSOR(leftv res, leftv u, leftv v)
Definition iparith.cc:3637
static BOOLEAN jjFWALK(leftv res, leftv u, leftv v)
Definition iparith.cc:2358
static BOOLEAN jjDIFF_ID_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1929
static BOOLEAN jjSYZ_2(leftv res, leftv u, leftv v)
Definition iparith.cc:3574
static BOOLEAN jjRING_1(leftv res, leftv u, leftv v)
Definition iparith.cc:1670
static BOOLEAN jjOP_I_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:257
static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v)
Definition iparith.cc:2407
static BOOLEAN jjFIND2(leftv res, leftv u, leftv v)
Definition iparith.cc:2293
static BOOLEAN jjCOEF_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1797
static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:623
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition iparith.cc:1083
static BOOLEAN jjCOEFFS2_KB(leftv res, leftv u, leftv v)
Definition iparith.cc:1815
static BOOLEAN jjVARSTR2(leftv res, leftv u, leftv v)
Definition iparith.cc:3663
static BOOLEAN jjPLUS_N(leftv res, leftv u, leftv v)
Definition iparith.cc:770
static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1215
static BOOLEAN jjEXTGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2003
static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:2364
static BOOLEAN jjCONTRACT(leftv res, leftv u, leftv v)
Definition iparith.cc:1829
static BOOLEAN jjFAREY_LI(leftv res, leftv u, leftv v)
Definition iparith.cc:10410
static BOOLEAN jjDelete_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1859
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1163
static BOOLEAN jjKERNEL(leftv res, leftv u, leftv v)
Definition iparith.cc:2570
static BOOLEAN jjMOD_N(leftv res, leftv u, leftv v)
Definition iparith.cc:2705
static BOOLEAN jjLOAD_E(leftv, leftv v, leftv u)
Definition iparith.cc:2630
static BOOLEAN jjEQUAL_R(leftv res, leftv u, leftv v)
Definition iparith.cc:1344
static BOOLEAN jjINTERSECT(leftv res, leftv u, leftv v)
Definition iparith.cc:2518
static BOOLEAN jjOP_BI_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:274
static BOOLEAN jjDIFF_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1907
static BOOLEAN jjMINUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:917
static BOOLEAN jjRSUM(leftv res, leftv u, leftv v)
Definition iparith.cc:3332
static BOOLEAN jjINDEX_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1387
static BOOLEAN jjPOWER_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:566
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1569
static BOOLEAN jjFETCH(leftv res, leftv u, leftv v)
Definition iparith.cc:2165
static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
Definition iparith.cc:3490
static BOOLEAN jjTIMES_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1005
static BOOLEAN jjPLUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:834
static BOOLEAN jjMINUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:892
static BOOLEAN jjTIMES_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:988
static BOOLEAN jjFACSTD2(leftv res, leftv v, leftv w)
Definition iparith.cc:2109
static BOOLEAN jjEXPORTTO(leftv, leftv u, leftv v)
Definition iparith.cc:1991
static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b)
Definition iparith.cc:2835
static BOOLEAN jjDIV_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1273
static BOOLEAN jjKBASE2(leftv res, leftv u, leftv v)
Definition iparith.cc:2557
static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
Definition iparith.cc:520
static BOOLEAN jjRES(leftv res, leftv u, leftv v)
Definition iparith.cc:3157
static BOOLEAN jjPLUS_P_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:857
static BOOLEAN jjPLUS_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:812
static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1170
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1193
static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
Definition iparith.cc:3748
static BOOLEAN jjCOMPARE_P(leftv res, leftv u, leftv v)
Definition iparith.cc:450
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition iparith.cc:846
static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:3441
static BOOLEAN jjELIMIN_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1977
static BOOLEAN jjDIFF_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:1918
static BOOLEAN jjTIMES_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:1071
static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
Definition iparith.cc:976
static BOOLEAN jjDIV_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1260
static BOOLEAN jjFRES(leftv res, leftv u, leftv v)
Definition iparith.cc:2348
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition iparith.cc:1557
static BOOLEAN jjCOMPARE_MA(leftv res, leftv u, leftv v)
Definition iparith.cc:422
static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2131
static BOOLEAN jjCOMPARE_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:395
static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1224
static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1202
static BOOLEAN jjTENSOR_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:3644
static BOOLEAN jjRMINUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3313
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition iparith.cc:1614
static BOOLEAN jjPLUS_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:765
static BOOLEAN jjDET2(leftv res, leftv u, leftv v)
Definition iparith.cc:1893
static BOOLEAN jjSTD_HILB(leftv res, leftv u, leftv v)
Definition iparith.cc:3457
static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
Definition iparith.cc:1377
static BOOLEAN jjINDEX_P_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1485
static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
Definition iparith.cc:2536
static BOOLEAN jjCOLON(leftv res, leftv u, leftv v)
Definition iparith.cc:318
static BOOLEAN jjRPLUS(leftv res, leftv u, leftv v)
Definition iparith.cc:3319
static BOOLEAN jjCOLCOL(leftv res, leftv u, leftv v)
Definition iparith.cc:691
static BOOLEAN jjFAC_P2(leftv res, leftv u, leftv dummy)
Definition iparith.cc:2062
static BOOLEAN jjHOMOG_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:2462
static BOOLEAN jjINDEX_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1514
static BOOLEAN jjDIM2(leftv res, leftv v, leftv w)
Definition iparith.cc:1934
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:261
static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:2377
static BOOLEAN jjRANK2(leftv res, leftv u, leftv v)
Definition iparith.cc:3115
static BOOLEAN jjINDEPSET2(leftv res, leftv u, leftv v)
Definition iparith.cc:2511
static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
Definition iparith.cc:3700
static BOOLEAN jjMINUS_SM(leftv res, leftv u, leftv v)
Definition iparith.cc:963
static BOOLEAN jjINDEX_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1445
static BOOLEAN jjEQUAL_Ma(leftv res, leftv u, leftv v)
Definition iparith.cc:1332
static BOOLEAN jjLOAD2(leftv, leftv, leftv v)
Definition iparith.cc:2626
static BOOLEAN jjALIGN_M(leftv res, leftv u, leftv v)
Definition iparith.cc:1776
static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
Definition iparith.cc:3676
static BOOLEAN jjDIV_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1247
static BOOLEAN jjCOMPARE_BIM(leftv res, leftv u, leftv v)
Definition iparith.cc:365
static BOOLEAN jjEQUAL_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1350
static BOOLEAN jjDelete_ID_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1873
static BOOLEAN jjDET2_S(leftv res, leftv u, leftv v)
Definition iparith.cc:1900
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1804
static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b)
Definition iparith.cc:2983
static BOOLEAN jjMOD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2716
static BOOLEAN jjPLUS_B(leftv res, leftv u, leftv v)
Definition iparith.cc:780
static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2401
static BOOLEAN jjPLUS_V(leftv res, leftv u, leftv v)
Definition iparith.cc:775
static BOOLEAN jjKoszul_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:2578
static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v)
Definition iparith.cc:10211
static BOOLEAN jjPLUS_S(leftv res, leftv u, leftv v)
Definition iparith.cc:861
static BOOLEAN jjHOMOG1_W(leftv res, leftv v, leftv u)
Definition iparith.cc:2484
static BOOLEAN jjINDEX_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1409
static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
Definition iparith.cc:876
static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
Definition iparith.cc:2547
static BOOLEAN jjPRUNE_MAP(leftv res, leftv v, leftv ma)
Definition iparith.cc:3056
static BOOLEAN jjLT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1211
static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
Definition iparith.cc:600
static BOOLEAN jjINDEX_PBu(leftv res, leftv u, leftv v)
Definition iparith.cc:1462
static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
Definition iparith.cc:582
static BOOLEAN jjEQUAL_P(leftv res, leftv u, leftv v)
Definition iparith.cc:1356
static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b)
Definition iparith.cc:2855
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3430
static BOOLEAN jjALIGN_V(leftv res, leftv u, leftv v)
Definition iparith.cc:1766
BOOLEAN jjIMPORTFROM(leftv, leftv u, leftv v)
Definition ipassign.cc:2510
BOOLEAN jjPRINT_FORMAT(leftv res, leftv u, leftv v)
Definition ipprint.cc:391
BOOLEAN lDelete(leftv res, leftv u, leftv v)
Definition lists.cc:161
BOOLEAN lAdd(leftv res, leftv u, leftv v)
Definition lists.cc:51
BOOLEAN lDeleteIV(leftv res, leftv u, leftv v)
Definition lists.cc:192
BOOLEAN lInsert(leftv res, leftv u, leftv v)
Definition lists.cc:120
BOOLEAN nuMPResMat(leftv res, leftv arg1, leftv arg2)
returns module representing the multipolynomial resultant matrix Arguments 2: ideal i,...
Definition ipshell.cc:4650
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 800 of file table.h.

801{
802// operations:
803// proc cmd res arg1 arg2 arg3 context
819#ifdef SINGULAR_4_2
821#endif
825#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
827#endif
834#ifdef SINGULAR_4_2
836#endif
887#ifdef OLD_RES
890#endif
894#ifdef SINGULAR_4_2
896#endif
907#ifdef OLD_RES
910#endif
913#ifdef OLD_RES
916#endif
932,{NULL_VAL, 0, 0, 0, 0, 0 , NO_NC |NO_RING}
933};
BOOLEAN atATTRIB3(leftv, leftv v, leftv b, leftv c)
Definition attrib.cc:368
#define jjWRONG3
Definition gentable.cc:124
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5824
static BOOLEAN jjMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6954
static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6205
static BOOLEAN jjBRACK_Ma_IV_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5960
static BOOLEAN jjSUBST_Id_I(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6913
static BOOLEAN jjSUBST_Bu(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6817
static BOOLEAN jjREDUCE3_ID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7206
static BOOLEAN jjELIMIN_HILB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6159
static BOOLEAN jjSTD_HILB_W(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7269
static BOOLEAN jjMODULO3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6993
static BOOLEAN jjCOEFFS3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6124
static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6362
static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6931
static BOOLEAN jjSUBST_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6830
static BOOLEAN jjLIFTSTD_SYZ(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7130
static BOOLEAN jjBAREISS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6079
static BOOLEAN jjJET_ID_M(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6368
static BOOLEAN jjCOEFFS3_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6104
static BOOLEAN jjHOMOG_W_M(leftv res, leftv v1, leftv v2, leftv v3)
Definition iparith.cc:6302
static BOOLEAN jjRING_2(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6067
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5797
static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6967
static BOOLEAN jjPROC3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6060
static BOOLEAN jjREDUCE3_CP(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7175
static BOOLEAN jjBRACK_Ma_I_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5910
static BOOLEAN jjINTERSEC3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6337
static BOOLEAN jjRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7214
static BOOLEAN jjJET_P_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6345
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7260
static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7255
static BOOLEAN jjFRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:2311
static BOOLEAN jjREDUCE3_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7199
static BOOLEAN jjELIMIN_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6151
static BOOLEAN jjJET_P_P(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6352
static BOOLEAN jjREDUCE3_CID(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7187
static BOOLEAN jjINTERSECT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6324
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5852
static BOOLEAN jjNEWSTRUCT3(leftv, leftv u, leftv v, leftv w)
Definition iparith.cc:6658
static BOOLEAN jjHOMOG_P_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6284
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6863
static BOOLEAN jjSMATRIX_Mo(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7095
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6668
static BOOLEAN jjBRACK_Ma_IV_IV(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6009
static BOOLEAN jjMRES_MAP(leftv res, leftv u, leftv v, leftv ma)
Definition iparith.cc:6575
static BOOLEAN jjLIFT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7108
static BOOLEAN jjHOMOG_ID_W(leftv res, leftv u, leftv v, leftv)
Definition iparith.cc:6266
static BOOLEAN jjFIND3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6174
static BOOLEAN jjMODULO3S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7044
static BOOLEAN jjHILBERT3Qt(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6244
static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6310
static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
Definition iparith.cc:2942
static BOOLEAN jjRANDOM_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6742
static BOOLEAN jjCOEFFS3_KB(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6118
static BOOLEAN jjHILBERT3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6214
static BOOLEAN jjLIFTSTD_ALG(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7153
static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5781
static BOOLEAN jjSUBST_Id_N(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6917
static BOOLEAN jjSBA_2(leftv res, leftv v, leftv u, leftv t)
Definition iparith.cc:5127
static BOOLEAN jjBRACK_SM(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5881
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3086
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
Definition ipshell.cc:3335
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:4673
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:4816
@ 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 936 of file table.h.

937{
938// operations:
939// proc cmd res number_of_args context
941,{D(jjRING_PL), '[', RING_CMD, -2 , ALLOW_NC |ALLOW_RING}
947#ifdef SINGULAR_4_2
950#endif
957//,{D(jjEXPORTTO_M), EXPORTTO_CMD, NONE, -2 , ALLOW_NC |ALLOW_RING}
958,{D(jjCALL2ARG), FETCH_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
959,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_PLURAL |ALLOW_RING}
960,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,4 , ALLOW_PLURAL |ALLOW_RING}
961,{D(jjCALL1ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,1 , ALLOW_NC |ALLOW_RING}
962,{D(jjCALL2ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
963,{D(jjCALL3ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_NC |ALLOW_RING}
971,{D(jjCALL2ARG), JET_CMD, POLY_CMD,/*or set by p*/ 2 , ALLOW_PLURAL |ALLOW_RING}
972,{D(jjCALL3ARG), JET_CMD, POLY_CMD,/*or set by p*/ 3 , ALLOW_PLURAL |ALLOW_RING}
973,{D(jjJET4), JET_CMD, POLY_CMD,/*or set by p*/ 4 , ALLOW_PLURAL |ALLOW_RING}
995,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING}
996,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING}
997,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_NC |ALLOW_RING}
998,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING}
999,{D(jjREDUCE5), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 5, ALLOW_PLURAL |ALLOW_RING}
1002//,{D(jjCALL1ARG), RESERVEDNAMELIST_CMD, LIST_CMD, 1 , ALLOW_NC |ALLOW_RING}
1005,{D(jjCALL3ARG), SUBST_CMD, NONE/*set by p*/, 3 , ALLOW_NC |ALLOW_RING}
1006,{D(jjSUBST_M), SUBST_CMD, NONE/*set by p*/, -2 , ALLOW_NC |ALLOW_RING}
1007,{D(jjSYSTEM), SYSTEM_CMD, NONE/*or set by p*/,-2 , ALLOW_NC |ALLOW_RING}
1015,{D(jjCALL1ARG), STD_CMD, IDEAL_CMD/* or set by p*/,1 , ALLOW_NC |ALLOW_RING}
1021,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
1022};
BOOLEAN jjSYSTEM(leftv res, leftv args)
Definition extra.cc:230
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8512
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8361
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8442
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7806
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8645
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8490
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8117
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7325
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7318
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7366
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6379
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7651
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7920
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8935
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8371
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8626
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7383
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8852
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8148
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8592
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7354
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7887
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8289
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7725
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8835
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7526
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8356
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:7981
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8777
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7342
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8238
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7346
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8064
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8808
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7482
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1272
BOOLEAN iiWRITE(leftv, leftv v)
Definition ipshell.cc:586
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4564
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:4917
@ 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.