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

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

◆ sValCmd2

struct sValCmd2

Definition at line 66 of file gentable.cc.

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

◆ sValCmd3

struct sValCmd3

Definition at line 83 of file gentable.cc.

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

◆ sValCmdM

struct sValCmdM

Definition at line 93 of file gentable.cc.

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

◆ sValAssign_sys

struct sValAssign_sys

Definition at line 101 of file gentable.cc.

Data Fields
short arg
int p
proc1 p
short res

◆ sValAssign

struct sValAssign

Definition at line 108 of file gentable.cc.

Data Fields
short arg
int p
proci p
short res

Typedef Documentation

◆ proc1

typedef BOOLEAN(* proc1) (leftv, leftv)

Definition at line 122 of file ipshell.h.

◆ proc2

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 710 of file iplib.cc.

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

◆ ii_CallProcId2Id()

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

Definition at line 670 of file iplib.cc.

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

◆ ii_CallProcId2Int()

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

Definition at line 689 of file iplib.cc.

690{
691 char *plib = iiConvName(lib);
694 if (h==NULL)
695 {
697 if (bo) return 0;
698 }
699 BOOLEAN err;
702 int I=(int)(long)iiCallLibProc1(proc,idCopy(arg),IDEAL_CMD,err);
704 if (err) return 0;
705 return I;
706}

◆ iiAddCproc()

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

Definition at line 1073 of file iplib.cc.

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

845{
846 if (iiCurrArgs==NULL)
847 {
848 Werror("not enough arguments for proc %s",VoiceName());
849 p->CleanUp();
850 return TRUE;
851 }
853 iiCurrArgs=h->next;
854 h->next=NULL;
855 if (h->rtyp!=IDHDL)
856 {
858 h->CleanUp();
860 return res;
861 }
862 if ((h->Typ()!=p->Typ()) &&(p->Typ()!=DEF_CMD))
863 {
864 WerrorS("type mismatch");
865 return TRUE;
866 }
867 idhdl pp=(idhdl)p->data;
868 switch(pp->typ)
869 {
870 case CRING_CMD:
872 break;
873 case DEF_CMD:
874 case INT_CMD:
875 break;
876 case INTVEC_CMD:
877 case INTMAT_CMD:
878 delete IDINTVEC(pp);
879 break;
880 case NUMBER_CMD:
882 break;
883 case BIGINT_CMD:
885 break;
886 case MAP_CMD:
887 {
888 map im = IDMAP(pp);
889 omFreeBinAddr((ADDRESS)im->preimage);
890 im->preimage=NULL;// and continue
891 }
892 // continue as ideal:
893 case IDEAL_CMD:
894 case MODUL_CMD:
895 case MATRIX_CMD:
897 break;
898 case PROC_CMD:
899 case RESOLUTION_CMD:
900 case STRING_CMD:
902 break;
903 case LIST_CMD:
904 IDLIST(pp)->Clean();
905 break;
906 case LINK_CMD:
908 break;
909 // case ring: cannot happen
910 default:
911 {
912 int t=p->Typ();
913 if (t<MAX_TOK)
914 {
915 Werror("unknown type %d(%s)",t,Tok2Cmdname(t));
916 return TRUE;
917 }
918 /*else: blackbox type, not yet set*/
919 break;
920 }
921 }
922 pp->typ=ALIAS_CMD;
923 IDDATA(pp)=(char*)h->data;
924 int eff_typ=h->Typ();
926 || ((eff_typ==LIST_CMD) && (lRingDependend((lists)h->Data()))))
927 {
928 ipSwapId(pp,IDROOT,currRing->idroot);
929 }
930 h->CleanUp();
932 return FALSE;
933}
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition cf_gcd.cc:676
int p
Definition cfModGcd.cc:4086
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition lists.h:24
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:459
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:556
CanonicalForm res
Definition facAbsFact.cc:60
void WerrorS(const char *s)
Definition feFopen.cc:24
const char * VoiceName()
Definition fevoices.cc:58
const char * Tok2Cmdname(int tok)
Definition gentable.cc:137
static int RingDependend(int t)
Definition gentable.cc:23
@ MAP_CMD
Definition grammar.cc:286
@ RESOLUTION_CMD
Definition grammar.cc:291
#define idDelete(H)
delete an ideal
Definition ideals.h:29
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition ipassign.cc:2097
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc:679
#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)
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
idrec * idhdl
Definition ring.h:22
#define IDHDL
Definition tok.h:31
@ ALIAS_CMD
Definition tok.h:34
@ BIGINT_CMD
Definition tok.h:38
@ CRING_CMD
Definition tok.h:56
@ DEF_CMD
Definition tok.h:58
@ LINK_CMD
Definition tok.h:117
@ STRING_CMD
Definition tok.h:187
@ MAX_TOK
Definition tok.h:220

◆ iiAllStart()

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

Definition at line 306 of file iplib.cc.

307{
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}
#define BITSET
Definition auxiliary.h:85
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:539
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:508
VAR unsigned si_opt_2
Definition options.c:6
VAR unsigned si_opt_1
Definition options.c:5
#define TEST_V_ALLWARN
Definition options.h:145
void PrintLn()
Definition reporter.cc:310
#define TRACE_SHOW_LINE
Definition reporter.h:33
EXTERN_VAR int traceit
Definition reporter.h:24
EXTERN_VAR int traceit_stop
Definition reporter.h:25
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46

◆ iiApply()

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

Definition at line 6420 of file ipshell.cc.

6421{
6422 res->Init();
6423 res->rtyp=a->Typ();
6424 switch (res->rtyp /*a->Typ()*/)
6425 {
6426 case INTVEC_CMD:
6427 case INTMAT_CMD:
6428 return iiApplyINTVEC(res,a,op,proc);
6429 case BIGINTMAT_CMD:
6430 return iiApplyBIGINTMAT(res,a,op,proc);
6431 case IDEAL_CMD:
6432 case MODUL_CMD:
6433 case MATRIX_CMD:
6434 return iiApplyIDEAL(res,a,op,proc);
6435 case LIST_CMD:
6436 return iiApplyLIST(res,a,op,proc);
6437 }
6438 WerrorS("first argument to `apply` must allow an index");
6439 return TRUE;
6440}
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:6339
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
Definition ipshell.cc:6381
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
Definition ipshell.cc:6376
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
Definition ipshell.cc:6371

◆ iiARROW()

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

Definition at line 6469 of file ipshell.cc.

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

◆ iiAssign()

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

Definition at line 2097 of file ipassign.cc.

2098{
2099 if (errorreported) return TRUE;
2100 int ll=l->listLength();
2101 int rl;
2102 int lt=l->Typ();
2103 int rt=NONE;
2104 int is_qring=FALSE;
2105 BOOLEAN b=FALSE;
2106 if (l->rtyp==ALIAS_CMD)
2107 {
2108 Werror("`%s` is read-only",l->Name());
2109 }
2110
2111 if (l->rtyp==IDHDL)
2112 {
2113 atKillAll((idhdl)l->data);
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:125
static int si_min(const int a, const int b)
Definition auxiliary.h:126
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
#define BB_LIKE_LIST(B)
Definition blackbox.h:53
CanonicalForm num(const CanonicalForm &f)
int k
Definition cfEzgcd.cc:99
CanonicalForm b
Definition cfModGcd.cc:4111
Matrices of numbers.
Definition bigintmat.h:51
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:298
@ VALTVARS
Definition grammar.cc:306
@ BIGINTVEC_CMD
Definition grammar.cc:279
@ VMINPOLY
Definition grammar.cc:310
@ RING_CMD
Definition grammar.cc:282
static BOOLEAN jjA_L_BIGINTVEC(leftv l, leftv r, bigintmat *bim)
Definition ipassign.cc:1817
static BOOLEAN jiA_MATRIX_L(leftv l, leftv r)
Definition ipassign.cc:1890
static BOOLEAN jiA_VECTOR_L(leftv l, leftv r)
Definition ipassign.cc:1613
static BOOLEAN iiAssign_sys(leftv l, leftv r)
Definition ipassign.cc:1513
static BOOLEAN jiAssign_rec(leftv l, leftv r)
Definition ipassign.cc:2074
static BOOLEAN jiAssign_1(leftv l, leftv r, int rt, BOOLEAN toplevel, BOOLEAN is_qring=FALSE)
Definition ipassign.cc:1330
static BOOLEAN jjA_L_LIST(leftv l, leftv r)
Definition ipassign.cc:1654
static BOOLEAN jiA_STRING_L(leftv l, leftv r)
Definition ipassign.cc:1966
static BOOLEAN jjA_L_BIGINTMAT(leftv l, leftv r, bigintmat *bim)
Definition ipassign.cc:1768
static BOOLEAN jiAssign_list(leftv l, leftv r)
Definition ipassign.cc:2002
static BOOLEAN jjA_L_STRING(leftv l, leftv r)
Definition ipassign.cc:1856
static BOOLEAN jiA_INTVEC_L(leftv l, leftv r)
Definition ipassign.cc:1587
static BOOLEAN jjA_L_INTVEC(leftv l, leftv r, intvec *iv)
Definition ipassign.cc:1719
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition ipconv.cc:450
void ipMoveId(idhdl tomove)
Definition ipid.cc:704
#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:300
#define pNormalize(p)
Definition polys.h:318
void PrintS(const char *s)
Definition reporter.cc:284
#define TRACE_ASSIGN
Definition reporter.h:46
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define loop
Definition structs.h:71
VAR omBin sSubexpr_bin
Definition subexpr.cc:40
@ VPRINTLEVEL
Definition tok.h:217
@ CMATRIX_CMD
Definition tok.h:46
@ VECHO
Definition tok.h:210
#define NONE
Definition tok.h:223

◆ iiAssignCR()

BOOLEAN iiAssignCR ( leftv  r,
leftv  arg 
)

Definition at line 6504 of file ipshell.cc.

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

◆ iiBranchTo()

BOOLEAN iiBranchTo ( leftv  r,
leftv  args 
)

Definition at line 1273 of file ipshell.cc.

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

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

◆ iiCheckPack()

void iiCheckPack ( package p)

Definition at line 1621 of file ipshell.cc.

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

◆ iiCheckRing()

BOOLEAN iiCheckRing ( int  i)

Definition at line 1577 of file ipshell.cc.

1578{
1579 if (currRing==NULL)
1580 {
1581 #ifdef SIQ
1582 if (siq<=0)
1583 {
1584 #endif
1585 if (RingDependend(i))
1586 {
1587 WerrorS("no ring active (9)");
1588 return TRUE;
1589 }
1590 #ifdef SIQ
1591 }
1592 #endif
1593 }
1594 return FALSE;
1595}
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:6545
#define ANY_TYPE
Definition tok.h:30

◆ iiConvName()

char * iiConvName ( const char libname)

Definition at line 1439 of file iplib.cc.

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

◆ iiDebug()

void iiDebug ( )

Definition at line 1065 of file ipshell.cc.

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

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

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

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

◆ iiExport() [2/2]

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

Definition at line 1525 of file ipshell.cc.

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

◆ iiExprArith1()

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

◆ iiExprArith1Tab()

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

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

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

Definition at line 9200 of file iparith.cc.

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

◆ iiExprArith2()

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

◆ iiExprArith2Tab()

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

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

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

Definition at line 9127 of file iparith.cc.

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

◆ iiExprArith3()

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

Definition at line 9540 of file iparith.cc.

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

◆ iiExprArith3Tab()

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

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

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

Definition at line 9592 of file iparith.cc.

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

◆ iiExprArithM()

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

◆ iiGetLibName()

static char * iiGetLibName ( const procinfov  pi)
inlinestatic

find the library of an proc

Definition at line 66 of file ipshell.h.

66{ return pi->libname; }

◆ iiGetLibProcBuffer()

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

◆ iiGetLibStatus()

BOOLEAN iiGetLibStatus ( const char lib)

Definition at line 77 of file iplib.cc.

78{
79 idhdl hl;
80
81 char *plib = iiConvName(lib);
82 hl = basePack->idroot->get(plib,0);
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 1597 of file ipshell.cc.

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

◆ iiInternalExport()

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

Definition at line 1456 of file ipshell.cc.

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

◆ iiLibCmd()

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

Definition at line 894 of file iplib.cc.

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

◆ iiLoadLIB()

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

Definition at line 983 of file iplib.cc.

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

◆ iiLocateLib()

BOOLEAN iiLocateLib ( const char lib,
char where 
)

Definition at line 880 of file iplib.cc.

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

◆ iiMake_proc()

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

Definition at line 513 of file iplib.cc.

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

◆ iiMakeResolv()

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

Definition at line 846 of file ipshell.cc.

848{
849 lists L=liMakeResolv(r,length,rlen,typ0,weights);
850 int i=0;
851 idhdl h;
852 size_t len=strlen(name)+5;
853 char * s=(char *)omAlloc(len);
854
855 while (i<=L->nr)
856 {
857 snprintf(s,len,"%s(%d)",name,i+1);
858 if (i==0)
859 h=enterid(s,myynest,typ0,&(currRing->idroot), FALSE);
860 else
862 if (h!=NULL)
863 {
864 h->data.uideal=(ideal)L->m[i].data;
865 h->attribute=L->m[i].attribute;
866 if (BVERBOSE(V_DEF_RES))
867 Print("//defining: %s as %d-th syzygy module\n",s,i+1);
868 }
869 else
870 {
871 idDelete((ideal *)&(L->m[i].data));
872 Warn("cannot define %s",s);
873 }
874 //L->m[i].data=NULL;
875 //L->m[i].rtyp=0;
876 //L->m[i].attribute=NULL;
877 i++;
878 }
879 omFreeSize((ADDRESS)L->m,(L->nr+1)*sizeof(sleftv));
882}
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=NULL;
738 if (IDELEMS(id)>0) degs=(long*)omAlloc(IDELEMS(id)*sizeof(long));
739 for(int i=IDELEMS(id)-1;i>=0;i--)
740 {
741 poly p=id->m[i];
743 else degs[i]=0;
744 }
745 for(int j=IDELEMS(theMap)-1;j>=0 && !overflow;j--)
746 {
747 if (theMap->m[j]!=NULL)
748 {
750
751 for(int i=IDELEMS(id)-1;i>=0;i--)
752 {
753 poly p=id->m[i];
754 if ((p!=NULL) && (degs[i]!=0) &&
755 ((unsigned long)deg_monexp > (currRing->bitmask / ((unsigned long)degs[i])/2)))
756 {
757 overflow=TRUE;
758 break;
759 }
760 }
761 }
762 }
763 if (degs!=NULL) omFreeSize(degs,IDELEMS(id)*sizeof(long));
764 }
765 else if (tmpW.rtyp==POLY_CMD)
766 {
767 for(int j=IDELEMS(theMap)-1;j>=0 && !overflow;j--)
768 {
769 if (theMap->m[j]!=NULL)
770 {
772 poly p=(poly)tmpW.data;
773 long deg=0;
774 if ((p!=NULL) && ((deg=p_Totaldegree(p,src_ring))!=0) &&
775 ((unsigned long)deg_monexp > (currRing->bitmask / ((unsigned long)deg)/2)))
776 {
777 overflow=TRUE;
778 break;
779 }
780 }
781 }
782 }
783 if (overflow)
784#ifdef HAVE_SHIFTBBA
785 // in Letterplace rings the exponent is always 0 or 1! ignore this warning.
786 if (!rIsLPRing(currRing))
787 {
788#endif
789 Warn("possible OVERFLOW in map, max exponent is %ld",currRing->bitmask/2);
790#ifdef HAVE_SHIFTBBA
791 }
792#endif
793#if 0
794 if (((tmpW.rtyp==IDEAL_CMD)||(tmpW.rtyp==MODUL_CMD)) && idIs0(IDIDEAL(w)))
795 {
796 v->rtyp=tmpW.rtyp;
797 v->data=idInit(IDELEMS(IDIDEAL(w)),IDIDEAL(w)->rank);
798 }
799 else
800#endif
801 {
802 if ((tmpW.rtyp==IDEAL_CMD)
803 ||(tmpW.rtyp==MODUL_CMD)
804 ||(tmpW.rtyp==MATRIX_CMD)
805 ||(tmpW.rtyp==MAP_CMD))
806 {
807 v->rtyp=tmpW.rtyp;
808 char *tmp = theMap->preimage;
809 theMap->preimage=(char*)1L;
810 // map gets 1 as its rank (as an ideal)
812 theMap->preimage=tmp; // map gets its preimage back
813 }
814 if (v->data==NULL) /*i.e. not IDEAL_CMD/MODUL_CMD/MATRIX_CMD/MAP */
815 {
817 {
818 Werror("cannot map %s(%d)",Tok2Cmdname(w->typ),w->typ);
820 if (save_r!=NULL) IDMAP(w)->preimage=save_r;
821 return NULL;
822 }
823 }
824 }
825 if (save_r!=NULL)
826 {
827 IDMAP(w)->preimage=save_r;
828 IDMAP((idhdl)v)->preimage=omStrDup(save_r);
829 v->rtyp=MAP_CMD;
830 }
831 return v;
832 }
833 else
834 {
835 Werror("%s undefined in %s",what,theMap->preimage);
836 }
837 }
838 else
839 {
840 Werror("cannot find preimage %s",theMap->preimage);
841 }
842 return NULL;
843}
int typ
Definition idrec.h:43
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:701
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
const CanonicalForm & w
Definition facAbsFact.cc:51
ideal maMapIdeal(const ideal map_id, const ring preimage_r, const ideal image_id, const ring image_r, const nMapFunc nMap)
polynomial map for ideals/module/matrix map_id: the ideal to map map_r: the base ring for map_id imag...
Definition gen_maps.cc:88
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN maApplyFetch(int what, map theMap, leftv res, leftv w, ring preimage_r, int *perm, int *par_perm, int P, nMapFunc nMap)
Definition maps_ip.cc:45
#define omReallocSize(addr, o_size, size)
poly p_One(const ring r)
Definition p_polys.cc:1314
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition p_polys.h:490
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1523
static long pTotaldegree(poly p)
Definition polys.h:283
poly * polyset
Definition polys.h:260
static BOOLEAN rIsLPRing(const ring r)
Definition ring.h:417
#define IDELEMS(i)

◆ iiOpsTwoChar()

int iiOpsTwoChar ( const char s)

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

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

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

◆ iiRegularity()

int iiRegularity ( lists  L)

Definition at line 1037 of file ipshell.cc.

1038{
1039 int len,reg,typ0;
1040
1041 resolvente r=liFindRes(L,&len,&typ0);
1042
1043 if (r==NULL)
1044 return -2;
1045 intvec *weights=NULL;
1046 int add_row_shift=0;
1047 intvec *ww=(intvec *)atGet(&(L->m[0]),"isHomog",INTVEC_CMD);
1048 if (ww!=NULL)
1049 {
1050 weights=ivCopy(ww);
1051 add_row_shift = ww->min_in();
1052 (*weights) -= add_row_shift;
1053 }
1054 //Print("attr:%x\n",weights);
1055
1056 intvec *dummy=syBetti(r,len,&reg,weights);
1057 if (weights!=NULL) delete weights;
1058 delete dummy;
1059 omFreeSize((ADDRESS)r,len*sizeof(ideal));
1060 return reg+1+add_row_shift;
1061}
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:146
resolvente liFindRes(lists L, int *len, int *typ0, intvec ***weights)
Definition lists.cc:338
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition syz.cc:783

◆ iiSetReturn()

void iiSetReturn ( const leftv  h)

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

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

◆ iiTokType()

int iiTokType ( int  op)

Definition at line 229 of file iparith.cc.

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

◆ iiTryLoadLib()

BOOLEAN iiTryLoadLib ( leftv  v,
const char id 
)

Definition at line 832 of file iplib.cc.

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

◆ iiTwoOps()

const char * iiTwoOps ( int  t)

Definition at line 258 of file gentable.cc.

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

◆ iiWRITE()

BOOLEAN iiWRITE ( leftv  res,
leftv  exprlist 
)

Definition at line 586 of file ipshell.cc.

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

◆ IsCmd()

int IsCmd ( const char n,
int tok 
)

Definition at line 9738 of file iparith.cc.

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

◆ jjBETTI()

BOOLEAN jjBETTI ( leftv  res,
leftv  v 
)

Definition at line 967 of file ipshell.cc.

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

◆ jjBETTI2()

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

Definition at line 1001 of file ipshell.cc.

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

◆ jjBETTI2_ID()

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

Definition at line 980 of file ipshell.cc.

981{
983 l->Init(1);
984 l->m[0].rtyp=u->Typ();
985 l->m[0].data=u->Data();
986 attr *a=u->Attribute();
987 if (a!=NULL)
988 l->m[0].attribute=*a;
989 sleftv tmp2;
990 tmp2.Init();
991 tmp2.rtyp=LIST_CMD;
992 tmp2.data=(void *)l;
994 l->m[0].data=NULL;
995 l->m[0].attribute=NULL;
996 l->m[0].rtyp=DEF_CMD;
997 l->Clean();
998 return r;
999}
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 3339 of file ipshell.cc.

3340{
3342 return (res->data==NULL);
3343}
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:414
#define assume(x)
Definition mod2.h:389
ip_package * package
Definition structs.h:39

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv  res,
leftv  v 
)

Definition at line 8216 of file iparith.cc.

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

◆ jjLOAD()

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

load lib/module given in v

Definition at line 5567 of file iparith.cc.

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

◆ jjLOAD_TRY()

BOOLEAN jjLOAD_TRY ( const char s)

Definition at line 5643 of file iparith.cc.

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

◆ jjMINRES()

BOOLEAN jjMINRES ( leftv  res,
leftv  v 
)

Definition at line 946 of file ipshell.cc.

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

3333{
3334 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(),
3335 (poly)w->CopyD(), currRing);
3336 return errorreported;
3337}
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:1980
#define NUM
Definition readcf.cc:180
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
ring rCopy(ring r)
Definition ring.cc:1736
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define A
Definition sirandom.c:24
VAR omBin fractionObjectBin
Definition transext.cc:89

◆ jjSYSTEM()

BOOLEAN jjSYSTEM ( leftv  res,
leftv  v 
)

Definition at line 231 of file extra.cc.

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

◆ jjVARIABLES_ID()

BOOLEAN jjVARIABLES_ID ( leftv  res,
leftv  u 
)

Definition at line 6307 of file ipshell.cc.

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

◆ jjVARIABLES_P()

BOOLEAN jjVARIABLES_P ( leftv  res,
leftv  u 
)

Definition at line 6299 of file ipshell.cc.

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

◆ 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:484
BOOLEAN killlocals_list(int v, lists L)
Definition ipshell.cc:366
STATIC_VAR BOOLEAN iiNoKeepRing
Definition ipshell.cc:84
void killlocals_rec(idhdl *root, int v, ring r)
Definition ipshell.cc:330
static void killlocals0(int v, idhdl *localhdl, const ring r)
Definition ipshell.cc:295

◆ kQHWeight()

BOOLEAN kQHWeight ( leftv  res,
leftv  v 
)

Definition at line 3315 of file ipshell.cc.

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

◆ kWeight()

BOOLEAN kWeight ( leftv  res,
leftv  id 
)

Definition at line 3287 of file ipshell.cc.

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

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

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

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

◆ mpKoszul()

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

Definition at line 3076 of file ipshell.cc.

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

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

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

◆ nuMPResMat()

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

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

Definition at line 4647 of file ipshell.cc.

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

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

◆ nuVanderSys()

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

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

Definition at line 4813 of file ipshell.cc.

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

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

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

◆ rDecompose()

lists rDecompose ( const ring  r)

Definition at line 2143 of file ipshell.cc.

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

◆ rDecompose_CF()

BOOLEAN rDecompose_CF ( leftv  res,
const coeffs  C 
)

Definition at line 1933 of file ipshell.cc.

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

◆ rDecompose_list_cf()

lists rDecompose_list_cf ( const ring  r)

Definition at line 2104 of file ipshell.cc.

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

◆ rDefault()

idhdl rDefault ( const char s)

Definition at line 1635 of file ipshell.cc.

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

◆ rFindHdl()

idhdl rFindHdl ( ring  r,
idhdl  n 
)

Definition at line 1691 of file ipshell.cc.

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

◆ rInit()

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

Definition at line 5617 of file ipshell.cc.

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

◆ rKill() [1/2]

void rKill ( idhdl  h)

Definition at line 6215 of file ipshell.cc.

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

◆ rKill() [2/2]

void rKill ( ring  r)

Definition at line 6170 of file ipshell.cc.

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

◆ rSetHdl()

void rSetHdl ( idhdl  h)

Definition at line 5118 of file ipshell.cc.

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

◆ scIndIndset()

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

Definition at line 1103 of file ipshell.cc.

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

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

◆ semicProc3()

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

Definition at line 4503 of file ipshell.cc.

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

◆ setOption()

BOOLEAN setOption ( leftv  res,
leftv  v 
)

Definition at line 570 of file misc_ip.cc.

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

◆ showOption()

char * showOption ( )

Definition at line 711 of file misc_ip.cc.

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

◆ singular_example()

void singular_example ( char str)

Definition at line 431 of file misc_ip.cc.

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

◆ singular_system()

leftv singular_system ( sleftv  h)

◆ spaddProc()

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

Definition at line 4420 of file ipshell.cc.

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

◆ spectrumfProc()

BOOLEAN spectrumfProc ( leftv  result,
leftv  first 
)

Definition at line 4176 of file ipshell.cc.

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

◆ spectrumProc()

BOOLEAN spectrumProc ( leftv  result,
leftv  first 
)

Definition at line 4125 of file ipshell.cc.

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

◆ spmulProc()

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

Definition at line 4462 of file ipshell.cc.

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

◆ syBetti1()

BOOLEAN syBetti1 ( leftv  res,
leftv  u 
)

Definition at line 3156 of file ipshell.cc.

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

◆ syBetti2()

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

Definition at line 3132 of file ipshell.cc.

3133{
3135
3136 BOOLEAN minim=(int)(long)w->Data();
3137 int row_shift=0;
3138 int add_row_shift=0;
3139 intvec *weights=NULL;
3140 intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3141 if (ww!=NULL)
3142 {
3143 weights=ivCopy(ww);
3144 add_row_shift = ww->min_in();
3145 (*weights) -= add_row_shift;
3146 }
3147
3148 res->data=(void *)syBettiOfComputation(syzstr,minim,&row_shift,weights);
3149 if (ww!=NULL) delete weights;
3150 //row_shift += add_row_shift;
3151 //Print("row_shift=%d, add_row_shift=%d\n",row_shift,add_row_shift);
3152 atSet(res,omStrDup("rowShift"),(void*)(long)add_row_shift,INT_CMD);
3153
3154 return FALSE;
3155}
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 3240 of file ipshell.cc.

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

◆ syConvRes()

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

Definition at line 3168 of file ipshell.cc.

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

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

◆ type_cmd()

void type_cmd ( leftv  v)

Definition at line 254 of file ipshell.cc.

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

◆ versionString()

char * versionString ( )

Definition at line 772 of file misc_ip.cc.

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

Variable Documentation

◆ currid

const char* currid
extern

Definition at line 171 of file grammar.cc.

◆ dArith1

const struct sValCmd1 dArith1[]
extern

Definition at line 38 of file table.h.

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

◆ dArith2

const struct sValCmd2 dArith2[]
extern

Definition at line 325 of file table.h.

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

◆ dArith3

const struct sValCmd3 dArith3[]
extern

Definition at line 801 of file table.h.

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

◆ dArithM

const struct sValCmdM dArithM[]
extern

Definition at line 937 of file table.h.

938{
939// operations:
940// proc cmd res number_of_args context
942,{D(jjRING_PL), '[', RING_CMD, -2 , ALLOW_NC |ALLOW_RING}
948#ifdef SINGULAR_4_2
951#endif
958//,{D(jjEXPORTTO_M), EXPORTTO_CMD, NONE, -2 , ALLOW_NC |ALLOW_RING}
959,{D(jjCALL2ARG), FETCH_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
960,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_PLURAL |ALLOW_RING}
961,{D(jjFETCH_M), FETCH_CMD, ANY_TYPE/*or set by p*/,4 , ALLOW_PLURAL |ALLOW_RING}
962,{D(jjCALL1ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,1 , ALLOW_NC |ALLOW_RING}
963,{D(jjCALL2ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,2 , ALLOW_NC |ALLOW_RING}
964,{D(jjCALL3ARG), HILBERT_CMD, ANY_TYPE/*or set by p*/,3 , ALLOW_NC |ALLOW_RING}
972,{D(jjCALL2ARG), JET_CMD, POLY_CMD,/*or set by p*/ 2 , ALLOW_PLURAL |ALLOW_RING}
973,{D(jjCALL3ARG), JET_CMD, POLY_CMD,/*or set by p*/ 3 , ALLOW_PLURAL |ALLOW_RING}
974,{D(jjJET4), JET_CMD, POLY_CMD,/*or set by p*/ 4 , ALLOW_PLURAL |ALLOW_RING}
996,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING}
997,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING}
998,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_NC |ALLOW_RING}
999,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING}
1000,{D(jjREDUCE5), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 5, ALLOW_PLURAL |ALLOW_RING}
1003//,{D(jjCALL1ARG), RESERVEDNAMELIST_CMD, LIST_CMD, 1 , ALLOW_NC |ALLOW_RING}
1006,{D(jjCALL3ARG), SUBST_CMD, NONE/*set by p*/, 3 , ALLOW_NC |ALLOW_RING}
1007,{D(jjSUBST_M), SUBST_CMD, NONE/*set by p*/, -2 , ALLOW_NC |ALLOW_RING}
1008,{D(jjSYSTEM), SYSTEM_CMD, NONE/*or set by p*/,-2 , ALLOW_NC |ALLOW_RING}
1016,{D(jjCALL1ARG), STD_CMD, IDEAL_CMD/* or set by p*/,1 , ALLOW_NC |ALLOW_RING}
1022,{NULL_VAL, 0, 0, 0 , NO_NC |NO_RING}
1023};
BOOLEAN jjSYSTEM(leftv res, leftv args)
Definition extra.cc:231
static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
Definition iparith.cc:8490
static BOOLEAN jjOPTION_PL(leftv res, leftv v)
Definition iparith.cc:8339
static BOOLEAN jjREDUCE5(leftv res, leftv u)
Definition iparith.cc:8420
static BOOLEAN jjLU_SOLVE(leftv res, leftv v)
Definition iparith.cc:7785
static BOOLEAN jjFactModD_M(leftv res, leftv v)
Definition iparith.cc:8623
static BOOLEAN jjRESERVED0(leftv, leftv)
Definition iparith.cc:8468
static BOOLEAN jjLIFT_4(leftv res, leftv U)
Definition iparith.cc:8095
static BOOLEAN jjBREAK1(leftv, leftv v)
Definition iparith.cc:7305
static BOOLEAN jjBREAK0(leftv, leftv)
Definition iparith.cc:7298
static BOOLEAN jjCOEF_M(leftv, leftv v)
Definition iparith.cc:7346
static BOOLEAN jjMINOR_M(leftv res, leftv v)
Definition iparith.cc:6365
static BOOLEAN jjINTERSECT_PL(leftv res, leftv v)
Definition iparith.cc:7630
static BOOLEAN jjBIGINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7898
static BOOLEAN jjRING_PL(leftv res, leftv a)
Definition iparith.cc:8913
static BOOLEAN jjREDUCE4(leftv res, leftv u)
Definition iparith.cc:8349
static BOOLEAN jjTEST(leftv, leftv v)
Definition iparith.cc:8604
static BOOLEAN jjDIVISION4(leftv res, leftv v)
Definition iparith.cc:7363
static BOOLEAN jjSTD_HILB_WP(leftv res, leftv INPUT)
Definition iparith.cc:8830
static BOOLEAN jjLIFTSTD_M(leftv res, leftv U)
Definition iparith.cc:8126
static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Definition iparith.cc:8570
static BOOLEAN jjCALL3ARG(leftv res, leftv u)
Definition iparith.cc:7334
static BOOLEAN jjINTVEC_PL(leftv res, leftv v)
Definition iparith.cc:7866
static BOOLEAN jjMODULO4(leftv res, leftv u)
Definition iparith.cc:8267
static BOOLEAN jjLU_INVERSE(leftv res, leftv v)
Definition iparith.cc:7704
static BOOLEAN jjQRDS(leftv res, leftv INPUT)
Definition iparith.cc:8813
static BOOLEAN jjFETCH_M(leftv res, leftv u)
Definition iparith.cc:7505
static BOOLEAN jjNAMES0(leftv res, leftv)
Definition iparith.cc:8334
static BOOLEAN jjJET4(leftv res, leftv u)
Definition iparith.cc:7959
static BOOLEAN jjSTATUS_M(leftv res, leftv v)
Definition iparith.cc:8755
static BOOLEAN jjCALL1ARG(leftv res, leftv v)
Definition iparith.cc:7322
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8216
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7326
static BOOLEAN jjKLAMMER_PL(leftv res, leftv u)
Definition iparith.cc:8042
static BOOLEAN jjSUBST_M(leftv res, leftv u)
Definition iparith.cc:8786
static BOOLEAN jjIDEAL_PL(leftv res, leftv v)
Definition iparith.cc:7462
BOOLEAN jjDBPRINT(leftv res, leftv u)
Definition ipprint.cc:318
BOOLEAN iiBranchTo(leftv, leftv args)
Definition ipshell.cc:1273
BOOLEAN iiWRITE(leftv, leftv v)
Definition ipshell.cc:586
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
Definition ipshell.cc:4561
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:4914
@ 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.