Loading...
Searching...
No Matches
iparith.cc File Reference
`#include "kernel/mod2.h"`
`#include "factory/factory.h"`
`#include "coeffs/bigintmat.h"`
`#include "coeffs/coeffs.h"`
`#include "coeffs/numbers.h"`
`#include "misc/options.h"`
`#include "misc/intvec.h"`
`#include "misc/sirandom.h"`
`#include "misc/prime.h"`
`#include "polys/matpol.h"`
`#include "polys/monomials/maps.h"`
`#include "polys/sparsmat.h"`
`#include "polys/weight.h"`
`#include "polys/ext_fields/transext.h"`
`#include "polys/clapsing.h"`
`#include "polys/flintconv.h"`
`#include "kernel/combinatorics/stairc.h"`
`#include "kernel/combinatorics/hilb.h"`
`#include "kernel/linear_algebra/interpolation.h"`
`#include "kernel/linear_algebra/linearAlgebra.h"`
`#include "kernel/linear_algebra/MinorInterface.h"`
`#include "kernel/GBEngine/kChinese.h"`
`#include "kernel/spectrum/GMPrat.h"`
`#include "kernel/groebner_walk/walkProc.h"`
`#include "kernel/oswrapper/timer.h"`
`#include "kernel/fglm/fglm.h"`
`#include "kernel/GBEngine/kstdfac.h"`
`#include "kernel/GBEngine/syz.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include "kernel/GBEngine/units.h"`
`#include "kernel/GBEngine/tgb.h"`
`#include "kernel/preimage.h"`
`#include "kernel/polys.h"`
`#include "kernel/ideals.h"`
`#include "Singular/mod_lib.h"`
`#include "Singular/fevoices.h"`
`#include "Singular/tok.h"`
`#include "Singular/ipid.h"`
`#include "Singular/sdb.h"`
`#include "Singular/subexpr.h"`
`#include "Singular/lists.h"`
`#include "Singular/maps_ip.h"`
`#include "Singular/feOpt.h"`
`#include "Singular/ipconv.h"`
`#include "Singular/ipprint.h"`
`#include "Singular/attrib.h"`
`#include "Singular/links/silink.h"`
`#include "Singular/misc_ip.h"`
`#include "Singular/linearAlgebra_ip.h"`
`#include "Singular/number2.h"`
`#include "Singular/htable.h"`
`#include "Singular/fglm.h"`
`#include "Singular/blackbox.h"`
`#include "Singular/newstruct.h"`
`#include "Singular/ipshell.h"`
`#include "reporter/si_signals.h"`
`#include <ctype.h>`
`#include "kernel/GBEngine/ratgring.h"`
`#include "kernel/GBEngine/nc.h"`
`#include "polys/nc/nc.h"`
`#include "polys/nc/sca.h"`
`#include "table.h"`
`#include "iparith.inc"`

Go to the source code of this file.

## Data Structures

struct | sValCmdTab
struct | cmdnames
struct | sValCmd1
struct | sValCmd2
struct | sValCmd3
struct | sValCmdM
struct | SArithBase

## Macros

#define | NC_MASK (3+64)
#define | RING_MASK 4
#define | ZERODIVISOR_MASK 8
#define | ALLOW_PLURAL 1
#define | NO_NC 0
#define | COMM_PLURAL 2
#define | ALLOW_RING 4
#define | NO_RING 0
#define | NO_ZERODIVISOR 8
#define | ALLOW_ZERODIVISOR 0
#define | ALLOW_LP 64
#define | NO_LRING 128
#define | ALLOW_NC ALLOW_LP|ALLOW_PLURAL
#define | ALLOW_ZZ (ALLOW_RING|NO_ZERODIVISOR)
#define | WARN_RING 16
#define | NO_CONVERSION 32
#define | bit31 SIZEOF_LONG*8-1
#define | ii_div_by_0 "div. by 0"
#define | SIMPL_NORMALIZE 64
#define | SIMPL_LMDIV 32
#define | SIMPL_LMEQ 16
#define | SIMPL_MULT 8
#define | SIMPL_EQU 4
#define | SIMPL_NULL 2
#define | SIMPL_NORM 1
#define | D(A)
#define | NULL_VAL NULL
#define | IPARITH

## Typedefs

typedef sValCmdTab | jjValCmdTab[]
typedef BOOLEAN(* | proc2) (leftv, leftv, leftv)
typedef BOOLEAN(* | proc3) (leftv, leftv, leftv, leftv)
typedef char | si_char_2[2]

## Functions

static BOOLEAN | check_valid (const int p, const int op)
static int | _gentable_sort_cmds (const void *a, const void *b)
| compares to entry of cmdsname-list
int | iiArithRemoveCmd (char *szName)
int | iiArithAddCmd (const char *szName, short nAlias, short nTokval, short nToktype, short nPos=-1)
static int | iiTabIndex (const jjValCmdTab dArithTab, const int len, const int op)
static Subexpr | jjMakeSub (leftv e)
static int | iin_Int (number &n, coeffs cf)
int | iiTokType (int op)
static BOOLEAN | jjOP_BIM_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_I_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_BIM_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_BI_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_IV_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_I_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_IM_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_I_IM (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOLON (leftv res, leftv u, leftv v)
static BOOLEAN | jjDOTDOT (leftv res, leftv u, leftv v)
static void | jjEQUAL_REST (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_IV_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_MA (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOMPARE_S (leftv res, leftv u, leftv v)
static BOOLEAN | jjOP_REST (leftv res, leftv u, leftv v)
static BOOLEAN | jjPOWER_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjPOWER_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjPOWER_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjPOWER_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjPOWER_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUSMINUS_Gen (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOLCOL (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_V (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_B (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_B_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_MA (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_SM (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_MA_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_P_MA (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_S (leftv res, leftv u, leftv v)
static BOOLEAN | jjPLUS_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_V (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_B_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_B (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_MA (leftv res, leftv u, leftv v)
static BOOLEAN | jjMINUS_SM (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_BIM (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_BI1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_BI2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_P1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_P2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_N1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_N2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_I1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA_I2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_MA (leftv res, leftv u, leftv v)
static BOOLEAN | jjTIMES_SM (leftv res, leftv u, leftv v)
static BOOLEAN | jjGE_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjGE_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjGE_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjGT_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjGT_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjGT_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjLE_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjLE_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjLE_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjLT_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjLT_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjLT_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIVMOD_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIV_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIV_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIV_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIV_Ma (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_Ma (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_SM (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_R (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjEQUAL_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjAND_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjOR_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_PBu (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_P_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_V (leftv res, leftv u, leftv v)
static BOOLEAN | jjINDEX_V_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjKLAMMER_rest (leftv res, leftv u, leftv v)
static BOOLEAN | jjKLAMMER (leftv res, leftv u, leftv v)
static BOOLEAN | jjKLAMMER_IV (leftv res, leftv u, leftv v)
BOOLEAN | jjPROC (leftv res, leftv u, leftv v)
static BOOLEAN | jjMAP (leftv res, leftv u, leftv v)
static BOOLEAN | jjRING_1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjCHINREM_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjALIGN_V (leftv res, leftv u, leftv v)
static BOOLEAN | jjALIGN_M (leftv res, leftv u, leftv v)
static BOOLEAN | jjCHINREM_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOEF (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOEF_Id (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOEFFS_Id (leftv res, leftv u, leftv v)
static BOOLEAN | jjCOEFFS2_KB (leftv res, leftv u, leftv v)
static BOOLEAN | jjCONTRACT (leftv res, leftv u, leftv v)
static BOOLEAN | jjDEG_M_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjDEG_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjDelete_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjDelete_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjDelete_ID_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjDET2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjDET2_S (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIFF_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIFF_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIFF_ID_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjDIM2 (leftv res, leftv v, leftv w)
static BOOLEAN | jjDIVISION (leftv res, leftv u, leftv v)
static BOOLEAN | jjELIMIN (leftv res, leftv u, leftv v)
static BOOLEAN | jjELIMIN_IV (leftv res, leftv u, leftv v)
static BOOLEAN | jjEXPORTTO (leftv, leftv u, leftv v)
static BOOLEAN | jjERROR (leftv, leftv u)
static BOOLEAN | jjEXTGCD_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjEXTGCD_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjEXTGCD_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjFAC_P2 (leftv res, leftv u, leftv dummy)
static BOOLEAN | jjFACSTD2 (leftv res, leftv v, leftv w)
static BOOLEAN | jjFAREY_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjFAREY_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjFAREY_LI (leftv res, leftv u, leftv v)
static BOOLEAN | jjFETCH (leftv res, leftv u, leftv v)
static BOOLEAN | jjFIND2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjFRES3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjFRES (leftv res, leftv u, leftv v)
static BOOLEAN | jjFWALK (leftv res, leftv u, leftv v)
static BOOLEAN | jjGCD_I (leftv res, leftv u, leftv v)
static BOOLEAN | jjGCD_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjGCD_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjGCD_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjHILBERT2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjHOMOG_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjHOMOG_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjHOMOG1_W (leftv res, leftv v, leftv u)
static BOOLEAN | jjHOMOG1_WI (leftv res, leftv v, leftv u)
static BOOLEAN | jjINDEPSET2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjINTERSECT (leftv res, leftv u, leftv v)
static BOOLEAN | jjINTERPOLATION (leftv res, leftv l, leftv v)
static BOOLEAN | jjJanetBasis2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjJanetBasis (leftv res, leftv v)
static BOOLEAN | jjJET_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjJET_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjKBASE2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjPREIMAGE (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjKERNEL (leftv res, leftv u, leftv v)
static BOOLEAN | jjKoszul (leftv res, leftv u, leftv v)
static BOOLEAN | jjKoszul_Id (leftv res, leftv u, leftv v)
static BOOLEAN | jjLIFT (leftv res, leftv u, leftv v)
static BOOLEAN | jjLIFTSTD (leftv res, leftv u, leftv v)
static BOOLEAN | jjLOAD2 (leftv, leftv, leftv v)
static BOOLEAN | jjLOAD_E (leftv, leftv v, leftv u)
static BOOLEAN | jjMODULO (leftv res, leftv u, leftv v)
static BOOLEAN | jjMOD_BI (leftv res, leftv u, leftv v)
static BOOLEAN | jjMOD_N (leftv res, leftv u, leftv v)
static BOOLEAN | jjMOD_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjMONITOR2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjMONITOR1 (leftv res, leftv v)
static BOOLEAN | jjMONOM (leftv res, leftv v)
static BOOLEAN | jjNEWSTRUCT2 (leftv, leftv u, leftv v)
static BOOLEAN | jjPARSTR2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjPlural_num_poly (leftv res, leftv a, leftv b)
static BOOLEAN | jjPlural_num_mat (leftv res, leftv a, leftv b)
static BOOLEAN | jjPlural_mat_poly (leftv res, leftv a, leftv b)
static BOOLEAN | jjPlural_mat_mat (leftv res, leftv a, leftv b)
static BOOLEAN | jjBRACKET (leftv res, leftv a, leftv b)
static BOOLEAN | jjBRACKET_REC (leftv res, leftv a, leftv b, leftv c)
static BOOLEAN | jjOPPOSE (leftv res, leftv a, leftv b)
static BOOLEAN | jjPRUNE_MAP (leftv res, leftv v, leftv ma)
static BOOLEAN | jjQUOT (leftv res, leftv u, leftv v)
static BOOLEAN | jjRANDOM (leftv res, leftv u, leftv v)
static BOOLEAN | jjRANK2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjREAD2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjREDUCE_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjREDUCE_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjRES (leftv res, leftv u, leftv v)
static BOOLEAN | jjPFAC2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjRMINUS (leftv res, leftv u, leftv v)
static BOOLEAN | jjRPLUS (leftv res, leftv u, leftv v)
static BOOLEAN | jjRSUM (leftv res, leftv u, leftv v)
static BOOLEAN | jjSIMPL_ID (leftv res, leftv u, leftv v)
static BOOLEAN | jjSQR_FREE2 (leftv res, leftv u, leftv dummy)
static BOOLEAN | jjSTATUS2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjSTATUS2L (leftv res, leftv u, leftv v)
static BOOLEAN | jjSIMPL_P (leftv res, leftv u, leftv v)
static BOOLEAN | jjSTD_HILB (leftv res, leftv u, leftv v)
static BOOLEAN | jjSTD_1 (leftv res, leftv u, leftv v)
static BOOLEAN | jjSYZ_2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjTENSOR (leftv res, leftv u, leftv v)
static BOOLEAN | jjTENSOR_Ma (leftv res, leftv u, leftv v)
static BOOLEAN | jjVARSTR2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjWAIT1ST2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjWAITALL2 (leftv res, leftv u, leftv v)
static BOOLEAN | jjWEDGE (leftv res, leftv u, leftv v)
static BOOLEAN | jjWRONG (leftv, leftv)
static BOOLEAN | jjWRONG2 (leftv, leftv, leftv)
static BOOLEAN | jjWRONG3 (leftv, leftv, leftv, leftv)
static BOOLEAN | jjDUMMY (leftv res, leftv u)
static BOOLEAN | jjNULL (leftv, leftv)
static BOOLEAN | jjPLUSPLUS (leftv, leftv u)
static BOOLEAN | jjUMINUS_BI (leftv res, leftv u)
static BOOLEAN | jjUMINUS_I (leftv res, leftv u)
static BOOLEAN | jjUMINUS_N (leftv res, leftv u)
static BOOLEAN | jjUMINUS_P (leftv res, leftv u)
static BOOLEAN | jjUMINUS_MA (leftv res, leftv u)
static BOOLEAN | jjUMINUS_IV (leftv res, leftv u)
static BOOLEAN | jjUMINUS_BIM (leftv res, leftv u)
static BOOLEAN | jjSetRing (leftv, leftv u)
static BOOLEAN | jjPROC1 (leftv res, leftv u)
static BOOLEAN | jjBAREISS (leftv res, leftv v)
static BOOLEAN | jjBAREISS_BIM (leftv res, leftv v)
static BOOLEAN | jjBI2N (leftv res, leftv u)
static BOOLEAN | jjBI2IM (leftv res, leftv u)
static BOOLEAN | jjBI2P (leftv res, leftv u)
static BOOLEAN | jjCALL1MANY (leftv res, leftv u)
static BOOLEAN | jjCHAR (leftv res, leftv v)
static BOOLEAN | jjCOEFFS1 (leftv res, leftv v)
static BOOLEAN | jjCOLS (leftv res, leftv v)
static BOOLEAN | jjCOLS_BIM (leftv res, leftv v)
static BOOLEAN | jjCOLS_IV (leftv res, leftv v)
static BOOLEAN | jjCONTENT (leftv res, leftv v)
static BOOLEAN | jjCOUNT_BI (leftv res, leftv v)
static BOOLEAN | jjCOUNT_BIM (leftv res, leftv v)
static BOOLEAN | jjCOUNT_N (leftv res, leftv v)
static BOOLEAN | jjCOUNT_L (leftv res, leftv v)
static BOOLEAN | jjCOUNT_M (leftv res, leftv v)
static BOOLEAN | jjCOUNT_IV (leftv res, leftv v)
static BOOLEAN | jjCOUNT_RG (leftv res, leftv v)
static BOOLEAN | jjDEG (leftv res, leftv v)
static BOOLEAN | jjDEG_M (leftv res, leftv u)
static BOOLEAN | jjDEGREE (leftv res, leftv v)
static BOOLEAN | jjDEFINED (leftv res, leftv v)
static BOOLEAN | jjDENOMINATOR (leftv res, leftv v)
| Return the denominator of the input number.
static BOOLEAN | jjNUMERATOR (leftv res, leftv v)
| Return the numerator of the input number.
static BOOLEAN | jjDET (leftv res, leftv v)
static BOOLEAN | jjDET_BI (leftv res, leftv v)
static BOOLEAN | jjDET_I (leftv res, leftv v)
static BOOLEAN | jjDET_S (leftv res, leftv v)
static BOOLEAN | jjDIM (leftv res, leftv v)
static BOOLEAN | jjDUMP (leftv, leftv v)
static BOOLEAN | jjE (leftv res, leftv v)
static BOOLEAN | jjEXECUTE (leftv, leftv v)
static BOOLEAN | jjFACSTD (leftv res, leftv v)
static BOOLEAN | jjFAC_P (leftv res, leftv u)
static BOOLEAN | jjGETDUMP (leftv, leftv v)
static BOOLEAN | jjHIGHCORNER (leftv res, leftv v)
static BOOLEAN | jjHIGHCORNER_M (leftv res, leftv v)
static BOOLEAN | jjHILBERT (leftv, leftv v)
static BOOLEAN | jjHILBERT_IV (leftv res, leftv v)
static BOOLEAN | jjHOMOG1 (leftv res, leftv v)
static BOOLEAN | jjidMaxIdeal (leftv res, leftv v)
static BOOLEAN | jjIDEAL_Ma (leftv res, leftv v)
static BOOLEAN | jjIDEAL_Map (leftv res, leftv v)
static BOOLEAN | jjIDEAL_R (leftv res, leftv v)
static BOOLEAN | jjIm2Iv (leftv res, leftv v)
static BOOLEAN | jjIMPART (leftv res, leftv v)
static BOOLEAN | jjINDEPSET (leftv res, leftv v)
static BOOLEAN | jjINTERRED (leftv res, leftv v)
static BOOLEAN | jjBIV2IV (leftv res, leftv v)
static BOOLEAN | jjIS_RINGVAR_P (leftv res, leftv v)
static BOOLEAN | jjIS_RINGVAR_S (leftv res, leftv v)
static BOOLEAN | jjIS_RINGVAR0 (leftv res, leftv)
static BOOLEAN | jjJACOB_P (leftv res, leftv v)
static BOOLEAN | jjDIFF_COEF (leftv res, leftv u, leftv v)
static BOOLEAN | jjJACOB_M (leftv res, leftv a)
static BOOLEAN | jjKERNEL_M (leftv res, leftv v)
static BOOLEAN | jjKERNEL_SM (leftv res, leftv v)
static BOOLEAN | jjKBASE (leftv res, leftv v)
static BOOLEAN | jjL2R (leftv res, leftv v)
static BOOLEAN | jjLEADCOEF (leftv res, leftv v)
static BOOLEAN | jjLEADEXP (leftv res, leftv v)
static BOOLEAN | jjLEADMONOM (leftv res, leftv v)
static BOOLEAN | jjLOAD1 (leftv, leftv v)
static BOOLEAN | jjLISTRING (leftv res, leftv v)
static BOOLEAN | jjPFAC1 (leftv res, leftv v)
static BOOLEAN | jjLagSolve (leftv res, leftv v)
static BOOLEAN | jjLU_DECOMP (leftv res, leftv v)
static BOOLEAN | jjMEMORY (leftv res, leftv v)
static BOOLEAN | jjMSTD (leftv res, leftv v)
static BOOLEAN | jjMULT (leftv res, leftv v)
static BOOLEAN | jjMINRES_R (leftv res, leftv v)
static BOOLEAN | jjN2BI (leftv res, leftv v)
static BOOLEAN | jjNAMEOF (leftv res, leftv v)
static BOOLEAN | jjNAMES (leftv res, leftv v)
static BOOLEAN | jjNAMES_I (leftv res, leftv v)
static BOOLEAN | jjNOT (leftv res, leftv v)
static BOOLEAN | jjNVARS (leftv res, leftv v)
static BOOLEAN | jjOpenClose (leftv, leftv v)
static BOOLEAN | jjORD (leftv res, leftv v)
static BOOLEAN | jjPAR1 (leftv res, leftv v)
static BOOLEAN | jjPARDEG (leftv res, leftv v)
static BOOLEAN | jjPARSTR1 (leftv res, leftv v)
static BOOLEAN | jjP2BI (leftv res, leftv v)
static BOOLEAN | jjP2I (leftv res, leftv v)
static BOOLEAN | jjPREIMAGE_R (leftv res, leftv v)
static BOOLEAN | jjPRIME (leftv res, leftv v)
static BOOLEAN | jjPRUNE (leftv res, leftv v)
static BOOLEAN | jjP2N (leftv res, leftv v)
static BOOLEAN | jjRESERVEDNAME (leftv res, leftv v)
static BOOLEAN | jjRANK1 (leftv res, leftv v)
static BOOLEAN | jjREAD (leftv res, leftv v)
static BOOLEAN | jjREGULARITY (leftv res, leftv v)
static BOOLEAN | jjREPART (leftv res, leftv v)
static BOOLEAN | jjRINGLIST (leftv res, leftv v)
static BOOLEAN | jjRINGLIST_C (leftv res, leftv v)
static BOOLEAN | jjRING_LIST (leftv res, leftv v)
static BOOLEAN | jjROWS (leftv res, leftv v)
static BOOLEAN | jjROWS_BIM (leftv res, leftv v)
static BOOLEAN | jjROWS_IV (leftv res, leftv v)
static BOOLEAN | jjRPAR (leftv res, leftv v)
static BOOLEAN | jjS2I (leftv res, leftv v)
static BOOLEAN | jjSLIM_GB (leftv res, leftv u)
static BOOLEAN | jjSBA (leftv res, leftv v)
static BOOLEAN | jjSBA_1 (leftv res, leftv v, leftv u)
static BOOLEAN | jjSBA_2 (leftv res, leftv v, leftv u, leftv t)
static BOOLEAN | jjSTD (leftv res, leftv v)
static BOOLEAN | jjSort_Id (leftv res, leftv v)
static BOOLEAN | jjSQR_FREE (leftv res, leftv u)
static BOOLEAN | jjSYZYGY (leftv res, leftv v)
static BOOLEAN | jjTRACE_IV (leftv res, leftv v)
static BOOLEAN | jjTRANSP_BIM (leftv res, leftv v)
static BOOLEAN | jjTRANSP_IV (leftv res, leftv v)
static BOOLEAN | jjOPPOSITE (leftv res, leftv a)
static BOOLEAN | jjENVELOPE (leftv res, leftv a)
static BOOLEAN | jjTWOSTD (leftv res, leftv a)
static BOOLEAN | jjRIGHTSTD (leftv res, leftv v)
static BOOLEAN | jjTYPEOF (leftv res, leftv v)
static BOOLEAN | jjUNIVARIATE (leftv res, leftv v)
static BOOLEAN | jjVAR1 (leftv res, leftv v)
static BOOLEAN | jjVARSTR1 (leftv res, leftv v)
static BOOLEAN | jjVDIM (leftv res, leftv v)
BOOLEAN | jjWAIT1ST1 (leftv res, leftv u)
BOOLEAN | jjWAITALL1 (leftv res, leftv u)
BOOLEAN | jjLOAD (const char *s, BOOLEAN autoexport)
| load lib/module given in v
static void | WerrorS_dummy (const char *)
BOOLEAN | jjLOAD_TRY (const char *s)
static BOOLEAN | jjstrlen (leftv res, leftv v)
static BOOLEAN | jjpLength (leftv res, leftv v)
static BOOLEAN | jjidElem (leftv res, leftv v)
static BOOLEAN | jjidFreeModule (leftv res, leftv v)
static BOOLEAN | jjidVec2Ideal (leftv res, leftv v)
static BOOLEAN | jjrCharStr (leftv res, leftv v)
static BOOLEAN | jjpHead (leftv res, leftv v)
static BOOLEAN | jjidHead (leftv res, leftv v)
static BOOLEAN | jjidMinBase (leftv res, leftv v)
static BOOLEAN | jjpMaxComp (leftv res, leftv v)
static BOOLEAN | jjmpTrace (leftv res, leftv v)
static BOOLEAN | jjmpTransp (leftv res, leftv v)
static BOOLEAN | jjrOrdStr (leftv res, leftv v)
static BOOLEAN | jjrVarStr (leftv res, leftv v)
static BOOLEAN | jjrParStr (leftv res, leftv v)
static BOOLEAN | jjCOUNT_RES (leftv res, leftv v)
static BOOLEAN | jjDIM_R (leftv res, leftv v)
static BOOLEAN | jjidTransp (leftv res, leftv v)
static BOOLEAN | jjnInt (leftv res, leftv u)
static BOOLEAN | jjnlInt (leftv res, leftv u)
static BOOLEAN | jjBRACK_S (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Im (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Bim (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Ma (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_SM (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Ma_I_IV (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Ma_IV_I (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBRACK_Ma_IV_IV (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjPROC3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjRING_2 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBAREISS3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjCOEFFS3_Id (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjCOEFFS3_KB (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjCOEFFS3_P (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjELIMIN_ALG (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjELIMIN_HILB (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjFIND3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjFWALK3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjHILBERT3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjHILBERT3Qt (leftv, leftv u, leftv v, leftv w)
static BOOLEAN | jjHOMOG_ID_W (leftv res, leftv u, leftv v, leftv)
static BOOLEAN | jjHOMOG_P_W (leftv res, leftv u, leftv v, leftv)
static BOOLEAN | jjHOMOG_W_M (leftv res, leftv v1, leftv v2, leftv v3)
static BOOLEAN | jjINTMAT3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjINTERSECT3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjINTERSEC3S (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjJET_P_IV (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjJET_P_P (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjJET_ID_IV (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjJET_ID_M (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMINOR_M (leftv res, leftv v)
static BOOLEAN | jjMRES_MAP (leftv res, leftv u, leftv v, leftv ma)
static BOOLEAN | jjNEWSTRUCT3 (leftv, leftv u, leftv v, leftv w)
static BOOLEAN | jjRANDOM_Im (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSUBST_Test (leftv v, leftv w, int &ringvar, poly &monomexpr)
static BOOLEAN | jjSUBST_Bu (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSUBST_P (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSUBST_Id (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSUBST_Id_X (leftv res, leftv u, leftv v, leftv w, int input_type)
static BOOLEAN | jjSUBST_Id_I (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSUBST_Id_N (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMATRIX_Id (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMATRIX_Mo (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMATRIX_Ma (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMODULO3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjMODULO3S (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSMATRIX_Mo (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjLIFT3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjLIFTSTD_SYZ (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjLIFTSTD_ALG (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjREDUCE3_CP (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjREDUCE3_CID (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjREDUCE3_P (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjREDUCE3_ID (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjRES3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjRING3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSTATUS3 (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjSTD_HILB_W (leftv res, leftv u, leftv v, leftv w)
static BOOLEAN | jjBREAK0 (leftv, leftv)
static BOOLEAN | jjBREAK1 (leftv, leftv v)
static BOOLEAN | jjCALL1ARG (leftv res, leftv v)
static BOOLEAN | jjCALL2ARG (leftv res, leftv u)
static BOOLEAN | jjCALL3ARG (leftv res, leftv u)
static BOOLEAN | jjCOEF_M (leftv, leftv v)
static BOOLEAN | jjDIVISION4 (leftv res, leftv v)
static BOOLEAN | jjIDEAL_PL (leftv res, leftv v)
static BOOLEAN | jjFETCH_M (leftv res, leftv u)
static BOOLEAN | jjINTERSECT_PL (leftv res, leftv v)
static BOOLEAN | jjLU_INVERSE (leftv res, leftv v)
static BOOLEAN | jjLU_SOLVE (leftv res, leftv v)
static BOOLEAN | jjINTVEC_PL (leftv res, leftv v)
static BOOLEAN | jjBIGINTVEC_PL (leftv res, leftv v)
static BOOLEAN | jjJET4 (leftv res, leftv u)
static BOOLEAN | jjKLAMMER_PL (leftv res, leftv u)
static BOOLEAN | jjLIFT_4 (leftv res, leftv U)
static BOOLEAN | jjLIFTSTD_M (leftv res, leftv U)
BOOLEAN | jjLIST_PL (leftv res, leftv v)
static BOOLEAN | jjMODULO4 (leftv res, leftv u)
static BOOLEAN | jjNAMES0 (leftv res, leftv)
static BOOLEAN | jjOPTION_PL (leftv res, leftv v)
static BOOLEAN | jjREDUCE4 (leftv res, leftv u)
static BOOLEAN | jjREDUCE5 (leftv res, leftv u)
static BOOLEAN | jjRESERVED0 (leftv, leftv)
static BOOLEAN | jjRESERVEDLIST0 (leftv res, leftv)
static BOOLEAN | jjSTRING_PL (leftv res, leftv v)
static BOOLEAN | jjTEST (leftv, leftv v)
static BOOLEAN | jjFactModD_M (leftv res, leftv v)
static BOOLEAN | jjSTATUS_M (leftv res, leftv v)
static BOOLEAN | jjSUBST_M (leftv res, leftv u)
static BOOLEAN | jjQRDS (leftv res, leftv INPUT)
static BOOLEAN | jjSTD_HILB_WP (leftv res, leftv INPUT)
static BOOLEAN | jjRING_PL (leftv res, leftv a)
static BOOLEAN | jjRESTART (leftv, leftv u)
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)
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 | iiExprArith2 (leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
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 | iiExprArith1 (leftv res, leftv a, int op)
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)
BOOLEAN | iiExprArith3 (leftv res, int op, leftv a, leftv b, leftv c)
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 | iiExprArithM (leftv res, leftv a, int op)
int | IsCmd (const char *n, int &tok)
const char * | Tok2Cmdname (int tok)
int | iiInitArithmetic ()
| initialisation of arithmetic structured data
int | iiArithFindCmd (const char *szName)
char * | iiArithGetCmd (int nPos)
int | iiArithRemoveCmd (const char *szName)
static int | jjCOMPARE_ALL (const void *aa, const void *bb)
BOOLEAN | jjSORTLIST (leftv, leftv arg)
BOOLEAN | jjUNIQLIST (leftv, leftv arg)

## Variables

long | all_farey =0L
long | farey_cnt =0L
STATIC_VAR SArithBase | sArithBase
| Base entry for arithmetic.
EXTERN_VAR int | cmdtok
EXTERN_VAR BOOLEAN | expected_parms
VAR int | iiOp
EXTERN_VAR int | singclap_factorize_retry
STATIC_VAR int | WerrorS_dummy_cnt =0
STATIC_VAR si_char_2 | Tok2Cmdname_buf =" "

## Data Structure Documentation

## sValCmdTab

struct sValCmdTab

Definition at line 124 of file iparith.cc.

Data Fields
short | cmd |
short | start |

## _scmdnames

struct _scmdnames

Definition at line 56 of file gentable.cc.

Data Fields
short | alias |
const char * | name |
char * | name |
short | toktype |
short | tokval |

## 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 |

## SArithBase

struct SArithBase

Definition at line 181 of file iparith.cc.

Data Fields
unsigned | nCmdAllocated | number of commands-slots allocated
unsigned | nCmdUsed | number of commands used
unsigned | nLastIdentifier | valid identifiers are slot 1..nLastIdentifier
struct sValCmd1 * | psValCmd1 |
struct sValCmd2 * | psValCmd2 |
struct sValCmd3 * | psValCmd3 |
struct sValCmdM * | psValCmdM |
cmdnames * | sCmds | array of existing commands

## Macro Definition Documentation

## ALLOW_LP

#define ALLOW_LP 64

Definition at line 107 of file iparith.cc.

## ALLOW_NC

#define ALLOW_NC ALLOW_LP|ALLOW_PLURAL

Definition at line 109 of file iparith.cc.

## ALLOW_PLURAL

#define ALLOW_PLURAL 1

Definition at line 100 of file iparith.cc.

## ALLOW_RING

#define ALLOW_RING 4

Definition at line 103 of file iparith.cc.

## ALLOW_ZERODIVISOR

#define ALLOW_ZERODIVISOR 0

Definition at line 106 of file iparith.cc.

## ALLOW_ZZ

#define ALLOW_ZZ (ALLOW_RING|NO_ZERODIVISOR)

Definition at line 111 of file iparith.cc.

## bit31

#define bit31 SIZEOF_LONG*8-1

Definition at line 121 of file iparith.cc.

## COMM_PLURAL

#define COMM_PLURAL 2

Definition at line 102 of file iparith.cc.

## D

#define D | ( |  | A | ) |

Value:
(A)
A
#define A
Definition sirandom.c:24

Definition at line 8992 of file iparith.cc.

## ii_div_by_0

#define ii_div_by_0 "div. by 0"

Definition at line 217 of file iparith.cc.

## IPARITH

#define IPARITH

Definition at line 8994 of file iparith.cc.

## NC_MASK

#define NC_MASK (3+64)

Definition at line 93 of file iparith.cc.

## NO_CONVERSION

#define NO_CONVERSION 32

Definition at line 117 of file iparith.cc.

## NO_LRING

#define NO_LRING 128

Definition at line 108 of file iparith.cc.

## NO_NC

#define NO_NC 0

Definition at line 101 of file iparith.cc.

## NO_RING

#define NO_RING 0

Definition at line 104 of file iparith.cc.

## NO_ZERODIVISOR

#define NO_ZERODIVISOR 8

Definition at line 105 of file iparith.cc.

## NULL_VAL

#define NULL_VAL NULL

Definition at line 8993 of file iparith.cc.

## RING_MASK

#define RING_MASK 4

Definition at line 98 of file iparith.cc.

## SIMPL_EQU

#define SIMPL_EQU 4

Definition at line 3354 of file iparith.cc.

## SIMPL_LMDIV

#define SIMPL_LMDIV 32

Definition at line 3351 of file iparith.cc.

## SIMPL_LMEQ

#define SIMPL_LMEQ 16

Definition at line 3352 of file iparith.cc.

## SIMPL_MULT

#define SIMPL_MULT 8

Definition at line 3353 of file iparith.cc.

## SIMPL_NORM

#define SIMPL_NORM 1

Definition at line 3356 of file iparith.cc.

## SIMPL_NORMALIZE

#define SIMPL_NORMALIZE 64

Definition at line 3350 of file iparith.cc.

## SIMPL_NULL

#define SIMPL_NULL 2

Definition at line 3355 of file iparith.cc.

## WARN_RING

#define WARN_RING 16

Definition at line 115 of file iparith.cc.

## ZERODIVISOR_MASK

#define ZERODIVISOR_MASK 8

Definition at line 99 of file iparith.cc.

## Typedef Documentation

## jjValCmdTab

typedef sValCmdTab jjValCmdTab[]

Definition at line 130 of file iparith.cc.

## proc2

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

Definition at line 150 of file iparith.cc.

## proc3

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

Definition at line 161 of file iparith.cc.

## si_char_2

typedef char si_char_2[2]

Definition at line 9895 of file iparith.cc.

## Function Documentation

## _gentable_sort_cmds()

int _gentable_sort_cmds | ( | const void * | a,
|  | const void * | b )

static

compares to entry of cmdsname-list

Parameters

  [in] | a |
  [in] | b |

Returns
  <ReturnValue>

Definition at line 9951 of file iparith.cc.

{
cmdnames *pCmdL = (cmdnames*)a;
cmdnames *pCmdR = (cmdnames*)b;
if(a==NULL || b==NULL) return 0;
/* empty entries goes to the end of the list for later reuse */
if(pCmdL->name==NULL) return 1;
if(pCmdR->name==NULL) return -1;
/* $INVALID$ must come first */
if(strcmp(pCmdL->name, "$INVALID$")==0) return -1;
if(strcmp(pCmdR->name, "$INVALID$")==0) return 1;
/* tokval=-1 are reserved names at the end */
if (pCmdL->tokval==-1)
{
if (pCmdR->tokval==-1)
return strcmp(pCmdL->name, pCmdR->name);
/* pCmdL->tokval==-1, pCmdL goes at the end */
return 1;
}
/* pCmdR->tokval==-1, pCmdR goes at the end */
if(pCmdR->tokval==-1) return -1;
return strcmp(pCmdL->name, pCmdR->name);
}
b
CanonicalForm b
Definition cfModGcd.cc:4111
NULL
#define NULL
Definition omList.c:12

## check_valid()

BOOLEAN check_valid | ( | const int | p,
|  | const int | op )

static

Definition at line 10177 of file iparith.cc.

{
if (rIsPluralRing(currRing))
{
if ((p & NC_MASK)==NO_NC)
{
WerrorS("not implemented for non-commutative rings");
return TRUE;
}
else if ((p & NC_MASK)==COMM_PLURAL)
{
Warn("assume commutative subalgebra for cmd `%s` in >>%s<<",Tok2Cmdname(op),my_yylinebuf);
return FALSE;
}
/* else, ALLOW_PLURAL */
}
else if (rIsLPRing(currRing))
{
if ((p & ALLOW_LP)==0)
{
Werror("`%s` not implemented for letterplace rings in >>%s<<",Tok2Cmdname(op),my_yylinebuf);
return TRUE;
}
}
if (rField_is_Ring(currRing))
{
if ((p & RING_MASK)==0 /*NO_RING*/)
{
WerrorS("not implemented for rings with rings as coeffients");
return TRUE;
}
if (((p & NO_LRING)==NO_LRING) && rHasLocalOrMixedOrdering(currRing))
{
WerrorS("not implemented for rings with rings as coeffients and non-global orderings");
return TRUE;
}
/* else ALLOW_RING */
else if (((p & ZERODIVISOR_MASK)==NO_ZERODIVISOR)
&&(!rField_is_Domain(currRing)))
{
WerrorS("domain required as coeffients");
return TRUE;
}
/* else ALLOW_ZERODIVISOR */
else if(((p & WARN_RING)==WARN_RING)&&(myynest==0))
{
WarnS("considering the image in Q[...]");
}
}
return FALSE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
p
int p
Definition cfModGcd.cc:4086
Warn
#define Warn
Definition emacs.cc:77
WarnS
#define WarnS
Definition emacs.cc:78
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
my_yylinebuf
VAR char my_yylinebuf[80]
Definition febase.cc:44
myynest
VAR int myynest
Definition febase.cc:41
COMM_PLURAL
#define COMM_PLURAL
Definition gentable.cc:31
NO_ZERODIVISOR
#define NO_ZERODIVISOR
Definition gentable.cc:42
NO_LRING
#define NO_LRING
Definition gentable.cc:54
ALLOW_LP
#define ALLOW_LP
Definition gentable.cc:33
RING_MASK
#define RING_MASK
Definition gentable.cc:20
WARN_RING
#define WARN_RING
Definition gentable.cc:49
NC_MASK
#define NC_MASK
Definition gentable.cc:34
NO_NC
#define NO_NC
Definition gentable.cc:29
ZERODIVISOR_MASK
#define ZERODIVISOR_MASK
Definition gentable.cc:21
Tok2Cmdname
const char * Tok2Cmdname(int tok)
Definition iparith.cc:9897
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189
rHasLocalOrMixedOrdering
static BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:769
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
rField_is_Domain
static BOOLEAN rField_is_Domain(const ring r)
Definition ring.h:493
rIsLPRing
static BOOLEAN rIsLPRing(const ring r)
Definition ring.h:417
rField_is_Ring
#define rField_is_Ring(R)
Definition ring.h:491

## iiArithAddCmd()

int iiArithAddCmd | ( | const char * | szName,
|  | short | nAlias,
|  | short | nTokval,
|  | short | nToktype,
|  | short | nPos = -1 )

extern

Definition at line 10118 of file iparith.cc.

{
//printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
// nTokval, nToktype, nPos);
if(nPos>=0)
{
// no checks: we rely on a correct generated code in iparith.inc
assume((unsigned)nPos < sArithBase.nCmdAllocated);
assume(szName!=NULL);
sArithBase.sCmds[nPos].name = omStrDup(szName);
sArithBase.sCmds[nPos].alias = nAlias;
sArithBase.sCmds[nPos].tokval = nTokval;
sArithBase.sCmds[nPos].toktype = nToktype;
sArithBase.nCmdUsed++;
//if(nTokval>0) sArithBase.nLastIdentifier++;
}
else
{
if(szName==NULL) return -1;
int nIndex = iiArithFindCmd(szName);
if(nIndex>=0)
{
Print("'%s' already exists at %d\n", szName, nIndex);
return -1;
}
if(sArithBase.nCmdUsed>=sArithBase.nCmdAllocated)
{
/* needs to create new slots */
unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
if(sArithBase.sCmds==NULL) return -1;
sArithBase.nCmdAllocated++;
}
/* still free slots available */
sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
sArithBase.nCmdUsed++;
qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
(&_gentable_sort_cmds));
for(sArithBase.nLastIdentifier=sArithBase.nCmdUsed-1;
sArithBase.nLastIdentifier>0; sArithBase.nLastIdentifier--)
{
if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
}
//Print("L=%d\n", sArithBase.nLastIdentifier);
}
return 0;
}
Print
#define Print
Definition emacs.cc:80
_gentable_sort_cmds
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition gentable.cc:191
iiArithFindCmd
int iiArithFindCmd(const char *szName)
Definition iparith.cc:10023
sArithBase
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
Definition iparith.cc:198
assume
#define assume(x)
Definition mod2.h:389
nSize
#define nSize(n)
Definition numbers.h:39
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omRealloc
#define omRealloc(addr, size)
Definition omAllocDecl.h:225

## iiArithFindCmd()

int iiArithFindCmd | ( | const char * | szName | ) |

Definition at line 10023 of file iparith.cc.

{
int an=0;
int i = 0,v = 0;
int en=sArithBase.nLastIdentifier;
loop
//for(an=0; an<sArithBase.nCmdUsed; )
{
if(an>=en-1)
{
if (strcmp(szName, sArithBase.sCmds[an].name) == 0)
{
//Print("RET-an=%d %s\n", an, sArithBase.sCmds[an].name);
return an;
}
else if (strcmp(szName, sArithBase.sCmds[en].name) == 0)
{
//Print("RET-en=%d %s\n", en, sArithBase.sCmds[en].name);
return en;
}
else
{
//Print("RET- 1\n");
return -1;
}
}
i=(an+en)/2;
if (*szName < *(sArithBase.sCmds[i].name))
{
en=i-1;
}
else if (*szName > *(sArithBase.sCmds[i].name))
{
an=i+1;
}
else
{
v=strcmp(szName,sArithBase.sCmds[i].name);
if(v<0)
{
en=i-1;
}
else if(v>0)
{
an=i+1;
}
else /*v==0*/
{
//Print("RET-i=%d %s\n", i, sArithBase.sCmds[i].name);
return i;
}
}
}
//if(i>=0 && i<sArithBase.nCmdUsed)
// return i;
//PrintS("RET-2\n");
return -2;
}
i
int i
Definition cfEzgcd.cc:132
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
loop
#define loop
Definition structs.h:71

## iiArithGetCmd()

char * iiArithGetCmd | ( | int | nPos | ) |

Definition at line 10083 of file iparith.cc.

{
if(nPos<0) return NULL;
if(nPos<(int)sArithBase.nCmdUsed)
return sArithBase.sCmds[nPos].name;
return NULL;
}

## iiArithRemoveCmd() [1/2]

int iiArithRemoveCmd | ( | char * | szName | ) |

extern

## iiArithRemoveCmd() [2/2]

int iiArithRemoveCmd | ( | const char * | szName | ) |

Definition at line 10091 of file iparith.cc.

{
int nIndex;
if(szName==NULL) return -1;
nIndex = iiArithFindCmd(szName);
if(nIndex<0 || nIndex>=(int)sArithBase.nCmdUsed)
{
Print("'%s' not found (%d)\n", szName, nIndex);
return -1;
}
omFreeBinAddr(sArithBase.sCmds[nIndex].name);
sArithBase.sCmds[nIndex].name=NULL;
qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
(&_gentable_sort_cmds));
sArithBase.nCmdUsed--;
/* fix last-identifier */
for(sArithBase.nLastIdentifier=sArithBase.nCmdUsed-1;
sArithBase.nLastIdentifier>0; sArithBase.nLastIdentifier--)
{
if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
}
//Print("L=%d\n", sArithBase.nLastIdentifier);
return 0;
}
omFreeBinAddr
#define omFreeBinAddr(addr)
Definition omAllocDecl.h:258

## iiExprArith1()

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

Definition at line 9365 of file iparith.cc.

{
if (!errorreported)
{
res->Init();
#ifdef SIQ
if (siq>0)
{
//Print("siq:%d\n",siq);
command d=(command)omAlloc0Bin(sip_command_bin);
memcpy(&d->arg1,a,sizeof(sleftv));
a->Init();
d->op=op;
d->argc=1;
res->data=(char *)d;
res->rtyp=COMMAND;
return FALSE;
}
#endif
int at=a->Typ();
// handling bb-objects ----------------------------------------------------
if(op>MAX_TOK) // explicit type conversion to bb
{
blackbox *bb=getBlackboxStuff(op);
if (bb!=NULL)
{
res->rtyp=op;
res->data=bb->blackbox_Init(bb);
return bb->blackbox_Assign(res,a);
}
else
return TRUE;
}
else if (at>MAX_TOK) // argument is of bb-type
{
blackbox *bb=getBlackboxStuff(at);
if (bb!=NULL)
{
if(!bb->blackbox_Op1(op,res,a)) return FALSE;
// if not defined, try generic routines (attrib, defined,..)
}
else
return TRUE;
}
if (errorreported) return TRUE;
int i=iiTabIndex(dArithTab1,JJTAB1LEN,op);
return iiExprArith1Tab(res,a,op, dArith1+i,at,dConvertTypes);
}
a->CleanUp();
return TRUE;
}
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
sleftv
Class used for (list of) interpreter objects.
Definition subexpr.h:83
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Init
void Init()
Definition subexpr.h:107
sleftv::CleanUp
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
res
CanonicalForm res
Definition facAbsFact.cc:60
errorreported
VAR short errorreported
Definition feFopen.cc:23
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
Definition iparith.cc:9235
iiTabIndex
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition iparith.cc:9872
dConvertTypes
const struct sConvertTypes dConvertTypes[]
Definition table.h:1321
sip_command_bin
VAR omBin sip_command_bin
Definition ipid.cc:45
command
ip_command * command
Definition ipid.h:23
dArith1
const struct sValCmd1 dArith1[]
Definition table.h:38
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition omAllocDecl.h:206
siq
VAR BOOLEAN siq
Definition subexpr.cc:48
MAX_TOK
@ MAX_TOK
Definition tok.h:220
COMMAND
#define COMMAND
Definition tok.h:29

## 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] | res | pre-allocated result
  [in] | a | argument
  [in] | op | operation
  [in] | dA1 | table of possible proc assumes dArith1[0].cmd==op
  [in] | at | a->Typ()
  [in] | dConvertTypes | table of type conversions

Definition at line 9235 of file iparith.cc.

{
res->Init();
BOOLEAN call_failed=FALSE;
if (!errorreported)
{
BOOLEAN failed=FALSE;
iiOp=op;
int i = 0;
while (dA1[i].cmd==op)
{
if (at==dA1[i].arg)
{
if (currRing!=NULL)
{
if (check_valid(dA1[i].valid_for,op)) break;
}
else
{
if (RingDependend(dA1[i].res))
{
WerrorS("no ring active (5)");
break;
}
}
if (traceit&TRACE_CALL)
Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
res->rtyp=dA1[i].res;
if ((call_failed=dA1[i].p(res,a)))
{
break;// leave loop, goto error handling
}
if (a->Next()!=NULL)
{
res->next=(leftv)omAllocBin(sleftv_bin);
failed=iiExprArith1(res->next,a->next,op);
}
a->CleanUp();
return failed;
}
i++;
}
// implicite type conversion --------------------------------------------
if (dA1[i].cmd!=op)
{
leftv an = (leftv)omAlloc0Bin(sleftv_bin);
i=0;
//Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
while (dA1[i].cmd==op)
{
int ai;
//Print("test %s\n",Tok2Cmdname(dA1[i].arg));
if ((dA1[i].valid_for & NO_CONVERSION)==0)
{
if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
{
if (currRing!=NULL)
{
if (check_valid(dA1[i].valid_for,op)) break;
}
else
{
if (RingDependend(dA1[i].res))
{
WerrorS("no ring active (6)");
break;
}
}
if (traceit&TRACE_CALL)
Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
res->rtyp=dA1[i].res;
failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
|| (call_failed=dA1[i].p(res,an)));
// everything done, clean up temp. variables
if (failed)
{
// leave loop, goto error handling
break;
}
else
{
if (an->Next() != NULL)
{
res->next = (leftv)omAllocBin(sleftv_bin);
failed=iiExprArith1(res->next,an->next,op);
}
// everything ok, clean up and return
an->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
return failed;
}
}
}
i++;
}
an->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
}
// error handling
if (!errorreported)
{
if ((at==0) && (a->Fullname()!=sNoName_fe))
{
Werror("`%s` is not defined",a->Fullname());
}
else
{
i=0;
const char *s = iiTwoOps(op);
Werror("%s(`%s`) failed"
,s,Tok2Cmdname(at));
if ((!call_failed) && BVERBOSE(V_SHOW_USE))
{
while (dA1[i].cmd==op)
{
if ((dA1[i].res!=0)
&& (dA1[i].p!=jjWRONG))
Werror("expected %s(`%s`)"
,s,Tok2Cmdname(dA1[i].arg));
i++;
}
}
}
}
res->rtyp = UNKNOWN;
}
a->CleanUp();
return TRUE;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
sleftv::next
leftv next
Definition subexpr.h:86
sleftv::Next
leftv Next()
Definition subexpr.h:136
sleftv::Fullname
const char * Fullname()
Definition subexpr.h:125
s
const CanonicalForm int s
Definition facAbsFact.cc:51
sNoName_fe
const char sNoName_fe[]
Definition fevoices.cc:57
NO_CONVERSION
#define NO_CONVERSION
Definition gentable.cc:51
iiTestConvert
int iiTestConvert(int inputType, int outputType)
Definition gentable.cc:298
iiTwoOps
const char * iiTwoOps(int t)
Definition gentable.cc:258
jjWRONG
#define jjWRONG
Definition gentable.cc:124
RingDependend
static int RingDependend(int t)
Definition gentable.cc:23
iiExprArith1
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition iparith.cc:9365
check_valid
static BOOLEAN check_valid(const int p, const int op)
Definition iparith.cc:10177
iiOp
VAR int iiOp
Definition iparith.cc:219
iiConvert
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition ipconv.cc:450
sleftv_bin
EXTERN_VAR omBin sleftv_bin
Definition ipid.h:145
sValCmd1::p
int p
Definition gentable.cc:77
sValCmd1::res
short res
Definition gentable.cc:79
omAllocBin
#define omAllocBin(bin)
Definition omAllocDecl.h:205
omFreeBin
#define omFreeBin(addr, bin)
Definition omAllocDecl.h:259
BVERBOSE
#define BVERBOSE(a)
Definition options.h:35
V_SHOW_USE
#define V_SHOW_USE
Definition options.h:52
traceit
EXTERN_VAR int traceit
Definition reporter.h:24
TRACE_CALL
#define TRACE_CALL
Definition reporter.h:44
leftv
sleftv * leftv
Definition structs.h:53
UNKNOWN
#define UNKNOWN
Definition tok.h:224

## iiExprArith2()

BOOLEAN iiExprArith2 | ( | leftv | res,
|  | leftv | a,
|  | int | op,
|  | leftv | b,
|  | BOOLEAN | proccall )

Definition at line 9176 of file iparith.cc.

{
res->Init();
if (!errorreported)
{
#ifdef SIQ
if (siq>0)
{
//Print("siq:%d\n",siq);
command d=(command)omAlloc0Bin(sip_command_bin);
memcpy(&d->arg1,a,sizeof(sleftv));
a->Init();
memcpy(&d->arg2,b,sizeof(sleftv));
b->Init();
d->argc=2;
d->op=op;
res->data=(char *)d;
res->rtyp=COMMAND;
return FALSE;
}
#endif
int at=a->Typ();
int bt=b->Typ();
// handling bb-objects ----------------------------------------------------
if (at>MAX_TOK)
{
blackbox *bb=getBlackboxStuff(at);
if (bb!=NULL)
{
if(!bb->blackbox_Op2(op,res,a,b)) return FALSE;
// if not defined, try generic (attrib, ..)
}
else
return TRUE;
}
else if ((bt>MAX_TOK)&&(op!='('))
{
blackbox *bb=getBlackboxStuff(bt);
if (bb!=NULL)
{
if(!bb->blackbox_Op2(op,res,a,b)) return FALSE;
// if not defined, try generic (attrib, ..)
}
else
return TRUE;
}
int i=iiTabIndex(dArithTab2,JJTAB2LEN,op);
return iiExprArith2TabIntern(res,a,op,b,proccall,dArith2+i,at,bt,dConvertTypes);
}
a->CleanUp();
b->CleanUp();
return TRUE;
}
iiExprArith2TabIntern
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:9003
dArith2
const struct sValCmd2 dArith2[]
Definition table.h:325

## 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] | res | pre-allocated result
  [in] | a | 2 arguments
  [in] | op | operation
  [in] | dA2 | table of possible proc assumes dA2[0].cmd==op
  [in] | at | a->Typ()
  [in] | dConvertTypes | table of type conversions

Definition at line 9162 of file iparith.cc.

{
res->Init();
leftv b=a->next;
a->next=NULL;
int bt=b->Typ();
BOOLEAN bo=iiExprArith2TabIntern(res,a,op,b,TRUE,dA2,at,bt,dConvertTypes);
a->next=b;
a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
return bo;
}

## iiExprArith2TabIntern()

BOOLEAN iiExprArith2TabIntern | ( | leftv | res,
|  | leftv | a,
|  | int | op,
|  | leftv | b,
|  | BOOLEAN | proccall,
|  | const struct sValCmd2 * | dA2,
|  | int | at,
|  | int | bt,
|  | const struct sConvertTypes * | dConvertTypes )

static

Definition at line 9003 of file iparith.cc.

{
BOOLEAN call_failed=FALSE;
if (!errorreported)
{
int i=0;
iiOp=op;
while (dA2[i].cmd==op)
{
if ((at==dA2[i].arg1)
&& (bt==dA2[i].arg2))
{
res->rtyp=dA2[i].res;
if (currRing!=NULL)
{
if (check_valid(dA2[i].valid_for,op)) break;
}
else
{
if (RingDependend(dA2[i].res))
{
WerrorS("no ring active (3)");
break;
}
}
if (traceit&TRACE_CALL)
Print("call %s(%s,%s)\n",iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt));
if ((call_failed=dA2[i].p(res,a,b)))
{
break;// leave loop, goto error handling
}
a->CleanUp();
b->CleanUp();
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return FALSE;
}
i++;
}
// implicite type conversion ----------------------------------------------
if (dA2[i].cmd!=op)
{
int ai,bi;
leftv an = (leftv)omAlloc0Bin(sleftv_bin);
leftv bn = (leftv)omAlloc0Bin(sleftv_bin);
BOOLEAN failed=FALSE;
i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
//Print("op: %c, type: %s %s\n",op,Tok2Cmdname(at),Tok2Cmdname(bt));
while (dA2[i].cmd==op)
{
//Print("test %s %s\n",Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
if ((dA2[i].valid_for & NO_CONVERSION)==0)
{
if ((ai=iiTestConvert(at,dA2[i].arg1,dConvertTypes))!=0)
{
if ((bi=iiTestConvert(bt,dA2[i].arg2,dConvertTypes))!=0)
{
res->rtyp=dA2[i].res;
if (currRing!=NULL)
{
if (check_valid(dA2[i].valid_for,op)) break;
}
else
{
if (RingDependend(dA2[i].res))
{
WerrorS("no ring active (4)");
break;
}
}
if (traceit&TRACE_CALL)
Print("call %s(%s,%s)\n",iiTwoOps(op),
Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
failed= ((iiConvert(at,dA2[i].arg1,ai,a,an))
|| (iiConvert(bt,dA2[i].arg2,bi,b,bn))
|| (call_failed=dA2[i].p(res,an,bn)));
// everything done, clean up temp. variables
if (failed)
{
// leave loop, goto error handling
break;
}
else
{
// everything ok, clean up and return
an->CleanUp();
bn->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
omFreeBin((ADDRESS)bn, sleftv_bin);
return FALSE;
}
}
}
}
i++;
}
an->CleanUp();
bn->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
omFreeBin((ADDRESS)bn, sleftv_bin);
}
// error handling ---------------------------------------------------
const char *s=NULL;
if (!errorreported)
{
if ((at==0) && (a->Fullname()!=sNoName_fe))
{
s=a->Fullname();
}
else if ((bt==0) && (b->Fullname()!=sNoName_fe))
{
s=b->Fullname();
}
if (s!=NULL)
Werror("`%s` is not defined",s);
else
{
i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
s = iiTwoOps(op);
if (proccall)
{
Werror("%s(`%s`,`%s`) failed"
,s,Tok2Cmdname(at),Tok2Cmdname(bt));
}
else
{
Werror("`%s` %s `%s` failed"
,Tok2Cmdname(at),s,Tok2Cmdname(bt));
}
if ((!call_failed) && BVERBOSE(V_SHOW_USE))
{
while (dA2[i].cmd==op)
{
if(((at==dA2[i].arg1)||(bt==dA2[i].arg2))
&& (dA2[i].res!=0)
&& (dA2[i].p!=jjWRONG2))
{
if (proccall)
Werror("expected %s(`%s`,`%s`)"
,s,Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
else
Werror("expected `%s` %s `%s`"
,Tok2Cmdname(dA2[i].arg1),s,Tok2Cmdname(dA2[i].arg2));
}
i++;
}
}
}
}
a->CleanUp();
b->CleanUp();
res->rtyp = UNKNOWN;
}
return TRUE;
}
jjWRONG2
#define jjWRONG2
Definition gentable.cc:125
sValCmd2::res
short res
Definition gentable.cc:70
sValCmd2::p
int p
Definition gentable.cc:68

## iiExprArith3()

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

Definition at line 9575 of file iparith.cc.

{
res->Init();
if (!errorreported)
{
#ifdef SIQ
if (siq>0)
{
//Print("siq:%d\n",siq);
command d=(command)omAlloc0Bin(sip_command_bin);
memcpy(&d->arg1,a,sizeof(sleftv));
a->Init();
memcpy(&d->arg2,b,sizeof(sleftv));
b->Init();
memcpy(&d->arg3,c,sizeof(sleftv));
c->Init();
d->op=op;
d->argc=3;
res->data=(char *)d;
res->rtyp=COMMAND;
return FALSE;
}
#endif
int at=a->Typ();
// handling bb-objects ----------------------------------------------
if (at>MAX_TOK)
{
blackbox *bb=getBlackboxStuff(at);
if (bb!=NULL)
{
if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
// otherwise, try defaul (attrib,..)
}
else
return TRUE;
if (errorreported) return TRUE;
}
int bt=b->Typ();
int ct=c->Typ();
iiOp=op;
int i=0;
while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
}
a->CleanUp();
b->CleanUp();
c->CleanUp();
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return TRUE;
}
iiExprArith3TabIntern
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:9422
dArith3
const struct sValCmd3 dArith3[]
Definition table.h:801

## 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] | res | pre-allocated result
  [in] | a | 3 arguments
  [in] | op | operation
  [in] | dA3 | table of possible proc assumes dA3[0].cmd==op
  [in] | at | a->Typ()
  [in] | dConvertTypes | table of type conversions

Definition at line 9627 of file iparith.cc.

{
res->Init();
leftv b=a->next;
a->next=NULL;
int bt=b->Typ();
leftv c=b->next;
b->next=NULL;
int ct=c->Typ();
BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
b->next=c;
a->next=b;
a->CleanUp(); // to cleanup the chain, content already done
return bo;
}

## iiExprArith3TabIntern()

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 )

static

Definition at line 9422 of file iparith.cc.

{
BOOLEAN call_failed=FALSE;
assume(dA3[0].cmd==op);
if (!errorreported)
{
int i=0;
iiOp=op;
while (dA3[i].cmd==op)
{
if ((at==dA3[i].arg1)
&& (bt==dA3[i].arg2)
&& (ct==dA3[i].arg3))
{
res->rtyp=dA3[i].res;
if (currRing!=NULL)
{
if (check_valid(dA3[i].valid_for,op)) break;
}
if (traceit&TRACE_CALL)
Print("call %s(%s,%s,%s)\n",
iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
if ((call_failed=dA3[i].p(res,a,b,c)))
{
break;// leave loop, goto error handling
}
a->CleanUp();
b->CleanUp();
c->CleanUp();
return FALSE;
}
i++;
}
// implicite type conversion ----------------------------------------------
if (dA3[i].cmd!=op)
{
int ai,bi,ci;
leftv an = (leftv)omAlloc0Bin(sleftv_bin);
leftv bn = (leftv)omAlloc0Bin(sleftv_bin);
leftv cn = (leftv)omAlloc0Bin(sleftv_bin);
BOOLEAN failed=FALSE;
i=0;
//while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
while (dA3[i].cmd==op)
{
if ((dA3[i].valid_for & NO_CONVERSION)==0)
{
if ((ai=iiTestConvert(at,dA3[i].arg1,dConvertTypes))!=0)
{
if ((bi=iiTestConvert(bt,dA3[i].arg2,dConvertTypes))!=0)
{
if ((ci=iiTestConvert(ct,dA3[i].arg3,dConvertTypes))!=0)
{
res->rtyp=dA3[i].res;
if (currRing!=NULL)
{
if (check_valid(dA3[i].valid_for,op)) break;
}
if (traceit&TRACE_CALL)
Print("call %s(%s,%s,%s)\n",
iiTwoOps(op),Tok2Cmdname(dA3[i].arg1),
Tok2Cmdname(dA3[i].arg2),Tok2Cmdname(dA3[i].arg3));
failed= ((iiConvert(at,dA3[i].arg1,ai,a,an,dConvertTypes))
|| (iiConvert(bt,dA3[i].arg2,bi,b,bn,dConvertTypes))
|| (iiConvert(ct,dA3[i].arg3,ci,c,cn,dConvertTypes))
|| (call_failed=dA3[i].p(res,an,bn,cn)));
// everything done, clean up temp. variables
if (failed)
{
// leave loop, goto error handling
break;
}
else
{
// everything ok, clean up and return
an->CleanUp();
bn->CleanUp();
cn->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
omFreeBin((ADDRESS)bn, sleftv_bin);
omFreeBin((ADDRESS)cn, sleftv_bin);
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return FALSE;
}
}
}
}
}
i++;
}
an->CleanUp();
bn->CleanUp();
cn->CleanUp();
omFreeBin((ADDRESS)an, sleftv_bin);
omFreeBin((ADDRESS)bn, sleftv_bin);
omFreeBin((ADDRESS)cn, sleftv_bin);
}
// error handling ---------------------------------------------------
if (!errorreported)
{
const char *s=NULL;
if ((at==0) && (a->Fullname()!=sNoName_fe))
{
s=a->Fullname();
}
else if ((bt==0) && (b->Fullname()!=sNoName_fe))
{
s=b->Fullname();
}
else if ((ct==0) && (c->Fullname()!=sNoName_fe))
{
s=c->Fullname();
}
if (s!=NULL)
Werror("`%s` is not defined",s);
else
{
i=0;
//while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
const char *s = iiTwoOps(op);
Werror("%s(`%s`,`%s`,`%s`) failed"
,s,Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
if ((!call_failed) && BVERBOSE(V_SHOW_USE))
{
while (dA3[i].cmd==op)
{
if(((at==dA3[i].arg1)
||(bt==dA3[i].arg2)
||(ct==dA3[i].arg3))
&& (dA3[i].res!=0))
{
Werror("expected %s(`%s`,`%s`,`%s`)"
,s,Tok2Cmdname(dA3[i].arg1)
,Tok2Cmdname(dA3[i].arg2)
,Tok2Cmdname(dA3[i].arg3));
}
i++;
}
}
}
}
res->rtyp = UNKNOWN;
}
a->CleanUp();
b->CleanUp();
c->CleanUp();
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return TRUE;
}
sValCmd3::p
int p
Definition gentable.cc:85
sValCmd3::res
short res
Definition gentable.cc:87

## iiExprArithM()

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

Definition at line 9666 of file iparith.cc.

{
res->Init();
if (!errorreported)
{
#ifdef SIQ
if (siq>0)
{
//Print("siq:%d\n",siq);
command d=(command)omAlloc0Bin(sip_command_bin);
d->op=op;
res->data=(char *)d;
if (a!=NULL)
{
d->argc=a->listLength();
// else : d->argc=0;
memcpy(&d->arg1,a,sizeof(sleftv));
switch(d->argc)
{
case 3:
memcpy(&d->arg3,a->next->next,sizeof(sleftv));
a->next->next->Init(); /* no break */
case 2:
memcpy(&d->arg2,a->next,sizeof(sleftv));
a->next->Init();
a->next->next=d->arg2.next;
d->arg2.next=NULL; /* no break */
case 1:
a->Init();
a->next=d->arg1.next;
d->arg1.next=NULL;
}
if (d->argc>3) a->next=NULL;
a->name=NULL;
a->rtyp=0;
a->data=NULL;
a->e=NULL;
a->attribute=NULL;
a->CleanUp();
}
res->rtyp=COMMAND;
return FALSE;
}
#endif
if ((a!=NULL) && (a->Typ()>MAX_TOK))
{
blackbox *bb=getBlackboxStuff(a->Typ());
if (bb!=NULL)
{
if(!bb->blackbox_OpM(op,res,a)) return FALSE;
// otherwise, try default
}
else
return TRUE;
if (errorreported) return TRUE;
}
int args=0;
if (a!=NULL) args=a->listLength();
iiOp=op;
int i=0;
while ((dArithM[i].cmd!=op)&&(dArithM[i].cmd!=0)) i++;
while (dArithM[i].cmd==op)
{
if ((args==dArithM[i].number_of_args)
|| (dArithM[i].number_of_args==-1)
|| ((dArithM[i].number_of_args==-2)&&(args>0)))
{
res->rtyp=dArithM[i].res;
if (currRing!=NULL)
{
if (check_valid(dArithM[i].valid_for,op)) break;
}
if (traceit&TRACE_CALL)
Print("call %s(... (%d args))\n", iiTwoOps(op),args);
if (dArithM[i].p(res,a))
{
break;// leave loop, goto error handling
}
if (a!=NULL) a->CleanUp();
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return FALSE;
}
i++;
}
// error handling
if (!errorreported)
{
if ((args>0) && (a->rtyp==0) && (a->Name()!=sNoName_fe))
{
Werror("`%s` is not defined",a->Fullname());
}
else
{
const char *s = iiTwoOps(op);
Werror("%s(...) failed",s);
}
}
res->rtyp = UNKNOWN;
}
if (a!=NULL) a->CleanUp();
//Print("op: %d,result typ:%d\n",op,res->rtyp);
return TRUE;
}
sleftv::name
const char * name
Definition subexpr.h:87
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::Name
const char * Name()
Definition subexpr.h:120
sleftv::listLength
int listLength()
Definition subexpr.cc:51
sleftv::data
void * data
Definition subexpr.h:88
sleftv::e
Subexpr e
Definition subexpr.h:105
sleftv::attribute
attr attribute
Definition subexpr.h:89
dArithM
const struct sValCmdM dArithM[]
Definition table.h:937

## iiInitArithmetic()

int iiInitArithmetic | ( |  | ) |

initialisation of arithmetic structured data

Return values

  0 | on success

Definition at line 9988 of file iparith.cc.

{
//printf("iiInitArithmetic()\n");
memset(&sArithBase, 0, sizeof(sArithBase));
iiInitCmdName();
/* fix last-identifier */
#if 0
/* we expect that gentable allready did every thing */
for(sArithBase.nLastIdentifier=sArithBase.nCmdUsed-1;
sArithBase.nLastIdentifier>0; sArithBase.nLastIdentifier--) {
if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
}
#endif
//Print("L=%d\n", sArithBase.nLastIdentifier);
//iiArithAddCmd(szName, nAlias, nTokval, nToktype);
//iiArithAddCmd("mygcd", 1, GCD_CMD, CMD_2);
//iiArithAddCmd("Top", 0,-1,0);
//for(i=0; i<sArithBase.nCmdUsed; i++) {
// printf("CMD[%03d] %s, %d, %d, %d\n", i,
// sArithBase.sCmds[i].name,
// sArithBase.sCmds[i].alias,
// sArithBase.sCmds[i].tokval,
// sArithBase.sCmds[i].toktype);
//}
//iiArithRemoveCmd("Top");
//iiArithAddCmd("mygcd", 2, GCD_CMD, CMD_2);
//iiArithRemoveCmd("mygcd");
//iiArithAddCmd("kkk", 1, 1234, CMD_1);
return 0;
}

## iin_Int()

int iin_Int | ( | number & | n,
|  | coeffs | cf )

static

Definition at line 222 of file iparith.cc.

{
long l=n_Int(n,cf);
int i=(int)l;
if ((long)i==l) return l;
return 0;
}
l
int l
Definition cfEzgcd.cc:100
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition coeffs.h:550

## iiTabIndex()

int iiTabIndex | ( | const jjValCmdTab | dArithTab,
|  | const int | len,
|  | const int | op )

static

Definition at line 9872 of file iparith.cc.

{
// user defined types are not in the pre-computed table:
if (op>MAX_TOK) return 0;
int a=0;
int e=len;
int p=len/2;
do
{
if (op==dArithTab[p].cmd) return dArithTab[p].start;
if (op<dArithTab[p].cmd) e=p-1;
else a = p+1;
p=a+(e-a)/2;
}
while ( a <= e);
// catch missing a cmd:
// may be missing as a op for blackbox, if the first operand is "undef" instead of bb
// Print("op %d (%c) unknown",op,op);
return 0;
}

## iiTokType()

int iiTokType | ( | int | op | ) |

Definition at line 230 of file iparith.cc.

{
for (unsigned i=0;i<sArithBase.nCmdUsed;i++)
{
if (sArithBase.sCmds[i].tokval==op)
return sArithBase.sCmds[i].toktype;
}
return 0;
}

## IsCmd()

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

Definition at line 9773 of file iparith.cc.

{
int i;
int an=1;
int en=sArithBase.nLastIdentifier;
loop
//for(an=0; an<sArithBase.nCmdUsed; )
{
if(an>=en-1)
{
if (strcmp(n, sArithBase.sCmds[an].name) == 0)
{
i=an;
break;
}
else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
{
i=en;
break;
}
else
{
// -- blackbox extensions:
// return 0;
return blackboxIsCmd(n,tok);
}
}
i=(an+en)/2;
if (*n < *(sArithBase.sCmds[i].name))
{
en=i-1;
}
else if (*n > *(sArithBase.sCmds[i].name))
{
an=i+1;
}
else
{
int v=strcmp(n,sArithBase.sCmds[i].name);
if(v<0)
{
en=i-1;
}
else if(v>0)
{
an=i+1;
}
else /*v==0*/
{
break;
}
}
}
lastreserved=sArithBase.sCmds[i].name;
tok=sArithBase.sCmds[i].tokval;
if(sArithBase.sCmds[i].alias==2)
{
Warn("outdated identifier `%s` used - please change your code",
sArithBase.sCmds[i].name);
sArithBase.sCmds[i].alias=1;
}
#if 0
if (currRingHdl==NULL)
{
#ifdef SIQ
if (siq<=0)
{
#endif
if ((tok>=BEGIN_RING) && (tok<=END_RING))
{
WerrorS("no ring active");
return 0;
}
#ifdef SIQ
}
#endif
}
#endif
if (!expected_parms)
{
switch (tok)
{
case IDEAL_CMD:
case INT_CMD:
case INTVEC_CMD:
case MAP_CMD:
case MATRIX_CMD:
case MODUL_CMD:
case POLY_CMD:
case PROC_CMD:
case RING_CMD:
case STRING_CMD:
cmdtok = tok;
break;
}
}
return sArithBase.sCmds[i].toktype;
}
blackboxIsCmd
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
@ END_RING
Definition grammar.cc:311
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
MATRIX_CMD
@ MATRIX_CMD
Definition grammar.cc:287
MAP_CMD
@ MAP_CMD
Definition grammar.cc:286
PROC_CMD
@ PROC_CMD
Definition grammar.cc:281
BEGIN_RING
@ BEGIN_RING
Definition grammar.cc:283
MODUL_CMD
@ MODUL_CMD
Definition grammar.cc:288
POLY_CMD
@ POLY_CMD
Definition grammar.cc:290
RING_CMD
@ RING_CMD
Definition grammar.cc:282
cmdtok
int cmdtok
Definition grammar.cc:174
expected_parms
BOOLEAN expected_parms
Definition grammar.cc:173
currRingHdl
VAR idhdl currRingHdl
Definition ipid.cc:57
lastreserved
const char * lastreserved
Definition ipshell.cc:83
INTVEC_CMD
@ INTVEC_CMD
Definition tok.h:101
STRING_CMD
@ STRING_CMD
Definition tok.h:187
INT_CMD
@ INT_CMD
Definition tok.h:96

## jjALIGN_M()

BOOLEAN jjALIGN_M | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1779 of file iparith.cc.

{
ideal M=(ideal)u->CopyD();
int s=(int)(long)v->Data();
for(int i=IDELEMS(M)-1; i>=0;i--)
{
if (s+p_MinComp(M->m[i],currRing)<=0)
{ id_Delete(&M,currRing);return TRUE;}
}
id_Shift(M,s,currRing);
res->data=M;
return FALSE;
}
sleftv::CopyD
void * CopyD(int t)
Definition subexpr.cc:714
p_MinComp
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition p_polys.h:315
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
id_Shift
void id_Shift(ideal M, int s, const ring r)
Definition simpleideals.cc:2196
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
M
#define M
Definition sirandom.c:25

## jjALIGN_V()

BOOLEAN jjALIGN_V | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1769 of file iparith.cc.

{
poly p=(poly)u->CopyD();
long s=(long)v->Data();
if (s+p_MinComp(p,currRing)<=0)
{ p_Delete(&p,currRing);return TRUE;}
p_Shift(&p,s,currRing);
res->data=p;
return FALSE;
}
p_Shift
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition p_polys.cc:4860
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903

## jjAND_I()

BOOLEAN jjAND_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1380 of file iparith.cc.

{
res->data = (char *)((long)u->Data() && (long)v->Data());
return FALSE;
}
sleftv::Data
void * Data()
Definition subexpr.cc:1192

## jjBAREISS()

BOOLEAN jjBAREISS | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3879 of file iparith.cc.

{
//matrix m=(matrix)v->Data();
//lists l=mpBareiss(m,FALSE);
intvec *iv;
ideal m;
sm_CallBareiss((ideal)v->Data(),0,0,m,&iv, currRing);
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=MODUL_CMD;
l->m[1].rtyp=INTVEC_CMD;
l->m[0].data=(void *)m;
l->m[1].data=(void *)iv;
res->data = (char *)l;
return FALSE;
}
m
int m
Definition cfEzgcd.cc:128
intvec
Definition intvec.h:24
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
lists
slists * lists
Definition mpr_numeric.h:146
sm_CallBareiss
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
Definition sparsmat.cc:347

## jjBAREISS3()

BOOLEAN jjBAREISS3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6095 of file iparith.cc.

{
intvec *iv;
ideal m;
lists l=(lists)omAllocBin(slists_bin);
int k=(int)(long)w->Data();
if (k>=0)
{
sm_CallBareiss((ideal)u->Data(),(int)(long)v->Data(),(int)(long)w->Data(),m,&iv, currRing);
l->Init(2);
l->m[0].rtyp=MODUL_CMD;
l->m[1].rtyp=INTVEC_CMD;
l->m[0].data=(void *)m;
l->m[1].data=(void *)iv;
}
else
{
m=sm_CallSolv((ideal)u->Data(), currRing);
l->Init(1);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=(void *)m;
}
res->data = (char *)l;
return FALSE;
}
k
int k
Definition cfEzgcd.cc:99
w
const CanonicalForm & w
Definition facAbsFact.cc:51
sm_CallSolv
ideal sm_CallSolv(ideal I, const ring R)
Definition sparsmat.cc:2316

## jjBAREISS_BIM()

BOOLEAN jjBAREISS_BIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3902 of file iparith.cc.

{
bigintmat *b=(bigintmat*)v->CopyD(BIGINTMAT_CMD);
b->hnf();
res->data=(char*)b;
return FALSE;
}
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
BIGINTMAT_CMD
@ BIGINTMAT_CMD
Definition grammar.cc:278

## jjBI2IM()

BOOLEAN jjBI2IM | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3924 of file iparith.cc.

{
bigintmat *b=(bigintmat*)u->Data();
res->data=(void *)bim2iv(b);
return FALSE;
}
bim2iv
intvec * bim2iv(bigintmat *b)
Definition bigintmat.cc:339

## jjBI2N()

BOOLEAN jjBI2N | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3909 of file iparith.cc.

{
BOOLEAN bo=FALSE;
number n=(number)u->CopyD();
nMapFunc nMap=n_SetMap(coeffs_BIGINT,currRing->cf);
if (nMap!=NULL)
res->data=nMap(n,coeffs_BIGINT,currRing->cf);
else
{
Werror("cannot convert bigint to cring %s", nCoeffName(currRing->cf));
bo=TRUE;
}
n_Delete(&n,coeffs_BIGINT);
return bo;
}
n_SetMap
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:703
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
nCoeffName
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition coeffs.h:962
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition polys.cc:14

## jjBI2P()

BOOLEAN jjBI2P | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3930 of file iparith.cc.

{
sleftv tmp;
BOOLEAN bo=jjBI2N(&tmp,u);
if (!bo)
{
number n=(number) tmp.data;
if (nIsZero(n)) { res->data=NULL;nDelete(&n); }
else
{
res->data=(void *)pNSet(n);
}
}
return bo;
}
jjBI2N
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition iparith.cc:3909
nDelete
#define nDelete(n)
Definition numbers.h:16
nIsZero
#define nIsZero(n)
Definition numbers.h:19
pNSet
#define pNSet(n)
Definition polys.h:314

## jjBIGINTVEC_PL()

BOOLEAN jjBIGINTVEC_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7932 of file iparith.cc.

{
leftv h=v;
int l=0;
while (h!=NULL)
{
if(h->Typ()==INT_CMD) l++;
else if (h->Typ()==BIGINT_CMD) l++;
else if (h->Typ()==INTVEC_CMD)
{
intvec *ivv=(intvec*)h->Data();
l+=ivv->rows();
}
else if (h->Typ()==BIGINTVEC_CMD)
{
bigintmat *ivv=(bigintmat *)h->Data();
l+=ivv->rows();
}
else return TRUE;
h=h->next;
}
bigintmat *bim=new bigintmat(1,l,coeffs_BIGINT);
h=v;
int i=0;
while (h!=NULL)
{
if(h->Typ()==INT_CMD)
{
number tp = n_Init((long)(h->Data()), coeffs_BIGINT);
bim->set(i++, tp);
n_Delete(&tp, coeffs_BIGINT);
}
else if (h->Typ()==INTVEC_CMD)
{
intvec *ivv=(intvec*)h->Data();
for(int j=0;j<ivv->length();j++)
{
number tp = n_Init((long)(*ivv)[j], coeffs_BIGINT);
bim->set(i++, tp);
n_Delete(&tp, coeffs_BIGINT);
}
}
else if(h->Typ()==BIGINT_CMD)
{
number tp = (number)h->Data();
bim->set(i++, tp);
}
else if(h->Typ()==BIGINTVEC_CMD)
{
bigintmat *b=(bigintmat*)h->Data();
for(int j=0;j<b->cols();j++)
{
number tp=BIMATELEM((*b),1,j);
bim->set(i++, tp);
}
}
h=h->next;
}
res->data=(char *)bim;
return FALSE;
}
BIMATELEM
#define BIMATELEM(M, I, J)
Definition bigintmat.h:133
bigintmat::rows
int rows() const
Definition bigintmat.h:145
bigintmat::set
void set(int i, int j, number n, const coeffs C=NULL)
replace an entry with a copy (delete old + copy new!). NOTE: starts at [1,1]
Definition bigintmat.cc:93
intvec::length
int length() const
Definition intvec.h:95
intvec::rows
int rows() const
Definition intvec.h:97
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
j
int j
Definition facHensel.cc:110
BIGINTVEC_CMD
@ BIGINTVEC_CMD
Definition grammar.cc:279
h
STATIC_VAR Poly * h
Definition janet.cc:971
BIGINT_CMD
@ BIGINT_CMD
Definition tok.h:38

## jjBIV2IV()

BOOLEAN jjBIV2IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4479 of file iparith.cc.

{
bigintmat* aa= (bigintmat *)v->Data();
int l=aa->cols();
intvec *iv=new intvec(l);
for(int i=0;i<l;i++) (*iv)[i]=iin_Int(BIMATELEM((*aa),1,i+1),coeffs_BIGINT);
res->data = (void*)iv;
return FALSE;
}
bigintmat::cols
int cols() const
Definition bigintmat.h:144
iin_Int
static int iin_Int(number &n, coeffs cf)
Definition iparith.cc:222

## jjBRACK_Bim()

BOOLEAN jjBRACK_Bim | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5840 of file iparith.cc.

{
bigintmat *bim = (bigintmat *)u->Data();
int r = (int)(long)v->Data();
int c = (int)(long)w->Data();
if ((r<1)||(r>bim->rows())||(c<1)||(c>bim->cols()))
{
Werror("wrong range[%d,%d] in bigintmat %s(%d x %d)",
r,c,u->Fullname(),bim->rows(),bim->cols());
return TRUE;
}
res->data=u->data; u->data=NULL;
res->rtyp=u->rtyp; u->rtyp=0;
res->name=u->name; u->name=NULL;
Subexpr e=jjMakeSub(v);
e->next=jjMakeSub(w);
if (u->e==NULL)
res->e=e;
else
{
Subexpr h=u->e;
while (h->next!=NULL) h=h->next;
h->next=e;
res->e=u->e;
u->e=NULL;
}
return FALSE;
}
jjMakeSub
static Subexpr jjMakeSub(leftv e)
Definition iparith.cc:8970

## jjBRACK_Im()

BOOLEAN jjBRACK_Im | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5813 of file iparith.cc.

{
intvec *iv = (intvec *)u->Data();
int r = (int)(long)v->Data();
int c = (int)(long)w->Data();
if ((r<1)||(r>iv->rows())||(c<1)||(c>iv->cols()))
{
Werror("wrong range[%d,%d] in intmat %s(%d x %d)",
r,c,u->Fullname(),iv->rows(),iv->cols());
return TRUE;
}
res->data=u->data; u->data=NULL;
res->rtyp=u->rtyp; u->rtyp=0;
res->name=u->name; u->name=NULL;
Subexpr e=jjMakeSub(v);
e->next=jjMakeSub(w);
if (u->e==NULL) res->e=e;
else
{
Subexpr h=u->e;
while (h->next!=NULL) h=h->next;
h->next=e;
res->e=u->e;
u->e=NULL;
}
return FALSE;
}
intvec::cols
int cols() const
Definition intvec.h:96

## jjBRACK_Ma()

BOOLEAN jjBRACK_Ma | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5868 of file iparith.cc.

{
matrix m= (matrix)u->Data();
int r = (int)(long)v->Data();
int c = (int)(long)w->Data();
//Print("gen. elem %d, %d\n",r,c);
if ((r<1)||(r>MATROWS(m))||(c<1)||(c>MATCOLS(m)))
{
Werror("wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->Fullname(),
MATROWS(m),MATCOLS(m));
return TRUE;
}
res->data=u->data; u->data=NULL;
res->rtyp=u->rtyp; u->rtyp=0;
res->name=u->name; u->name=NULL;
Subexpr e=jjMakeSub(v);
e->next=jjMakeSub(w);
if (u->e==NULL)
res->e=e;
else
{
Subexpr h=u->e;
while (h->next!=NULL) h=h->next;
h->next=e;
res->e=u->e;
u->e=NULL;
}
return FALSE;
}
matrix
ip_smatrix * matrix
Definition matpol.h:43
MATROWS
#define MATROWS(i)
Definition matpol.h:26
MATCOLS
#define MATCOLS(i)
Definition matpol.h:27

## jjBRACK_Ma_I_IV()

BOOLEAN jjBRACK_Ma_I_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5926 of file iparith.cc.

{
if ((u->rtyp!=IDHDL)||(u->e!=NULL))
{
WerrorS("cannot build expression lists from unnamed objects");
return TRUE;
}
leftv p=NULL;
intvec *iv=(intvec *)w->Data();
int l;
BOOLEAN nok;
sleftv ut;
memcpy(&ut,u,sizeof(ut));
sleftv t;
t.Init();
t.rtyp=INT_CMD;
for (l=0;l< iv->length(); l++)
{
t.data=(char *)(long)((*iv)[l]);
if (p==NULL)
{
p=res;
}
else
{
p->next=(leftv)omAlloc0Bin(sleftv_bin);
p=p->next;
}
memcpy(u,&ut,sizeof(ut));
if (u->Typ() == MATRIX_CMD)
nok=jjBRACK_Ma(p,u,v,&t);
else if (u->Typ() == BIGINTMAT_CMD)
nok=jjBRACK_Bim(p,u,v,&t);
else /* INTMAT_CMD */
nok=jjBRACK_Im(p,u,v,&t);
if (nok)
{
while (res->next!=NULL)
{
p=res->next->next;
omFreeBin((ADDRESS)res->next, sleftv_bin);
// res->e aufraeumen !!!!
res->next=p;
}
return TRUE;
}
}
return FALSE;
}
jjBRACK_Bim
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5840
jjBRACK_Im
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5813
jjBRACK_Ma
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:5868
IDHDL
#define IDHDL
Definition tok.h:31

## jjBRACK_Ma_IV_I()

BOOLEAN jjBRACK_Ma_IV_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5976 of file iparith.cc.

{
if ((u->rtyp!=IDHDL)||(u->e!=NULL))
{
WerrorS("cannot build expression lists from unnamed objects");
return TRUE;
}
leftv p=NULL;
intvec *iv=(intvec *)v->Data();
int l;
BOOLEAN nok;
sleftv ut;
memcpy(&ut,u,sizeof(ut));
sleftv t;
t.Init();
t.rtyp=INT_CMD;
for (l=0;l< iv->length(); l++)
{
t.data=(char *)(long)((*iv)[l]);
if (p==NULL)
{
p=res;
}
else
{
p->next=(leftv)omAlloc0Bin(sleftv_bin);
p=p->next;
}
memcpy(u,&ut,sizeof(ut));
if (u->Typ() == MATRIX_CMD)
nok=jjBRACK_Ma(p,u,&t,w);
else if (u->Typ() == BIGINTMAT_CMD)
nok=jjBRACK_Bim(p,u,&t,w);
else /* INTMAT_CMD */
nok=jjBRACK_Im(p,u,&t,w);
if (nok)
{
while (res->next!=NULL)
{
p=res->next->next;
omFreeBin((ADDRESS)res->next, sleftv_bin);
// res->e aufraeumen !!
res->next=p;
}
return TRUE;
}
}
return FALSE;
}

## jjBRACK_Ma_IV_IV()

BOOLEAN jjBRACK_Ma_IV_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6025 of file iparith.cc.

{
if ((u->rtyp!=IDHDL)||(u->e!=NULL))
{
WerrorS("cannot build expression lists from unnamed objects");
return TRUE;
}
leftv p=NULL;
intvec *vv=(intvec *)v->Data();
intvec *wv=(intvec *)w->Data();
int vl;
int wl;
BOOLEAN nok;
sleftv t1,t2,ut;
memcpy(&ut,u,sizeof(ut));
t1.Init();
t1.rtyp=INT_CMD;
t2.Init();
t2.rtyp=INT_CMD;
for (vl=0;vl< vv->length(); vl++)
{
t1.data=(char *)(long)((*vv)[vl]);
for (wl=0;wl< wv->length(); wl++)
{
t2.data=(char *)(long)((*wv)[wl]);
if (p==NULL)
{
p=res;
}
else
{
p->next=(leftv)omAlloc0Bin(sleftv_bin);
p=p->next;
}
memcpy(u,&ut,sizeof(ut));
if (u->Typ() == MATRIX_CMD)
nok=jjBRACK_Ma(p,u,&t1,&t2);
else if (u->Typ() == BIGINTMAT_CMD)
nok=jjBRACK_Bim(p,u,&t1,&t2);
else /* INTMAT_CMD */
nok=jjBRACK_Im(p,u,&t1,&t2);
if (nok)
{
res->CleanUp();
return TRUE;
}
}
}
return FALSE;
}

## jjBRACK_S()

BOOLEAN jjBRACK_S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5797 of file iparith.cc.

{
char *s= (char *)u->Data();
int r = (int)(long)v->Data();
int c = (int)(long)w->Data();
int l = strlen(s);
if ( (r<1) || (r>l) || (c<0) )
{
Werror("wrong range[%d,%d] in string %s",r,c,u->Fullname());
return TRUE;
}
res->data = (char *)omAlloc((long)(c+1));
snprintf((char *)res->data,c+1,"%-*.*s",c,c,s+r-1);
return FALSE;
}
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210

## jjBRACK_SM()

BOOLEAN jjBRACK_SM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 5897 of file iparith.cc.

{
ideal m= (ideal)u->Data();
int r = (int)(long)v->Data();
int c = (int)(long)w->Data();
//Print("gen. elem %d, %d\n",r,c);
if ((r<1)||(r>m->rank)||(c<1)||(c>IDELEMS(m)))
{
Werror("wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->Fullname(),
(int)m->rank,IDELEMS(m));
return TRUE;
}
res->data=u->data; u->data=NULL;
res->rtyp=u->rtyp; u->rtyp=0;
res->name=u->name; u->name=NULL;
Subexpr e=jjMakeSub(v);
e->next=jjMakeSub(w);
if (u->e==NULL)
res->e=e;
else
{
Subexpr h=u->e;
while (h->next!=NULL) h=h->next;
h->next=e;
res->e=u->e;
u->e=NULL;
}
return FALSE;
}

## jjBRACKET()

BOOLEAN jjBRACKET | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2918 of file iparith.cc.

{
res->data=NULL;
if (rIsPluralRing(currRing) || rIsLPRing(currRing))
{
const poly q = (poly)b->Data();
if( q != NULL )
{
if( (poly)a->Data() != NULL )
{
if (rIsPluralRing(currRing))
{
poly p = (poly)a->CopyD(POLY_CMD); // p = copy!
res->data = nc_p_Bracket_qq(p,q, currRing); // p will be destroyed!
}
else if (rIsLPRing(currRing))
{
const poly p = (poly)a->Data();
res->data = pAdd(ppMult_qq(p,q), pNeg(ppMult_qq(q,p)));
}
}
}
}
return FALSE;
}
nc_p_Bracket_qq
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
Definition old.gring.cc:2251
pAdd
#define pAdd(p, q)
Definition polys.h:204
pNeg
#define pNeg(p)
Definition polys.h:199
ppMult_qq
#define ppMult_qq(p, q)
Definition polys.h:209

## jjBRACKET_REC()

BOOLEAN jjBRACKET_REC | ( | leftv | res,
|  | leftv | a,
|  | leftv | b,
|  | leftv | c )

static

Definition at line 2945 of file iparith.cc.

{
res->data=NULL;
if (rIsLPRing(currRing) || rIsPluralRing(currRing))
{
const poly q = (poly)b->Data();
if(q != NULL)
{
if((poly)a->Data() != NULL)
{
const poly p = (poly)a->Data();
int k=(int)(long)c->Data();
if (k > 0)
{
poly qq = pCopy(q);
for (int i = 0; i < k; i++)
{
poly qq_ref = qq;
if (rIsLPRing(currRing))
{
qq = pAdd(ppMult_qq(p,qq), pNeg(ppMult_qq(qq,p)));
}
else if (rIsPluralRing(currRing))
{
qq = nc_p_Bracket_qq(pCopy(p), qq, currRing);
}
pDelete(&qq_ref);
if (qq == NULL) break;
}
res->data = qq;
}
else
{
Werror("invalid number of iterations");
}
}
}
}
return FALSE;
}
pDelete
#define pDelete(p_ptr)
Definition polys.h:187
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186

## jjBREAK0()

BOOLEAN jjBREAK0 | ( | leftv | ,
|  | leftv | )

static

Definition at line 7332 of file iparith.cc.

{
#ifdef HAVE_SDB
sdb_show_bp();
#endif
return FALSE;
}
sdb_show_bp
void sdb_show_bp()
Definition sdb.cc:57

## jjBREAK1()

BOOLEAN jjBREAK1 | ( | leftv | ,
|  | leftv | v )

static

Definition at line 7339 of file iparith.cc.

{
#ifdef HAVE_SDB
if(v->Typ()==PROC_CMD)
{
int lineno=0;
if((v->next!=NULL) && (v->next->Typ()==INT_CMD))
{
lineno=(int)(long)v->next->Data();
}
return sdb_set_breakpoint(v->Name(),lineno);
}
return TRUE;
#else
return FALSE;
#endif
}
sdb_set_breakpoint
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
Definition sdb.cc:64

## jjCALL1ARG()

BOOLEAN jjCALL1ARG | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7356 of file iparith.cc.

{
return iiExprArith1(res,v,iiOp);
}

## jjCALL1MANY()

BOOLEAN jjCALL1MANY | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3945 of file iparith.cc.

{
return iiExprArithM(res,u,iiOp);
}
iiExprArithM
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition iparith.cc:9666

## jjCALL2ARG()

BOOLEAN jjCALL2ARG | ( | leftv | res,
|  | leftv | u )

static

Definition at line 7360 of file iparith.cc.

{
leftv v=u->next;
u->next=NULL;
BOOLEAN b=iiExprArith2(res,u,iiOp,v, (iiOp > 255));
u->next=v;
return b;
}
iiExprArith2
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition iparith.cc:9176

## jjCALL3ARG()

BOOLEAN jjCALL3ARG | ( | leftv | res,
|  | leftv | u )

static

Definition at line 7368 of file iparith.cc.

{
leftv v = u->next;
leftv w = v->next;
u->next = NULL;
v->next = NULL;
BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
u->next = v;
v->next = w;
return b;
}
iiExprArith3
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition iparith.cc:9575

## jjCHAR()

BOOLEAN jjCHAR | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3949 of file iparith.cc.

{
res->data = (char *)(long)rChar((ring)v->Data());
return FALSE;
}
rChar
int rChar(ring r)
Definition ring.cc:719

## jjCHINREM_BI()

BOOLEAN jjCHINREM_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1682 of file iparith.cc.

{
intvec *c=(intvec*)u->Data();
intvec* p=(intvec*)v->Data();
int rl=p->length();
number *x=(number *)omAlloc(rl*sizeof(number));
number *q=(number *)omAlloc(rl*sizeof(number));
int i;
for(i=rl-1;i>=0;i--)
{
q[i]=n_Init((*p)[i], coeffs_BIGINT);
x[i]=n_Init((*c)[i], coeffs_BIGINT);
}
CFArray iv(rl);
number n=n_ChineseRemainderSym(x,q,rl,FALSE,iv,coeffs_BIGINT);
for(i=rl-1;i>=0;i--)
{
n_Delete(&(q[i]),coeffs_BIGINT);
n_Delete(&(x[i]),coeffs_BIGINT);
}
omFree(x); omFree(q);
res->data=(char *)n;
return FALSE;
}
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
x
Variable x
Definition cfModGcd.cc:4090
n_ChineseRemainderSym
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
Definition coeffs.h:759
omFree
#define omFree(addr)
Definition omAllocDecl.h:261

## jjCHINREM_ID()

BOOLEAN jjCHINREM_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 10229 of file iparith.cc.

{
if ((currRing!=NULL)
&& rField_is_Ring(currRing)
&& (!rField_is_Z(currRing)))
{
WerrorS("not implemented for rings with rings as coeffients (except ZZ)");
return TRUE;
}
coeffs cf;
lists c=(lists)u->CopyD(); // list of ideal or bigint/int
int rl=c->nr+1;
int return_type=c->m[0].Typ();
if ((return_type!=IDEAL_CMD)
&& (return_type!=MODUL_CMD)
&& (return_type!=SMATRIX_CMD)
&& (return_type!=MATRIX_CMD)
&& (return_type!=POLY_CMD))
{
if((return_type==BIGINT_CMD)
||(return_type==INT_CMD))
return_type=BIGINT_CMD;
else if (return_type==LIST_CMD)
{
// create a tmp list of the correct size
lists res_l=(lists)omAllocBin(slists_bin);
res_l->Init(rl /*c->nr+1*/);
BOOLEAN bo=FALSE;
int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,CHINREM_CMD);
for (unsigned i=0;i<=(unsigned)c->nr;i++)
{
sleftv tmp;
tmp.Copy(v);
bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],CHINREM_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
if (bo) { Werror("chinrem failed for list entry %d",i+1); break;}
}
c->Clean();
res->data=res_l;
res->rtyp=LIST_CMD;
return bo;
}
else
{
c->Clean();
WerrorS("poly/ideal/module/matrix/list expected");
return TRUE;
}
}
if (return_type==BIGINT_CMD)
cf=coeffs_BIGINT;
else
{
cf=currRing->cf;
if (nCoeff_is_Extension(cf) && (cf->extRing!=NULL))
cf=cf->extRing->cf;
}
lists pl=NULL;
intvec *p=NULL;
if (v->Typ()==LIST_CMD)
{
pl=(lists)v->Data();
if (pl->nr!=rl-1)
{
Werror("wromg number of primes (%d:%d) for chinrem",pl->nr+1,rl);
return TRUE;
}
}
else
{
p=(intvec*)v->Data();
if (p->length()!=rl)
{
Werror("wromg number of primes (%d:%d) for chinrem",p->length(),rl);
return TRUE;
}
}
ideal result;
ideal *x=(ideal *)omAlloc(rl*sizeof(ideal));
number *xx=NULL;
nMapFunc nMap=n_SetMap(coeffs_BIGINT,cf);
int i;
if (return_type!=BIGINT_CMD)
{
for(i=rl-1;i>=0;i--)
{
if (c->m[i].Typ()!=return_type)
{
Werror("%s expected at pos %d",Tok2Cmdname(return_type),i+1);
omFree(x); // delete c
return TRUE;
}
if (return_type==POLY_CMD)
{
x[i]=idInit(1,1);
x[i]->m[0]=(poly)c->m[i].CopyD();
}
else
{
x[i]=(ideal)c->m[i].CopyD();
}
//c->m[i].Init();
}
}
else
{
if (nMap==NULL)
{
Werror("not implemented: map bigint -> %s", nCoeffName(cf));
return TRUE;
}
xx=(number *)omAlloc(rl*sizeof(number));
for(i=rl-1;i>=0;i--)
{
if (c->m[i].Typ()==INT_CMD)
{
xx[i]=n_Init(((int)(long)c->m[i].Data()),cf);
}
else if (c->m[i].Typ()==BIGINT_CMD)
{
xx[i]=nMap((number)c->m[i].Data(),coeffs_BIGINT,cf);
}
else
{
Werror("bigint expected at pos %d",i+1);
omFree(x); // delete c
omFree(xx); // delete c
return TRUE;
}
}
}
number *q=(number *)omAlloc(rl*sizeof(number));
if (p!=NULL)
{
for(i=rl-1;i>=0;i--)
{
q[i]=n_Init((*p)[i], cf);
}
}
else
{
for(i=rl-1;i>=0;i--)
{
if (pl->m[i].Typ()==INT_CMD)
{
q[i]=n_Init((int)(long)pl->m[i].Data(),cf);
}
else if (pl->m[i].Typ()==BIGINT_CMD)
{
q[i]=nMap((number)(pl->m[i].Data()),coeffs_BIGINT,cf);
}
else
{
Werror("bigint expected at pos %d",i+1);
for(i++;i<rl;i++)
{
n_Delete(&(q[i]),cf);
}
omFree(x); // delete c
omFree(q); // delete pl
if (xx!=NULL) omFree(xx); // delete c
return TRUE;
}
}
}
if (return_type==BIGINT_CMD)
{
CFArray i_v(rl);
number n=n_ChineseRemainderSym(xx,q,rl,TRUE,i_v,coeffs_BIGINT);
res->data=(char *)n;
}
else
{
/* called in modular.lib::chinrem_recursive: too many proc.
#ifdef HAVE_VSPACE
int cpus = (long) feOptValue(FE_OPT_CPUS);
if ((cpus>1) && (rField_is_Q(currRing)))
result=id_ChineseRemainder_0(x,q,rl,currRing); // deletes also x
else
#endif
*/
result=id_ChineseRemainder(x,q,rl,currRing); // deletes also x
c->Clean();
if ((return_type==POLY_CMD) &&(result!=NULL))
{
res->data=(char *)result->m[0];
result->m[0]=NULL;
idDelete(&result);
}
else
res->data=(char *)result;
}
for(i=rl-1;i>=0;i--)
{
n_Delete(&(q[i]),cf);
}
omFree(q);
res->rtyp=return_type;
return result==NULL;
}
sleftv::Copy
void Copy(leftv e)
Definition subexpr.cc:689
slists::m
sleftv * m
Definition lists.h:46
slists::Clean
void Clean(ring r=currRing)
Definition lists.h:26
slists::Init
INLINE_THIS void Init(int l=0)
slists::nr
int nr
Definition lists.h:44
nCoeff_is_Extension
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition coeffs.h:841
result
return result
Definition facAbsBiFact.cc:76
SMATRIX_CMD
@ SMATRIX_CMD
Definition grammar.cc:292
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
rField_is_Z
static BOOLEAN rField_is_Z(const ring r)
Definition ring.h:515
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_ChineseRemainder
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
Definition simpleideals.cc:2147
LIST_CMD
@ LIST_CMD
Definition tok.h:118
CHINREM_CMD
@ CHINREM_CMD
Definition tok.h:45

## jjCOEF()

BOOLEAN jjCOEF | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1793 of file iparith.cc.

{
poly p=(poly)v->Data();
if ((p==NULL)||(pNext(p)!=NULL)) return TRUE;
res->data=(char *)mp_CoeffProc((poly)u->Data(),p /*(poly)v->Data()*/,currRing);
return FALSE;
}
mp_CoeffProc
matrix mp_CoeffProc(poly f, poly vars, const ring R)
Definition matpol.cc:392
pNext
#define pNext(p)
Definition monomials.h:36

## jjCOEF_Id()

BOOLEAN jjCOEF_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1800 of file iparith.cc.

{
poly p=(poly)v->Data();
if ((p==NULL)||(pNext(p)!=NULL)) return TRUE;
res->data=(char *)mp_CoeffProcId((ideal)u->Data(),p /*(poly)v->Data()*/,currRing);
return FALSE;
}
mp_CoeffProcId
matrix mp_CoeffProcId(ideal I, poly vars, const ring R)
Definition matpol.cc:469

## jjCOEF_M()

BOOLEAN jjCOEF_M | ( | leftv | ,
|  | leftv | v )

static

Definition at line 7380 of file iparith.cc.

{
const short t[]={4,VECTOR_CMD,POLY_CMD,MATRIX_CMD,MATRIX_CMD};
if (iiCheckTypes(v,t,1))
{
idhdl c=(idhdl)v->next->next->data;
if (v->next->next->next->rtyp!=IDHDL) return TRUE;
idhdl m=(idhdl)v->next->next->next->data;
idDelete((ideal *)&(c->data.uideal));
idDelete((ideal *)&(m->data.uideal));
mp_Coef2((poly)v->Data(),(poly)v->next->Data(),
(matrix *)&(c->data.umatrix),(matrix *)&(m->data.umatrix),currRing);
return FALSE;
}
return TRUE;
}
VECTOR_CMD
@ VECTOR_CMD
Definition grammar.cc:293
iiCheckTypes
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
Definition ipshell.cc:6576
mp_Coef2
void mp_Coef2(poly v, poly mon, matrix *c, matrix *m, const ring R)
corresponds to Macauley's coef: the exponent vector of vars has to contain the variables,...
Definition matpol.cc:574
idhdl
idrec * idhdl
Definition ring.h:22

## jjCOEFFS1()

BOOLEAN jjCOEFFS1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3954 of file iparith.cc.

{
ring r=(ring)v->Data();
r->cf->ref++;
res->data = (char *)r->cf;
return FALSE;
}

## jjCOEFFS2_KB()

BOOLEAN jjCOEFFS2_KB | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1818 of file iparith.cc.

{
poly p = pInit();
int i;
for (i=1; i<=currRing->N; i++)
{
pSetExp(p, i, 1);
}
pSetm(p);
res->data = (void*)idCoeffOfKBase((ideal)(u->Data()),
(ideal)(v->Data()), p);
pLmFree(&p);
return FALSE;
}
idCoeffOfKBase
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition ideals.cc:2668
pSetm
#define pSetm(p)
Definition polys.h:272
pLmFree
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition polys.h:71
pInit
#define pInit()
allocates a new monomial and initializes everything to 0
Definition polys.h:62
pSetExp
#define pSetExp(p, i, v)
Definition polys.h:43

## jjCOEFFS3_Id()

BOOLEAN jjCOEFFS3_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6120 of file iparith.cc.

{
if ((w->rtyp!=IDHDL)||(w->e!=NULL))
{
WerrorS("3rd argument must be a name of a matrix");
return TRUE;
}
ideal i=(ideal)u->Data();
int rank=(int)i->rank;
BOOLEAN r=jjCOEFFS_Id(res,u,v);
if (r) return TRUE;
mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
return FALSE;
}
jjCOEFFS_Id
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition iparith.cc:1807
mp_Monomials
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
Definition matpol.cc:355
pVar
#define pVar(m)
Definition polys.h:381

## jjCOEFFS3_KB()

BOOLEAN jjCOEFFS3_KB | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6134 of file iparith.cc.

{
res->data=(void*)idCoeffOfKBase((ideal)(u->Data()),
(ideal)(v->Data()),(poly)(w->Data()));
return FALSE;
}

## jjCOEFFS3_P()

BOOLEAN jjCOEFFS3_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6140 of file iparith.cc.

{
if ((w->rtyp!=IDHDL)||(w->e!=NULL))
{
WerrorS("3rd argument must be a name of a matrix");
return TRUE;
}
// CopyD for POLY_CMD and VECTOR_CMD are identical:
poly p=(poly)u->CopyD(POLY_CMD);
ideal i=idInit(1,1);
i->m[0]=p;
sleftv t;
t.Init();
t.data=(char *)i;
t.rtyp=IDEAL_CMD;
int rank=1;
if (u->Typ()==VECTOR_CMD)
{
i->rank=rank=pMaxComp(p);
t.rtyp=MODUL_CMD;
}
BOOLEAN r=jjCOEFFS_Id(res,&t,v);
t.CleanUp();
if (r) return TRUE;
mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
return FALSE;
}
pMaxComp
#define pMaxComp(p)
Definition polys.h:300

## jjCOEFFS_Id()

BOOLEAN jjCOEFFS_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1807 of file iparith.cc.

{
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
res->data=(char *)mp_Coeffs((ideal)u->CopyD(),i,currRing);
return FALSE;
}
mp_Coeffs
matrix mp_Coeffs(ideal I, int var, const ring R)
corresponds to Maple's coeffs: var has to be the number of a variable
Definition matpol.cc:306

## jjCOLCOL()

BOOLEAN jjCOLCOL | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 693 of file iparith.cc.

{
switch(u->Typ())
{
case 0:
{
int name_err=0;
if(isupper(u->name[0]))
{
const char *c=u->name+1;
while((*c!='\0')&&(islower(*c)||(isdigit(*c))||(*c=='_'))) c++;
if (*c!='\0')
name_err=1;
else
{
Print("%s of type 'ANY'. Trying load.\n", u->name);
if(iiTryLoadLib(u, u->name))
{
Werror("'%s' no such package", u->name);
return TRUE;
}
syMake(u,u->name,NULL);
}
}
else name_err=1;
if(name_err)
{ Werror("'%s' is an invalid package name",u->name);return TRUE;}
// and now, after the loading: use next case !!! no break !!!
}
case PACKAGE_CMD:
{
package pa=(package)u->Data();
if (u->rtyp==IDHDL) pa=IDPACKAGE((idhdl)u->data);
if((!pa->loaded)
&& (pa->language > LANG_TOP))
{
Werror("'%s' not loaded", u->name);
return TRUE;
}
if(v->rtyp == IDHDL)
{
v->name = omStrDup(v->name);
}
else if (v->rtyp!=0)
{
WerrorS("reserved name with ::");
return TRUE;
}
v->req_packhdl=pa;
syMake(v, v->name, pa);
memcpy(res, v, sizeof(sleftv));
v->Init();
}
break;
case DEF_CMD:
break;
default:
WerrorS("<package>::<id> expected");
return TRUE;
}
return FALSE;
}
Variable::name
char name() const
Definition variable.cc:122
pa
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
if
if(!FE_OPT_NO_SHELL_FLAG)
Definition fehelp.cc:1000
IDPACKAGE
#define IDPACKAGE(a)
Definition ipid.h:139
iiTryLoadLib
BOOLEAN iiTryLoadLib(leftv v, const char *id)
Definition iplib.cc:832
syMake
void syMake(leftv v, const char *id, package pa)
Definition subexpr.cc:1613
LANG_TOP
@ LANG_TOP
Definition subexpr.h:22
PACKAGE_CMD
@ PACKAGE_CMD
Definition tok.h:150
DEF_CMD
@ DEF_CMD
Definition tok.h:58

## jjCOLON()

BOOLEAN jjCOLON | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 320 of file iparith.cc.

{
int l=(int)(long)v->Data();
if (l>=0)
{
int d=(int)(long)u->Data();
intvec *vv=new intvec(l);
int i;
for(i=l-1;i>=0;i--) { (*vv)[i]=d; }
res->data=(char *)vv;
}
return (l<0);
}

## jjCOLS()

BOOLEAN jjCOLS | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3961 of file iparith.cc.

{
res->data = (char *)(long)MATCOLS((matrix)(v->Data()));
return FALSE;
}

## jjCOLS_BIM()

BOOLEAN jjCOLS_BIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3966 of file iparith.cc.

{
res->data = (char *)(long)((bigintmat*)(v->Data()))->cols();
return FALSE;
}

## jjCOLS_IV()

BOOLEAN jjCOLS_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3971 of file iparith.cc.

{
res->data = (char *)(long)((intvec*)(v->Data()))->cols();
return FALSE;
}

## jjCOMPARE_ALL()

int jjCOMPARE_ALL | ( | const void * | aa,
|  | const void * | bb )

static

Definition at line 10447 of file iparith.cc.

{
leftv a=(leftv)aa;
int at=a->Typ();
leftv b=(leftv)bb;
int bt=b->Typ();
if (at < bt) return -1;
if (at > bt) return 1;
int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,'<');
sleftv tmp;
tmp.Init();
iiOp='<';
BOOLEAN bo=iiExprArith2TabIntern(&tmp,a,'<',b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
if (bo)
{
Werror(" no `<` for %s",Tok2Cmdname(at));
unsigned long ad=(unsigned long)a->Data();
unsigned long bd=(unsigned long)b->Data();
if (ad<bd) return -1;
else if (ad==bd) return 0;
else return 1;
}
else if (tmp.data==NULL) /* not < */
{
iiOp=EQUAL_EQUAL;
tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,EQUAL_EQUAL);
bo=iiExprArith2TabIntern(&tmp,a,EQUAL_EQUAL,b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
if (bo)
{
Werror(" no `==` for %s",Tok2Cmdname(at));
unsigned long ad=(unsigned long)a->Data();
unsigned long bd=(unsigned long)b->Data();
if (ad<bd) return -1;
else if (ad==bd) return 0;
else return 1;
}
else if (tmp.data==NULL) /* not <,== */ return 1;
else return 0;
}
else return -1;
}
EQUAL_EQUAL
@ EQUAL_EQUAL
Definition grammar.cc:268

## jjCOMPARE_BIM()

BOOLEAN jjCOMPARE_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 367 of file iparith.cc.

{
bigintmat* a = (bigintmat * )(u->Data());
bigintmat* b = (bigintmat * )(v->Data());
int r=a->compare(b);
switch (iiOp)
{
#if 0
case '<':
res->data = (char *) (r<0);
break;
case '>':
res->data = (char *) (r>0);
break;
case LE:
res->data = (char *) (r<=0);
break;
case GE:
res->data = (char *) (r>=0);
break;
#endif
case EQUAL_EQUAL:
case NOTEQUAL: /* negation handled by jjEQUAL_REST */
res->data = (char *) (r==0);
break;
}
jjEQUAL_REST(res,u,v);
if(r==-2) { WerrorS("size incompatible"); return TRUE; }
return FALSE;
}
bigintmat::compare
int compare(const bigintmat *op) const
Definition bigintmat.cc:360
GE
@ GE
Definition grammar.cc:269
LE
@ LE
Definition grammar.cc:270
NOTEQUAL
@ NOTEQUAL
Definition grammar.cc:273
jjEQUAL_REST
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition iparith.cc:1367

## jjCOMPARE_IV()

BOOLEAN jjCOMPARE_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 339 of file iparith.cc.

{
intvec* a = (intvec * )(u->Data());
intvec* b = (intvec * )(v->Data());
int r=a->compare(b);
switch (iiOp)
{
case '<':
res->data = (char *) (r<0);
break;
case '>':
res->data = (char *) (r>0);
break;
case LE:
res->data = (char *) (r<=0);
break;
case GE:
res->data = (char *) (r>=0);
break;
case EQUAL_EQUAL:
case NOTEQUAL: /* negation handled by jjEQUAL_REST */
res->data = (char *) (r==0);
break;
}
jjEQUAL_REST(res,u,v);
if(r==-2) { WerrorS("size incompatible"); return TRUE; }
return FALSE;
}
intvec::compare
int compare(const intvec *o) const
Definition intvec.cc:206

## jjCOMPARE_IV_I()

BOOLEAN jjCOMPARE_IV_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 397 of file iparith.cc.

{
intvec* a = (intvec * )(u->Data());
int b = (int)(long)(v->Data());
int r=a->compare(b);
switch (iiOp)
{
case '<':
res->data = (char *) (r<0);
break;
case '>':
res->data = (char *) (r>0);
break;
case LE:
res->data = (char *) (r<=0);
break;
case GE:
res->data = (char *) (r>=0);
break;
case EQUAL_EQUAL:
case NOTEQUAL: /* negation handled by jjEQUAL_REST */
res->data = (char *) (r==0);
break;
}
jjEQUAL_REST(res,u,v);
return FALSE;
}

## jjCOMPARE_MA()

BOOLEAN jjCOMPARE_MA | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 424 of file iparith.cc.

{
//Print("in: >>%s<<\n",my_yylinebuf);
matrix a=(matrix)u->Data();
matrix b=(matrix)v->Data();
int r=mp_Compare(a,b,currRing);
switch (iiOp)
{
case '<':
res->data = (char *) (long)(r < 0);
break;
case '>':
res->data = (char *) (long)(r > 0);
break;
case LE:
res->data = (char *) (long)(r <= 0);
break;
case GE:
res->data = (char *) (long)(r >= 0);
break;
case EQUAL_EQUAL:
case NOTEQUAL: /* negation handled by jjEQUAL_REST */
res->data = (char *)(long) (r == 0);
break;
}
jjEQUAL_REST(res,u,v);
return FALSE;
}
mp_Compare
int mp_Compare(matrix a, matrix b, const ring R)
Definition matpol.cc:637

## jjCOMPARE_P()

BOOLEAN jjCOMPARE_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 452 of file iparith.cc.

{
poly p=(poly)u->Data();
poly q=(poly)v->Data();
int r=p_Compare(p,q,currRing);
switch (iiOp)
{
case '<':
res->data = (char *) (r < 0);
break;
case '>':
res->data = (char *) (r > 0);
break;
case LE:
res->data = (char *) (r <= 0);
break;
case GE:
res->data = (char *) (r >= 0);
break;
//case EQUAL_EQUAL:
//case NOTEQUAL: /* negation handled by jjEQUAL_REST */
// res->data = (char *) (r == 0);
// break;
}
jjEQUAL_REST(res,u,v);
return FALSE;
}
p_Compare
int p_Compare(const poly a, const poly b, const ring R)
Definition p_polys.cc:5050

## jjCOMPARE_S()

BOOLEAN jjCOMPARE_S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 479 of file iparith.cc.

{
char* a = (char * )(u->Data());
char* b = (char * )(v->Data());
int result = strcmp(a,b);
switch (iiOp)
{
case '<':
res->data = (char *) (result < 0);
break;
case '>':
res->data = (char *) (result > 0);
break;
case LE:
res->data = (char *) (result <= 0);
break;
case GE:
res->data = (char *) (result >= 0);
break;
case EQUAL_EQUAL:
case NOTEQUAL: /* negation handled by jjEQUAL_REST */
res->data = (char *) (result == 0);
break;
}
jjEQUAL_REST(res,u,v);
return FALSE;
}

## jjCONTENT()

BOOLEAN jjCONTENT | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3976 of file iparith.cc.

{
// CopyD for POLY_CMD and VECTOR_CMD are identical:
poly p=(poly)v->CopyD(POLY_CMD);
if (p!=NULL) p_Cleardenom(p, currRing);
res->data = (char *)p;
return FALSE;
}
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition p_polys.cc:2893

## jjCONTRACT()

BOOLEAN jjCONTRACT | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1832 of file iparith.cc.

{
res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data(),FALSE);
return FALSE;
}
idDiffOp
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
Definition ideals.cc:2202

## jjCOUNT_BI()

BOOLEAN jjCOUNT_BI | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3984 of file iparith.cc.

{
res->data = (char *)(long)n_Size((number)v->Data(),coeffs_BIGINT);
return FALSE;
}
n_Size
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition coeffs.h:573

## jjCOUNT_BIM()

BOOLEAN jjCOUNT_BIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3989 of file iparith.cc.

{
bigintmat* aa= (bigintmat *)v->Data();
res->data = (char *)(long)(aa->rows()*aa->cols());
return FALSE;
}

## jjCOUNT_IV()

BOOLEAN jjCOUNT_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4012 of file iparith.cc.

{
res->data = (char *)(long)((intvec*)(v->Data()))->length();
return FALSE;
}

## jjCOUNT_L()

BOOLEAN jjCOUNT_L | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4000 of file iparith.cc.

{
lists l=(lists)v->Data();
res->data = (char *)(long)(lSize(l)+1);
return FALSE;
}
lSize
int lSize(lists L)
Definition lists.cc:25

## jjCOUNT_M()

BOOLEAN jjCOUNT_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4006 of file iparith.cc.

{
matrix m=(matrix)v->Data();
res->data = (char *)(long)(MATROWS(m)*MATCOLS(m));
return FALSE;
}

## jjCOUNT_N()

BOOLEAN jjCOUNT_N | ( | leftv | res,
|  | leftv | v )

static

Definition at line 3995 of file iparith.cc.

{
res->data = (char *)(long)nSize((number)v->Data());
return FALSE;
}

## jjCOUNT_RES()

BOOLEAN jjCOUNT_RES | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5766 of file iparith.cc.

{
res->data=(char *)(long)sySize((syStrategy)v->Data());
return FALSE;
}
sySize
int sySize(syStrategy syzstr)
Definition syz1.cc:1830
syStrategy
ssyStrategy * syStrategy
Definition syz.h:36

## jjCOUNT_RG()

BOOLEAN jjCOUNT_RG | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4017 of file iparith.cc.

{
ring r=(ring)v->Data();
int elems=-1;
if (rField_is_Zp(r)) elems=r->cf->ch;
else if (rField_is_GF(r)) elems=r->cf->m_nfCharQ;
else if (rField_is_Zp_a(r) && (r->cf->type==n_algExt))
{
extern int ipower ( int b, int n ); /* factory/cf_util */
elems=ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));
}
res->data = (char *)(long)elems;
return FALSE;
}
ipower
int ipower(int b, int m)
int ipower ( int b, int m )
Definition cf_util.cc:27
n_algExt
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
Definition coeffs.h:35
rField_is_Zp_a
static BOOLEAN rField_is_Zp_a(const ring r)
Definition ring.h:535
rField_is_Zp
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:506
rField_is_GF
static BOOLEAN rField_is_GF(const ring r)
Definition ring.h:527

## jjDEFINED()

BOOLEAN jjDEFINED | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4067 of file iparith.cc.

{
if ((v->rtyp==IDHDL)
&& ((myynest==IDLEV((idhdl)v->data))||(0==IDLEV((idhdl)v->data))))
{
res->data=(void *)(long)(IDLEV((idhdl)v->data)+1);
}
else if (v->rtyp!=0) res->data=(void *)(-1);
return FALSE;
}
IDLEV
#define IDLEV(a)
Definition ipid.h:121

## jjDEG()

BOOLEAN jjDEG | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4031 of file iparith.cc.

{
int dummy;
poly p=(poly)v->Data();
if (p!=NULL) res->data = (char *)currRing->pLDeg(p,&dummy,currRing);
else res->data=(char *)-1;
return FALSE;
}

## jjDEG_IV()

BOOLEAN jjDEG_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1848 of file iparith.cc.

{
poly p=(poly)u->Data();
if (p!=NULL)
{
int *iv=iv2array((intvec *)v->Data(),currRing);
const long d = p_DegW(p,iv,currRing);
omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(int) );
res->data = (char *)(d);
}
else
res->data=(char *)(long)(-1);
return FALSE;
}
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
p_DegW
long p_DegW(poly p, const int *w, const ring R)
Definition p_polys.cc:691
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
iv2array
int * iv2array(intvec *iv, const ring R)
Definition weight.cc:200

## jjDEG_M()

BOOLEAN jjDEG_M | ( | leftv | res,
|  | leftv | u )

static

Definition at line 4039 of file iparith.cc.

{
ideal I=(ideal)u->Data();
int d=-1;
int dummy;
int i;
for(i=IDELEMS(I)-1;i>=0;i--)
if (I->m[i]!=NULL) d=si_max(d,(int)currRing->pLDeg(I->m[i],&dummy,currRing));
res->data = (char *)(long)d;
return FALSE;
}
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125

## jjDEG_M_IV()

BOOLEAN jjDEG_M_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1837 of file iparith.cc.

{
int *iv=iv2array((intvec *)v->Data(),currRing);
ideal I=(ideal)u->Data();
int d=-1;
int i;
for(i=IDELEMS(I);i>=0;i--) d=si_max(d,(int)p_DegW(I->m[i],iv,currRing));
omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(int) );
res->data = (char *)((long)d);
return FALSE;
}

## jjDEGREE()

BOOLEAN jjDEGREE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4050 of file iparith.cc.

{
SPrintStart();
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of degree is being performed for\n");
PrintS("// generic fibre, that is, over Q\n");
}
assumeStdFlag(v);
intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
scDegree((ideal)v->Data(),module_w,currRing->qideal);
char *s=SPrintEnd();
int l=strlen(s)-1;
s[l]='\0';
res->data=(void*)s;
return FALSE;
}
atGet
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition attrib.cc:132
scDegree
void scDegree(ideal S, intvec *modulweight, ideal Q)
Definition hilb.cc:2057
SPrintStart
void SPrintStart()
Definition reporter.cc:250
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
SPrintEnd
char * SPrintEnd()
Definition reporter.cc:277
assumeStdFlag
BOOLEAN assumeStdFlag(leftv h)
Definition subexpr.cc:1587

## jjDelete_ID()

BOOLEAN jjDelete_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1869 of file iparith.cc.

{
int pos=(int)(long)v->Data();
ideal I=(ideal)u->Data();
res->data=(void*)id_Delete_Pos(I,pos-1,currRing);
return res->data==NULL;
}
id_Delete_Pos
ideal id_Delete_Pos(const ideal I, const int p, const ring r)
Definition simpleideals.cc:2210

## jjDelete_ID_IV()

BOOLEAN jjDelete_ID_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1876 of file iparith.cc.

{
intvec *iv=(intvec*)v->Data();
ideal I=(ideal)u->Data();
ideal tmp1=NULL;
ideal tmp2;
for(int i=iv->length()-1;i>=0;i--)
{
int pos= (*iv)[i];
tmp2=id_Delete_Pos(I,pos-1,currRing);
if (tmp1==NULL) /* first entry */
{ tmp1=I; }
else
{ id_Delete(&I,currRing); }
I=tmp2;
if (I==NULL) break;
}
res->data=(void*)I;
return res->data==NULL;
}
tmp1
CFList tmp1
Definition facFqBivar.cc:75
tmp2
CFList tmp2
Definition facFqBivar.cc:75

## jjDelete_IV()

BOOLEAN jjDelete_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1862 of file iparith.cc.

{
int pos=(int)(long)v->Data();
intvec *iv=(intvec*)u->Data();
res->data=(void*)iv->delete_pos(pos-1);
return res->data==NULL;
}
intvec::delete_pos
intvec * delete_pos(int p)
Definition intvec.cc:842

## jjDENOMINATOR()

BOOLEAN jjDENOMINATOR | ( | leftv | res,
|  | leftv | v )

static

Return the denominator of the input number.

Definition at line 4079 of file iparith.cc.

{
number n = reinterpret_cast<number>(v->CopyD());
res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing->cf));
n_Delete(&n,currRing->cf);
return FALSE;
}
n_GetDenom
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1)
Definition coeffs.h:606

## jjDET()

BOOLEAN jjDET | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4096 of file iparith.cc.

{
matrix m=(matrix)v->Data();
res ->data = mp_Det(m,currRing);
return FALSE;
}
mp_Det
poly mp_Det(matrix a, const ring r, DetVariant d)
Definition matpol.cc:2139

## jjDET2()

BOOLEAN jjDET2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1896 of file iparith.cc.

{
matrix m=(matrix)u->Data();
DetVariant d=mp_GetAlgorithmDet((char*)v->Data());
res ->data = mp_Det(m,currRing,d);
return FALSE;
}
mp_GetAlgorithmDet
DetVariant mp_GetAlgorithmDet(matrix m, const ring r)
Definition matpol.cc:2108
DetVariant
DetVariant
Definition matpol.h:35

## jjDET2_S()

BOOLEAN jjDET2_S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1903 of file iparith.cc.

{
DetVariant d=mp_GetAlgorithmDet((char*)v->Data());
ideal m=(ideal)u->Data();
res ->data = sm_Det(m,currRing,d);
return FALSE;
}
sm_Det
poly sm_Det(ideal a, const ring r, DetVariant d)
Definition matpol.cc:2163

## jjDET_BI()

BOOLEAN jjDET_BI | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4102 of file iparith.cc.

{
bigintmat * m=(bigintmat*)v->Data();
int i,j;
i=m->rows();j=m->cols();
if(i==j)
res->data = (char *)(long)singclap_det_bi(m,coeffs_BIGINT);
else
{
Werror("det of %d x %d bigintmat",i,j);
return TRUE;
}
return FALSE;
}
singclap_det_bi
number singclap_det_bi(bigintmat *m, const coeffs cf)
Definition clapsing.cc:1852

## jjDET_I()

BOOLEAN jjDET_I | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4138 of file iparith.cc.

{
intvec * m=(intvec*)v->Data();
int i,j;
i=m->rows();j=m->cols();
if(i==j)
res->data = (char *)(long)singclap_det_i(m,currRing);
else
{
Werror("det of %d x %d intmat",i,j);
return TRUE;
}
return FALSE;
}
singclap_det_i
int singclap_det_i(intvec *m, const ring)
Definition clapsing.cc:1834

## jjDET_S()

BOOLEAN jjDET_S | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4152 of file iparith.cc.

{
ideal I=(ideal)v->Data();
res->data=(char*)sm_Det(I,currRing);
return FALSE;
}

## jjDIFF_COEF()

BOOLEAN jjDIFF_COEF | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 4516 of file iparith.cc.

{
if (!nCoeff_is_transExt(currRing->cf))
{
WerrorS("differentiation not defined in the coefficient ring");
return TRUE;
}
number n = (number) u->Data();
number k = (number) v->Data();
res->data = ntDiff(n,k,currRing->cf);
return FALSE;
}
nCoeff_is_transExt
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition coeffs.h:913
ntDiff
number ntDiff(number a, number d, const coeffs cf)
Definition transext.cc:897

## jjDIFF_ID()

BOOLEAN jjDIFF_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1921 of file iparith.cc.

{
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
res->data=(char *)idDiff((matrix)(u->Data()),i);
return FALSE;
}
idDiff
matrix idDiff(matrix i, int k)
Definition ideals.cc:2189

## jjDIFF_ID_ID()

BOOLEAN jjDIFF_ID_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1932 of file iparith.cc.

{
res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data());
return FALSE;
}

## jjDIFF_P()

BOOLEAN jjDIFF_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1910 of file iparith.cc.

{
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
res->data=(char *)pDiff((poly)(u->Data()),i);
return FALSE;
}
pDiff
#define pDiff(a, b)
Definition polys.h:297

## jjDIM()

BOOLEAN jjDIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4158 of file iparith.cc.

{
assumeStdFlag(v);
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (rField_is_Ring(currRing))
{
WerrorS("`dim` is not implemented for letterplace rings over rings");
return TRUE;
}
if (currRing->qideal != NULL)
{
WerrorS("qring not supported by `dim` for letterplace rings at the moment");
return TRUE;
}
int gkDim = lp_gkDim((ideal)(v->Data()));
res->data = (char *)(long)gkDim;
return (gkDim == -2);
}
#endif
if (rHasMixedOrdering(currRing))
{
Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
}
res->data = (char *)(long)scDimIntRing((ideal)(v->Data()),currRing->qideal);
return FALSE;
}
scDimIntRing
int scDimIntRing(ideal vid, ideal Q)
scDimInt for ring-coefficients
Definition hdegree.cc:136
lp_gkDim
int lp_gkDim(const ideal _G)
Definition hdegree.cc:1827
rHasMixedOrdering
static BOOLEAN rHasMixedOrdering(const ring r)
Definition ring.h:770

## jjDIM2()

BOOLEAN jjDIM2 | ( | leftv | res,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 1937 of file iparith.cc.

{
assumeStdFlag(v);
if (rHasMixedOrdering(currRing))
{
Warn("dim(%s,...) may be wrong because the mixed monomial ordering",v->Name());
}
if(currRing->qideal==NULL)
res->data = (char *)((long)scDimIntRing((ideal)(v->Data()),(ideal)w->Data()));
else
{
ideal q=idSimpleAdd(currRing->qideal,(ideal)w->Data());
res->data = (char *)((long)scDimIntRing((ideal)(v->Data()),q));
idDelete(&q);
}
return FALSE;
}
idSimpleAdd
#define idSimpleAdd(A, B)
Definition ideals.h:42

## jjDIM_R()

BOOLEAN jjDIM_R | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5771 of file iparith.cc.

{
res->data = (char *)(long)syDim((syStrategy)v->Data());
return FALSE;
}
syDim
int syDim(syStrategy syzstr)
Definition syz1.cc:1850

## jjDIV_BI()

BOOLEAN jjDIV_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1250 of file iparith.cc.

{
number q=(number)v->Data();
if (n_IsZero(q,coeffs_BIGINT))
{
WerrorS(ii_div_by_0);
return TRUE;
}
q = n_Div((number)u->Data(),q,coeffs_BIGINT);
n_Normalize(q,coeffs_BIGINT);
res->data = (char *)q;
return FALSE;
}
n_Div
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition coeffs.h:618
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
n_Normalize
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition coeffs.h:581
ii_div_by_0
#define ii_div_by_0
Definition iparith.cc:217

## jjDIV_Ma()

BOOLEAN jjDIV_Ma | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1294 of file iparith.cc.

{
poly q=(poly)v->Data();
if (q==NULL)
{
WerrorS(ii_div_by_0);
return TRUE;
}
matrix m=(matrix)(u->Data());
int r=m->rows();
int c=m->cols();
matrix mm=mpNew(r,c);
unsigned i,j;
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
if (pNext(q)!=NULL)
{
MATELEM(mm,i,j) = singclap_pdivide( MATELEM(m,i,j) ,
q /*(poly)(v->Data())*/, currRing );
}
else
MATELEM(mm,i,j) = pp_DivideM(MATELEM(m,i,j),q,currRing);
}
}
res->data=(char *)mm;
return FALSE;
}
singclap_pdivide
poly singclap_pdivide(poly f, poly g, const ring r)
Definition clapsing.cc:649
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
pp_DivideM
poly pp_DivideM(poly a, poly b, const ring r)
Definition p_polys.cc:1637

## jjDIV_N()

BOOLEAN jjDIV_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1263 of file iparith.cc.

{
number q=(number)v->Data();
if (nIsZero(q))
{
WerrorS(ii_div_by_0);
return TRUE;
}
q = nDiv((number)u->Data(),q);
nNormalize(q);
res->data = (char *)q;
return FALSE;
}
nDiv
#define nDiv(a, b)
Definition numbers.h:32
nNormalize
#define nNormalize(n)
Definition numbers.h:30

## jjDIV_P()

BOOLEAN jjDIV_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1276 of file iparith.cc.

{
poly q=(poly)v->Data();
poly p=(poly)(u->Data());
if (q!=NULL)
{
res->data=(void*)(pp_Divide(p /*(poly)(u->Data())*/ ,
q /*(poly)(v->Data())*/ ,currRing));
if (res->data!=NULL) pNormalize((poly)res->data);
return errorreported; /*there may be errors in p_Divide: div. ny 0, etc.*/
}
else
{
WerrorS("div. by 0");
return TRUE;
}
}
pp_Divide
poly pp_Divide(poly p, poly q, const ring r)
polynomial division a/b, ignoring the rest via singclap_pdivide resp. idLift does not destroy a,...
Definition polys.cc:178
pNormalize
#define pNormalize(p)
Definition polys.h:318

## jjDIVISION()

BOOLEAN jjDIVISION | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1954 of file iparith.cc.

{
ideal vi=(ideal)v->Data();
int vl= IDELEMS(vi);
ideal ui=(ideal)u->Data();
unsigned ul= IDELEMS(ui);
ideal R; matrix U;
ideal m = idLift(vi,ui,&R, FALSE,hasFlag(v,FLAG_STD),TRUE,&U);
if (m==NULL) return TRUE;
// now make sure that all matrices have the correct size:
matrix T = id_Module2formatedMatrix(m,vl,ul,currRing);
assume (MATCOLS(U) == (int)ul);
lists L=(lists)omAllocBin(slists_bin);
L->Init(3);
L->m[0].rtyp=MATRIX_CMD; L->m[0].data=(void *)T;
L->m[1].rtyp=u->Typ(); L->m[1].data=(void *)R;
L->m[2].rtyp=MATRIX_CMD; L->m[2].data=(void *)U;
res->data=(char *)L;
return FALSE;
}
idLift
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
Definition ideals.cc:1111
hasFlag
#define hasFlag(A, F)
Definition ipid.h:112
FLAG_STD
#define FLAG_STD
Definition ipid.h:106
T
STATIC_VAR jList * T
Definition janet.cc:30
id_Module2formatedMatrix
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
Definition simpleideals.cc:1640
R
#define R
Definition sirandom.c:27

## jjDIVISION4()

BOOLEAN jjDIVISION4 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7397 of file iparith.cc.

{ // may have 3 or 4 arguments
leftv v1=v;
leftv v2=v1->next;
leftv v3=v2->next;
leftv v4=v3->next;
assumeStdFlag(v2);
int i1=iiTestConvert(v1->Typ(),MODUL_CMD);
int i2=iiTestConvert(v2->Typ(),MODUL_CMD);
if((i1==0)||(i2==0)
||(v3->Typ()!=INT_CMD)||((v4!=NULL)&&(v4->Typ()!=INTVEC_CMD)))
{
WarnS("<module>,<module>,<int>[,<intvec>] expected!");
return TRUE;
}
sleftv w1,w2;
iiConvert(v1->Typ(),MODUL_CMD,i1,v1,&w1);
iiConvert(v2->Typ(),MODUL_CMD,i2,v2,&w2);
ideal P=(ideal)w1.Data();
ideal Q=(ideal)w2.Data();
int n=(int)(long)v3->Data();
int *w=NULL;
if(v4!=NULL)
{
w = iv2array((intvec *)v4->Data(),currRing);
int * w0 = w + 1;
int i = currRing->N;
while( (i > 0) && ((*w0) > 0) )
{
w0++;
i--;
}
if(i>0)
WarnS("not all weights are positive!");
}
matrix T;
ideal R;
idLiftW(P,Q,n,T,R,w);
w1.CleanUp();
w2.CleanUp();
if(w!=NULL)
omFreeSize( (ADDRESS)w, (rVar(currRing)+1)*sizeof(int) );
lists L=(lists) omAllocBin(slists_bin);
L->Init(2);
L->m[1].rtyp=v1->Typ();
if(v1->Typ()==POLY_CMD||v1->Typ()==VECTOR_CMD)
{
if(v1->Typ()==POLY_CMD)
p_Shift(&R->m[0],-1,currRing);
L->m[1].data=(void *)R->m[0];
R->m[0]=NULL;
idDelete(&R);
}
else if(v1->Typ()==IDEAL_CMD||v1->Typ()==MATRIX_CMD)
L->m[1].data=(void *)id_Module2Matrix(R,currRing);
else
{
L->m[1].rtyp=MODUL_CMD;
L->m[1].data=(void *)R;
}
L->m[0].rtyp=MATRIX_CMD;
L->m[0].data=(char *)T;
res->data=L;
return FALSE;
}
idLiftW
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, int *w)
Definition ideals.cc:1347
id_Module2Matrix
matrix id_Module2Matrix(ideal mod, const ring R)
Definition simpleideals.cc:1594
Q
#define Q
Definition sirandom.c:26

## jjDIVMOD_I()

BOOLEAN jjDIVMOD_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1227 of file iparith.cc.

{
if (iiOp=='/') Warn("int division with `/`: use `div` instead in line >>%s<<",my_yylinebuf);
long a= (long)u->Data();
long b= (long)v->Data();
if (b==0)
{
WerrorS(ii_div_by_0);
return TRUE;
}
long c=a%b;
long r=0;
switch (iiOp)
{
case '%':
r=c; break;
case '/':
case INTDIV_CMD:
r=((a-c) /b); break;
}
res->data=(void *)r;
return FALSE;
}
INTDIV_CMD
@ INTDIV_CMD
Definition tok.h:97

## jjDOTDOT()

BOOLEAN jjDOTDOT | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 333 of file iparith.cc.

{
res->data=(char *)new intvec((int)(long)u->Data(),(int)(long)v->Data());
return FALSE;
}

## jjDUMMY()

BOOLEAN jjDUMMY | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3777 of file iparith.cc.

{
// res->data = (char *)u->CopyD();
// also copy attributes:
res->Copy(u);
return FALSE;
}

## jjDUMP()

BOOLEAN jjDUMP | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4186 of file iparith.cc.

{
si_link l = (si_link)v->Data();
if (slDump(l))
{
const char *s;
if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
else s=sNoName_fe;
Werror("cannot dump to `%s`",s);
return TRUE;
}
else
return FALSE;
}
slDump
BOOLEAN slDump(si_link l)
Definition silink.cc:344
si_link
ip_link * si_link
Definition silink.h:20

## jjE()

BOOLEAN jjE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4200 of file iparith.cc.

{
res->data = (char *)pOne();
int co=(int)(long)v->Data();
if (co>0)
{
pSetComp((poly)res->data,co);
pSetm((poly)res->data);
}
else WerrorS("argument of gen must be positive");
return (co<=0);
}
pSetComp
#define pSetComp(p, v)
Definition polys.h:39
pOne
#define pOne()
Definition polys.h:316

## jjELIMIN()

BOOLEAN jjELIMIN | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1974 of file iparith.cc.

{
res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data());
//setFlag(res,FLAG_STD);
return v->next!=NULL; //do not allow next like in eliminate(I,a(1..4))
}
idElimination
ideal idElimination(ideal h1, poly delVar, intvec *hilb, GbVariant alg)
Definition ideals.cc:1884

## jjELIMIN_ALG()

BOOLEAN jjELIMIN_ALG | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6167 of file iparith.cc.

{
ideal I=(ideal)u->Data();
GbVariant alg=syGetAlgorithm((char*)w->Data(),currRing,I);
res->data=(char *)idElimination(I,(poly)v->Data(),NULL,alg);
//setFlag(res,FLAG_STD);
return v->next!=NULL; //do not allow next like in eliminate(I,a(1..4))
}
syGetAlgorithm
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
Definition ideals.cc:3698
GbVariant
GbVariant
Definition ideals.h:119

## jjELIMIN_HILB()

BOOLEAN jjELIMIN_HILB | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6175 of file iparith.cc.

{
bigintmat *ww=(bigintmat*)w->Data();
res->data=(char *)idElimination2((ideal)u->Data(),(poly)v->Data(),
ww);
//setFlag(res,FLAG_STD);
return FALSE;
}
idElimination2
ideal idElimination2(ideal h1, poly delVar, bigintmat *hilb, GbVariant alg)
Definition ideals.cc:1640

## jjELIMIN_IV()

BOOLEAN jjELIMIN_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1980 of file iparith.cc.

{
poly p=pOne();
intvec *iv=(intvec*)v->Data();
for(int i=iv->length()-1; i>=0; i--)
{
pSetExp(p,(*iv)[i],1);
}
pSetm(p);
res->data=(char *)idElimination((ideal)u->Data(),p);
pLmDelete(&p);
//setFlag(res,FLAG_STD);
return FALSE;
}
pLmDelete
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition polys.h:77

## jjENVELOPE()

BOOLEAN jjENVELOPE | ( | leftv | res,
|  | leftv | a )

static

Definition at line 5329 of file iparith.cc.

{
#ifdef HAVE_PLURAL
ring r = (ring)a->Data();
if (rIsPluralRing(r))
{
ring s = rEnvelope(r);
res->data = s;
}
else res->data = rCopy(r);
return FALSE;
#else
return TRUE;
#endif
}
rEnvelope
ring rEnvelope(ring R)
Definition ring.cc:5819
rCopy
ring rCopy(ring r)
Definition ring.cc:1737

## jjEQUAL_BI()

BOOLEAN jjEQUAL_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1323 of file iparith.cc.

{
res->data = (char *)((long)n_Equal((number)u->Data(),(number)v->Data(),coeffs_BIGINT));
jjEQUAL_REST(res,u,v);
return FALSE;
}
n_Equal
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition coeffs.h:466

## jjEQUAL_I()

BOOLEAN jjEQUAL_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1329 of file iparith.cc.

{
res->data = (char *)((int)((long)u->Data()) == (int)((long)v->Data()));
jjEQUAL_REST(res,u,v);
return FALSE;
}

## jjEQUAL_Ma()

BOOLEAN jjEQUAL_Ma | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1335 of file iparith.cc.

{
res->data = (char *)((long)mp_Equal((matrix)u->Data(),(matrix)v->Data(),currRing));
jjEQUAL_REST(res,u,v);
return FALSE;
}
mp_Equal
BOOLEAN mp_Equal(matrix a, matrix b, const ring R)
Definition matpol.cc:656

## jjEQUAL_N()

BOOLEAN jjEQUAL_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1353 of file iparith.cc.

{
res->data = (char *)((long)nEqual((number)u->Data(),(number)v->Data()));
jjEQUAL_REST(res,u,v);
return FALSE;
}
nEqual
#define nEqual(n1, n2)
Definition numbers.h:20

## jjEQUAL_P()

BOOLEAN jjEQUAL_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1359 of file iparith.cc.

{
poly p=(poly)u->Data();
poly q=(poly)v->Data();
res->data = (char *) ((long)pEqualPolys(p,q));
jjEQUAL_REST(res,u,v);
return FALSE;
}
pEqualPolys
#define pEqualPolys(p1, p2)
Definition polys.h:400

## jjEQUAL_R()

BOOLEAN jjEQUAL_R | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1347 of file iparith.cc.

{
res->data = (char *)(long)(u->Data()==v->Data());
jjEQUAL_REST(res,u,v);
return FALSE;
}

## jjEQUAL_REST()

void jjEQUAL_REST | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1367 of file iparith.cc.

{
if ((res->data) && (u->next!=NULL) && (v->next!=NULL))
{
int save_iiOp=iiOp;
if (iiOp==NOTEQUAL)
iiExprArith2(res,u->next,EQUAL_EQUAL,v->next);
else
iiExprArith2(res,u->next,iiOp,v->next);
iiOp=save_iiOp;
}
if (iiOp==NOTEQUAL) res->data=(char *)(!(long)res->data);
}

## jjEQUAL_SM()

BOOLEAN jjEQUAL_SM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1341 of file iparith.cc.

{
res->data = (char *)((long)sm_Equal((ideal)u->Data(),(ideal)v->Data(),currRing));
jjEQUAL_REST(res,u,v);
return FALSE;
}
sm_Equal
BOOLEAN sm_Equal(ideal a, ideal b, const ring R)
Definition matpol.cc:1999

## jjERROR()

BOOLEAN jjERROR | ( | leftv | ,
|  | leftv | u )

static

Definition at line 1999 of file iparith.cc.

{
WerrorS((char *)u->Data());
EXTERN_VAR int inerror;
inerror=3;
return TRUE;
}
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
inerror
EXTERN_VAR int inerror
Definition interpreter_support.cc:21

## jjEXECUTE()

BOOLEAN jjEXECUTE | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4212 of file iparith.cc.

{
char * d = (char *)v->Data();
char * s = (char *)omAlloc(strlen(d) + 13);
strcpy( s, (char *)d);
strcat( s, "\n;RETURN();\n");
newBuffer(s,BT_execute);
return yyparse();
}
newBuffer
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition fevoices.cc:166
BT_execute
@ BT_execute
Definition fevoices.h:23
yyparse
int yyparse(void)
Definition grammar.cc:2149

## jjEXPORTTO()

BOOLEAN jjEXPORTTO | ( | leftv | ,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1994 of file iparith.cc.

{
//Print("exportto %s -> %s\n",v->Name(),u->Name() );
return iiExport(v,0,IDPACKAGE((idhdl)u->data));
}
iiExport
BOOLEAN iiExport(leftv v, int toLev)
Definition ipshell.cc:1510

## jjEXTGCD_BI()

BOOLEAN jjEXTGCD_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2006 of file iparith.cc.

{
number uu=(number)u->Data();number vv=(number)v->Data();
lists L=(lists)omAllocBin(slists_bin);
number a,b;
number p0=n_ExtGcd(uu,vv,&a,&b,coeffs_BIGINT);
L->Init(3);
L->m[0].rtyp=BIGINT_CMD; L->m[0].data=(void *)p0;
L->m[1].rtyp=BIGINT_CMD; L->m[1].data=(void *)a;
L->m[2].rtyp=BIGINT_CMD; L->m[2].data=(void *)b;
res->rtyp=LIST_CMD;
res->data=(char *)L;
return FALSE;
}
n_ExtGcd
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
Definition coeffs.h:674

## jjEXTGCD_I()

BOOLEAN jjEXTGCD_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2020 of file iparith.cc.

{
int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
int p0=ABS(uu),p1=ABS(vv);
int f0 = 1, f1 = 0, g0 = 0, g1 = 1, q, r;
while ( p1!=0 )
{
q=p0 / p1;
r=p0 % p1;
p0 = p1; p1 = r;
r = g0 - g1 * q;
g0 = g1; g1 = r;
r = f0 - f1 * q;
f0 = f1; f1 = r;
}
int a = f0;
int b = g0;
if ( uu /*(int)(long)u->Data()*/ < 0 ) a=-a;
if ( vv /*(int)(long)v->Data()*/ < 0 ) b=-b;
lists L=(lists)omAllocBin(slists_bin);
L->Init(3);
L->m[0].rtyp=INT_CMD; L->m[0].data=(void *)(long)p0;
L->m[1].rtyp=INT_CMD; L->m[1].data=(void *)(long)a;
L->m[2].rtyp=INT_CMD; L->m[2].data=(void *)(long)b;
res->data=(char *)L;
return FALSE;
}
ABS
static int ABS(int v)
Definition auxiliary.h:113

## jjEXTGCD_P()

BOOLEAN jjEXTGCD_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2048 of file iparith.cc.

{
poly r,pa,pb;
BOOLEAN ret=singclap_extgcd((poly)u->Data(),(poly)v->Data(),r,pa,pb,currRing);
if (ret) return TRUE;
lists L=(lists)omAllocBin(slists_bin);
L->Init(3);
res->data=(char *)L;
L->m[0].data=(void *)r;
L->m[0].rtyp=POLY_CMD;
L->m[1].data=(void *)pa;
L->m[1].rtyp=POLY_CMD;
L->m[2].data=(void *)pb;
L->m[2].rtyp=POLY_CMD;
return FALSE;
}
singclap_extgcd
BOOLEAN singclap_extgcd(poly f, poly g, poly &res, poly &pa, poly &pb, const ring r)
Definition clapsing.cc:505
pb
static BOOLEAN pb(leftv res, leftv args)
Definition cohomo.cc:3796

## jjFAC_P()

BOOLEAN jjFAC_P | ( | leftv | res,
|  | leftv | u )

static

Definition at line 4261 of file iparith.cc.

{
intvec *v=NULL;
singclap_factorize_retry=0;
ideal f=singclap_factorize((poly)(u->CopyD()), &v, 0,currRing);
if (f==NULL) return TRUE;
ivTest(v);
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=(void *)f;
l->m[1].rtyp=INTVEC_CMD;
l->m[1].data=(void *)v;
res->data=(void *)l;
return FALSE;
}
f
FILE * f
Definition checklibs.c:9
singclap_factorize
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition clapsing.cc:983
singclap_factorize_retry
VAR int singclap_factorize_retry
Definition clapsing.cc:981
ivTest
#define ivTest(v)
Definition intvec.h:172

## jjFAC_P2()

BOOLEAN jjFAC_P2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | dummy )

static

Definition at line 2065 of file iparith.cc.

{
intvec *v=NULL;
int sw=(int)(long)dummy->Data();
int fac_sw=sw;
if ((sw<0)||(sw>2)) fac_sw=1;
singclap_factorize_retry=0;
ideal f=singclap_factorize((poly)(u->CopyD()), &v, fac_sw,currRing);
if (f==NULL)
return TRUE;
switch(sw)
{
case 0:
case 2:
{
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=(void *)f;
l->m[1].rtyp=INTVEC_CMD;
l->m[1].data=(void *)v;
res->data=(void *)l;
res->rtyp=LIST_CMD;
return FALSE;
}
case 1:
res->data=(void *)f;
return FALSE;
case 3:
{
poly p=f->m[0];
int i=IDELEMS(f);
f->m[0]=NULL;
while(i>1)
{
i--;
p=pMult(p,f->m[i]);
f->m[i]=NULL;
}
res->data=(void *)p;
res->rtyp=POLY_CMD;
}
return FALSE;
}
WerrorS("invalid switch");
return TRUE;
}
pMult
#define pMult(p, q)
Definition polys.h:208

## jjFACSTD()

BOOLEAN jjFACSTD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4221 of file iparith.cc.

{
lists L=(lists)omAllocBin(slists_bin);
if (currRing->cf->convSingNFactoryN!=ndConvSingNFactoryN) /* conversion to factory*/
{
ideal_list p,h;
h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL);
if (h==NULL)
{
L->Init(1);
L->m[0].data=(char *)idInit(1);
L->m[0].rtyp=IDEAL_CMD;
}
else
{
p=h;
int l=0;
while (p!=NULL) { p=p->next;l++; }
L->Init(l);
l=0;
while(h!=NULL)
{
L->m[l].data=(char *)h->d;
L->m[l].rtyp=IDEAL_CMD;
p=h->next;
omFreeSize(h,sizeof(*h));
h=p;
l++;
}
}
}
else
{
WarnS("no factorization implemented");
L->Init(1);
iiExprArith1(&(L->m[0]),v,STD_CMD);
}
res->data=(void *)L;
return FALSE;
}
kStdfac
ideal_list kStdfac(ideal F, ideal Q, tHomog h, intvec **w, ideal D)
Definition kstdfac.cc:800
ndConvSingNFactoryN
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition numbers.cc:313
testHomog
@ testHomog
Definition structs.h:34
STD_CMD
@ STD_CMD
Definition tok.h:186

## jjFACSTD2()

BOOLEAN jjFACSTD2 | ( | leftv | res,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 2112 of file iparith.cc.

{
ideal_list p,h;
h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL,(ideal)w->Data());
p=h;
int l=0;
while (p!=NULL) { p=p->next;l++; }
lists L=(lists)omAllocBin(slists_bin);
L->Init(l);
l=0;
while(h!=NULL)
{
L->m[l].data=(char *)h->d;
L->m[l].rtyp=IDEAL_CMD;
p=h->next;
omFreeSize(h,sizeof(*h));
h=p;
l++;
}
res->data=(void *)L;
return FALSE;
}

## jjFactModD_M()

BOOLEAN jjFactModD_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 8657 of file iparith.cc.

{
/* compute two factors of h(x,y) modulo x^(d+1) in K[[x]][y],
see a detailed documentation in /kernel/linear_algebra/linearAlgebra.h
valid argument lists:
- (poly h, int d),
- (poly h, int d, poly f0, poly g0), optional: factors of h(0,y),
- (poly h, int d, int xIndex, int yIndex), optional: indices of vars x & y
in list of ring vars,
- (poly h, int d, poly f0, poly g0, int xIndex, int yIndec),
optional: all 4 optional args
(The defaults are xIndex = 1, yIndex = 2, f0 and g0 polynomials as found
by singclap_factorize and h(0, y)
has exactly two distinct monic factors [possibly with exponent > 1].)
result:
- list with the two factors f and g such that
h(x,y) = f(x,y)*g(x,y) mod x^(d+1) */
poly h = NULL;
int d = 1;
poly f0 = NULL;
poly g0 = NULL;
int xIndex = 1; /* default index if none provided */
int yIndex = 2; /* default index if none provided */
leftv u = v; int factorsGiven = 0;
if ((u == NULL) || (u->Typ() != POLY_CMD))
{
WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
return TRUE;
}
else h = (poly)u->Data();
u = u->next;
if ((u == NULL) || (u->Typ() != INT_CMD))
{
WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
return TRUE;
}
else d = (int)(long)u->Data();
u = u->next;
if ((u != NULL) && (u->Typ() == POLY_CMD))
{
if ((u->next == NULL) || (u->next->Typ() != POLY_CMD))
{
WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
return TRUE;
}
else
{
f0 = (poly)u->Data();
g0 = (poly)u->next->Data();
factorsGiven = 1;
u = u->next->next;
}
}
if ((u != NULL) && (u->Typ() == INT_CMD))
{
if ((u->next == NULL) || (u->next->Typ() != INT_CMD))
{
WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
return TRUE;
}
else
{
xIndex = (int)(long)u->Data();
yIndex = (int)(long)u->next->Data();
u = u->next->next;
}
}
if (u != NULL)
{
WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
return TRUE;
}
/* checks for provided arguments */
if (pIsConstant(h) || (factorsGiven && (pIsConstant(f0) || pIsConstant(g0))))
{
WerrorS("expected non-constant polynomial argument(s)");
return TRUE;
}
int n = rVar(currRing);
if ((xIndex < 1) || (n < xIndex))
{
Werror("index for variable x (%d) out of range [1..%d]", xIndex, n);
return TRUE;
}
if ((yIndex < 1) || (n < yIndex))
{
Werror("index for variable y (%d) out of range [1..%d]", yIndex, n);
return TRUE;
}
if (xIndex == yIndex)
{
WerrorS("expected distinct indices for variables x and y");
return TRUE;
}
/* computation of f0 and g0 if missing */
if (factorsGiven == 0)
{
poly h0 = pSubst(pCopy(h), xIndex, NULL);
intvec* v = NULL;
ideal i = singclap_factorize(h0, &v, 0,currRing);
ivTest(v);
if (i == NULL) return TRUE;
idTest(i);
if ((v->rows() != 3) || ((*v)[0] =! 1) || (!nIsOne(pGetCoeff(i->m[0]))))
{
WerrorS("expected h(0,y) to have exactly two distinct monic factors");
return TRUE;
}
f0 = pPower(pCopy(i->m[1]), (*v)[1]);
g0 = pPower(pCopy(i->m[2]), (*v)[2]);
idDelete(&i);
}
poly f; poly g;
henselFactors(xIndex, yIndex, h, f0, g0, d, f, g);
lists L = (lists)omAllocBin(slists_bin);
L->Init(2);
L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f;
L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g;
res->rtyp = LIST_CMD;
res->data = (char*)L;
return FALSE;
}
g
g
Definition cfModGcd.cc:4098
idTest
#define idTest(id)
Definition ideals.h:47
h0
VAR idhdl h0
Definition libparse.cc:1143
henselFactors
void henselFactors(const int xIndex, const int yIndex, const poly h, const poly f0, const poly g0, const int d, poly &f, poly &g)
Computes a factorization of a polynomial h(x, y) in K[[x]][y] up to a certain degree in x,...
Definition linearAlgebra.cc:1228
pGetCoeff
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
nIsOne
#define nIsOne(n)
Definition numbers.h:25
pIsConstant
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:239
pPower
#define pPower(p, q)
Definition polys.h:205
pSubst
#define pSubst(p, n, e)
Definition polys.h:366

## jjFAREY_BI()

BOOLEAN jjFAREY_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2134 of file iparith.cc.

{
if (rField_is_Q(currRing))
{
number uu=(number)u->Data();
number vv=(number)v->Data();
res->data=(char *)n_Farey(uu,vv,currRing->cf);
return FALSE;
}
else return TRUE;
}
n_Farey
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
Definition coeffs.h:762
rField_is_Q
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:512

## jjFAREY_ID()

BOOLEAN jjFAREY_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2145 of file iparith.cc.

{
ideal uu=(ideal)u->Data();
number vv=(number)v->Data();
//timespec buf1,buf2;
//clock_gettime(CLOCK_THREAD_CPUTIME_ID,&buf1);
#ifdef HAVE_VSPACE
int cpus = (long) feOptValue(FE_OPT_CPUS);
if ((cpus>1) && (rField_is_Q(currRing)))
res->data=(void*)id_Farey_0(uu,vv,currRing);
else
#endif
res->data=(void*)id_Farey(uu,vv,currRing);
//clock_gettime(CLOCK_THREAD_CPUTIME_ID,&buf2);
//const unsigned long SEC = 1000L*1000L*1000L;
//all_farey+=((buf2.tv_sec-buf1.tv_sec)*SEC+
// buf2.tv_nsec-buf1.tv_nsec);
//farey_cnt++;
return FALSE;
}
feOptValue
static void * feOptValue(feOptIndex opt)
Definition feOpt.h:40
id_Farey
ideal id_Farey(ideal x, number N, const ring r)
Definition ideals.cc:3103
id_Farey_0
ideal id_Farey_0(ideal x, number N, const ring r)
Definition kChinese.cc:330

## jjFAREY_LI()

BOOLEAN jjFAREY_LI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 10428 of file iparith.cc.

{
lists c=(lists)u->CopyD();
lists res_l=(lists)omAllocBin(slists_bin);
res_l->Init(c->nr+1);
BOOLEAN bo=FALSE;
int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,FAREY_CMD);
for (unsigned i=0;i<=(unsigned)c->nr;i++)
{
sleftv tmp;
tmp.Copy(v);
bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],FAREY_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
if (bo) { Werror("farey failed for list entry %d",i+1); break;}
}
c->Clean();
res->data=res_l;
return bo;
}
FAREY_CMD
@ FAREY_CMD
Definition tok.h:77

## jjFETCH()

BOOLEAN jjFETCH | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2166 of file iparith.cc.

{
ring r=(ring)u->Data();
idhdl w;
int op=iiOp;
nMapFunc nMap;
if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
{
int *perm=NULL;
int *par_perm=NULL;
int par_perm_size=0;
BOOLEAN bo;
nMap=n_SetMap(r->cf,currRing->cf);
if (nMap==NULL)
{
// Allow imap/fetch to be make an exception only for:
if (nCoeff_is_Extension(r->cf) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
((n_SetMap(r->cf->extRing->cf,currRing->cf)!=NULL)
|| (nCoeff_is_Extension(currRing->cf) && (n_SetMap(r->cf->extRing->cf,currRing->cf->extRing->cf)!=NULL))))
{
par_perm_size=rPar(r);
}
else
{
goto err_fetch;
}
}
if (
(iiOp!=FETCH_CMD) || (r->N!=currRing->N) || (rPar(r)!=rPar(currRing))
#ifdef HAVE_SHIFTBBA
|| rIsLPRing(currRing)
#endif
)
{
perm=(int *)omAlloc0((r->N+1)*sizeof(int));
if (par_perm_size!=0)
par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
op=IMAP_CMD;
if (iiOp==IMAP_CMD)
{
int r_par=0;
char ** r_par_names=NULL;
if (r->cf->extRing!=NULL)
{
r_par=r->cf->extRing->N;
r_par_names=r->cf->extRing->names;
}
int c_par=0;
char ** c_par_names=NULL;
if (currRing->cf->extRing!=NULL)
{
c_par=currRing->cf->extRing->N;
c_par_names=currRing->cf->extRing->names;
}
if (!rIsLPRing(r))
{
maFindPerm(r->names, r->N, r_par_names, r_par,
currRing->names,currRing->N,c_par_names, c_par,
perm,par_perm, currRing->cf->type);
}
#ifdef HAVE_SHIFTBBA
else
{
maFindPermLP(r->names, r->N, r_par_names, r_par,
currRing->names,currRing->N,c_par_names, c_par,
perm,par_perm, currRing->cf->type,r->isLPring);
}
#endif
}
else
{
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
maFetchPermLP(r, currRing, perm);
}
else
#endif
{
unsigned i;
if (par_perm_size!=0)
for(i=si_min(rPar(r),rPar(currRing));i>0;i--) par_perm[i-1]=-i;
for(i=si_min(r->N,currRing->N);i>0;i--) perm[i]=i;
}
}
}
if ((iiOp==FETCH_CMD) && (BVERBOSE(V_IMAP)))
{
unsigned i;
for(i=0;i<(unsigned)si_min(r->N,currRing->N);i++)
{
Print("// var nr %d: %s -> %s\n",i,r->names[i],currRing->names[i]);
}
for(i=0;i<(unsigned)si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
{
Print("// par nr %d: %s -> %s\n",
i,rParameter(r)[i],rParameter(currRing)[i]);
}
}
if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
sleftv tmpW;
tmpW.Init();
tmpW.rtyp=IDTYP(w);
tmpW.data=IDDATA(w);
if ((bo=maApplyFetch(op,NULL,res,&tmpW, r,
perm,par_perm,par_perm_size,nMap)))
{
Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
}
if (perm!=NULL)
omFreeSize((ADDRESS)perm,(r->N+1)*sizeof(int));
if (par_perm!=NULL)
omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
return bo;
}
else
{
Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
}
return TRUE;
err_fetch:
char *s1=nCoeffString(r->cf);
char *s2=nCoeffString(currRing->cf);
Werror("no identity map from %s (%s -> %s)",u->Fullname(),s1,s2);
omFree(s2); omFree(s1);
return TRUE;
}
si_min
static int si_min(const int a, const int b)
Definition auxiliary.h:126
nCoeffString
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
Definition coeffs.h:958
Tok2Cmdname
const char * Tok2Cmdname(int tok)
Definition gentable.cc:137
IMAP_CMD
@ IMAP_CMD
Definition grammar.cc:299
FETCH_CMD
@ FETCH_CMD
Definition grammar.cc:296
IDDATA
#define IDDATA(a)
Definition ipid.h:126
IDTYP
#define IDTYP(a)
Definition ipid.h:119
maFetchPermLP
void maFetchPermLP(const ring preimage_r, const ring dst_r, int *perm)
Definition maps.cc:298
maFindPerm
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition maps.cc:155
maFindPermLP
void maFindPermLP(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, int lV)
Definition maps.cc:223
maApplyFetch
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
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
V_IMAP
#define V_IMAP
Definition options.h:53
rPar
static int rPar(const ring r)
(r->cf->P)
Definition ring.h:605
rParameter
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition ring.h:631
ALIAS_CMD
@ ALIAS_CMD
Definition tok.h:34

## jjFETCH_M()

BOOLEAN jjFETCH_M | ( | leftv | res,
|  | leftv | u )

static

Definition at line 7539 of file iparith.cc.

{
ring r=(ring)u->Data();
leftv v=u->next;
leftv perm_var_l=v->next;
leftv perm_par_l=v->next->next;
if ((perm_var_l->Typ()!=INTVEC_CMD)
||((perm_par_l!=NULL)&&(perm_par_l->Typ()!=INTVEC_CMD))
||(u->Typ()!=RING_CMD))
{
WerrorS("fetch(<ring>,<name>[,<intvec>[,<intvec>])");
return TRUE;
}
intvec *perm_var_v=(intvec*)perm_var_l->Data();
intvec *perm_par_v=NULL;
if (perm_par_l!=NULL)
perm_par_v=(intvec*)perm_par_l->Data();
idhdl w;
nMapFunc nMap;
if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
{
int *perm=NULL;
int *par_perm=NULL;
int par_perm_size=0;
BOOLEAN bo;
if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
{
// Allow imap/fetch to be make an exception only for:
if (nCoeff_is_Extension(r->cf) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
((n_SetMap(r->cf->extRing->cf,currRing->cf)!=NULL)
|| (nCoeff_is_Extension(currRing->cf) && (n_SetMap(r->cf->extRing->cf,currRing->cf->extRing->cf)!=NULL))))
{
par_perm_size=rPar(r);
}
else
{
goto err_fetch;
}
}
else
par_perm_size=rPar(r);
perm=(int *)omAlloc0((rVar(r)+1)*sizeof(int));
if (par_perm_size!=0)
par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
int i;
if (perm_par_l==NULL)
{
if (par_perm_size!=0)
for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
}
else
{
if (par_perm_size==0) WarnS("source ring has no parameters");
else
{
for(i=rPar(r)-1;i>=0;i--)
{
if (i<perm_par_v->length()) par_perm[i]=(*perm_par_v)[i];
if ((par_perm[i]<-rPar(currRing))
|| (par_perm[i]>rVar(currRing)))
{
Warn("invalid entry for par %d: %d\n",i,par_perm[i]);
par_perm[i]=0;
}
}
}
}
for(i=rVar(r)-1;i>=0;i--)
{
if (i<perm_var_v->length()) perm[i+1]=(*perm_var_v)[i];
if ((perm[i]<-rPar(currRing))
|| (perm[i]>rVar(currRing)))
{
Warn("invalid entry for var %d: %d\n",i,perm[i]);
perm[i]=0;
}
}
if (BVERBOSE(V_IMAP))
{
for(i=1;i<=si_min(rVar(r),rVar(currRing));i++)
{
if (perm[i]>0)
Print("// var nr %d: %s -> var %s\n",i,r->names[i-1],currRing->names[perm[i]-1]);
else if (perm[i]<0)
Print("// var nr %d: %s -> par %s\n",i,r->names[i-1],rParameter(currRing)[-perm[i]-1]);
}
for(i=1;i<=si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
{
if (par_perm[i-1]<0)
Print("// par nr %d: %s -> par %s\n",
i,rParameter(r)[i-1],rParameter(currRing)[-par_perm[i-1]-1]);
else if (par_perm[i-1]>0)
Print("// par nr %d: %s -> var %s\n",
i,rParameter(r)[i-1],currRing->names[par_perm[i-1]-1]);
}
}
if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
sleftv tmpW;
tmpW.Init();
tmpW.rtyp=IDTYP(w);
tmpW.data=IDDATA(w);
if ((bo=maApplyFetch(IMAP_CMD,NULL,res,&tmpW, r,
perm,par_perm,par_perm_size,nMap)))
{
Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
}
if (perm!=NULL)
omFreeSize((ADDRESS)perm,(rVar(r)+1)*sizeof(int));
if (par_perm!=NULL)
omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
return bo;
}
else
{
Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
}
return TRUE;
err_fetch:
char *s1=nCoeffString(r->cf);
char *s2=nCoeffString(currRing->cf);
Werror("no identity map from %s (%s -> %s)",u->Fullname(),s1,s2);
omFreeBinAddr(s2);omFreeBinAddr(s1);
return TRUE;
}
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257

## jjFIND2()

BOOLEAN jjFIND2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2294 of file iparith.cc.

{
/*4
* look for the substring what in the string where
* return the position of the first char of what in where
* or 0
*/
char *where=(char *)u->Data();
char *what=(char *)v->Data();
char *found = strstr(where,what);
if (found != NULL)
{
res->data=(char *)((found-where)+1);
}
/*else res->data=NULL;*/
return FALSE;
}
found
bool found
Definition facFactorize.cc:55

## jjFIND3()

BOOLEAN jjFIND3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6184 of file iparith.cc.

{
/*4
* look for the substring what in the string where
* starting at position n
* return the position of the first char of what in where
* or 0
*/
int n=(int)(long)w->Data();
char *where=(char *)u->Data();
char *what=(char *)v->Data();
char *found;
if ((1>n)||(n>(int)strlen(where)))
{
Werror("start position %d out of range",n);
return TRUE;
}
found = strchr(where+n-1,*what);
if (*(what+1)!='\0')
{
while((found !=NULL) && (strncmp(found+1,what+1,strlen(what+1))!=0))
{
found=strchr(found+1,*what);
}
}
if (found != NULL)
{
res->data=(char *)((found-where)+1);
}
return FALSE;
}

## jjFRES()

BOOLEAN jjFRES | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2351 of file iparith.cc.

{
leftv w = (leftv)omAlloc0Bin(sleftv_bin);
w->rtyp = STRING_CMD;
w->data = (char *)"complete"; // default
BOOLEAN RES = jjFRES3(res, u, v, w);
omFreeBin(w,sleftv_bin);
return RES;
}
jjFRES3
static BOOLEAN jjFRES3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:2312

## jjFRES3()

BOOLEAN jjFRES3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 2312 of file iparith.cc.

{
assumeStdFlag(u);
ideal id = (ideal)u->Data();
int max_length = (int)(long)v->Data();
if (max_length < 0)
{
WerrorS("length for fres must not be negative");
return TRUE;
}
if (max_length == 0)
{
max_length = currRing->N+4;
if (currRing->qideal != NULL)
{
max_length = currRing->N+1;
Warn("full resolution in a qring may be infinite, "
"setting max length to %d", max_length);
}
}
char *method = (char *)w->Data();
/* For the moment, only "complete" (default), "frame", or "extended frame"
* are allowed. Another useful option would be "linear strand".
*/
if (strcmp(method, "complete") != 0
&& strcmp(method, "frame") != 0
&& strcmp(method, "extended frame") != 0
&& strcmp(method, "single module") != 0)
{
WerrorS("wrong optional argument for fres");
return TRUE;
}
syStrategy r = syFrank(id, max_length, method);
assume(r->fullres != NULL);
syFix(r);
res->data = (void *)r;
return FALSE;
}
syFix
void syFix(syStrategy r)
Definition syz.cc:1230
ssyStrategy::fullres
resolvente fullres
Definition syz.h:57
syFrank
syStrategy syFrank(const ideal arg, const int length, const char *method, const bool use_cache=true, const bool use_tensor_trick=false)
Definition syz4.cc:792

## jjFWALK()

BOOLEAN jjFWALK | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2361 of file iparith.cc.

{
res->data=(char *)fractalWalkProc(u,v);
setFlag( res, FLAG_STD );
return FALSE;
}
setFlag
#define setFlag(A, F)
Definition ipid.h:113
fractalWalkProc
ideal fractalWalkProc(leftv first, leftv second)
Definition walk_ip.cc:161

## jjFWALK3()

BOOLEAN jjFWALK3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6215 of file iparith.cc.

{
if ((int)(long)w->Data()==0)
res->data=(char *)walkProc(u,v);
else
res->data=(char *)fractalWalkProc(u,v);
setFlag( res, FLAG_STD );
return FALSE;
}
walkProc
ideal walkProc(leftv first, leftv second)
Definition walk_ip.cc:55

## jjGCD_BI()

BOOLEAN jjGCD_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2380 of file iparith.cc.

{
number n1 = (number) u->Data();
number n2 = (number) v->Data();
res->data = n_Gcd(n1,n2,coeffs_BIGINT);
return FALSE;
}
n_Gcd
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ,...
Definition coeffs.h:667

## jjGCD_I()

BOOLEAN jjGCD_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2367 of file iparith.cc.

{
int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
int p0=ABS(uu),p1=ABS(vv);
int r;
while ( p1!=0 )
{
r=p0 % p1;
p0 = p1; p1 = r;
}
res->data=(char *)(long)p0;
return FALSE;
}

## jjGCD_N()

BOOLEAN jjGCD_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2387 of file iparith.cc.

{
number a=(number) u->Data();
number b=(number) v->Data();
if (nIsZero(a))
{
if (nIsZero(b)) res->data=(char *)nInit(1);
else res->data=(char *)nCopy(b);
}
else
{
if (nIsZero(b)) res->data=(char *)nCopy(a);
//else res->data=(char *)n_Gcd(a, b, currRing->cf);
else res->data=(char *)n_SubringGcd(a, b, currRing->cf);
}
return FALSE;
}
n_SubringGcd
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition coeffs.h:669
nCopy
#define nCopy(n)
Definition numbers.h:15
nInit
#define nInit(i)
Definition numbers.h:24

## jjGCD_P()

BOOLEAN jjGCD_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2404 of file iparith.cc.

{
res->data=(void *)singclap_gcd((poly)(u->CopyD(POLY_CMD)),
(poly)(v->CopyD(POLY_CMD)),currRing);
return FALSE;
}
singclap_gcd
poly singclap_gcd(poly f, poly g, const ring r)
polynomial gcd via singclap_gcd_r resp. idSyzygies destroys f and g
Definition polys.cc:409

## jjGE_BI()

BOOLEAN jjGE_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1166 of file iparith.cc.

{
number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
res->data = (char *) (n_GreaterZero(h,coeffs_BIGINT)||(n_IsZero(h,coeffs_BIGINT)));
n_Delete(&h,coeffs_BIGINT);
return FALSE;
}
n_GreaterZero
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition coeffs.h:500
n_Sub
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
Definition coeffs.h:658

## jjGE_I()

BOOLEAN jjGE_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1173 of file iparith.cc.

{
res->data = (char *)(long)((int)((long)u->Data()) >= (int)((long)v->Data()));
return FALSE;
}

## jjGE_N()

BOOLEAN jjGE_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1178 of file iparith.cc.

{
res->data = (char *)(long) (nGreater((number)u->Data(),(number)v->Data())
|| nEqual((number)u->Data(),(number)v->Data()));
return FALSE;
}
nGreater
#define nGreater(a, b)
Definition numbers.h:28

## jjGETDUMP()

BOOLEAN jjGETDUMP | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4277 of file iparith.cc.

{
si_link l = (si_link)v->Data();
if (slGetDump(l))
{
const char *s;
if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
else s=sNoName_fe;
Werror("cannot get dump from `%s`",s);
return TRUE;
}
else
return FALSE;
}
slGetDump
BOOLEAN slGetDump(si_link l)
Definition silink.cc:374

## jjGT_BI()

BOOLEAN jjGT_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1184 of file iparith.cc.

{
number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
res->data = (char *)(long) (n_GreaterZero(h,coeffs_BIGINT)&&(!n_IsZero(h,coeffs_BIGINT)));
n_Delete(&h,coeffs_BIGINT);
return FALSE;
}

## jjGT_I()

BOOLEAN jjGT_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1191 of file iparith.cc.

{
res->data = (char *)(long)((int)((long)u->Data()) > (int)((long)v->Data()));
return FALSE;
}

## jjGT_N()

BOOLEAN jjGT_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1196 of file iparith.cc.

{
res->data = (char *)(long)(nGreater((number)u->Data(),(number)v->Data()));
return FALSE;
}

## jjHIGHCORNER()

BOOLEAN jjHIGHCORNER | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4291 of file iparith.cc.

{
assumeStdFlag(v);
ideal I=(ideal)v->Data();
res->data=(void *)iiHighCorner(I,0);
return FALSE;
}
iiHighCorner
poly iiHighCorner(ideal I, int ak)
the largest monomial in R/I
Definition ipshell.cc:1606

## jjHIGHCORNER_M()

BOOLEAN jjHIGHCORNER_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4298 of file iparith.cc.

{
assumeStdFlag(v);
intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
BOOLEAN delete_w=FALSE;
ideal I=(ideal)v->Data();
int i;
poly p=NULL,po=NULL;
int rk=id_RankFreeModule(I,currRing);
if (w==NULL)
{
w = new intvec(rk);
delete_w=TRUE;
}
for(i=rk;i>0;i--)
{
p=iiHighCorner(I,i);
if (p==NULL)
{
WerrorS("module must be zero-dimensional");
if (delete_w) delete w;
return TRUE;
}
if (po==NULL)
{
po=p;
}
else
{
// now po!=NULL, p!=NULL
int d=(currRing->pFDeg(po,currRing)-(*w)[pGetComp(po)-1] - currRing->pFDeg(p,currRing)+(*w)[i-1]);
if (d==0)
d=pLmCmp(po,p);
if (d > 0)
{
pDelete(&p);
}
else // (d < 0)
{
pDelete(&po); po=p;
}
}
}
if (delete_w) delete w;
res->data=(void *)po;
return FALSE;
}
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
pLmCmp
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition polys.h:106
id_RankFreeModule
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Definition simpleideals.cc:992

## jjHILBERT()

BOOLEAN jjHILBERT | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4345 of file iparith.cc.

{
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of Hilbert series etc. is being\n");
PrintS("// performed for generic fibre, that is, over Q\n");
}
assumeStdFlag(v);
intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
//scHilbertPoly((ideal)v->Data(),currRing->qideal);
hLookSeries((ideal)v->Data(),module_w,currRing->qideal);
return FALSE;
}
hLookSeries
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree)
Definition hilb.cc:220

## jjHILBERT2()

BOOLEAN jjHILBERT2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2410 of file iparith.cc.

{
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of Hilbert series etc. is being\n");
PrintS("// performed for generic fibre, that is, over Q\n");
}
assumeStdFlag(u);
intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
#if 1
switch((int)(long)v->Data())
{
case 1:
res->data=(void *)hFirstSeries0b((ideal)u->Data(),currRing->qideal,NULL,module_w,currRing,coeffs_BIGINT);
return FALSE;
case 2:
res->data=(void *)hSecondSeries0b((ideal)u->Data(),currRing->qideal,NULL,module_w,currRing,coeffs_BIGINT);
return FALSE;
}
#else
intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal);
if (errorreported) return TRUE;
switch((int)(long)v->Data())
{
case 1:
res->data=(void *)iv;
return FALSE;
case 2:
res->data=(void *)hSecondSeries(iv);
delete iv;
return FALSE;
}
delete iv;
#endif
WerrorS(feNotImplemented);
return TRUE;
}
hSecondSeries
intvec * hSecondSeries(intvec *hseries1)
Definition hilb.cc:71
hFirstSeries
intvec * hFirstSeries(ideal A, intvec *module_w, ideal Q, intvec *wdegree)
Definition hilb.cc:1514
hFirstSeries0b
bigintmat * hFirstSeries0b(ideal I, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const coeffs biv_cf)
Definition hilb.cc:2019
hSecondSeries0b
bigintmat * hSecondSeries0b(ideal I, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const coeffs biv_cf)
Definition hilb.cc:2041
feNotImplemented
const char feNotImplemented[]
Definition reporter.cc:54

## jjHILBERT3()

BOOLEAN jjHILBERT3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6224 of file iparith.cc.

{
intvec *wdegree=(intvec*)w->Data();
if (wdegree->length()!=currRing->N)
{
Werror("weight vector must have size %d, not %d",
currRing->N,wdegree->length());
return TRUE;
}
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of Hilbert series etc. is being\n");
PrintS("// performed for generic fibre, that is, over Q\n");
}
assumeStdFlag(u);
intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
if (errorreported) return TRUE;
switch((int)(long)v->Data())
{
case 1:
res->data=(void *)hFirstSeries0b((ideal)u->Data(),currRing->qideal,wdegree,module_w,currRing,coeffs_BIGINT);
return FALSE;
case 2:
res->data=(void *)hSecondSeries0b((ideal)u->Data(),currRing->qideal,wdegree,module_w,currRing,coeffs_BIGINT);
return FALSE;
}
WerrorS(feNotImplemented);
return TRUE;
}

## jjHILBERT3Qt()

BOOLEAN jjHILBERT3Qt | ( | leftv | ,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6254 of file iparith.cc.

{
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of Hilbert series etc. is being\n");
PrintS("// performed for generic fibre, that is, over Q\n");
}
assumeStdFlag(u);
ring Qt =(ring)v->Data();
char *name=(char*)w->Data();
poly h;
if (u->Typ()==IDEAL_CMD)
h=hFirstSeries0p((ideal)u->Data(),currRing->qideal,NULL,currRing,Qt);
else
{
intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
h=hFirstSeries0m((ideal)u->Data(),currRing->qideal,NULL,module_w,currRing,Qt);
}
idhdl hh=enterid(name,myynest,POLY_CMD,&(Qt->idroot),FALSE,FALSE);
IDPOLY(hh)=h;
return FALSE;
}
name
char name(const Variable &v)
Definition factory.h:189
hFirstSeries0m
poly hFirstSeries0m(ideal A, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const ring Qt)
Definition hilb.cc:1427
hFirstSeries0p
poly hFirstSeries0p(ideal A, ideal Q, intvec *wdegree, const ring src, const ring Qt)
Definition hilb.cc:1384
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
IDPOLY
#define IDPOLY(a)
Definition ipid.h:130

## jjHILBERT_IV()

BOOLEAN jjHILBERT_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4358 of file iparith.cc.

{
if (rField_is_Z(currRing))
{
PrintS("// NOTE: computation of Hilbert series etc. is being\n");
PrintS("// performed for generic fibre, that is, over Q\n");
}
res->data=(void *)hSecondSeries((intvec *)v->Data());
return FALSE;
}

## jjHOMOG1()

BOOLEAN jjHOMOG1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4368 of file iparith.cc.

{
intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
ideal v_id=(ideal)v->Data();
if (w==NULL)
{
res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
if (res->data!=NULL)
{
if (v->rtyp==IDHDL)
{
char *s_isHomog=omStrDup("isHomog");
if (v->e==NULL)
atSet((idhdl)(v->data),s_isHomog,w,INTVEC_CMD);
else
atSet((idhdl)(v->LData()),s_isHomog,w,INTVEC_CMD);
}
else if (w!=NULL) delete w;
} // if res->data==NULL then w==NULL
}
else
{
res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w);
if((res->data==NULL) && (v->rtyp==IDHDL))
{
if (v->e==NULL)
atKill((idhdl)(v->data),"isHomog");
else
atKill((idhdl)(v->LData()),"isHomog");
}
}
return FALSE;
}
atSet
void atSet(idhdl root, char *name, void *data, int typ)
Definition attrib.cc:153
atKill
#define atKill(H, A)
Definition attrib.h:49
idTestHomModule
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition ideals.cc:2120
idHomModule
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition ideals.h:96

## jjHOMOG1_W()

BOOLEAN jjHOMOG1_W | ( | leftv | res,
|  | leftv | v,
|  | leftv | u )

static

Definition at line 2487 of file iparith.cc.

{
intvec *w=new intvec(rVar(currRing));
intvec *vw=(intvec*)u->Data();
ideal v_id=(ideal)v->Data();
pFDegProc save_FDeg=currRing->pFDeg;
pLDegProc save_LDeg=currRing->pLDeg;
BOOLEAN save_pLexOrder=currRing->pLexOrder;
currRing->pLexOrder=FALSE;
kHomW=vw;
kModW=w;
pSetDegProcs(currRing,kHomModDeg);
res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
currRing->pLexOrder=save_pLexOrder;
kHomW=NULL;
kModW=NULL;
pRestoreDegProcs(currRing,save_FDeg,save_LDeg);
if (w!=NULL) delete w;
return FALSE;
}
kHomModDeg
long kHomModDeg(poly p, const ring r)
Definition kstd1.cc:2421
kHomW
VAR intvec * kHomW
Definition kstd1.cc:2409
kModW
VAR intvec * kModW
Definition kstd1.cc:2409
pRestoreDegProcs
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition p_polys.cc:3774
pSetDegProcs
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition p_polys.cc:3762
pFDegProc
long(* pFDegProc)(poly p, ring r)
Definition ring.h:39
pLDegProc
long(* pLDegProc)(poly p, int *length, ring r)
Definition ring.h:38

## jjHOMOG1_WI()

BOOLEAN jjHOMOG1_WI | ( | leftv | res,
|  | leftv | v,
|  | leftv | u )

static

Definition at line 2507 of file iparith.cc.

{
intvec *vw=(intvec*)u->Data();
ideal v_id=(ideal)v->Data();
res->data=(void *)(long)id_HomIdealW(v_id,currRing->qideal,vw,currRing);
return FALSE;
}
id_HomIdealW
BOOLEAN id_HomIdealW(ideal id, ideal Q, const intvec *w, const ring r)
Definition simpleideals.cc:1082

## jjHOMOG_ID()

BOOLEAN jjHOMOG_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2465 of file iparith.cc.

{
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
pFDegProc deg;
if (currRing->pLexOrder && (currRing->order[0]==ringorder_lp))
deg=p_Totaldegree;
else
deg=currRing->pFDeg;
poly p=pOne(); pSetExp(p,i,1); pSetm(p);
int d=deg(p,currRing);
pLmDelete(p);
if (d==1)
res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
else
WerrorS("variable must have weight 1");
return (d!=1);
}
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
ringorder_lp
@ ringorder_lp
Definition ring.h:78
id_Homogen
ideal id_Homogen(ideal h, int varnum, const ring r)
Definition simpleideals.cc:1503

## jjHOMOG_ID_W()

BOOLEAN jjHOMOG_ID_W | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | )

static

Definition at line 6276 of file iparith.cc.

{
PrintS("TODO\n");
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
poly p=pOne(); pSetExp(p,i,1); pSetm(p);
int d=pWTotaldegree(p);
pLmDelete(p);
if (d==1)
res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
else
WerrorS("variable must have weight 1");
return (d!=1);
}
pWTotaldegree
#define pWTotaldegree(p)
Definition polys.h:284

## jjHOMOG_P()

BOOLEAN jjHOMOG_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2448 of file iparith.cc.

{
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
poly p=pOne(); pSetExp(p,i,1); pSetm(p);
int d=pWTotaldegree(p);
pLmDelete(p);
if (d==1)
res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
else
WerrorS("variable must have weight 1");
return (d!=1);
}
p_Homogen
poly p_Homogen(poly p, int varnum, const ring r)
Definition p_polys.cc:3319

## jjHOMOG_P_W()

BOOLEAN jjHOMOG_P_W | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | )

static

Definition at line 6294 of file iparith.cc.

{
PrintS("TODO\n");
int i=pVar((poly)v->Data());
if (i==0)
{
WerrorS("ringvar expected");
return TRUE;
}
poly p=pOne(); pSetExp(p,i,1); pSetm(p);
int d=pWTotaldegree(p);
pLmDelete(p);
if (d==1)
res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
else
WerrorS("variable must have weight 1");
return (d!=1);
}

## jjHOMOG_W_M()

BOOLEAN jjHOMOG_W_M | ( | leftv | res,
|  | leftv | v1,
|  | leftv | v2,
|  | leftv | v3 )

static

Definition at line 6312 of file iparith.cc.

{
intvec *w=(intvec *)v3->Data();
intvec *vw=(intvec*)v2->Data();
ideal v_id=(ideal)v1->Data();
res->data=(void *)(long)id_HomModuleW(v_id,currRing->qideal,vw,w,currRing);
return FALSE;
}
id_HomModuleW
BOOLEAN id_HomModuleW(ideal id, ideal Q, const intvec *w, const intvec *module_w, const ring r)
Definition simpleideals.cc:1105

## jjIDEAL_Ma()

BOOLEAN jjIDEAL_Ma | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4418 of file iparith.cc.

{
matrix mat=(matrix)v->CopyD(MATRIX_CMD);
IDELEMS((ideal)mat)=MATCOLS(mat)*MATROWS(mat);
MATROWS(mat)=1;
mat->rank=1;
res->data=(char *)mat;
return FALSE;
}
ip_smatrix::rank
long rank
Definition matpol.h:19

## jjIDEAL_Map()

BOOLEAN jjIDEAL_Map | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4427 of file iparith.cc.

{
map m=(map)v->CopyD(MAP_CMD);
omFreeBinAddr((ADDRESS)m->preimage);
m->preimage=NULL;
ideal I=(ideal)m;
I->rank=1;
res->data=(char *)I;
return FALSE;
}
map
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition cf_map_ext.cc:505

## jjIDEAL_PL()

BOOLEAN jjIDEAL_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7496 of file iparith.cc.

{
leftv h=v;
int s=exprlist_length(h);
ideal id=idInit(s,1);
int rank=1;
int i=0;
poly p;
int dest_type=POLY_CMD;
if (iiOp==MODUL_CMD) dest_type=VECTOR_CMD;
while (h!=NULL)
{
// use standard type conversions to poly/vector
int ri;
int ht=h->Typ();
if (ht==dest_type)
{
p=(poly)h->CopyD();
if (p!=NULL) rank=si_max(rank,(int)pMaxComp(p));
}
else if ((ri=iiTestConvert(ht,dest_type,dConvertTypes))!=0)
{
sleftv tmp;
leftv hnext=h->next;
h->next=NULL;
iiConvert(ht,dest_type,ri,h,&tmp,dConvertTypes);
h->next=hnext;
p=(poly)tmp.data;
if (p!=NULL) rank=si_max(rank,(int)pMaxComp(p));
}
else
{
idDelete(&id);
return TRUE;
}
id->m[i]=p;
i++;
h=h->next;
}
id->rank=rank;
res->data=(char *)id;
return FALSE;
}
exprlist_length
int exprlist_length(leftv v)
Definition ipshell.cc:551

## jjIDEAL_R()

BOOLEAN jjIDEAL_R | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4437 of file iparith.cc.

{
if (currRing!=NULL)
{
ring q=(ring)v->Data();
if (rSamePolyRep(currRing, q))
{
if (q->qideal==NULL)
res->data=(char *)idInit(1,1);
else
res->data=(char *)idCopy(q->qideal);
return FALSE;
}
}
WerrorS("can only get ideal from identical qring");
return TRUE;
}
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
rSamePolyRep
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition ring.cc:1805

## jjidElem()

BOOLEAN jjidElem | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5693 of file iparith.cc.

{
res->data = (char *)(long)idElem((ideal)v->Data());
return FALSE;
}
idElem
static int idElem(const ideal F)
number of non-zero polys in F
Definition simpleideals.h:69

## jjidFreeModule()

BOOLEAN jjidFreeModule | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5698 of file iparith.cc.

{
res->data = (char *)id_FreeModule((int)(long)v->Data(), currRing);
return FALSE;
}
id_FreeModule
ideal id_FreeModule(int i, const ring r)
the free module of rank i
Definition simpleideals.cc:1235

## jjidHead()

BOOLEAN jjidHead | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5718 of file iparith.cc.

{
res->data = (char *)id_Head((ideal)v->Data(),currRing);
setFlag(res,FLAG_STD);
return FALSE;
}
id_Head
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
Definition simpleideals.cc:1483

## jjidMaxIdeal()

BOOLEAN jjidMaxIdeal | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4401 of file iparith.cc.

{
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
int deg = (int)(long)v->Data();
if (deg > currRing->N/currRing->isLPring)
{
WerrorS("degree bound of Letterplace ring is to small");
return TRUE;
}
}
#endif
res->data = (char *)idMaxIdeal((int)(long)v->Data());
setFlag(res,FLAG_STD);
return FALSE;
}
idMaxIdeal
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition ideals.h:33

## jjidMinBase()

BOOLEAN jjidMinBase | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5724 of file iparith.cc.

{
res->data = (char *)idMinBase((ideal)v->Data());
return FALSE;
}
idMinBase
ideal idMinBase(ideal h1, ideal *SB)
Definition ideals.cc:51

## jjidTransp()

BOOLEAN jjidTransp | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5776 of file iparith.cc.

{
res->data = (char *)id_Transp((ideal)v->Data(),currRing);
return FALSE;
}
id_Transp
ideal id_Transp(ideal a, const ring rRing)
transpose a module
Definition simpleideals.cc:2014

## jjidVec2Ideal()

BOOLEAN jjidVec2Ideal | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5703 of file iparith.cc.

{
res->data = (char *)id_Vec2Ideal((poly)v->Data(), currRing);
return FALSE;
}
id_Vec2Ideal
ideal id_Vec2Ideal(poly vec, const ring R)
Definition simpleideals.cc:1528

## jjIm2Iv()

BOOLEAN jjIm2Iv | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4454 of file iparith.cc.

{
intvec *iv = (intvec *)v->CopyD(INTMAT_CMD);
iv->makeVector();
res->data = iv;
return FALSE;
}
intvec::makeVector
void makeVector()
Definition intvec.h:103
INTMAT_CMD
@ INTMAT_CMD
Definition grammar.cc:280

## jjIMPART()

BOOLEAN jjIMPART | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4461 of file iparith.cc.

{
res->data = (char *)n_ImPart((number)v->Data(),currRing->cf);
return FALSE;
}
n_ImPart
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
Definition coeffs.h:788

## jjINDEPSET()

BOOLEAN jjINDEPSET | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4466 of file iparith.cc.

{
assumeStdFlag(v);
res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal);
return FALSE;
}
scIndIntvec
intvec * scIndIntvec(ideal S, ideal Q)
Definition hdegree.cc:284

## jjINDEPSET2()

BOOLEAN jjINDEPSET2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2514 of file iparith.cc.

{
assumeStdFlag(u);
res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()),
currRing->qideal);
return FALSE;
}
scIndIndset
lists scIndIndset(ideal S, BOOLEAN all, ideal Q)
Definition ipshell.cc:1111

## jjINDEX_I()

BOOLEAN jjINDEX_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1390 of file iparith.cc.

{
res->rtyp=u->rtyp; u->rtyp=0;
res->data=u->data; u->data=NULL;
res->name=u->name; u->name=NULL;
res->e=u->e; u->e=NULL;
if (res->e==NULL) res->e=jjMakeSub(v);
else
{
Subexpr sh=res->e;
while (sh->next != NULL) sh=sh->next;
sh->next=jjMakeSub(v);
}
if (u->next!=NULL)
{
leftv rn=(leftv)omAlloc0Bin(sleftv_bin);
BOOLEAN bo=iiExprArith2(rn,u->next,iiOp,v);
res->next=rn;
return bo;
}
return FALSE;
}

## jjINDEX_IV()

BOOLEAN jjINDEX_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1412 of file iparith.cc.

{
if ((u->rtyp!=IDHDL)||(u->e!=NULL))
{
WerrorS("indexed object must have a name");
return TRUE;
}
intvec * iv=(intvec *)v->Data();
leftv p=NULL;
int i;
sleftv t;
t.Init();
t.rtyp=INT_CMD;
for (i=0;i<iv->length(); i++)
{
t.data=(char *)((long)(*iv)[i]);
if (p==NULL)
{
p=res;
}
else
{
p->next=(leftv)omAlloc0Bin(sleftv_bin);
p=p->next;
}
p->rtyp=IDHDL;
p->data=u->data;
p->name=u->name;
p->flag=u->flag;
p->e=jjMakeSub(&t);
}
u->rtyp=0;
u->data=NULL;
u->name=NULL;
return FALSE;
}
sleftv::flag
BITSET flag
Definition subexpr.h:90

## jjINDEX_P()

BOOLEAN jjINDEX_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1448 of file iparith.cc.

{
poly p=(poly)u->Data();
long i=(long)v->Data();
long j=0;
while (p!=NULL)
{
j++;
if (j==i)
{
res->data=(char *)pHead(p);
return FALSE;
}
pIter(p);
}
return FALSE;
}
pIter
#define pIter(p)
Definition monomials.h:37
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68

## jjINDEX_P_IV()

BOOLEAN jjINDEX_P_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1488 of file iparith.cc.

{
poly p=(poly)u->Data();
poly r=NULL;
intvec *iv=(intvec *)v->CopyD(INTVEC_CMD);
int i;
int sum=0;
for(i=iv->length()-1;i>=0;i--)
sum+=(*iv)[i];
int j=0;
while ((p!=NULL) && (sum>0))
{
j++;
for(i=iv->length()-1;i>=0;i--)
{
if (j==(*iv)[i])
{
r=pAdd(r,pHead(p));
sum-=j;
(*iv)[i]=0;
break;
}
}
pIter(p);
}
delete iv;
res->data=(char *)r;
return FALSE;
}

## jjINDEX_PBu()

BOOLEAN jjINDEX_PBu | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1465 of file iparith.cc.

{
sBucket_pt b=(sBucket_pt)u->CopyD();
sBucketCanonicalize(b);
int l; poly p,pp;
sBucketDestroyAdd(b, &pp, &l);
long i=(long)v->Data();
long j=0;
p=pp;
while (p!=NULL)
{
j++;
if (j==i)
{
res->data=(char *)pHead(p);
p_Delete(&pp,currRing);
return FALSE;
}
pIter(p);
}
p_Delete(&pp,currRing);
return FALSE;
}
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
sBucketCanonicalize
void sBucketCanonicalize(sBucket_pt bucket)
Definition sbuckets.cc:401
sBucket_pt
sBucket * sBucket_pt
Definition sbuckets.h:16
sBucketDestroyAdd
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
Definition sbuckets.h:68

## jjINDEX_V()

BOOLEAN jjINDEX_V | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1517 of file iparith.cc.

{
poly p=(poly)u->Data();
int i=(int)(long)v->Data();
res->data=(char *)p_Vec2Poly(p,i,currRing);
return FALSE;
}
p_Vec2Poly
poly p_Vec2Poly(poly v, int k, const ring r)
Definition p_polys.cc:3698

## jjINDEX_V_IV()

BOOLEAN jjINDEX_V_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1524 of file iparith.cc.

{
poly p=(poly)u->CopyD(VECTOR_CMD);
if (p!=NULL)
{
poly r=pOne();
poly hp=r;
intvec *iv=(intvec *)v->Data();
int i;
loop
{
for(i=0;i<iv->length();i++)
{
if (((int)pGetComp(p))==(*iv)[i])
{
poly h;
pSplit(p,&h);
pNext(hp)=p;
p=h;
pIter(hp);
break;
}
}
if (p==NULL) break;
if (i==iv->length())
{
pLmDelete(&p);
if (p==NULL) break;
}
}
pLmDelete(&r);
res->data=(char *)r;
}
return FALSE;
}
pSplit
#define pSplit(p, r)
Definition polys.h:266

## jjINTERPOLATION()

BOOLEAN jjINTERPOLATION | ( | leftv | res,
|  | leftv | l,
|  | leftv | v )

static

Definition at line 2527 of file iparith.cc.

{
const lists L = (lists)l->Data();
const int n = L->nr; assume (n >= 0);
std::vector<ideal> V(n + 1);
for(int i = n; i >= 0; i--) V[i] = (ideal)(L->m[i].Data());
res->data=interpolation(V, (intvec*)v->Data());
setFlag(res,FLAG_STD);
return errorreported;
}
interpolation
ideal interpolation(const std::vector< ideal > &L, intvec *v)
Definition interpolation.cc:1484

## jjINTERRED()

BOOLEAN jjINTERRED | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4472 of file iparith.cc.

{
ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
if (TEST_OPT_PROT) { PrintLn(); mflush(); }
res->data = result;
return FALSE;
}
kInterRed
ideal kInterRed(ideal F, const ideal Q)
Definition kstd1.cc:3802
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition options.h:105
PrintLn
void PrintLn()
Definition reporter.cc:314
mflush
#define mflush()
Definition reporter.h:58

## jjINTERSEC3S()

BOOLEAN jjINTERSEC3S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6347 of file iparith.cc.

{
ideal I=(ideal)u->Data();
GbVariant alg=syGetAlgorithm((char*)w->Data(),currRing,I);
res->data=(char *)idSect(I,(ideal)v->Data(),alg);
if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}
idSect
ideal idSect(ideal h1, ideal h2, GbVariant alg)
Definition ideals.cc:315
TEST_OPT_RETURN_SB
#define TEST_OPT_RETURN_SB
Definition options.h:114

## jjINTERSECT()

BOOLEAN jjINTERSECT | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2521 of file iparith.cc.

{
res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data());
if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}

## jjINTERSECT3()

BOOLEAN jjINTERSECT3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6334 of file iparith.cc.

{
ideal I1=(ideal)u->Data();
ideal I2=(ideal)v->Data();
ideal I3=(ideal)w->Data();
resolvente r=(resolvente)omAlloc0(3*sizeof(ideal));
r[0]=I1;
r[1]=I2;
r[2]=I3;
res->data=(char *)idMultSect(r,3);
omFreeSize((ADDRESS)r,3*sizeof(ideal));
return FALSE;
}
idMultSect
ideal idMultSect(resolvente arg, int length, GbVariant alg)
Definition ideals.cc:472
resolvente
ideal * resolvente
Definition ideals.h:18

## jjINTERSECT_PL()

BOOLEAN jjINTERSECT_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7664 of file iparith.cc.

{
leftv h=v;
int l=v->listLength();
resolvente r=(resolvente)omAlloc0(l*sizeof(ideal));
BOOLEAN *copied=(BOOLEAN *)omAlloc0(l*sizeof(BOOLEAN));
int t=0;
// try to convert to IDEAL_CMD
while (h!=NULL)
{
if (iiTestConvert(h->Typ(),IDEAL_CMD)!=0)
{
t=IDEAL_CMD;
}
else break;
h=h->next;
}
// if failure, try MODUL_CMD
if (t==0)
{
h=v;
while (h!=NULL)
{
if (iiTestConvert(h->Typ(),MODUL_CMD)!=0)
{
t=MODUL_CMD;
}
else break;
h=h->next;
}
}
// check for success in converting
if (t==0)
{
WerrorS("cannot convert to ideal or module");
return TRUE;
}
// call idMultSect
h=v;
int i=0;
sleftv tmp;
while (h!=NULL)
{
if (h->Typ()==t)
{
r[i]=(ideal)h->Data(); /*no copy*/
h=h->next;
}
else if(iiConvert(h->Typ(),t,iiTestConvert(h->Typ(),t),h,&tmp))
{
omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
omFreeSize((ADDRESS)r,l*sizeof(ideal));
Werror("cannot convert arg. %d to %s",i+1,Tok2Cmdname(t));
return TRUE;
}
else
{
r[i]=(ideal)tmp.Data(); /*now it's a copy*/
copied[i]=TRUE;
h=tmp.next;
}
i++;
}
res->rtyp=t;
res->data=(char *)idMultSect(r,i);
while(i>0)
{
i--;
if (copied[i]) idDelete(&(r[i]));
}
omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
omFreeSize((ADDRESS)r,l*sizeof(ideal));
return FALSE;
}

## jjINTMAT3()

BOOLEAN jjINTMAT3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6320 of file iparith.cc.

{
intvec* im= new intvec((int)(long)v->Data(),(int)(long)w->Data(), 0);
intvec* arg = (intvec*) u->Data();
int i, n = si_min(im->cols()*im->rows(), arg->cols()*arg->rows());
for (i=0; i<n; i++)
{
(*im)[i] = (*arg)[i];
}
res->data = (char *)im;
return FALSE;
}

## jjINTVEC_PL()

BOOLEAN jjINTVEC_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7900 of file iparith.cc.

{
leftv h=v;
int i=exprlist_length(h);
intvec *iv=new intvec(i);
i=0;
while (h!=NULL)
{
if(h->Typ()==INT_CMD)
{
(*iv)[i]=(int)(long)h->Data();
}
else if (h->Typ()==INTVEC_CMD)
{
intvec *ivv=(intvec*)h->Data();
for(int j=0;j<ivv->length();j++,i++)
{
(*iv)[i]=(*ivv)[j];
}
i--;
}
else
{
delete iv;
return TRUE;
}
i++;
h=h->next;
}
res->data=(char *)iv;
return FALSE;
}

## jjIS_RINGVAR0()

BOOLEAN jjIS_RINGVAR0 | ( | leftv | res,
|  | leftv | )

static

Definition at line 4499 of file iparith.cc.

{
res->data = (char *)0;
return FALSE;
}

## jjIS_RINGVAR_P()

BOOLEAN jjIS_RINGVAR_P | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4488 of file iparith.cc.

{
res->data = (char *)(long)pVar((poly)v->Data());
return FALSE;
}

## jjIS_RINGVAR_S()

BOOLEAN jjIS_RINGVAR_S | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4493 of file iparith.cc.

{
res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing->names,
currRing->N)+1);
return FALSE;
}
r_IsRingVar
int r_IsRingVar(const char *n, char **names, int N)
Definition ring.cc:213

## jjJACOB_M()

BOOLEAN jjJACOB_M | ( | leftv | res,
|  | leftv | a )

static

Definition at line 4535 of file iparith.cc.

{
ideal id = (ideal)a->Data();
id = id_Transp(id,currRing);
int W = IDELEMS(id);
ideal result = idInit(W * currRing->N, id->rank);
poly *p = result->m;
for( int v = 1; v <= currRing->N; v++ )
{
poly* q = id->m;
for( int i = 0; i < W; i++, p++, q++ )
*p = pDiff( *q, v );
}
idDelete(&id);
res->data = (char *)result;
return FALSE;
}

## jjJACOB_P()

BOOLEAN jjJACOB_P | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4504 of file iparith.cc.

{
ideal i=idInit(currRing->N,1);
int k;
poly p=(poly)(v->Data());
for (k=currRing->N;k>0;k--)
{
i->m[k-1]=pDiff(p,k);
}
res->data = (char *)i;
return FALSE;
}

## jjJanetBasis()

BOOLEAN jjJanetBasis | ( | leftv | res,
|  | leftv | v )

static

Definition at line 2545 of file iparith.cc.

{
extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
return jjStdJanetBasis(res,v,0);
}
jjStdJanetBasis
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
Definition wrapper.cc:50

## jjJanetBasis2()

BOOLEAN jjJanetBasis2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2539 of file iparith.cc.

{
extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
return jjStdJanetBasis(res,u,(int)(long)v->Data());
}

## jjJET4()

BOOLEAN jjJET4 | ( | leftv | res,
|  | leftv | u )

static

Definition at line 7993 of file iparith.cc.

{
const short t1[]={4,POLY_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
const short t2[]={4,VECTOR_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
const short t3[]={4,IDEAL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
const short t4[]={4,MODUL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
leftv u1=u;
leftv u2=u1->next;
leftv u3=u2->next;
leftv u4=u3->next;
if (iiCheckTypes(u,t1)||iiCheckTypes(u,t2))
{
if(!pIsUnit((poly)u2->Data()))
{
WerrorS("2nd argument must be a unit");
return TRUE;
}
res->rtyp=u1->Typ();
res->data=(char*)pSeries((int)(long)u3->Data(),pCopy((poly)u1->Data()),
pCopy((poly)u2->Data()),(intvec*)u4->Data());
return FALSE;
}
else
if (iiCheckTypes(u,t3)||iiCheckTypes(u,t4))
{
if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
{
WerrorS("2nd argument must be a diagonal matrix of units");
return TRUE;
}
res->rtyp=u1->Typ();
res->data=(char*)idSeries(
(int)(long)u3->Data(),
idCopy((ideal)u1->Data()),
mp_Copy((matrix)u2->Data(), currRing),
(intvec*)u4->Data()
);
return FALSE;
}
else
{
Werror("%s(`poly`,`poly`,`int`,`intvec`) exppected",
Tok2Cmdname(iiOp));
return TRUE;
}
}
idSeries
ideal idSeries(int n, ideal M, matrix U, intvec *w)
Definition ideals.cc:2172
mp_IsDiagUnit
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition matpol.cc:810
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition matpol.cc:57
pIsUnit
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition polys.h:241
pSeries
#define pSeries(n, p, u, w)
Definition polys.h:372

## jjJET_ID()

BOOLEAN jjJET_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2555 of file iparith.cc.

{
res->data = (char *)id_Jet((ideal)u->Data(),(int)(long)v->Data(),currRing);
return FALSE;
}
id_Jet
ideal id_Jet(const ideal i, int d, const ring R)
Definition simpleideals.cc:1847

## jjJET_ID_IV()

BOOLEAN jjJET_ID_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6372 of file iparith.cc.

{
res->data = (char *)id_JetW((ideal)u->Data(),(int)(long)v->Data(),
(intvec *)w->Data(),currRing);
return FALSE;
}
id_JetW
ideal id_JetW(const ideal i, int d, intvec *iv, const ring R)
Definition simpleideals.cc:1873

## jjJET_ID_M()

BOOLEAN jjJET_ID_M | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6378 of file iparith.cc.

{
if (!mp_IsDiagUnit((matrix)v->Data(), currRing))
{
WerrorS("2nd argument must be a diagonal matrix of units");
return TRUE;
}
res->data = (char *)idSeries((int)(long)w->Data(),(ideal)u->CopyD(),
(matrix)v->CopyD());
return FALSE;
}

## jjJET_P()

BOOLEAN jjJET_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2550 of file iparith.cc.

{
res->data = (char *)pJet((poly)u->CopyD(), (int)(long)v->Data());
return FALSE;
}
pJet
#define pJet(p, m)
Definition polys.h:368

## jjJET_P_IV()

BOOLEAN jjJET_P_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6355 of file iparith.cc.

{
int *iw=iv2array((intvec *)w->Data(),currRing);
res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
omFreeSize( (ADDRESS)iw, (rVar(currRing)+1)*sizeof(int) );
return FALSE;
}
ppJetW
#define ppJetW(p, m, iv)
Definition polys.h:369

## jjJET_P_P()

BOOLEAN jjJET_P_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6362 of file iparith.cc.

{
if (!pIsUnit((poly)v->Data()))
{
WerrorS("2nd argument must be a unit");
return TRUE;
}
res->data = (char *)p_Series((int)(long)w->Data(),(poly)u->CopyD(),(poly)v->CopyD(),NULL,currRing);
return FALSE;
}
p_Series
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
Definition p_polys.cc:4652

## jjKBASE()

BOOLEAN jjKBASE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4574 of file iparith.cc.

{
assumeStdFlag(v);
res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal);
return FALSE;
}
scKBase
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition hdegree.cc:1414

## jjKBASE2()

BOOLEAN jjKBASE2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2560 of file iparith.cc.

{
assumeStdFlag(u);
intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
res->data = (char *)scKBase((int)(long)v->Data(),
(ideal)(u->Data()),currRing->qideal, w_u);
if (w_u!=NULL)
{
atSet(res,omStrDup("isHomog"),ivCopy(w_u),INTVEC_CMD);
}
return FALSE;
}
ivCopy
intvec * ivCopy(const intvec *o)
Definition intvec.h:146

## jjKERNEL()

BOOLEAN jjKERNEL | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2573 of file iparith.cc.

{
return jjPREIMAGE(res,u,v,NULL);
}
jjPREIMAGE
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6678

## jjKERNEL_M()

BOOLEAN jjKERNEL_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4556 of file iparith.cc.

{
#ifdef HAVE_FLINT
res->data = (char *)singflint_kernel((matrix)(v->Data()),currRing);
return res->data==NULL;
#else
return TRUE;
#endif
}
singflint_kernel
matrix singflint_kernel(matrix m, const ring R)

## jjKERNEL_SM()

BOOLEAN jjKERNEL_SM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4565 of file iparith.cc.

{
#ifdef HAVE_FLINT
res->data = (char *)singflint_kernel((ideal)(v->Data()),currRing);
return res->data==NULL;
#else
return TRUE;
#endif
}

## jjKLAMMER()

BOOLEAN jjKLAMMER | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1560 of file iparith.cc.

{
if(u->name==NULL) return TRUE;
long slen = strlen(u->name) + 14;
char *nn = (char*) omAlloc(slen);
snprintf(nn,slen,"%s(%d)",u->name,(int)(long)v->Data());
char *n=omStrDup(nn);
omFreeSize((ADDRESS)nn,slen);
syMake(res,n);
if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
return FALSE;
}
jjKLAMMER_rest
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
Definition iparith.cc:1599

## jjKLAMMER_IV()

BOOLEAN jjKLAMMER_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1572 of file iparith.cc.

{
if(u->name==NULL) return TRUE;
intvec * iv=(intvec *)v->Data();
leftv p=NULL;
int i;
long slen = strlen(u->name) + 14;
char *n = (char*) omAlloc(slen);
for (i=0;i<iv->length(); i++)
{
if (p==NULL)
{
p=res;
}
else
{
p->next=(leftv)omAlloc0Bin(sleftv_bin);
p=p->next;
}
snprintf(n,slen,"%s(%d)",u->name,(*iv)[i]);
syMake(p,omStrDup(n));
}
omFreeSize(n, slen);
if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
return FALSE;
}

## jjKLAMMER_PL()

BOOLEAN jjKLAMMER_PL | ( | leftv | res,
|  | leftv | u )

static

Definition at line 8076 of file iparith.cc.

{
if ((yyInRingConstruction)
&& ((strcmp(u->Name(),"real")==0) || (strcmp(u->Name(),"complex")==0)))
{
memcpy(res,u,sizeof(sleftv));
u->Init();
return FALSE;
}
leftv v=u->next;
BOOLEAN b;
if(v==NULL) // p()
b=iiExprArith1(res,u,iiOp);
else if ((v->next==NULL) // p(1)
|| (u->Typ()!=UNKNOWN)) // p(1,2), p proc or map
{
u->next=NULL;
b=iiExprArith2(res,u,iiOp,v);
u->next=v;
}
else // p(1,2), p undefined
{
if (v->Typ()!=INT_CMD)
{
Werror("`%s` undefined or `int` expected while building `%s(`",u->name,u->name);
return TRUE;
}
int l=u->listLength();
size_t len=strlen(u->name) + 12*l;
char * nn = (char *)omAlloc(len);
snprintf(nn,len,"%s(%d",u->name,(int)(long)v->Data());
char *s=nn;
do
{
while (*s!='\0') s++;
v=v->next;
if (v->Typ()!=INT_CMD)
{
Werror("`%s` undefined or `int` expected while building `%s(`",u->name,u->name);
omFree((ADDRESS)nn);
return TRUE;
}
snprintf(s,len-(nn-s),",%d",(int)(long)v->Data());
} while (v->next!=NULL);
while (*s!='\0') s++;
nn=strcat(nn,")");
char *n=omStrDup(nn);
omFree((ADDRESS)nn);
syMake(res,n);
b=FALSE;
}
return b;
}
yyInRingConstruction
BOOLEAN yyInRingConstruction
Definition grammar.cc:172

## jjKLAMMER_rest()

BOOLEAN jjKLAMMER_rest | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1599 of file iparith.cc.

{
leftv tmp=(leftv)omAlloc0Bin(sleftv_bin);
BOOLEAN b;
if (v->Typ()==INTVEC_CMD)
b=jjKLAMMER_IV(tmp,u,v);
else
b=jjKLAMMER(tmp,u,v);
if (b)
{
omFreeBin(tmp,sleftv_bin);
return TRUE;
}
leftv h=res;
while (h->next!=NULL) h=h->next;
h->next=tmp;
return FALSE;
}
jjKLAMMER_IV
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition iparith.cc:1572
jjKLAMMER
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition iparith.cc:1560

## jjKoszul()

BOOLEAN jjKoszul | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2577 of file iparith.cc.

{
return mpKoszul(res, u,v,NULL);
}
mpKoszul
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition ipshell.cc:3086

## jjKoszul_Id()

BOOLEAN jjKoszul_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2581 of file iparith.cc.

{
sleftv h;
h.Init();
h.rtyp=INT_CMD;
h.data=(void *)(long)IDELEMS((ideal)v->Data());
return mpKoszul(res, u, &h, v);
}

## jjL2R()

BOOLEAN jjL2R | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4580 of file iparith.cc.

{
res->data=(char *)syConvList((lists)v->Data());
if (res->data != NULL)
return FALSE;
else
return TRUE;
}
syConvList
syStrategy syConvList(lists li)
Definition ipshell.cc:3250

## jjLagSolve()

BOOLEAN jjLagSolve | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4657 of file iparith.cc.

{
sleftv a2,a3;
a2.Init();
a3.Init();
a2.rtyp=INT_CMD; a2.data=(void*)10;
a3.rtyp=INT_CMD; a3.data=(void*)1;
return nuLagSolve(res,v,&a2,&a3);
}
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 us...
Definition ipshell.cc:4681

## jjLE_BI()

BOOLEAN jjLE_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1201 of file iparith.cc.

{
return jjGE_BI(res,v,u);
}
jjGE_BI
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1166

## jjLE_I()

BOOLEAN jjLE_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1205 of file iparith.cc.

{
res->data = (char *)(long)((int)((long)u->Data()) <= (int)((long)v->Data()));
return FALSE;
}

## jjLE_N()

BOOLEAN jjLE_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1210 of file iparith.cc.

{
return jjGE_N(res,v,u);
}
jjGE_N
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1178

## jjLEADCOEF()

BOOLEAN jjLEADCOEF | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4588 of file iparith.cc.

{
poly p=(poly)v->Data();
if (p==NULL)
{
res->data=(char *)nInit(0);
}
else
{
nNormalize(pGetCoeff(p));
res->data=(char *)nCopy(pGetCoeff(p));
}
return FALSE;
}

## jjLEADEXP()

BOOLEAN jjLEADEXP | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4602 of file iparith.cc.

{
poly p=(poly)v->Data();
int s=currRing->N;
if (v->Typ()==VECTOR_CMD) s++;
intvec *iv=new intvec(s);
if (p!=NULL)
{
for(int i = currRing->N;i;i--)
{
(*iv)[i-1]=pGetExp(p,i);
}
if (s!=currRing->N)
(*iv)[currRing->N]=pGetComp(p);
}
res->data=(char *)iv;
return FALSE;
}
pGetExp
#define pGetExp(p, i)
Exponent.
Definition polys.h:42

## jjLEADMONOM()

BOOLEAN jjLEADMONOM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4620 of file iparith.cc.

{
poly p=(poly)v->Data();
if (p == NULL)
{
res->data = (char*) NULL;
}
else
{
poly lm = pLmInit(p);
pSetCoeff0(lm, nInit(1));
res->data = (char*) lm;
}
return FALSE;
}
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
pLmInit
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
Definition polys.h:65

## jjLIFT()

BOOLEAN jjLIFT | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2589 of file iparith.cc.

{
int ul= IDELEMS((ideal)u->Data());
int vl= IDELEMS((ideal)v->Data());
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < ul)
{
Werror("At least %d ncgen variables are needed for this computation.", ul);
return TRUE;
}
}
#endif
ideal m = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,
hasFlag(u,FLAG_STD));
if ((m==NULL)||(errorreported)) return TRUE;
res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
return FALSE;
}

## jjLIFT3()

BOOLEAN jjLIFT3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7127 of file iparith.cc.

{
if (w->rtyp!=IDHDL) return TRUE;
int ul= IDELEMS((ideal)u->Data());
int vl= IDELEMS((ideal)v->Data());
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < ul)
{
Werror("At least %d ncgen variables are needed for this computation.", ul);
return TRUE;
}
}
#endif
ideal m
= idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))));
if (m==NULL) return TRUE;
res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
return FALSE;
}
IDMATRIX
#define IDMATRIX(a)
Definition ipid.h:134

## jjLIFT_4()

BOOLEAN jjLIFT_4 | ( | leftv | res,
|  | leftv | U )

static

Definition at line 8129 of file iparith.cc.

{
const short t1[]={4,IDEAL_CMD,IDEAL_CMD,MATRIX_CMD,STRING_CMD};
const short t2[]={4,MODUL_CMD,MODUL_CMD,MATRIX_CMD,STRING_CMD};
leftv u=U;
leftv v=u->next;
leftv w=v->next;
leftv u4=w->next;
if (w->rtyp!=IDHDL) return TRUE;
if (iiCheckTypes(U,t1)||iiCheckTypes(U,t2))
{
// see jjLIFT3
ideal I=(ideal)u->Data();
int ul= IDELEMS(I /*(ideal)u->Data()*/);
int vl= IDELEMS((ideal)v->Data());
GbVariant alg=syGetAlgorithm((char*)u4->Data(),currRing,I);
ideal m
= idLift(I,(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))),alg);
if (m==NULL) return TRUE;
res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
return FALSE;
}
else
{
Werror("%s(`ideal`,`ideal`,`matrix`,`string`)\n"
"or (`module`,`module`,`matrix`,`string`) expected",
Tok2Cmdname(iiOp));
return TRUE;
}
}

## jjLIFTSTD()

BOOLEAN jjLIFTSTD | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2609 of file iparith.cc.

{
if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
idhdl h=(idhdl)v->data;
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < IDELEMS((ideal)u->Data()))
{
Werror("At least %d ncgen variables are needed for this computation.", IDELEMS((ideal)u->Data()));
return TRUE;
}
}
#endif
// CopyD for IDEAL_CMD and MODUL_CMD are identical:
res->data = (char *)idLiftStd((ideal)u->Data(),
&(h->data.umatrix),testHomog);
setFlag(res,FLAG_STD); v->flag=0;
return FALSE;
}
idLiftStd
ideal idLiftStd(ideal h1, matrix *T, tHomog hi, ideal *S, GbVariant alg, ideal h11)
Definition ideals.cc:982

## jjLIFTSTD_ALG()

BOOLEAN jjLIFTSTD_ALG | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7172 of file iparith.cc.

{
if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
idhdl hv=(idhdl)v->data;
GbVariant alg=syGetAlgorithm((char*)w->Data(),currRing,(ideal)u->Data());
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < IDELEMS((ideal)u->Data()))
{
Werror("At least %d ncgen variables are needed for this computation.", IDELEMS((ideal)u->Data()));
return TRUE;
}
}
#endif
// CopyD for IDEAL_CMD and MODUL_CMD are identical:
res->data = (char *)idLiftStd((ideal)u->Data(),
&(hv->data.umatrix),testHomog,
NULL,alg);
setFlag(res,FLAG_STD); v->flag=0;
return FALSE;
}

## jjLIFTSTD_M()

BOOLEAN jjLIFTSTD_M | ( | leftv | res,
|  | leftv | U )

static

Definition at line 8160 of file iparith.cc.

{
// we have 4 or 5 arguments
leftv u=U;
leftv v=u->next;
leftv u3=v->next;
leftv u4=u3->next;
leftv u5=u4->next; // might be NULL
ideal *syz=NULL;
GbVariant alg=GbDefault;
ideal h11=NULL;
if(u5==NULL)
{
// test all three possibilities for 4 arguments
const short t1[]={4,IDEAL_CMD,MATRIX_CMD,MODUL_CMD,STRING_CMD};
const short t2[]={4,MODUL_CMD,MATRIX_CMD,MODUL_CMD,STRING_CMD};
const short t3[]={4,IDEAL_CMD,MATRIX_CMD,MODUL_CMD,IDEAL_CMD};
const short t4[]={4,MODUL_CMD,MATRIX_CMD,MODUL_CMD,MODUL_CMD};
const short t5[]={4,IDEAL_CMD,MATRIX_CMD,STRING_CMD,IDEAL_CMD};
const short t6[]={4,MODUL_CMD,MATRIX_CMD,STRING_CMD,MODUL_CMD};
if(iiCheckTypes(U,t1)||iiCheckTypes(U,t2))
{
if ((u3->rtyp!=IDHDL)||(u3->e!=NULL)) return TRUE;
idhdl hw=(idhdl)u3->data;
syz=&(hw->data.uideal);
alg=syGetAlgorithm((char*)u4->Data(),currRing,(ideal)u->Data());
}
else if(iiCheckTypes(U,t3)||iiCheckTypes(U,t4))
{
if ((u3->rtyp!=IDHDL)||(u3->e!=NULL)) return TRUE;
idhdl hw=(idhdl)u3->data;
syz=&(hw->data.uideal);
h11=(ideal)u4->Data();
}
else if(iiCheckTypes(U,t5)||iiCheckTypes(U,t6))
{
alg=syGetAlgorithm((char*)u3->Data(),currRing,(ideal)u->Data());
h11=(ideal)u4->Data();
}
else
{
Werror("%s(`ideal/module`,`matrix`[,`module`][,`string`][,`ideal/module`]) expected",Tok2Cmdname(iiOp));
return TRUE;
}
}
else
{
// we have 5 arguments
const short t1[]={5,IDEAL_CMD,MATRIX_CMD,MODUL_CMD,STRING_CMD,IDEAL_CMD};
const short t2[]={5,MODUL_CMD,MATRIX_CMD,MODUL_CMD,STRING_CMD,MODUL_CMD};
if(iiCheckTypes(U,t1)||iiCheckTypes(U,t2))
{
idhdl hw=(idhdl)u3->data;
syz=&(hw->data.uideal);
alg=syGetAlgorithm((char*)u4->Data(),currRing,(ideal)u->Data());
h11=(ideal)u5->Data();
}
else
{
Werror("%s(`ideal/module`,`matrix`[,`module`][,`string`][,`ideal/module`]) expected",Tok2Cmdname(iiOp));
return TRUE;
}
}
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < IDELEMS((ideal)u->Data()))
{
Werror("At least %d ncgen variables are needed for this computation.", IDELEMS((ideal)u->Data()));
return TRUE;
}
}
#endif
if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
idhdl hv=(idhdl)v->data;
// CopyD for IDEAL_CMD and MODUL_CMD are identical:
res->rtyp = u->Typ();
res->data = (char *)idLiftStd((ideal)u->Data(),
&(hv->data.umatrix),testHomog,
syz,alg,h11);
setFlag(res,FLAG_STD); v->flag=0;
if(syz!=NULL)
u3->flag=0;
return FALSE;
}
GbDefault
@ GbDefault
Definition ideals.h:120

## jjLIFTSTD_SYZ()

BOOLEAN jjLIFTSTD_SYZ | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7149 of file iparith.cc.

{
if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
if ((w->rtyp!=IDHDL)||(w->e!=NULL)) return TRUE;
idhdl hv=(idhdl)v->data;
idhdl hw=(idhdl)w->data;
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < IDELEMS((ideal)u->Data()))
{
Werror("At least %d ncgen variables are needed for this computation.", IDELEMS((ideal)u->Data()));
return TRUE;
}
}
#endif
// CopyD for IDEAL_CMD and MODUL_CMD are identical:
res->data = (char *)idLiftStd((ideal)u->Data(),
&(hv->data.umatrix),testHomog,
&(hw->data.uideal));
setFlag(res,FLAG_STD); v->flag=0; w->flag=0;
return FALSE;
}

## jjLIST_PL()

BOOLEAN jjLIST_PL | ( | leftv | res,
|  | leftv | v )

Definition at line 8250 of file iparith.cc.

{
int sl=0;
if (v!=NULL) sl = v->listLength();
lists L;
if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
{
int add_row_shift = 0;
intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
if (weights!=NULL) add_row_shift=weights->min_in();
L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
}
else
{
L=(lists)omAllocBin(slists_bin);
leftv h=NULL;
int i;
int rt;
L->Init(sl);
for (i=0;i<sl;i++)
{
if (h!=NULL)
{ /* e.g. not in the first step:
* h is the pointer to the old sleftv,
* v is the pointer to the next sleftv
* (in this moment) */
h->next=v;
}
h=v;
v=v->next;
h->next=NULL;
rt=h->Typ();
if (rt==0)
{
L->Clean();
Werror("`%s` is undefined",h->Fullname());
return TRUE;
}
if (rt==RING_CMD)
{
L->m[i].rtyp=rt;
L->m[i].data=rIncRefCnt(((ring)h->Data()));
}
else
L->m[i].Copy(h);
}
}
res->data=(char *)L;
return FALSE;
}
intvec::min_in
int min_in()
Definition intvec.h:122
RESOLUTION_CMD
@ RESOLUTION_CMD
Definition grammar.cc:291
syConvRes
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition ipshell.cc:3178
rIncRefCnt
static ring rIncRefCnt(ring r)
Definition ring.h:849

## jjLISTRING()

BOOLEAN jjLISTRING | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4639 of file iparith.cc.

{
lists l=(lists)v->Data();
long mm=(long)atGet(v,"maxExp",INT_CMD);
int isLetterplace=(int)(long)atGet(v,"isLetterplaceRing",INT_CMD);
ring r=rCompose(l,TRUE,mm,isLetterplace);
res->data=(char *)r;
return (r==NULL);
}
rCompose
ring rCompose(const lists L, const BOOLEAN check_comp, const long bitmask, const int isLetterplace)
Definition ipshell.cc:2782

## jjLOAD()

BOOLEAN jjLOAD | ( | const char * | s,
|  | BOOLEAN | autoexport )

load lib/module given in v

Definition at line 5591 of file iparith.cc.

{
char libnamebuf[1024];
lib_types LT = type_of_LIB(s, libnamebuf);
#ifdef HAVE_DYNAMIC_LOADING
extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
#endif /* HAVE_DYNAMIC_LOADING */
switch(LT)
{
default:
case LT_NONE:
Werror("%s: unknown type", s);
break;
case LT_NOTFOUND:
Werror("cannot open %s", s);
break;
case LT_SINGULAR:
{
char *plib = iiConvName(s);
idhdl pl = IDROOT->get_level(plib,0);
if (pl==NULL)
{
pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
IDPACKAGE(pl)->language = LANG_SINGULAR;
IDPACKAGE(pl)->libname=omStrDup(s);
}
else if (IDTYP(pl)!=PACKAGE_CMD)
{
Werror("can not create package `%s`",plib);
omFreeBinAddr(plib);
return TRUE;
}
else /* package */
{
package pa=IDPACKAGE(pl);
if ((pa->language==LANG_C)
|| (pa->language==LANG_MIX))
{
Werror("can not create package `%s` - binaries exists",plib);
omFreeBinAddr(plib);
return TRUE;
}
}
omFreeBinAddr(plib);
package savepack=currPack;
currPack=IDPACKAGE(pl);
IDPACKAGE(pl)->loaded=TRUE;
char libnamebuf[1024];
FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
currPack=savepack;
IDPACKAGE(pl)->loaded=(!bo);
return bo;
}
case LT_BUILTIN:
SModulFunc_t iiGetBuiltinModInit(const char*);
return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
case LT_MACH_O:
case LT_ELF:
case LT_HPUX:
#ifdef HAVE_DYNAMIC_LOADING
return load_modules(s, libnamebuf, autoexport);
#else /* HAVE_DYNAMIC_LOADING */
WerrorS("Dynamic modules are not supported by this version of Singular");
break;
#endif /* HAVE_DYNAMIC_LOADING */
}
return TRUE;
}
fp
CanonicalForm fp
Definition cfModGcd.cc:4110
feFopen
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition feFopen.cc:47
basePack
VAR package basePack
Definition ipid.cc:56
currPack
VAR package currPack
Definition ipid.cc:55
IDROOT
#define IDROOT
Definition ipid.h:19
load_builtin
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition iplib.cc:1304
SModulFunc_t
int(* SModulFunc_t)(SModulFunctions *)
Definition ipid.h:81
iiLoadLIB
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
Definition iplib.cc:983
iiConvName
char * iiConvName(const char *libname)
Definition iplib.cc:1439
load_modules
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition iplib.cc:1294
iiGetBuiltinModInit
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition iplib.cc:816
libnamebuf
VAR char libnamebuf[1024]
Definition libparse.cc:1098
type_of_LIB
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
Definition mod_lib.cc:27
lib_types
lib_types
Definition mod_raw.h:16
LT_MACH_O
@ LT_MACH_O
Definition mod_raw.h:16
LT_HPUX
@ LT_HPUX
Definition mod_raw.h:16
LT_SINGULAR
@ LT_SINGULAR
Definition mod_raw.h:16
LT_BUILTIN
@ LT_BUILTIN
Definition mod_raw.h:16
LT_ELF
@ LT_ELF
Definition mod_raw.h:16
LT_NONE
@ LT_NONE
Definition mod_raw.h:16
LT_NOTFOUND
@ LT_NOTFOUND
Definition mod_raw.h:16
LANG_SINGULAR
@ LANG_SINGULAR
Definition subexpr.h:22
LANG_MIX
@ LANG_MIX
Definition subexpr.h:22
LANG_C
@ LANG_C
Definition subexpr.h:22

## jjLOAD1()

BOOLEAN jjLOAD1 | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4635 of file iparith.cc.

{
return jjLOAD((char*)v->Data(),FALSE);
}
jjLOAD
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition iparith.cc:5591

## jjLOAD2()

BOOLEAN jjLOAD2 | ( | leftv | ,
|  | leftv | ,
|  | leftv | v )

static

Definition at line 2629 of file iparith.cc.

{
return jjLOAD((char*)v->Data(),TRUE);
}

## jjLOAD_E()

BOOLEAN jjLOAD_E | ( | leftv | ,
|  | leftv | v,
|  | leftv | u )

static

Definition at line 2633 of file iparith.cc.

{
char * s=(char *)u->Data();
if(strcmp(s, "with")==0)
return jjLOAD((char*)v->Data(), TRUE);
if (strcmp(s,"try")==0)
return jjLOAD_TRY((char*)v->Data());
WerrorS("invalid second argument");
WerrorS("load(\"libname\" [,option]);");
return TRUE;
}
jjLOAD_TRY
BOOLEAN jjLOAD_TRY(const char *s)
Definition iparith.cc:5667

## jjLOAD_TRY()

BOOLEAN jjLOAD_TRY | ( | const char * | s | ) |

Definition at line 5667 of file iparith.cc.

{
if (!iiGetLibStatus(s))
{
void (*WerrorS_save)(const char *s) = WerrorS_callback;
WerrorS_callback=WerrorS_dummy;
WerrorS_dummy_cnt=0;
BOOLEAN bo=jjLOAD(s,TRUE);
if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
Print("loading of >%s< failed\n",s);
WerrorS_callback=WerrorS_save;
errorreported=0;
}
return FALSE;
}
WerrorS_callback
VAR void(* WerrorS_callback)(const char *s)
Definition feFopen.cc:21
WerrorS_dummy_cnt
STATIC_VAR int WerrorS_dummy_cnt
Definition iparith.cc:5662
WerrorS_dummy
static void WerrorS_dummy(const char *)
Definition iparith.cc:5663
iiGetLibStatus
BOOLEAN iiGetLibStatus(const char *lib)
Definition iplib.cc:77

## jjLT_BI()

BOOLEAN jjLT_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1214 of file iparith.cc.

{
return jjGT_BI(res,v,u);
}
jjGT_BI
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:1184

## jjLT_I()

BOOLEAN jjLT_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1218 of file iparith.cc.

{
res->data = (char *)(long)((int)((long)u->Data()) < (int)((long)v->Data()));
return FALSE;
}

## jjLT_N()

BOOLEAN jjLT_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1223 of file iparith.cc.

{
return jjGT_N(res,v,u);
}
jjGT_N
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition iparith.cc:1196

## jjLU_DECOMP()

BOOLEAN jjLU_DECOMP | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4666 of file iparith.cc.

{
/* computes the LU-decomposition of a matrix M;
i.e., M = P * L * U, where
- P is a row permutation matrix,
- L is in lower triangular form,
- U is in upper row echelon form
Then, we also have P * M = L * U.
A list [P, L, U] is returned. */
matrix mat = (matrix)v->Data();
if (!idIsConstant((ideal)mat))
{
WerrorS("matrix must be constant");
return TRUE;
}
matrix pMat;
matrix lMat;
matrix uMat;
luDecomp(mat, pMat, lMat, uMat);
lists ll = (lists)omAllocBin(slists_bin);
ll->Init(3);
ll->m[0].rtyp=MATRIX_CMD; ll->m[0].data=(void *)pMat;
ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)lMat;
ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)uMat;
res->data=(char*)ll;
return FALSE;
}
idIsConstant
#define idIsConstant(I)
Definition ideals.h:40
luDecomp
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
Definition linearAlgebra.cc:103

## jjLU_INVERSE()

BOOLEAN jjLU_INVERSE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7738 of file iparith.cc.

{
/* computation of the inverse of a quadratic matrix A
using the L-U-decomposition of A;
There are two valid parametrisations:
1) exactly one argument which is just the matrix A,
2) exactly three arguments P, L, U which already
realise the L-U-decomposition of A, that is,
P * A = L * U, and P, L, and U satisfy the
properties decribed in method 'jjLU_DECOMP';
see there;
If A is invertible, the list [1, A^(-1)] is returned,
otherwise the list [0] is returned. Thus, the user may
inspect the first entry of the returned list to see
whether A is invertible. */
matrix iMat; int invertible;
const short t1[]={1,MATRIX_CMD};
const short t2[]={3,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
if (iiCheckTypes(v,t1))
{
matrix aMat = (matrix)v->Data();
int rr = aMat->rows();
int cc = aMat->cols();
if (rr != cc)
{
Werror("given matrix (%d x %d) is not quadratic, hence not invertible", rr, cc);
return TRUE;
}
if (!idIsConstant((ideal)aMat))
{
WerrorS("matrix must be constant");
return TRUE;
}
invertible = luInverse(aMat, iMat);
}
else if (iiCheckTypes(v,t2))
{
matrix pMat = (matrix)v->Data();
matrix lMat = (matrix)v->next->Data();
matrix uMat = (matrix)v->next->next->Data();
int rr = uMat->rows();
int cc = uMat->cols();
if (rr != cc)
{
Werror("third matrix (%d x %d) is not quadratic, hence not invertible",
rr, cc);
return TRUE;
}
if (!idIsConstant((ideal)pMat)
|| (!idIsConstant((ideal)lMat))
|| (!idIsConstant((ideal)uMat))
)
{
WerrorS("matricesx must be constant");
return TRUE;
}
invertible = luInverseFromLUDecomp(pMat, lMat, uMat, iMat);
}
else
{
Werror("expected either one or three matrices");
return TRUE;
}
/* build the return structure; a list with either one or two entries */
lists ll = (lists)omAllocBin(slists_bin);
if (invertible)
{
ll->Init(2);
ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)iMat;
}
else
{
ll->Init(1);
ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
}
res->data=(char*)ll;
return FALSE;
}
ip_smatrix::cols
int & cols()
Definition matpol.h:24
ip_smatrix::rows
int & rows()
Definition matpol.h:23
luInverseFromLUDecomp
bool luInverseFromLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, matrix &iMat, const ring R)
This code computes the inverse by inverting lMat and uMat, and then performing two matrix multiplicat...
Definition linearAlgebra.cc:352
luInverse
bool luInverse(const matrix aMat, matrix &iMat, const ring R)
This code first computes the LU-decomposition of aMat, and then calls the method for inverting a matr...
Definition linearAlgebra.cc:200

## jjLU_SOLVE()

BOOLEAN jjLU_SOLVE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 7819 of file iparith.cc.

{
/* for solving a linear equation system A * x = b, via the
given LU-decomposition of the matrix A;
There is one valid parametrisation:
1) exactly four arguments P, L, U, b;
P, L, and U realise the L-U-decomposition of A, that is,
P * A = L * U, and P, L, and U satisfy the
properties decribed in method 'jjLU_DECOMP';
see there;
b is the right-hand side vector of the equation system;
The method will return a list of either 1 entry or three entries:
1) [0] if there is no solution to the system;
2) [1, x, H] if there is at least one solution;
x is any solution of the given linear system,
H is the matrix with column vectors spanning the homogeneous
solution space.
The method produces an error if matrix and vector sizes do not fit. */
const short t[]={4,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
if (!iiCheckTypes(v,t))
{
WerrorS("expected exactly three matrices and one vector as input");
return TRUE;
}
matrix pMat = (matrix)v->Data();
matrix lMat = (matrix)v->next->Data();
matrix uMat = (matrix)v->next->next->Data();
matrix bVec = (matrix)v->next->next->next->Data();
matrix xVec; int solvable; matrix homogSolSpace;
if (pMat->rows() != pMat->cols())
{
Werror("first matrix (%d x %d) is not quadratic",
pMat->rows(), pMat->cols());
return TRUE;
}
if (lMat->rows() != lMat->cols())
{
Werror("second matrix (%d x %d) is not quadratic",
lMat->rows(), lMat->cols());
return TRUE;
}
if (lMat->rows() != uMat->rows())
{
Werror("second matrix (%d x %d) and third matrix (%d x %d) do not fit",
lMat->rows(), lMat->cols(), uMat->rows(), uMat->cols());
return TRUE;
}
if (uMat->rows() != bVec->rows())
{
Werror("third matrix (%d x %d) and vector (%d x 1) do not fit",
uMat->rows(), uMat->cols(), bVec->rows());
return TRUE;
}
if (!idIsConstant((ideal)pMat)
||(!idIsConstant((ideal)lMat))
||(!idIsConstant((ideal)uMat))
)
{
WerrorS("matrices must be constant");
return TRUE;
}
solvable = luSolveViaLUDecomp(pMat, lMat, uMat, bVec, xVec, homogSolSpace);
/* build the return structure; a list with either one or three entries */
lists ll = (lists)omAllocBin(slists_bin);
if (solvable)
{
ll->Init(3);
ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
}
else
{
ll->Init(1);
ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
}
res->data=(char*)ll;
return FALSE;
}
luSolveViaLUDecomp
bool luSolveViaLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, 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 LU-decompositi...
Definition linearAlgebra.cc:377

## jjMakeSub()

Subexpr jjMakeSub | ( | leftv | e | ) |

static

Definition at line 8970 of file iparith.cc.

{
assume( e->Typ()==INT_CMD );
Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
r->start =(int)(long)e->Data();
return r;
}
sSubexpr_bin
VAR omBin sSubexpr_bin
Definition subexpr.cc:40

## jjMAP()

BOOLEAN jjMAP | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1653 of file iparith.cc.

{
//Print("try to map %s with %s\n",$3.Name(),$1.Name());
if ((v->e==NULL)&&(v->name!=NULL)&&(v->next==NULL))
{
map m=(map)u->Data();
leftv sl=iiMap(m,v->name);
if (sl!=NULL)
{
memcpy(res,sl,sizeof(sleftv));
omFreeBin((ADDRESS)sl, sleftv_bin);
return FALSE;
}
}
else
{
Werror("%s(<name>) expected",u->Name());
}
return TRUE; /*sl==NULL or Werror*/
}
iiMap
leftv iiMap(map theMap, const char *what)
Definition ipshell.cc:618

## jjMATRIX_Id()

BOOLEAN jjMATRIX_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6950 of file iparith.cc.

{
int mi=(int)(long)v->Data();
int ni=(int)(long)w->Data();
if ((mi<1)||(ni<1))
{
Werror("converting ideal to matrix: dimensions must be positive(%dx%d)",mi,ni);
return TRUE;
}
matrix m=mpNew(mi,ni);
ideal I=(ideal)u->CopyD(IDEAL_CMD);
int i=si_min(IDELEMS(I),mi*ni);
//for(i=i-1;i>=0;i--)
//{
// m->m[i]=I->m[i];
// I->m[i]=NULL;
//}
memcpy(m->m,I->m,i*sizeof(poly));
memset(I->m,0,i*sizeof(poly));
id_Delete(&I,currRing);
res->data = (char *)m;
return FALSE;
}

## jjMATRIX_Ma()

BOOLEAN jjMATRIX_Ma | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6986 of file iparith.cc.

{
int mi=(int)(long)v->Data();
int ni=(int)(long)w->Data();
if ((mi<1)||(ni<1))
{
Werror("converting matrix to matrix: dimensions must be positive(%dx%d)",mi,ni);
return TRUE;
}
matrix m=mpNew(mi,ni);
matrix I=(matrix)u->CopyD(MATRIX_CMD);
int r=si_min(MATROWS(I),mi);
int c=si_min(MATCOLS(I),ni);
int i,j;
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
MATELEM(m,i,j)=MATELEM(I,i,j);
MATELEM(I,i,j)=NULL;
}
}
id_Delete((ideal *)&I,currRing);
res->data = (char *)m;
return FALSE;
}

## jjMATRIX_Mo()

BOOLEAN jjMATRIX_Mo | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6973 of file iparith.cc.

{
int mi=(int)(long)v->Data();
int ni=(int)(long)w->Data();
if ((mi<0)||(ni<1))
{
Werror("converting module to matrix: dimensions must be positive(%dx%d)",mi,ni);
return TRUE;
}
res->data = (char *)id_Module2formatedMatrix((ideal)u->CopyD(MODUL_CMD),
mi,ni,currRing);
return FALSE;
}

## jjMEMORY()

BOOLEAN jjMEMORY | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4696 of file iparith.cc.

{
// clean out "_":
sLastPrinted.CleanUp();
// collect all info:
omUpdateInfo();
switch(((int)(long)v->Data()))
{
case 0:
res->data=(char *)n_Init(om_Info.UsedBytes,coeffs_BIGINT);
break;
case 1:
res->data = (char *)n_Init(om_Info.CurrentBytesSystem,coeffs_BIGINT);
break;
case 2:
res->data = (char *)n_Init(om_Info.MaxBytesSystem,coeffs_BIGINT);
break;
default:
omPrintStats(stdout);
omPrintInfo(stdout);
omPrintBinStats(stdout);
res->data = (char *)0;
res->rtyp = NONE;
}
return FALSE;
}
om_Info
omInfo_t om_Info
Definition omStats.c:16
sLastPrinted
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46
NONE
#define NONE
Definition tok.h:223
omPrintStats
#define omPrintStats(F)
Definition xalloc.h:231
omPrintInfo
#define omPrintInfo(F)
Definition xalloc.h:232
omPrintBinStats
#define omPrintBinStats(F)
Definition xalloc.h:233
omUpdateInfo
#define omUpdateInfo()
Definition xalloc.h:230

## jjMINOR_M()

BOOLEAN jjMINOR_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 6389 of file iparith.cc.

{
/* Here's the use pattern for the minor command:
minor ( matrix_expression m, int_expression minorSize,
optional ideal_expression IasSB, optional int_expression k,
optional string_expression algorithm,
optional int_expression cachedMinors,
optional int_expression cachedMonomials )
This method here assumes that there are at least two arguments.
- If IasSB is present, it must be a std basis. All minors will be
reduced w.r.t. IasSB.
- If k is absent, all non-zero minors will be computed.
If k is present and k > 0, the first k non-zero minors will be
computed.
If k is present and k < 0, the first |k| minors (some of which
may be zero) will be computed.
If k is present and k = 0, an error is reported.
- If algorithm is absent, all the following arguments must be absent too.
In this case, a heuristic picks the best-suited algorithm (among
Bareiss, Laplace, and Laplace with caching).
If algorithm is present, it must be one of "Bareiss", "bareiss",
"Laplace", "laplace", "Cache", "cache". In the cases "Cache" and
"cache" two more arguments may be given, determining how many entries
the cache may have at most, and how many cached monomials there are at
most. (Cached monomials are counted over all cached polynomials.)
If these two additional arguments are not provided, 200 and 100000
will be used as defaults.
*/
matrix m;
leftv u=v->next;
v->next=NULL;
int v_typ=v->Typ();
if (v_typ==MATRIX_CMD)
{
m = (matrix)v->Data();
}
else
{
if (v_typ==0)
{
Werror("`%s` is undefined",v->Fullname());
return TRUE;
}
// try to convert to MATRIX:
int ii=iiTestConvert(v_typ,MATRIX_CMD);
BOOLEAN bo;
sleftv tmp;
if (ii>0) bo=iiConvert(v_typ,MATRIX_CMD,ii,v,&tmp);
else bo=TRUE;
if (bo)
{
Werror("cannot convert %s to matrix",Tok2Cmdname(v_typ));
return TRUE;
}
m=(matrix)tmp.data;
}
const int mk = (int)(long)u->Data();
bool noIdeal = true; bool noK = true; bool noAlgorithm = true;
bool noCacheMinors = true; bool noCacheMonomials = true;
ideal IasSB; int k=0; char* algorithm; int cacheMinors; int cacheMonomials;
/* here come the different cases of correct argument sets */
if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD))
{
IasSB = (ideal)u->next->Data();
noIdeal = false;
if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
{
k = (int)(long)u->next->next->Data();
noK = false;
if ((u->next->next->next != NULL) &&
(u->next->next->next->Typ() == STRING_CMD))
{
algorithm = (char*)u->next->next->next->Data();
noAlgorithm = false;
if ((u->next->next->next->next != NULL) &&
(u->next->next->next->next->Typ() == INT_CMD))
{
cacheMinors = (int)(long)u->next->next->next->next->Data();
noCacheMinors = false;
if ((u->next->next->next->next->next != NULL) &&
(u->next->next->next->next->next->Typ() == INT_CMD))
{
cacheMonomials =
(int)(long)u->next->next->next->next->next->Data();
noCacheMonomials = false;
}
}
}
}
}
else if ((u->next != NULL) && (u->next->Typ() == INT_CMD))
{
k = (int)(long)u->next->Data();
noK = false;
if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD))
{
algorithm = (char*)u->next->next->Data();
noAlgorithm = false;
if ((u->next->next->next != NULL) &&
(u->next->next->next->Typ() == INT_CMD))
{
cacheMinors = (int)(long)u->next->next->next->Data();
noCacheMinors = false;
if ((u->next->next->next->next != NULL) &&
(u->next->next->next->next->Typ() == INT_CMD))
{
cacheMonomials = (int)(long)u->next->next->next->next->Data();
noCacheMonomials = false;
}
}
}
}
else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD))
{
algorithm = (char*)u->next->Data();
noAlgorithm = false;
if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
{
cacheMinors = (int)(long)u->next->next->Data();
noCacheMinors = false;
if ((u->next->next->next != NULL) &&
(u->next->next->next->Typ() == INT_CMD))
{
cacheMonomials = (int)(long)u->next->next->next->Data();
noCacheMonomials = false;
}
}
}
/* upper case conversion for the algorithm if present */
if (!noAlgorithm)
{
if (strcmp(algorithm, "bareiss") == 0)
algorithm = (char*)"Bareiss";
if (strcmp(algorithm, "laplace") == 0)
algorithm = (char*)"Laplace";
if (strcmp(algorithm, "cache") == 0)
algorithm = (char*)"Cache";
}
v->next=u;
/* here come some tests */
if (!noIdeal)
{
assumeStdFlag(u->next);
}
if ((!noK) && (k == 0))
{
WerrorS("Provided number of minors to be computed is zero.");
return TRUE;
}
if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") != 0)
&& (strcmp(algorithm, "Laplace") != 0)
&& (strcmp(algorithm, "Cache") != 0))
{
WerrorS("Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
return TRUE;
}
if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
&& (!rField_is_Domain(currRing)))
{
Werror("Bareiss algorithm not defined over coefficient rings %s",
"with zero divisors.");
return TRUE;
}
if ((mk < 1) || (mk > m->rows()) || (mk > m->cols()))
{
ideal I=idInit(1,1);
if (mk<1) I->m[0]=p_One(currRing);
//Werror("invalid size of minors: %d (matrix is (%d x %d))", mk,
// m->rows(), m->cols());
res->data=(void*)I;
return FALSE;
}
if ((!noAlgorithm) && (strcmp(algorithm, "Cache") == 0)
&& (noCacheMinors || noCacheMonomials))
{
cacheMinors = 200;
cacheMonomials = 100000;
}
/* here come the actual procedure calls */
if (noAlgorithm)
res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k),
(noIdeal ? 0 : IasSB), false);
else if (strcmp(algorithm, "Cache") == 0)
res->data = getMinorIdealCache(m, mk, (noK ? 0 : k),
(noIdeal ? 0 : IasSB), 3, cacheMinors,
cacheMonomials, false);
else
res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm,
(noIdeal ? 0 : IasSB), false);
if (v_typ!=MATRIX_CMD) idDelete((ideal *)&m);
return FALSE;
}
getMinorIdealCache
ideal getMinorIdealCache(const matrix mat, const int minorSize, const int k, const ideal iSB, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
Definition MinorInterface.cc:457
getMinorIdeal
ideal getMinorIdeal(const matrix mat, const int minorSize, const int k, const char *algorithm, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
Definition MinorInterface.cc:238
getMinorIdealHeuristic
ideal getMinorIdealHeuristic(const matrix mat, const int minorSize, const int k, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
Definition MinorInterface.cc:495
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314

## jjMINRES_R()

BOOLEAN jjMINRES_R | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4747 of file iparith.cc.

{
intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
syStrategy tmp=syCopy((syStrategy)v->Data());
tmp = syMinimize(tmp); // enrich itself!
res->data=(char *)tmp;
if (weights!=NULL)
atSet(res, omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
return FALSE;
}
syMinimize
syStrategy syMinimize(syStrategy syzstr)
Definition syz1.cc:2393
syCopy
syStrategy syCopy(syStrategy syzstr)
Definition syz1.cc:1885

## jjMINUS_B()

BOOLEAN jjMINUS_B | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 919 of file iparith.cc.

{
sBucket_pt b=sBucketCreate(currRing);
poly p=(poly)u->CopyD(POLY_CMD);
int l=pLength(p);
sBucket_Add_p(b,p,l);
p= (poly)v->CopyD(POLY_CMD);
p=p_Neg(p,currRing);
l=pLength(p);
sBucket_Add_p(b,p,l);
res->data=(void*)b;
return jjPLUSMINUS_Gen(res,u,v);
}
jjPLUSMINUS_Gen
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition iparith.cc:631
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114
pLength
static int pLength(poly a)
Definition p_polys.h:190
sBucket_Add_p
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
Definition sbuckets.cc:203
sBucketCreate
sBucket_pt sBucketCreate(const ring r)
Definition sbuckets.cc:96

## jjMINUS_B_P()

BOOLEAN jjMINUS_B_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 909 of file iparith.cc.

{
sBucket_pt b=(sBucket_pt)u->CopyD(BUCKET_CMD);
poly p= (poly)v->CopyD(POLY_CMD);
int l=pLength(p);
p=p_Neg(p,currRing);
sBucket_Add_p(b,p,l);
res->data=(void*)b;
return jjPLUSMINUS_Gen(res,u,v);
}
BUCKET_CMD
@ BUCKET_CMD
Definition grammar.cc:284

## jjMINUS_BI()

BOOLEAN jjMINUS_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 894 of file iparith.cc.

{
res->data = (char *)(n_Sub((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
return jjPLUSMINUS_Gen(res,u,v);
}

## jjMINUS_BIM()

BOOLEAN jjMINUS_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 942 of file iparith.cc.

{
res->data = (char *)bimSub((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
if (res->data==NULL)
{
WerrorS("bigintmat/cmatrix not compatible");
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}
bimSub
bigintmat * bimSub(bigintmat *a, bigintmat *b)
Definition bigintmat.cc:216

## jjMINUS_I()

BOOLEAN jjMINUS_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 878 of file iparith.cc.

{
void *ap=u->Data(); void *bp=v->Data();
long aa=(long)ap;
long bb=(long)bp;
long cc=aa-bb;
unsigned long a=(unsigned long)ap;
unsigned long b=(unsigned long)bp;
unsigned long c=a-b;
if (((Sy_bitL(bit31)&a)!=(Sy_bitL(bit31)&b))&&((Sy_bitL(bit31)&a)!=(Sy_bitL(bit31)&c)))
{
WarnS("int overflow(-), result may be wrong");
}
res->data = (char *)cc;
return jjPLUSMINUS_Gen(res,u,v);
}
bit31
#define bit31
Definition iparith.cc:121
ap
Definition ap.h:40
Sy_bitL
#define Sy_bitL(x)
Definition options.h:32

## jjMINUS_IV()

BOOLEAN jjMINUS_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 932 of file iparith.cc.

{
res->data = (char *)ivSub((intvec*)(u->Data()), (intvec*)(v->Data()));
if (res->data==NULL)
{
WerrorS("intmat size not compatible");
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}
ivSub
intvec * ivSub(intvec *a, intvec *b)
Definition intvec.cc:297

## jjMINUS_MA()

BOOLEAN jjMINUS_MA | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 952 of file iparith.cc.

{
matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
res->data = (char *)(mp_Sub(A , B, currRing));
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d)",
MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
return FALSE;
}
B
b *CanonicalForm B
Definition facBivar.cc:52
mp_Sub
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition matpol.cc:189

## jjMINUS_N()

BOOLEAN jjMINUS_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 899 of file iparith.cc.

{
res->data = (char *)(nSub((number)u->Data(), (number)v->Data()));
return jjPLUSMINUS_Gen(res,u,v);
}
nSub
#define nSub(n1, n2)
Definition numbers.h:22

## jjMINUS_SM()

BOOLEAN jjMINUS_SM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 965 of file iparith.cc.

{
ideal A=(ideal)u->Data(); ideal B=(ideal)v->Data();
res->data = (char *)(sm_Sub(A , B, currRing));
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d)",
(int)A->rank,IDELEMS(A),(int)B->rank,IDELEMS(B));
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
return FALSE;
}
sm_Sub
ideal sm_Sub(ideal a, ideal b, const ring R)
Definition matpol.cc:1877

## jjMINUS_V()

BOOLEAN jjMINUS_V | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 904 of file iparith.cc.

{
res->data = (char *)(pSub((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
return jjPLUSMINUS_Gen(res,u,v);
}
pSub
#define pSub(a, b)
Definition polys.h:288

## jjMOD_BI()

BOOLEAN jjMOD_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2697 of file iparith.cc.

{
number q=(number)v->Data();
if (n_IsZero(q,coeffs_BIGINT))
{
WerrorS(ii_div_by_0);
return TRUE;
}
res->data =(char *) n_IntMod((number)u->Data(),q,coeffs_BIGINT);
return FALSE;
}
n_IntMod
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,...
Definition coeffs.h:631

## jjMOD_N()

BOOLEAN jjMOD_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2708 of file iparith.cc.

{
number q=(number)v->Data();
if (nIsZero(q))
{
WerrorS(ii_div_by_0);
return TRUE;
}
res->data =(char *) n_IntMod((number)u->Data(),q,currRing->cf);
return FALSE;
}

## jjMOD_P()

BOOLEAN jjMOD_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2719 of file iparith.cc.

{
poly q=(poly)v->Data();
if (q==NULL)
{
WerrorS(ii_div_by_0);
return TRUE;
}
poly p=(poly)(u->Data());
if (p==NULL)
{
res->data=NULL;
return FALSE;
}
res->data=(void*)(singclap_pmod(p /*(poly)(u->Data())*/ ,
q /*(poly)(v->Data())*/ ,currRing));
return FALSE;
}
singclap_pmod
poly singclap_pmod(poly f, poly g, const ring r)
Definition clapsing.cc:732

## jjMODULO()

BOOLEAN jjMODULO | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2644 of file iparith.cc.

{
intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w_u!=NULL)
{
//PrintS("modulo: wu:");w_u->show(INTVEC_CMD);PrintLn();
w_u=ivCopy(w_u);
hom=isHomog;
}
//else PrintS("modulo: wu:none\n");
intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
if (w_v!=NULL)
{
//PrintS("modulo: wv:");w_v->show(INTVEC_CMD);PrintLn();
w_v=ivCopy(w_v);
hom=isHomog;
}
//else PrintS("modulo: wv:none\n");
if ((w_u!=NULL) && (w_v==NULL))
w_v=ivCopy(w_u);
if ((w_v!=NULL) && (w_u==NULL))
w_u=ivCopy(w_v);
ideal u_id=(ideal)u->Data();
ideal v_id=(ideal)v->Data();
if (w_u!=NULL)
{
if ((*w_u).compare((w_v))!=0)
{
WarnS("incompatible weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
else
{
if ((!idTestHomModule(u_id,currRing->qideal,w_v))
|| (!idTestHomModule(v_id,currRing->qideal,w_v)))
{
WarnS("wrong weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
}
}
res->data = (char *)idModulo(u_id,v_id ,hom,&w_u);
if (w_u!=NULL)
{
atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
}
delete w_v;
//if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}
idModulo
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w, matrix *T, GbVariant alg)
Definition ideals.cc:2463
tHomog
tHomog
Definition structs.h:31
isHomog
@ isHomog
Definition structs.h:33

## jjMODULO3()

BOOLEAN jjMODULO3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7012 of file iparith.cc.

{
if (w->rtyp!=IDHDL) return TRUE; /* idhdhl required */
intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w_u!=NULL)
{
w_u=ivCopy(w_u);
hom=isHomog;
}
intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
if (w_v!=NULL)
{
w_v=ivCopy(w_v);
hom=isHomog;
}
if ((w_u!=NULL) && (w_v==NULL))
w_v=ivCopy(w_u);
if ((w_v!=NULL) && (w_u==NULL))
w_u=ivCopy(w_v);
ideal u_id=(ideal)u->Data();
ideal v_id=(ideal)v->Data();
if (w_u!=NULL)
{
if ((*w_u).compare((w_v))!=0)
{
WarnS("incompatible weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
else
{
if ((!idTestHomModule(u_id,currRing->qideal,w_v))
|| (!idTestHomModule(v_id,currRing->qideal,w_v)))
{
WarnS("wrong weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
}
}
idhdl h=(idhdl)w->data;
res->data = (char *)idModulo(u_id,v_id ,hom,&w_u, &(h->data.umatrix));
if (w_u!=NULL)
{
atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
}
delete w_v;
//if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}

## jjMODULO3S()

BOOLEAN jjMODULO3S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7063 of file iparith.cc.

{
if (w->rtyp!=IDHDL) return TRUE; /* idhdhl required */
intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w_u!=NULL)
{
w_u=ivCopy(w_u);
hom=isHomog;
}
intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
if (w_v!=NULL)
{
w_v=ivCopy(w_v);
hom=isHomog;
}
if ((w_u!=NULL) && (w_v==NULL))
w_v=ivCopy(w_u);
if ((w_v!=NULL) && (w_u==NULL))
w_u=ivCopy(w_v);
ideal u_id=(ideal)u->Data();
GbVariant alg=syGetAlgorithm((char*)w->Data(),currRing,u_id);
ideal v_id=(ideal)v->Data();
if (w_u!=NULL)
{
if ((*w_u).compare((w_v))!=0)
{
WarnS("incompatible weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
else
{
if ((!idTestHomModule(u_id,currRing->qideal,w_v))
|| (!idTestHomModule(v_id,currRing->qideal,w_v)))
{
WarnS("wrong weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
}
}
res->data = (char *)idModulo(u_id,v_id ,hom,&w_u, NULL,alg);
if (w_u!=NULL)
{
atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
}
delete w_v;
//if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}

## jjMODULO4()

BOOLEAN jjMODULO4 | ( | leftv | res,
|  | leftv | u )

static

Definition at line 8301 of file iparith.cc.

{
leftv v=u->next;
leftv w=v->next;
leftv u4=w->next;
GbVariant alg;
ideal u_id,v_id;
// we have 4 arguments
const short t1[]={4,IDEAL_CMD,IDEAL_CMD,MATRIX_CMD,STRING_CMD};
const short t2[]={4,MODUL_CMD,MODUL_CMD,MATRIX_CMD,STRING_CMD};
if(iiCheckTypes(u,t1)||iiCheckTypes(u,t2)||(w->rtyp!=IDHDL))
{
u_id=(ideal)u->Data();
v_id=(ideal)v->Data();
alg=syGetAlgorithm((char*)u4->Data(),currRing,u_id);
}
else
{
Werror("%s(`ideal/module`,`ideal/module`[,`matrix`][,`string`]) expected",Tok2Cmdname(iiOp));
return TRUE;
}
intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w_u!=NULL)
{
w_u=ivCopy(w_u);
hom=isHomog;
}
intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
if (w_v!=NULL)
{
w_v=ivCopy(w_v);
hom=isHomog;
}
if ((w_u!=NULL) && (w_v==NULL))
w_v=ivCopy(w_u);
if ((w_v!=NULL) && (w_u==NULL))
w_u=ivCopy(w_v);
if (w_u!=NULL)
{
if ((*w_u).compare((w_v))!=0)
{
WarnS("incompatible weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
else
{
if ((!idTestHomModule(u_id,currRing->qideal,w_v))
|| (!idTestHomModule(v_id,currRing->qideal,w_v)))
{
WarnS("wrong weights");
delete w_u; w_u=NULL;
hom=testHomog;
}
}
}
idhdl h=(idhdl)w->data;
res->data = (char *)idModulo(u_id,v_id ,hom,&w_u, &(h->data.umatrix),alg);
if (w_u!=NULL)
{
atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
}
delete w_v;
//if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}

## jjMONITOR1()

BOOLEAN jjMONITOR1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 2738 of file iparith.cc.

{
return jjMONITOR2(res,v,NULL);
}
jjMONITOR2
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition iparith.cc:2742

## jjMONITOR2()

BOOLEAN jjMONITOR2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2742 of file iparith.cc.

{
#if 0
char *opt=(char *)v->Data();
int mode=0;
while(*opt!='\0')
{
if (*opt=='i') mode |= SI_PROT_I;
else if (*opt=='o') mode |= SI_PROT_O;
opt++;
}
monitor((char *)(u->Data()),mode);
#else
si_link l=(si_link)u->Data();
if (slOpen(l,SI_LINK_WRITE,u)) return TRUE;
if(strcmp(l->m->type,"ASCII")!=0)
{
Werror("ASCII link required, not `%s`",l->m->type);
slClose(l);
return TRUE;
}
SI_LINK_SET_CLOSE_P(l); // febase handles the FILE*
if ( l->name[0]!='\0') // "" is the stop condition
{
const char *opt;
int mode=0;
if (v==NULL) opt=(const char*)"i";
else opt=(const char *)v->Data();
while(*opt!='\0')
{
if (*opt=='i') mode |= SI_PROT_I;
else if (*opt=='o') mode |= SI_PROT_O;
opt++;
}
monitor((FILE *)l->data,mode);
}
else
monitor(NULL,0);
return FALSE;
#endif
}
monitor
void monitor(void *F, int mode)
Definition febase.cc:68
SI_PROT_O
#define SI_PROT_O
Definition reporter.h:54
SI_PROT_I
#define SI_PROT_I
Definition reporter.h:53
slClose
BOOLEAN slClose(si_link l)
Definition silink.cc:240
slOpen
BOOLEAN slOpen(si_link l, short flag, leftv h)
Definition silink.cc:194
SI_LINK_WRITE
#define SI_LINK_WRITE
Definition silink.h:67
SI_LINK_SET_CLOSE_P
#define SI_LINK_SET_CLOSE_P(l)
Definition silink.h:76

## jjMONOM()

BOOLEAN jjMONOM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 2783 of file iparith.cc.

{
intvec *iv=(intvec *)v->Data();
poly p=pOne();
int e;
BOOLEAN err=FALSE;
for(unsigned i=si_min(currRing->N,iv->length()); i>0; i--)
{
e=(*iv)[i-1];
if (e>=0) pSetExp(p,i,e);
else err=TRUE;
}
if (iv->length()==(currRing->N+1))
{
res->rtyp=VECTOR_CMD;
e=(*iv)[currRing->N];
if (e>=0) pSetComp(p,e);
else err=TRUE;
}
pSetm(p);
res->data=(char*)p;
if(err) { pDelete(&p); WerrorS("no negative exponent allowed"); }
return err;
}

## jjmpTrace()

BOOLEAN jjmpTrace | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5741 of file iparith.cc.

{
res->data = (char *)mp_Trace((matrix)v->Data(),currRing);
return FALSE;
}
mp_Trace
poly mp_Trace(matrix a, const ring R)
Definition matpol.cc:268

## jjmpTransp()

BOOLEAN jjmpTransp | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5746 of file iparith.cc.

{
res->data = (char *)mp_Transp((matrix)v->Data(),currRing);
return FALSE;
}
mp_Transp
matrix mp_Transp(matrix a, const ring R)
Definition matpol.cc:247

## jjMRES_MAP()

BOOLEAN jjMRES_MAP | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | ma )

static

Definition at line 6585 of file iparith.cc.

{
if ((ma->rtyp!=IDHDL)||(ma->e!=NULL))
{
WerrorS("3rd argument must have a name");
return TRUE;
}
int maxl=(int)(long)v->Data();
if (maxl<0)
{
WerrorS("length for res must not be negative");
return TRUE;
}
syStrategy r;
intvec *weights=NULL;
int wmaxl=maxl;
ideal u_id=(ideal)u->Data();
maxl--;
if (/*(*/ maxl==-1 /*)*/)
{
maxl = currRing->N-1+2;
if (currRing->qideal!=NULL)
{
Warn(
"full resolution in a qring may be infinite, setting max length to %d",
maxl+1);
}
}
weights=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
if (weights!=NULL)
{
if (!idTestHomModule(u_id,currRing->qideal,weights))
{
WarnS("wrong weights given:");weights->show();PrintLn();
weights=NULL;
}
}
intvec *ww=NULL;
int add_row_shift=0;
if (weights!=NULL)
{
ww=ivCopy(weights);
add_row_shift = ww->min_in();
(*ww) -= add_row_shift;
}
unsigned save_opt=si_opt_1;
si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
u_id=(ideal)u->CopyD();
ideal mat;
r=syMres_with_map(u_id,maxl,ww,mat);
idhdl h=(idhdl)ma->data;
idDelete(&IDIDEAL(h));
IDIDEAL(h)=mat;
if (r->list_length>wmaxl)
{
for(int i=wmaxl-1;i>=r->list_length;i--)
{
if (r->fullres[i]!=NULL) id_Delete(&r->fullres[i],currRing);
if (r->minres[i]!=NULL) id_Delete(&r->minres[i],currRing);
}
}
r->list_length=wmaxl;
res->data=(void *)r;
if ((weights!=NULL) && (ww!=NULL)) { delete ww; ww=NULL; }
if ((r->weights!=NULL) && (r->weights[0]!=NULL))
{
ww=ivCopy(r->weights[0]);
if (weights!=NULL) (*ww) += add_row_shift;
atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
}
else
{
if (weights!=NULL)
{
atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
}
}
assume( (r->syRing != NULL) == (r->resPairs != NULL) );
assume( (r->minres != NULL) || (r->fullres != NULL) );
si_opt_1=save_opt;
return FALSE;
}
intvec::show
void show(int mat=0, int spaces=0) const
Definition intvec.cc:149
IDIDEAL
#define IDIDEAL(a)
Definition ipid.h:133
si_opt_1
VAR unsigned si_opt_1
Definition options.c:5
OPT_REDTAIL_SYZ
#define OPT_REDTAIL_SYZ
Definition options.h:88
Sy_bit
#define Sy_bit(x)
Definition options.h:31
syMres_with_map
syStrategy syMres_with_map(ideal arg, int maxlength, intvec *w, ideal &trans)
Definition syz.cc:1180
ssyStrategy::syRing
ring syRing
Definition syz.h:56
ssyStrategy::minres
resolvente minres
Definition syz.h:58
ssyStrategy::list_length
short list_length
Definition syz.h:62
ssyStrategy::weights
intvec ** weights
Definition syz.h:45
ssyStrategy::resPairs
SRes resPairs
Definition syz.h:49

## jjMSTD()

BOOLEAN jjMSTD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4726 of file iparith.cc.

{
int t=v->Typ();
ideal r,m;
r=kMin_std2((ideal)v->Data(),currRing->qideal,testHomog,NULL,m,NULL);
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=t;
l->m[0].data=(char *)r;
setFlag(&(l->m[0]),FLAG_STD);
l->m[1].rtyp=t;
l->m[1].data=(char *)m;
res->data=(char *)l;
return FALSE;
}
kMin_std2
ideal kMin_std2(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, bigintmat *hilb, int syzComp, int reduced)
Definition kstd1.cc:3069

## jjMULT()

BOOLEAN jjMULT | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4741 of file iparith.cc.

{
assumeStdFlag(v);
res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal);
return FALSE;
}
scMultInt
int scMultInt(ideal S, ideal Q)
Definition hdegree.cc:901

## jjN2BI()

BOOLEAN jjN2BI | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4761 of file iparith.cc.

{
number n,i; i=(number)v->Data();
nMapFunc nMap=n_SetMap(currRing->cf,coeffs_BIGINT);
if (nMap!=NULL)
n=nMap(i,currRing->cf,coeffs_BIGINT);
else goto err;
res->data=(void *)n;
return FALSE;
err:
WerrorS("cannot convert to bigint"); return TRUE;
}

## jjNAMEOF()

BOOLEAN jjNAMEOF | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4773 of file iparith.cc.

{
if ((v->rtyp==IDHDL)||(v->rtyp==ALIAS_CMD))
res->data=omStrDup(v->name);
else if (v->name==NULL)
res->data=omStrDup("");
else
{
res->data = (char *)v->name;
v->name=NULL;
}
return FALSE;
}

## jjNAMES()

BOOLEAN jjNAMES | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4786 of file iparith.cc.

{
res->data=ipNameList(((ring)v->Data())->idroot);
return FALSE;
}
ipNameList
lists ipNameList(idhdl root)
Definition ipid.cc:627

## jjNAMES0()

BOOLEAN jjNAMES0 | ( | leftv | res,
|  | leftv | )

static

Definition at line 8368 of file iparith.cc.

{
res->data=(void *)ipNameList(IDROOT);
return FALSE;
}

## jjNAMES_I()

BOOLEAN jjNAMES_I | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4791 of file iparith.cc.

{
res->data=ipNameListLev((IDROOT),(int)(long)v->Data());
return FALSE;
}
ipNameListLev
lists ipNameListLev(idhdl root, int lev)
Definition ipid.cc:650

## jjNEWSTRUCT2()

BOOLEAN jjNEWSTRUCT2 | ( | leftv | ,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2807 of file iparith.cc.

{
// u: the name of the new type
// v: the elements
const char *s=(const char *)u->Data();
newstruct_desc d=NULL;
if (strlen(s)>=2)
{
d=newstructFromString((const char *)v->Data());
if (d!=NULL) newstruct_setup(s,d);
}
else WerrorS("name of newstruct must be longer than 1 character");
return d==NULL;
}
newstruct_setup
void newstruct_setup(const char *n, newstruct_desc d)
Definition newstruct.cc:699
newstructFromString
newstruct_desc newstructFromString(const char *s)
Definition newstruct.cc:803

## jjNEWSTRUCT3()

BOOLEAN jjNEWSTRUCT3 | ( | leftv | ,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6668 of file iparith.cc.

{
// u: the name of the new type
// v: the parent type
// w: the elements
newstruct_desc d=newstructChildFromString((const char *)v->Data(),
(const char *)w->Data());
if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
return (d==NULL);
}
newstructChildFromString
newstruct_desc newstructChildFromString(const char *parent, const char *s)
Definition newstruct.cc:810

## jjnInt()

BOOLEAN jjnInt | ( | leftv | res,
|  | leftv | u )

static

Definition at line 5781 of file iparith.cc.

{
number n=(number)u->CopyD(); // n_Int may call n_Normalize
res->data=(char *)(long)iin_Int(n,currRing->cf);
n_Delete(&n,currRing->cf);
return FALSE;
}

## jjnlInt()

BOOLEAN jjnlInt | ( | leftv | res,
|  | leftv | u )

static

Definition at line 5788 of file iparith.cc.

{
number n=(number)u->Data();
res->data=(char *)(long)iin_Int(n,coeffs_BIGINT );
return FALSE;
}

## jjNOT()

BOOLEAN jjNOT | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4796 of file iparith.cc.

{
res->data=(char*)(long)((long)v->Data()==0 ? 1 : 0);
return FALSE;
}

## jjNULL()

BOOLEAN jjNULL | ( | leftv | ,
|  | leftv | )

static

Definition at line 3784 of file iparith.cc.

{
return FALSE;
}

## jjNUMERATOR()

BOOLEAN jjNUMERATOR | ( | leftv | res,
|  | leftv | v )

static

Return the numerator of the input number.

Definition at line 4088 of file iparith.cc.

{
number n = reinterpret_cast<number>(v->CopyD());
res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing->cf));
n_Delete(&n,currRing->cf);
return FALSE;
}
n_GetNumerator
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n)
Definition coeffs.h:611

## jjNVARS()

BOOLEAN jjNVARS | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4801 of file iparith.cc.

{
res->data = (char *)(long)(((ring)(v->Data()))->N);
return FALSE;
}
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56

## jjOP_BI_BIM()

BOOLEAN jjOP_BI_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 276 of file iparith.cc.

{
return jjOP_BIM_BI(res, v, u);
}
jjOP_BIM_BI
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition iparith.cc:263

## jjOP_BIM_BI()

BOOLEAN jjOP_BIM_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 263 of file iparith.cc.

{
bigintmat* aa= (bigintmat *)u->Data();
number bb = (number)(v->Data());
if (errorreported) return TRUE;
bigintmat *cc=NULL;
switch (iiOp)
{
case '*': cc=bimMult(aa,bb,coeffs_BIGINT); break;
}
res->data=(char *)cc;
return cc==NULL;
}
bimMult
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition bigintmat.cc:253

## jjOP_BIM_I()

BOOLEAN jjOP_BIM_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 244 of file iparith.cc.

{
bigintmat* aa= (bigintmat *)u->Data();
long bb = (long)(v->Data());
if (errorreported) return TRUE;
bigintmat *cc=NULL;
switch (iiOp)
{
case '+': cc=bimAdd(aa,bb); break;
case '-': cc=bimSub(aa,bb); break;
case '*': cc=bimMult(aa,bb); break;
}
res->data=(char *)cc;
return cc==NULL;
}
bimAdd
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? @Note: NULL as a result means an error (non-compati...
Definition bigintmat.cc:180

## jjOP_I_BIM()

BOOLEAN jjOP_I_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 259 of file iparith.cc.

{
return jjOP_BIM_I(res, v, u);
}
jjOP_BIM_I
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:244

## jjOP_I_IM()

BOOLEAN jjOP_I_IM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 316 of file iparith.cc.

{
return jjOP_IM_I(res,v,u);
}
jjOP_IM_I
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition iparith.cc:301

## jjOP_I_IV()

BOOLEAN jjOP_I_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 297 of file iparith.cc.

{
return jjOP_IV_I(res,v,u);
}
jjOP_IV_I
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition iparith.cc:280

## jjOP_IM_I()

BOOLEAN jjOP_IM_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 301 of file iparith.cc.

{
intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
int bb = (int)(long)(v->Data());
int i=si_min(aa->rows(),aa->cols());
switch (iiOp)
{
case '+': for (;i>0;i--) IMATELEM(*aa,i,i) += bb;
break;
case '-': for (;i>0;i--) IMATELEM(*aa,i,i) -= bb;
break;
}
res->data=(char *)aa;
return FALSE;
}
IMATELEM
#define IMATELEM(M, I, J)
Definition intvec.h:86

## jjOP_IV_I()

BOOLEAN jjOP_IV_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 280 of file iparith.cc.

{
intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
int bb = (int)(long)(v->Data());
if (errorreported) return TRUE;
switch (iiOp)
{
case '+': (*aa) += bb; break;
case '-': (*aa) -= bb; break;
case '*': (*aa) *= bb; break;
case '/':
case INTDIV_CMD: (*aa) /= bb; break;
case '%': (*aa) %= bb; break;
}
res->data=(char *)aa;
return FALSE;
}

## jjOP_REST()

BOOLEAN jjOP_REST | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 506 of file iparith.cc.

{
if (u->Next()!=NULL)
{
u=u->next;
res->next = (leftv)omAllocBin(sleftv_bin);
return iiExprArith2(res->next,u,iiOp,v);
}
else if (v->Next()!=NULL)
{
v=v->next;
res->next = (leftv)omAllocBin(sleftv_bin);
return iiExprArith2(res->next,u,iiOp,v);
}
return FALSE;
}

## jjOpenClose()

BOOLEAN jjOpenClose | ( | leftv | ,
|  | leftv | v )

static

Definition at line 4806 of file iparith.cc.

{
si_link l=(si_link)v->Data();
if (iiOp==OPEN_CMD) return slOpen(l, SI_LINK_OPEN,v);
else { slPrepClose(l); return slClose(l);}
}
slPrepClose
BOOLEAN slPrepClose(si_link l)
Definition silink.cc:223
SI_LINK_OPEN
#define SI_LINK_OPEN
Definition silink.h:65
OPEN_CMD
@ OPEN_CMD
Definition tok.h:145

## jjOPPOSE()

BOOLEAN jjOPPOSE | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2986 of file iparith.cc.

{
/* number, poly, vector, ideal, module, matrix */
ring r = (ring)a->Data();
if (r == currRing)
{
res->data = b->Data();
res->rtyp = b->rtyp;
return FALSE;
}
if (!rIsLikeOpposite(currRing, r))
{
Werror("%s is not an opposite ring to current ring",a->Fullname());
return TRUE;
}
idhdl w;
if( ((w=r->idroot->get(b->Name(),myynest))!=NULL) && (b->e==NULL))
{
int argtype = IDTYP(w);
switch (argtype)
{
case NUMBER_CMD:
{
/* since basefields are equal, we can apply nCopy */
res->data = nCopy((number)IDDATA(w));
res->rtyp = argtype;
break;
}
case POLY_CMD:
case VECTOR_CMD:
{
poly q = (poly)IDDATA(w);
res->data = pOppose(r,q,currRing);
res->rtyp = argtype;
break;
}
case IDEAL_CMD:
case MODUL_CMD:
{
ideal Q = (ideal)IDDATA(w);
res->data = idOppose(r,Q,currRing);
res->rtyp = argtype;
break;
}
case MATRIX_CMD:
{
ring save = currRing;
rChangeCurrRing(r);
matrix m = (matrix)IDDATA(w);
ideal Q = id_Matrix2Module(mp_Copy(m, currRing),currRing);
rChangeCurrRing(save);
ideal S = idOppose(r,Q,currRing);
id_Delete(&Q, r);
res->data = id_Module2Matrix(S,currRing);
res->rtyp = argtype;
break;
}
default:
{
WerrorS("unsupported type in oppose");
return TRUE;
}
}
}
else
{
Werror("identifier %s not found in %s",b->Fullname(),a->Fullname());
return TRUE;
}
return FALSE;
}
NUMBER_CMD
@ NUMBER_CMD
Definition grammar.cc:289
idOppose
ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst)
opposes a module I from Rop to currRing(dst)
Definition old.gring.cc:3363
pOppose
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
Definition old.gring.cc:3324
rIsLikeOpposite
BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate)
checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so
Definition old.gring.cc:3297
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
id_Matrix2Module
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
Definition simpleideals.cc:1560

## jjOPPOSITE()

BOOLEAN jjOPPOSITE | ( | leftv | res,
|  | leftv | a )

static

Definition at line 5310 of file iparith.cc.

{
#ifdef HAVE_PLURAL
ring r = (ring)a->Data();
//if (rIsPluralRing(r))
if (r->OrdSgn==1)
{
res->data = rOpposite(r);
}
else
{
WarnS("opposite only for global orderings");
res->data = rCopy(r);
}
return FALSE;
#else
return TRUE;
#endif
}
rOpposite
ring rOpposite(ring src)
Definition ring.cc:5425

## jjOPTION_PL()

BOOLEAN jjOPTION_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 8373 of file iparith.cc.

{
if(v==NULL)
{
res->data=(char *)showOption();
return FALSE;
}
res->rtyp=NONE;
return setOption(res,v);
}
setOption
BOOLEAN setOption(leftv res, leftv v)
Definition misc_ip.cc:570
showOption
char * showOption()
Definition misc_ip.cc:711

## jjOR_I()

BOOLEAN jjOR_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1385 of file iparith.cc.

{
res->data = (char *)((long)u->Data() || (long)v->Data());
return FALSE;
}

## jjORD()

BOOLEAN jjORD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4812 of file iparith.cc.

{
poly p=(poly)v->Data();
res->data=(char *)( p==NULL ? -1 : currRing->pFDeg(p,currRing) );
return FALSE;
}

## jjP2BI()

BOOLEAN jjP2BI | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4858 of file iparith.cc.

{
poly p=(poly)v->Data();
if (p==NULL) { res->data=(char *)n_Init(0,coeffs_BIGINT); return FALSE; }
if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
{
WerrorS("poly must be constant");
return TRUE;
}
number i=pGetCoeff(p);
number n;
nMapFunc nMap=n_SetMap(currRing->cf,coeffs_BIGINT);
if (nMap!=NULL)
n=nMap(i,currRing->cf,coeffs_BIGINT);
else goto err;
res->data=(void *)n;
return FALSE;
err:
WerrorS("cannot convert to bigint"); return TRUE;
}

## jjP2I()

BOOLEAN jjP2I | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4878 of file iparith.cc.

{
poly p=(poly)v->Data();
if (p==NULL) { /*res->data=(char *)0;*/ return FALSE; }
if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
{
WerrorS("poly must be constant");
return TRUE;
}
res->data = (char *)(long)iin_Int(pGetCoeff(p),currRing->cf);
return FALSE;
}

## jjP2N()

BOOLEAN jjP2N | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4926 of file iparith.cc.

{
number n;
poly p;
if (((p=(poly)v->Data())!=NULL)
&& (pIsConstant(p)))
{
n=nCopy(pGetCoeff(p));
}
else
{
n=nInit(0);
}
res->data = (char *)n;
return FALSE;
}

## jjPAR1()

BOOLEAN jjPAR1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4818 of file iparith.cc.

{
int i=(int)(long)v->Data();
int p=0;
p=rPar(currRing);
if ((0<i) && (i<=p))
{
res->data=(char *)n_Param(i,currRing);
}
else
{
Werror("par number %d out of range 1..%d",i,p);
return TRUE;
}
return FALSE;
}
n_Param
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
Definition coeffs.h:778

## jjPARDEG()

BOOLEAN jjPARDEG | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4834 of file iparith.cc.

{
number nn=(number)v->Data();
res->data = (char *)(long)n_ParDeg(nn, currRing->cf);
return FALSE;
}
n_ParDeg
static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
Definition coeffs.h:765

## jjPARSTR1()

BOOLEAN jjPARSTR1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4840 of file iparith.cc.

{
if (currRing==NULL)
{
WerrorS("no ring active (1)");
return TRUE;
}
int i=(int)(long)v->Data();
int p=0;
if ((0<i) && (rParameter(currRing)!=NULL) && (i<=(p=rPar(currRing))))
res->data=omStrDup(rParameter(currRing)[i-1]);
else
{
Werror("par number %d out of range 1..%d",i,p);
return TRUE;
}
return FALSE;
}

## jjPARSTR2()

BOOLEAN jjPARSTR2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 2821 of file iparith.cc.

{
idhdl h=(idhdl)u->data;
int i=(int)(long)v->Data();
int p=0;
if ((0<i)
&& (rParameter(IDRING(h))!=NULL)
&& (i<=(p=rPar(IDRING(h)))))
res->data=omStrDup(rParameter(IDRING(h))[i-1]);
else
{
Werror("par number %d out of range 1..%d",i,p);
return TRUE;
}
return FALSE;
}
IDRING
#define IDRING(a)
Definition ipid.h:127

## jjPFAC1()

BOOLEAN jjPFAC1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4648 of file iparith.cc.

{
/* call method jjPFAC2 with second argument = 0 (meaning that no
valid bound for the prime factors has been given) */
sleftv tmp;
tmp.Init();
tmp.rtyp = INT_CMD;
return jjPFAC2(res, v, &tmp);
}
jjPFAC2
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition iparith.cc:3298

## jjPFAC2()

BOOLEAN jjPFAC2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3298 of file iparith.cc.

{
number n1; int i;
if ((u->Typ() == BIGINT_CMD) ||
((u->Typ() == NUMBER_CMD) && rField_is_Q(currRing)))
{
n1 = (number)u->CopyD();
}
else if (u->Typ() == INT_CMD)
{
i = (int)(long)u->Data();
n1 = n_Init(i, coeffs_BIGINT);
}
else
{
return TRUE;
}
i = (int)(long)v->Data();
lists l = primeFactorisation(n1, i);
n_Delete(&n1, coeffs_BIGINT);
res->data = (char*)l;
return FALSE;
}
primeFactorisation
lists primeFactorisation(const number n, const int pBound)
Factorises a given bigint number n into its prime factors less than or equal to a given bound,...
Definition misc_ip.cc:358

## jjpHead()

BOOLEAN jjpHead | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5713 of file iparith.cc.

{
res->data = (char *)pHead((poly)v->Data());
return FALSE;
}

## jjpLength()

BOOLEAN jjpLength | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5688 of file iparith.cc.

{
res->data = (char *)(long)pLength((poly)v->Data());
return FALSE;
}

## jjPlural_mat_mat()

BOOLEAN jjPlural_mat_mat | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2898 of file iparith.cc.

{
if( currRing->qideal != NULL )
{
WerrorS("basering must NOT be a qring!");
return TRUE;
}
if (iiOp==NCALGEBRA_CMD)
{
return nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,currRing,false,true,false,currRing);
}
else
{
ring r=rCopy(currRing);
BOOLEAN result=nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,r,false,true,false,currRing);
res->data=r;
return result;
}
}
nc_CallPlural
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,...
Definition old.gring.cc:2692
NCALGEBRA_CMD
@ NCALGEBRA_CMD
Definition tok.h:138

## jjPlural_mat_poly()

BOOLEAN jjPlural_mat_poly | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2878 of file iparith.cc.

{
if( currRing->qideal != NULL )
{
WerrorS("basering must NOT be a qring!");
return TRUE;
}
if (iiOp==NCALGEBRA_CMD)
{
return nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),currRing,false,true,false,currRing);
}
else
{
ring r=rCopy(currRing);
BOOLEAN result=nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),r,false,true,false,currRing);
res->data=r;
return result;
}
}

## jjPlural_num_mat()

BOOLEAN jjPlural_num_mat | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2858 of file iparith.cc.

{
if( currRing->qideal != NULL )
{
WerrorS("basering must NOT be a qring!");
return TRUE;
}
if (iiOp==NCALGEBRA_CMD)
{
return nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,currRing,false,true,false,currRing);
}
else
{
ring r=rCopy(currRing);
BOOLEAN result=nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,r,false,true,false,currRing);
res->data=r;
return result;
}
}

## jjPlural_num_poly()

BOOLEAN jjPlural_num_poly | ( | leftv | res,
|  | leftv | a,
|  | leftv | b )

static

Definition at line 2838 of file iparith.cc.

{
if( currRing->qideal != NULL )
{
WerrorS("basering must NOT be a qring!");
return TRUE;
}
if (iiOp==NCALGEBRA_CMD)
{
return nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),currRing,false,true,false,currRing);
}
else
{
ring r=rCopy(currRing);
BOOLEAN result=nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),r,false,true,false,currRing);
res->data=r;
return result;
}
}

## jjPLUS_B()

BOOLEAN jjPLUS_B | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 782 of file iparith.cc.

{
//res->data = (char *)(pAdd((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
sBucket_pt b=sBucketCreate(currRing);
poly p=(poly)u->CopyD(POLY_CMD);
int l=pLength(p);
sBucket_Add_p(b,p,l);
p= (poly)v->CopyD(POLY_CMD);
l=pLength(p);
sBucket_Add_p(b,p,l);
res->data=(void*)b;
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUS_B_P()

BOOLEAN jjPLUS_B_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 795 of file iparith.cc.

{
sBucket_pt b=(sBucket_pt)u->CopyD(BUCKET_CMD);
poly p= (poly)v->CopyD(POLY_CMD);
int l=pLength(p);
sBucket_Add_p(b,p,l);
res->data=(void*)b;
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUS_BI()

BOOLEAN jjPLUS_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 767 of file iparith.cc.

{
res->data = (char *)(n_Add((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
return jjPLUSMINUS_Gen(res,u,v);
}
n_Add
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
Definition coeffs.h:653

## jjPLUS_BIM()

BOOLEAN jjPLUS_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 814 of file iparith.cc.

{
res->data = (char *)bimAdd((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
if (res->data==NULL)
{
WerrorS("bigintmat/cmatrix not compatible");
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUS_I()

BOOLEAN jjPLUS_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 755 of file iparith.cc.

{
unsigned long a=(unsigned long)u->Data();
unsigned long b=(unsigned long)v->Data();
unsigned long c=a+b;
res->data = (char *)((long)c);
if (((Sy_bitL(bit31)&a)==(Sy_bitL(bit31)&b))&&((Sy_bitL(bit31)&a)!=(Sy_bitL(bit31)&c)))
{
WarnS("int overflow(+), result may be wrong");
}
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUS_ID()

BOOLEAN jjPLUS_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 873 of file iparith.cc.

{
res->data = (char *)idAdd((ideal)u->Data(),(ideal)v->Data());
return jjPLUSMINUS_Gen(res,u,v);
}
idAdd
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition ideals.h:68

## jjPLUS_IV()

BOOLEAN jjPLUS_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 804 of file iparith.cc.

{
res->data = (char *)ivAdd((intvec*)(u->Data()), (intvec*)(v->Data()));
if (res->data==NULL)
{
WerrorS("intmat size not compatible");
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}
ivAdd
intvec * ivAdd(intvec *a, intvec *b)
Definition intvec.cc:249

## jjPLUS_MA()

BOOLEAN jjPLUS_MA | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 824 of file iparith.cc.

{
matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
res->data = (char *)(mp_Add(A , B, currRing));
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d)",
MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}
mp_Add
matrix mp_Add(matrix a, matrix b, const ring R)
Definition matpol.cc:172

## jjPLUS_MA_P()

BOOLEAN jjPLUS_MA_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 848 of file iparith.cc.

{
matrix m=(matrix)u->Data();
matrix p= mp_InitP(m->nrows,m->ncols,(poly)(v->CopyD(POLY_CMD)),currRing);
if (iiOp=='+')
res->data = (char *)mp_Add(m , p,currRing);
else
res->data = (char *)mp_Sub(m , p,currRing);
idDelete((ideal *)&p);
return jjPLUSMINUS_Gen(res,u,v);
}
mp_InitP
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
Definition matpol.cc:106

## jjPLUS_N()

BOOLEAN jjPLUS_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 772 of file iparith.cc.

{
res->data = (char *)(nAdd((number)u->Data(), (number)v->Data()));
return jjPLUSMINUS_Gen(res,u,v);
}
nAdd
#define nAdd(n1, n2)
Definition numbers.h:18

## jjPLUS_P_MA()

BOOLEAN jjPLUS_P_MA | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 859 of file iparith.cc.

{
return jjPLUS_MA_P(res,v,u);
}
jjPLUS_MA_P
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition iparith.cc:848

## jjPLUS_S()

BOOLEAN jjPLUS_S | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 863 of file iparith.cc.

{
char* a = (char * )(u->Data());
char* b = (char * )(v->Data());
char* r = (char * )omAlloc(strlen(a) + strlen(b) + 1);
strcpy(r,a);
strcat(r,b);
res->data=r;
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUS_SM()

BOOLEAN jjPLUS_SM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 836 of file iparith.cc.

{
ideal A=(ideal)u->Data(); ideal B=(ideal)v->Data();
res->data = (char *)(sm_Add(A , B, currRing));
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d)",
(int)A->rank,IDELEMS(A),(int)B->rank,IDELEMS(B));
return TRUE;
}
return jjPLUSMINUS_Gen(res,u,v);
}
sm_Add
ideal sm_Add(ideal a, ideal b, const ring R)
Definition matpol.cc:1867

## jjPLUS_V()

BOOLEAN jjPLUS_V | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 777 of file iparith.cc.

{
res->data = (char *)(pAdd((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
return jjPLUSMINUS_Gen(res,u,v);
}

## jjPLUSMINUS_Gen()

BOOLEAN jjPLUSMINUS_Gen | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 631 of file iparith.cc.

{
u=u->next;
v=v->next;
if (u==NULL)
{
if (v==NULL) return FALSE; /* u==NULL, v==NULL */
if (iiOp=='-') /* u==NULL, v<>NULL, iiOp=='-'*/
{
do
{
if (res->next==NULL)
res->next = (leftv)omAlloc0Bin(sleftv_bin);
leftv tmp_v=v->next;
v->next=NULL;
BOOLEAN b=iiExprArith1(res->next,v,'-');
v->next=tmp_v;
if (b)
return TRUE;
v=tmp_v;
res=res->next;
} while (v!=NULL);
return FALSE;
}
loop /* u==NULL, v<>NULL, iiOp=='+' */
{
res->next = (leftv)omAlloc0Bin(sleftv_bin);
res=res->next;
res->data = v->CopyD();
res->rtyp = v->Typ();
v=v->next;
if (v==NULL) return FALSE;
}
}
if (v!=NULL) /* u<>NULL, v<>NULL */
{
do
{
res->next = (leftv)omAlloc0Bin(sleftv_bin);
leftv tmp_u=u->next; u->next=NULL;
leftv tmp_v=v->next; v->next=NULL;
BOOLEAN b=iiExprArith2(res->next,u,iiOp,v);
u->next=tmp_u;
v->next=tmp_v;
if (b)
return TRUE;
u=tmp_u;
v=tmp_v;
res=res->next;
} while ((u!=NULL) && (v!=NULL));
return FALSE;
}
loop /* u<>NULL, v==NULL */
{
res->next = (leftv)omAlloc0Bin(sleftv_bin);
res=res->next;
res->data = u->CopyD();
res->rtyp = u->Typ();
u=u->next;
if (u==NULL) return FALSE;
}
}

## jjPLUSPLUS()

BOOLEAN jjPLUSPLUS | ( | leftv | ,
|  | leftv | u )

static

Definition at line 3798 of file iparith.cc.

{
if (IDTYP((idhdl)u->data)==INT_CMD)
{
int i=IDINT((idhdl)u->data);
if (iiOp==PLUSPLUS) i++;
else i--;
IDDATA((idhdl)u->data)=(char *)(long)i;
return FALSE;
}
return TRUE;
}
PLUSPLUS
@ PLUSPLUS
Definition grammar.cc:274
IDINT
#define IDINT(a)
Definition ipid.h:125

## jjpMaxComp()

BOOLEAN jjpMaxComp | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5736 of file iparith.cc.

{
res->data = (char *)pMaxComp((poly)v->Data());
return FALSE;
}

## jjPOWER_BI()

BOOLEAN jjPOWER_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 568 of file iparith.cc.

{
int e=(int)(long)v->Data();
number n=(number)u->Data();
if (e>=0)
{
n_Power(n,e,(number*)&res->data,coeffs_BIGINT);
}
else
{
WerrorS("exponent must be non-negative");
return TRUE;
}
if (u!=NULL) return jjOP_REST(res,u,v);
return FALSE;
}
n_Power
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition coeffs.h:635
jjOP_REST
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition iparith.cc:506

## jjPOWER_I()

BOOLEAN jjPOWER_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 522 of file iparith.cc.

{
long b=(long)u->Data();
long e=(long)v->Data();
long rc = 1;
BOOLEAN overflow=FALSE;
if (e >= 0)
{
if (b==0)
{
rc=(e==0);
}
else if ((e==0)||(b==1))
{
rc= 1;
}
else if (b== -1)
{
if (e&1) rc= -1;
else rc= 1;
}
else
{
long oldrc;
while ((e--)!=0)
{
oldrc=rc;
rc *= b;
if (!overflow)
{
if(rc/b!=oldrc) overflow=TRUE;
}
}
if (overflow)
WarnS("int overflow(^), result may be wrong");
}
res->data = (char *)rc;
if (u!=NULL) return jjOP_REST(res,u,v);
return FALSE;
}
else
{
WerrorS("exponent must be non-negative");
return TRUE;
}
}

## jjPOWER_ID()

BOOLEAN jjPOWER_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 625 of file iparith.cc.

{
res->data = (char *)id_Power((ideal)(u->Data()),(int)(long)(v->Data()), currRing);
if (u!=NULL) return jjOP_REST(res,u,v);
return FALSE;
}
id_Power
ideal id_Power(ideal given, int exp, const ring r)
Definition simpleideals.cc:1433

## jjPOWER_N()

BOOLEAN jjPOWER_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 584 of file iparith.cc.

{
int e=(int)(long)v->Data();
number n=(number)u->Data();
int d=0;
if (e<0)
{
n=nInvers(n);
e=-e;
d=1;
}
number r;
nPower(n,e,(number*)&r);
res->data=(char*)r;
if (d) nDelete(&n);
if (u!=NULL) return jjOP_REST(res,u,v);
return FALSE;
}
nInvers
#define nInvers(a)
Definition numbers.h:33
nPower
#define nPower(a, b, res)
Definition numbers.h:38

## jjPOWER_P()

BOOLEAN jjPOWER_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 602 of file iparith.cc.

{
int v_i=(int)(long)v->Data();
if (v_i<0)
{
WerrorS("exponent must be non-negative");
return TRUE;
}
poly u_p=(poly)u->CopyD(POLY_CMD);
if ((u_p!=NULL)
&& (!rIsLPRing(currRing))
&& ((v_i!=0) &&
((long)pTotaldegree(u_p) > (signed long)currRing->bitmask / (signed long)v_i/2)))
{
Werror("OVERFLOW in power(d=%ld, e=%d, max=%ld)",
pTotaldegree(u_p),v_i,currRing->bitmask/2);
pDelete(&u_p);
return TRUE;
}
res->data = (char *)pPower(u_p,v_i);
if (u!=NULL) return jjOP_REST(res,u,v);
return errorreported; /* pPower may set errorreported via Werror */
}
pTotaldegree
static long pTotaldegree(poly p)
Definition polys.h:283

## jjPREIMAGE()

BOOLEAN jjPREIMAGE | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6678 of file iparith.cc.

{
// handles preimage(r,phi,i) and kernel(r,phi)
idhdl h;
ring rr;
map mapping;
BOOLEAN kernel_cmd= (iiOp==KERNEL_CMD);
if ((v->name==NULL) || (!kernel_cmd && (w->name==NULL)))
{
WerrorS("2nd/3rd arguments must have names");
return TRUE;
}
rr=(ring)u->Data();
const char *ring_name=u->Name();
if ((h=rr->idroot->get(v->name,myynest))!=NULL)
{
if (h->typ==MAP_CMD)
{
mapping=IDMAP(h);
idhdl preim_ring=IDROOT->get(mapping->preimage,myynest);
if ((preim_ring==NULL)
|| (IDRING(preim_ring)!=currRing))
{
Werror("preimage ring `%s` is not the basering",mapping->preimage);
return TRUE;
}
}
else if (h->typ==IDEAL_CMD)
{
mapping=IDMAP(h);
}
else
{
Werror("`%s` is no map nor ideal",IDID(h));
return TRUE;
}
}
else
{
Werror("`%s` is not defined in `%s`",v->name,ring_name);
return TRUE;
}
ideal image;
if (kernel_cmd) image=idInit(1,1);
else
{
if ((h=rr->idroot->get(w->name,myynest))!=NULL)
{
if (h->typ==IDEAL_CMD)
{
image=IDIDEAL(h);
}
else
{
Werror("`%s` is no ideal",IDID(h));
return TRUE;
}
}
else
{
Werror("`%s` is not defined in `%s`",w->name,ring_name);
return TRUE;
}
}
if (((currRing->qideal!=NULL) && (rHasLocalOrMixedOrdering(currRing)))
|| ((rr->qideal!=NULL) && (rHasLocalOrMixedOrdering(rr))))
{
WarnS("preimage in local qring may be wrong: use Ring::preimageLoc instead");
}
res->data=(char *)maGetPreimage(rr,mapping,image,currRing);
if (kernel_cmd) idDelete(&image);
return (res->data==NULL/* is of type ideal, should not be NULL*/);
}
IDMAP
#define IDMAP(a)
Definition ipid.h:135
IDID
#define IDID(a)
Definition ipid.h:122
maGetPreimage
ideal maGetPreimage(ring theImageRing, map theMap, ideal id, const ring dst_r)
Definition preimage.cc:57
KERNEL_CMD
@ KERNEL_CMD
Definition tok.h:107

## jjPREIMAGE_R()

BOOLEAN jjPREIMAGE_R | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4890 of file iparith.cc.

{
map mapping=(map)v->Data();
syMake(res,omStrDup(mapping->preimage));
return FALSE;
}

## jjPRIME()

BOOLEAN jjPRIME | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4896 of file iparith.cc.

{
int i = IsPrime((int)(long)(v->Data()));
res->data = (char *)(long)(i > 1 ? i : 2);
return FALSE;
}
IsPrime
int IsPrime(int p)
Definition prime.cc:61

## jjPROC()

BOOLEAN jjPROC | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

Definition at line 1617 of file iparith.cc.

{
void *d;
Subexpr e;
int typ;
BOOLEAN t=FALSE;
idhdl tmp_proc=NULL;
if ((u->rtyp!=IDHDL)||(u->e!=NULL))
{
tmp_proc=(idhdl)omAlloc0(sizeof(idrec));
tmp_proc->id="_auto";
tmp_proc->typ=PROC_CMD;
tmp_proc->data.pinf=(procinfo *)u->Data();
tmp_proc->ref=1;
d=u->data; u->data=(void *)tmp_proc;
e=u->e; u->e=NULL;
t=TRUE;
typ=u->rtyp; u->rtyp=IDHDL;
}
BOOLEAN sl;
if (u->req_packhdl==currPack)
sl = iiMake_proc((idhdl)u->data,NULL,v);
else
sl = iiMake_proc((idhdl)u->data,u->req_packhdl,v);
if (t)
{
u->rtyp=typ;
u->data=d;
u->e=e;
omFreeSize(tmp_proc,sizeof(idrec));
}
if (sl) return TRUE;
memcpy(res,&iiRETURNEXPR,sizeof(sleftv));
iiRETURNEXPR.Init();
return FALSE;
}
idrec
Definition idrec.h:35
idrec::data
utypes data
Definition idrec.h:40
idrec::typ
int typ
Definition idrec.h:43
idrec::ref
short ref
Definition idrec.h:46
idrec::id
const char * id
Definition idrec.h:39
sleftv::req_packhdl
package req_packhdl
Definition subexpr.h:106
iiMake_proc
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv args)
Definition iplib.cc:513
iiRETURNEXPR
INST_VAR sleftv iiRETURNEXPR
Definition iplib.cc:483
procinfo
Definition subexpr.h:54

## jjPROC1()

BOOLEAN jjPROC1 | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3875 of file iparith.cc.

{
return jjPROC(res,u,NULL);
}
jjPROC
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition iparith.cc:1617

## jjPROC3()

BOOLEAN jjPROC3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6076 of file iparith.cc.

{
v->next=(leftv)omAllocBin(sleftv_bin);
memcpy(v->next,w,sizeof(sleftv));
w->Init();
return jjPROC(res,u,v);
}

## jjPRUNE()

BOOLEAN jjPRUNE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4902 of file iparith.cc.

{
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
ideal v_id=(ideal)v->Data();
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
// and continue at the non-homog case below
}
else
{
w=ivCopy(w);
intvec **ww=&w;
res->data = (char *)idMinEmbedding(v_id,FALSE,ww);
atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD);
return FALSE;
}
}
res->data = (char *)idMinEmbedding(v_id);
return FALSE;
}
idMinEmbedding
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
Definition ideals.cc:2853

## jjPRUNE_MAP()

BOOLEAN jjPRUNE_MAP | ( | leftv | res,
|  | leftv | v,
|  | leftv | ma )

static

Definition at line 3059 of file iparith.cc.

{
if (ma->Typ()!=SMATRIX_CMD)
{
WerrorS("expected prune_map(`module`,`smatrix`)`");
return TRUE;
}
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
ideal v_id=(ideal)v->Data();
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
// and continue at the non-homog case below
}
else
{
w=ivCopy(w);
intvec **ww=&w;
ideal mat;
int *g=(int*)omAlloc(v_id->rank*sizeof(int));
res->data = (char *)idMinEmbedding_with_map_v(v_id,ww,mat,g);
atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD);
idhdl h=(idhdl)ma->data;
idDelete(&IDIDEAL(h));
IDIDEAL(h)=mat;
for(int i=0;i<v_id->rank;i++) Print("v[%d]:%d ",i+1,g[i]);
PrintLn();
omFreeSize(g,v_id->rank*sizeof(int));
return FALSE;
}
}
ideal mat;
int *g=(int*)omAlloc(v_id->rank*sizeof(int));
res->data = (char *)idMinEmbedding_with_map_v(v_id,NULL,mat,g);
for(int i=0;i<v_id->rank;i++) Print("v[%d]:%d ",i+1,g[i]);
PrintLn();
omFreeSize(g,v_id->rank*sizeof(int));
idhdl h=(idhdl)ma->data;
idDelete(&IDIDEAL(h));
IDIDEAL(h)=mat;
return FALSE;
}
idMinEmbedding_with_map_v
ideal idMinEmbedding_with_map_v(ideal arg, intvec **w, ideal &trans, int *g)
Definition ideals.cc:2874

## jjQRDS()

BOOLEAN jjQRDS | ( | leftv | res,
|  | leftv | INPUT )

static

Definition at line 8847 of file iparith.cc.

{
if ((INPUT->Typ() != MATRIX_CMD) ||
(INPUT->next->Typ() != NUMBER_CMD) ||
(INPUT->next->next->Typ() != NUMBER_CMD) ||
(INPUT->next->next->next->Typ() != NUMBER_CMD))
{
WerrorS("expected (matrix, number, number, number) as arguments");
return TRUE;
}
leftv u = INPUT; leftv v = u->next; leftv w = v->next; leftv x = w->next;
res->data = (char *)qrDoubleShift((matrix)(u->Data()),
(number)(v->Data()),
(number)(w->Data()),
(number)(x->Data()));
return FALSE;
}
qrDoubleShift
lists qrDoubleShift(const matrix A, const number tol1, const number tol2, const number tol3, const ring r=currRing)
Computes all eigenvalues of a given real quadratic matrix with multiplicites.
Definition linearAlgebra_ip.cc:41

## jjQUOT()

BOOLEAN jjQUOT | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3105 of file iparith.cc.

{
res->data = (char *)idQuot((ideal)u->Data(),(ideal)v->Data(),
hasFlag(u,FLAG_STD),u->Typ()==v->Typ());
//if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}
idQuot
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
Definition ideals.cc:1539

## jjRANDOM()

BOOLEAN jjRANDOM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3112 of file iparith.cc.

{
int i=(int)(long)u->Data();
int j=(int)(long)v->Data();
if (j-i <0) {WerrorS("invalid range for random"); return TRUE;}
res->data =(char *)(long)((i > j) ? i : (siRand() % (j-i+1)) + i);
return FALSE;
}
siRand
int siRand()
Definition sirandom.c:42

## jjRANDOM_Im()

BOOLEAN jjRANDOM_Im | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6761 of file iparith.cc.

{
int di, k;
int i=(int)(long)u->Data();
int r=(int)(long)v->Data();
int c=(int)(long)w->Data();
if ((r<=0) || (c<=0)) return TRUE;
intvec *iv = new intvec(r, c, 0);
if (iv->rows()==0)
{
delete iv;
return TRUE;
}
if (i!=0)
{
if (i<0) i = -i;
di = 2 * i + 1;
for (k=0; k<iv->length(); k++)
{
(*iv)[k] = ((siRand() % di) - i);
}
}
res->data = (char *)iv;
return FALSE;
}

## jjRANK1()

BOOLEAN jjRANK1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4964 of file iparith.cc.

{
matrix m =(matrix)v->Data();
int rank = luRank(m, 0);
res->data =(char *)(long)rank;
return FALSE;
}
luRank
int luRank(const matrix aMat, const bool isRowEchelon, const ring R)
Computes the rank of a given (m x n)-matrix.
Definition linearAlgebra.cc:230

## jjRANK2()

BOOLEAN jjRANK2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3120 of file iparith.cc.

{
matrix m =(matrix)u->Data();
int isRowEchelon = (int)(long)v->Data();
if (isRowEchelon != 1) isRowEchelon = 0;
int rank = luRank(m, isRowEchelon);
res->data =(char *)(long)rank;
return FALSE;
}

## jjrCharStr()

BOOLEAN jjrCharStr | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5708 of file iparith.cc.

{
res->data = rCharStr((ring)v->Data());
return FALSE;
}
rCharStr
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
Definition ring.cc:652

## jjREAD()

BOOLEAN jjREAD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4971 of file iparith.cc.

{
return jjREAD2(res,v,NULL);
}
jjREAD2
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition iparith.cc:3129

## jjREAD2()

BOOLEAN jjREAD2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3129 of file iparith.cc.

{
si_link l=(si_link)u->Data();
leftv r=slRead(l,v);
if (r==NULL)
{
const char *s;
if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
else s=sNoName_fe;
Werror("cannot read from `%s`",s);
return TRUE;
}
memcpy(res,r,sizeof(sleftv));
omFreeBin((ADDRESS)r, sleftv_bin);
return FALSE;
}
slRead
leftv slRead(si_link l, leftv a)
Definition silink.cc:261

## jjREDUCE3_CID()

BOOLEAN jjREDUCE3_CID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7206 of file iparith.cc.

{
assumeStdFlag(v);
if (!idIsZeroDim((ideal)v->Data()))
{
Werror("`%s` must be 0-dimensional",v->Name());
return TRUE;
}
res->data = (char *)redNF((ideal)v->CopyD(),(ideal)u->CopyD(),
(matrix)w->CopyD());
return FALSE;
}
idIsZeroDim
static BOOLEAN idIsZeroDim(ideal i)
Definition ideals.h:180
redNF
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition kstd2.cc:2307

## jjREDUCE3_CP()

BOOLEAN jjREDUCE3_CP | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7194 of file iparith.cc.

{
assumeStdFlag(v);
if (!idIsZeroDim((ideal)v->Data()))
{
Werror("`%s` must be 0-dimensional",v->Name());
return TRUE;
}
res->data = (char *)redNF((ideal)v->CopyD(),(poly)u->CopyD(),
(poly)w->CopyD());
return FALSE;
}

## jjREDUCE3_ID()

BOOLEAN jjREDUCE3_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7225 of file iparith.cc.

{
assumeStdFlag(v);
res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(),
0,(int)(long)w->Data());
return FALSE;
}
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229

## jjREDUCE3_P()

BOOLEAN jjREDUCE3_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7218 of file iparith.cc.

{
assumeStdFlag(v);
res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(),
0,(int)(long)w->Data());
return FALSE;
}

## jjREDUCE4()

BOOLEAN jjREDUCE4 | ( | leftv | res,
|  | leftv | u )

static

Definition at line 8383 of file iparith.cc.

{
leftv u1=u;
leftv u2=u1->next;
leftv u3=u2->next;
leftv u4=u3->next;
int u1t=u1->Typ(); if (u1t==BUCKET_CMD) u1t=POLY_CMD;
int u2t=u2->Typ(); if (u2t==BUCKET_CMD) u2t=POLY_CMD;
if((u3->Typ()==INT_CMD)&&(u4->Typ()==INTVEC_CMD))
{
int save_d=Kstd1_deg;
Kstd1_deg=(int)(long)u3->Data();
kModW=(intvec *)u4->Data();
BITSET save2;
SI_SAVE_OPT2(save2);
si_opt_2|=Sy_bit(V_DEG_STOP);
u2->next=NULL;
BOOLEAN r=jjCALL2ARG(res,u);
kModW=NULL;
Kstd1_deg=save_d;
SI_RESTORE_OPT2(save2);
u->next->next=u3;
return r;
}
else
if((u1t==IDEAL_CMD)&&(u2t==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
(u4->Typ()==INT_CMD))
{
assumeStdFlag(u3);
if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
{
WerrorS("2nd argument must be a diagonal matrix of units");
return TRUE;
}
res->data=(char*)redNF(
idCopy((ideal)u3->Data()),
idCopy((ideal)u1->Data()),
mp_Copy((matrix)u2->Data(), currRing),
(int)(long)u4->Data()
);
return FALSE;
}
else
if((u1t==POLY_CMD)&&(u2t==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
(u4->Typ()==INT_CMD))
{
poly u1p;
if (u1->Typ()==BUCKET_CMD) u1p=sBucketPeek((sBucket_pt)u1->Data());
else u1p=(poly)u1->Data();
poly u2p;
if (u2->Typ()==BUCKET_CMD) u2p=sBucketPeek((sBucket_pt)u2->Data());
else u2p=(poly)u2->Data();
assumeStdFlag(u3);
if(!pIsUnit(u2p))
{
WerrorS("2nd argument must be a unit");
return TRUE;
}
res->rtyp=POLY_CMD;
res->data=(char*)redNF((ideal)u3->CopyD(),pCopy(u1p),
pCopy(u2p),(int)(long)u4->Data());
return FALSE;
}
else
{
Werror("%s(`poly`,`ideal`,`int`,`intvec`) expected",Tok2Cmdname(iiOp));
Werror("%s(`ideal`,`matrix`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
Werror("%s(`poly`,`poly`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
return TRUE;
}
}
BITSET
#define BITSET
Definition auxiliary.h:85
jjCALL2ARG
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition iparith.cc:7360
Kstd1_deg
EXTERN_VAR int Kstd1_deg
Definition kstd1.h:70
si_opt_2
VAR unsigned si_opt_2
Definition options.c:6
SI_SAVE_OPT2
#define SI_SAVE_OPT2(A)
Definition options.h:22
SI_RESTORE_OPT2
#define SI_RESTORE_OPT2(A)
Definition options.h:25
V_DEG_STOP
#define V_DEG_STOP
Definition options.h:73
sBucketPeek
poly sBucketPeek(sBucket_pt b)
Definition sbuckets.cc:455

## jjREDUCE5()

BOOLEAN jjREDUCE5 | ( | leftv | res,
|  | leftv | u )

static

Definition at line 8454 of file iparith.cc.

{
leftv u1=u;
leftv u2=u1->next;
leftv u3=u2->next;
leftv u4=u3->next;
leftv u5=u4->next;
if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
(u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
{
assumeStdFlag(u3);
if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
{
WerrorS("2nd argument must be a diagonal matrix of units");
return TRUE;
}
res->data=(char*)redNF(
idCopy((ideal)u3->Data()),
idCopy((ideal)u1->Data()),
mp_Copy((matrix)u2->Data(),currRing),
(int)(long)u4->Data(),
(intvec*)u5->Data()
);
return FALSE;
}
else
if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
(u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
{
assumeStdFlag(u3);
if(!pIsUnit((poly)u2->Data()))
{
WerrorS("2nd argument must be a unit");
return TRUE;
}
res->rtyp=POLY_CMD;
res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
pCopy((poly)u2->Data()),
(int)(long)u4->Data(),(intvec*)u5->Data());
return FALSE;
}
else
{
Werror("%s(`ideal`,`ideal`,`matrix`,`int`,`intvec`) exppected",
Tok2Cmdname(iiOp));
return TRUE;
}
}

## jjREDUCE_ID()

BOOLEAN jjREDUCE_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3153 of file iparith.cc.

{
ideal ui=(ideal)u->Data();
ideal vi=(ideal)v->Data();
if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
assumeStdFlag(v);
res->data = (char *)kNF(vi,currRing->qideal,ui);
return FALSE;
}

## jjREDUCE_P()

BOOLEAN jjREDUCE_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3145 of file iparith.cc.

{
ideal vi=(ideal)v->Data();
if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
assumeStdFlag(v);
res->data = (char *)kNF(vi,currRing->qideal,(poly)u->Data());
return FALSE;
}

## jjREGULARITY()

BOOLEAN jjREGULARITY | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4975 of file iparith.cc.

{
res->data = (char *)(long)iiRegularity((lists)v->Data());
return FALSE;
}
iiRegularity
int iiRegularity(lists L)
Definition ipshell.cc:1045

## jjREPART()

BOOLEAN jjREPART | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4980 of file iparith.cc.

{
res->data = (char *)n_RePart((number)v->Data(),currRing->cf);
return FALSE;
}
n_RePart
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
Definition coeffs.h:785

## jjRES()

BOOLEAN jjRES | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3162 of file iparith.cc.

{
// handles hres,kres,lres,mres,nres,sres
int maxl=(int)(long)v->Data();
if (maxl<0)
{
WerrorS("length for res must not be negative");
return TRUE;
}
BOOLEAN complete=(maxl==0) && (currRing->qideal==NULL);
syStrategy r;
intvec *weights=NULL;
int wmaxl=maxl;
ideal u_id=(ideal)u->Data();
maxl--;
if (maxl==-1)
{
if ((iiOp!=MRES_CMD) && (iiOp!=RES_CMD)&&(iiOp!=SRES_CMD))
maxl = currRing->N;
if (currRing->qideal!=NULL)
{
maxl = currRing->N-1+2*(iiOp==MRES_CMD);
Warn(
"full resolution in a qring may be infinite, setting max length to %d",
maxl+1);
}
}
weights=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
if (weights!=NULL)
{
if (!idTestHomModule(u_id,currRing->qideal,weights))
{
WarnS("wrong weights given:");weights->show();PrintLn();
weights=NULL;
}
}
intvec *ww=NULL;
int add_row_shift=0;
if (weights!=NULL)
{
ww=ivCopy(weights);
add_row_shift = ww->min_in();
(*ww) -= add_row_shift;
}
unsigned save_opt=si_opt_1;
si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
{
r=syResolution(u_id,maxl, ww, iiOp==MRES_CMD);
}
else if (iiOp==SRES_CMD)
// r=sySchreyerResolvente(u_id,maxl+1,&l);
r=sySchreyer(u_id,maxl+1);
else if (iiOp == LRES_CMD)
{
int dummy;
if((currRing->qideal!=NULL)||
(!idHomIdeal (u_id,NULL)))
{
WerrorS("`lres` not implemented for inhomogeneous input or qring");
return TRUE;
}
if(currRing->N == 1)
WarnS("the current implementation of `lres` may not work in the case of a single variable");
r=syLaScala3(u_id,&dummy);
}
else if (iiOp == KRES_CMD)
{
int dummy;
if((currRing->qideal!=NULL)||
(!idHomIdeal (u_id,NULL)))
{
WerrorS
("`kres` not implemented for inhomogeneous input or qring");
return TRUE;
}
r=syKosz(u_id,&dummy);
}
else
{ // HRES
int dummy;
if((currRing->qideal!=NULL)||
(!idHomIdeal (u_id,NULL)))
{
WerrorS
("`hres` not implemented for inhomogeneous input or qring");
return TRUE;
}
ideal u_id_copy=idCopy(u_id);
idSkipZeroes(u_id_copy);
r=syHilb(u_id_copy,&dummy);
idDelete(&u_id_copy);
}
if (r==NULL) return TRUE;
if (wmaxl>0)
{
if (r->list_length>wmaxl)
{
for(int i=wmaxl-1;i<=r->list_length;i++)
{
if (r->fullres[i]!=NULL) id_Delete(&r->fullres[i],currRing);
if (r->minres[i]!=NULL) id_Delete(&r->minres[i],currRing);
}
}
r->list_length=wmaxl;
}
res->data=(void *)r;
if ((weights!=NULL) && (ww!=NULL)) { delete ww; ww=NULL; }
if ((r->weights!=NULL) && (r->weights[0]!=NULL))
{
ww=ivCopy(r->weights[0]);
if (weights!=NULL) (*ww) += add_row_shift;
atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
}
else
{
if (weights!=NULL)
{
atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
}
}
// test the La Scala case' output
assume( ((iiOp == LRES_CMD) || (iiOp == HRES_CMD)) == (r->syRing != NULL) );
assume( (r->syRing != NULL) == (r->resPairs != NULL) );
if(iiOp != HRES_CMD)
assume( (r->minres != NULL) || (r->fullres != NULL) ); // is wrong for HRES_CMD...
else
assume( (r->orderedRes != NULL) || (r->res != NULL) ); // analog for hres...
if(complete) syFix(r);
si_opt_1=save_opt;
return FALSE;
}
idHomIdeal
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition ideals.h:91
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201
syResolution
syStrategy syResolution(ideal arg, int maxlength, intvec *w, BOOLEAN minim)
Definition syz.cc:625
syHilb
syStrategy syHilb(ideal arg, int *length)
Definition syz2.cc:950
sySchreyer
syStrategy sySchreyer(ideal arg, int maxlength)
Definition syz0.cc:1018
syKosz
syStrategy syKosz(ideal arg, int *length)
Definition syz3.cc:1766
ssyStrategy::res
resolvente res
Definition syz.h:47
ssyStrategy::orderedRes
resolvente orderedRes
Definition syz.h:48
syLaScala3
syStrategy syLaScala3(ideal arg, int *length)
Definition syz1.cc:2432
LRES_CMD
@ LRES_CMD
Definition tok.h:120
HRES_CMD
@ HRES_CMD
Definition tok.h:91
KRES_CMD
@ KRES_CMD
Definition tok.h:109
MRES_CMD
@ MRES_CMD
Definition tok.h:131
SRES_CMD
@ SRES_CMD
Definition tok.h:184
RES_CMD
@ RES_CMD
Definition tok.h:169

## jjRES3()

BOOLEAN jjRES3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7233 of file iparith.cc.

{
int maxl=(int)v->Data();
ideal u_id=(ideal)u->Data();
int l=0;
resolvente r;
intvec **weights=NULL;
int wmaxl=maxl;
maxl--;
unsigned save_opt=si_opt_1;
si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
if ((maxl==-1) && (iiOp!=MRES_CMD))
maxl = currRing->N-1;
if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
{
intvec * iv=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
if (iv!=NULL)
{
l=1;
if (!idTestHomModule(u_id,currRing->qideal,iv))
{
WarnS("wrong weights");
iv=NULL;
}
else
{
weights = (intvec**)omAlloc0Bin(char_ptr_bin);
weights[0] = ivCopy(iv);
}
}
r=syResolvente(u_id,maxl,&l, &weights, iiOp==MRES_CMD);
}
else
r=sySchreyerResolvente((ideal)u->Data(),maxl+1,&l);
if (r==NULL) return TRUE;
int t3=u->Typ();
iiMakeResolv(r,l,wmaxl,w->name,t3,weights);
si_opt_1=save_opt;
return FALSE;
}
iiMakeResolv
void iiMakeResolv(resolvente r, int length, int rlen, char *name, int typ0, intvec **weights)
Definition ipshell.cc:854
char_ptr_bin
EXTERN_VAR omBin char_ptr_bin
Definition structs.h:73
syResolvente
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition syz.cc:403
sySchreyerResolvente
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
Definition syz0.cc:855

## jjRESERVED0()

BOOLEAN jjRESERVED0 | ( | leftv | ,
|  | leftv | )

static

Definition at line 8502 of file iparith.cc.

{
unsigned i=1;
unsigned nCount = (sArithBase.nCmdUsed-1)/3;
if((3*nCount)<sArithBase.nCmdUsed) nCount++;
//Print("CMDS: %d/%d\n", sArithBase.nCmdUsed,
// sArithBase.nCmdAllocated);
for(i=0; i<nCount; i++)
{
Print("%-20s",sArithBase.sCmds[i+1].name);
if(i+1+nCount<sArithBase.nCmdUsed)
Print("%-20s",sArithBase.sCmds[i+1+nCount].name);
if(i+1+2*nCount<sArithBase.nCmdUsed)
Print("%-20s",sArithBase.sCmds[i+1+2*nCount].name);
//if ((i%3)==1) PrintLn();
PrintLn();
}
PrintLn();
printBlackboxTypes();
return FALSE;
}
printBlackboxTypes
void printBlackboxTypes()
list all defined type (for debugging)
Definition blackbox.cc:236

## jjRESERVEDLIST0()

BOOLEAN jjRESERVEDLIST0 | ( | leftv | res,
|  | leftv | )

static

Definition at line 8524 of file iparith.cc.

{
int l = 0;
int k = 0;
lists L = (lists)omAllocBin(slists_bin);
struct blackbox_list *bb_list = NULL;
unsigned nCount = (sArithBase.nCmdUsed-1) / 3;
if ((3*nCount) < sArithBase.nCmdUsed)
{
nCount++;
}
bb_list = getBlackboxTypes();
// count the number of entries;
for (unsigned i=0; i<nCount; i++)
{
l++;
if (i + 1 + nCount < sArithBase.nCmdUsed)
{
l++;
}
if(i+1+2*nCount<sArithBase.nCmdUsed)
{
l++;
}
}
for (int i = 0; i < bb_list->count; i++)
{
if (bb_list->list[i] != NULL)
{
l++;
}
}
// initiate list
L->Init(l);
k = 0;
for (unsigned i=0; i<nCount; i++)
{
L->m[k].rtyp = STRING_CMD;
L->m[k].data = omStrDup(sArithBase.sCmds[i+1].name);
k++;
// Print("%-20s", sArithBase.sCmds[i+1].name);
if (i + 1 + nCount < sArithBase.nCmdUsed)
{
L->m[k].rtyp = STRING_CMD;
L->m[k].data = omStrDup(sArithBase.sCmds[i+1+nCount].name);
k++;
// Print("%-20s", sArithBase.sCmds[i+1 + nCount].name);
}
if(i+1+2*nCount<sArithBase.nCmdUsed)
{
L->m[k].rtyp = STRING_CMD;
L->m[k].data = omStrDup(sArithBase.sCmds[i+1+2*nCount].name);
k++;
// Print("%-20s", sArithBase.sCmds[i+1+2*nCount].name);
}
// PrintLn();
}
// assign blackbox types
for (int i = 0; i < bb_list->count; i++)
{
if (bb_list->list[i] != NULL)
{
L->m[k].rtyp = STRING_CMD;
// already used strdup in getBlackBoxTypes
L->m[k].data = bb_list->list[i];
k++;
}
}
// free the struct (not the list entries itself, which were allocated
// by strdup)
omfree(bb_list->list);
omfree(bb_list);
// pass the resultant list to the res datastructure
res->data=(void *)L;
return FALSE;
}
getBlackboxTypes
struct blackbox_list * getBlackboxTypes()
return array of all define types.
Definition blackbox.cc:245
blackbox_list::list
void ** list
Definition blackbox.h:86
blackbox_list::count
int count
Definition blackbox.h:85
blackbox_list
struct for containing list of blackbox names and the number of them.
Definition blackbox.h:84
omfree
#define omfree(addr)
Definition omAllocDecl.h:237

## jjRESERVEDNAME()

BOOLEAN jjRESERVEDNAME | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4942 of file iparith.cc.

{
char *s= (char *)v->Data();
// try system keywords
for(unsigned i=0; i<sArithBase.nCmdUsed; i++)
{
//Print("test %d, >>%s<<, tab:>>%s<<\n",i,s,sArithBase.sCmds[i].name);
if (strcmp(s, sArithBase.sCmds[i].name) == 0)
{
res->data = (char *)1;
return FALSE;
}
}
// try blackbox names
int id;
blackboxIsCmd(s,id);
if (id>0)
{
res->data = (char *)1;
}
return FALSE;
}

## jjRESTART()

BOOLEAN jjRESTART | ( | leftv | ,
|  | leftv | u )

static

Definition at line 8977 of file iparith.cc.

{
int c=(int)(long)u->Data();
switch(c)
{
case 0:{
PrintS("delete all variables\n");
killlocals(0);
WerrorS("restarting...");
break;
};
default: WerrorS("not implemented");
}
return FALSE;
}
killlocals
void killlocals(int v)
Definition ipshell.cc:387

## jjRIGHTSTD()

BOOLEAN jjRIGHTSTD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5363 of file iparith.cc.

{
#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)// do not place above jjSTD in this file because we need to reference it
if (rIsLPRing(currRing))
{
if (rField_is_numeric(currRing))
WarnS("groebner base computations with inexact coefficients can not be trusted due to rounding errors");
ideal result;
ideal v_id=(ideal)v->Data();
/* intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD); */
/* tHomog hom=testHomog; */
/* if (w!=NULL) */
/* { */
/* if (!idTestHomModule(v_id,currRing->qideal,w)) */
/* { */
/* WarnS("wrong weights"); */
/* w=NULL; */
/* } */
/* else */
/* { */
/* hom=isHomog; */
/* w=ivCopy(w); */
/* } */
/* } */
/* result=kStd2(v_id,currRing->qideal,hom,&w); */
result = rightgb(v_id, currRing->qideal);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
/* if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD); */
return FALSE;
}
else if (rIsPluralRing(currRing))
{
ideal I=(ideal)v->Data();
ring A = currRing;
ring Aopp = rOpposite(A);
currRing = Aopp;
ideal Iopp = idOppose(A, I, Aopp);
ideal Jopp = kStd2(Iopp,currRing->qideal,testHomog,NULL,(bigintmat*)NULL);
if (errorreported) return TRUE;
currRing = A;
ideal J = idOppose(Aopp, Jopp, A);
id_Delete(&Iopp, Aopp);
id_Delete(&Jopp, Aopp);
rDelete(Aopp);
idSkipZeroes(J);
res->data = (char *)J;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
return FALSE;
}
else
{
return jjSTD(res, v);
}
#else
return TRUE;
#endif
}
jjSTD
static BOOLEAN jjSTD(leftv res, leftv v)
Definition iparith.cc:5163
kStd2
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
Definition kstd1.cc:2607
rightgb
ideal rightgb(ideal F, const ideal Q)
Definition kstd2.cc:4935
TEST_OPT_DEGBOUND
#define TEST_OPT_DEGBOUND
Definition options.h:115
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
rField_is_numeric
static BOOLEAN rField_is_numeric(const ring r)
Definition ring.h:521

## jjRING3()

BOOLEAN jjRING3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7274 of file iparith.cc.

{
res->data=(void *)rInit(u,v,w);
return (res->data==NULL);
}
rInit
ring rInit(leftv pn, leftv rv, leftv ord)
Definition ipshell.cc:5628

## jjRING_1()

BOOLEAN jjRING_1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1673 of file iparith.cc.

{
u->next=(leftv)omAlloc(sizeof(sleftv));
memcpy(u->next,v,sizeof(sleftv));
v->Init();
BOOLEAN bo=iiExprArithM(res,u,'[');
u->next=NULL;
return bo;
}

## jjRING_2()

BOOLEAN jjRING_2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6083 of file iparith.cc.

{
u->next=(leftv)omAlloc(sizeof(sleftv));
memcpy(u->next,v,sizeof(sleftv));
v->Init();
u->next->next=(leftv)omAlloc(sizeof(sleftv));
memcpy(u->next->next,w,sizeof(sleftv));
w->Init();
BOOLEAN bo=iiExprArithM(res,u,'[');
u->next=NULL;
return bo;
}

## jjRING_LIST()

BOOLEAN jjRING_LIST | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5007 of file iparith.cc.

{
ring r=(ring)v->Data();
if (r!=NULL)
res->data = (char *)rDecompose_list_cf((ring)v->Data());
return (r==NULL)||(res->data==NULL);
}
rDecompose_list_cf
lists rDecompose_list_cf(const ring r)
Definition ipshell.cc:2114

## jjRING_PL()

BOOLEAN jjRING_PL | ( | leftv | res,
|  | leftv | a )

static

Definition at line 8948 of file iparith.cc.

{
//Print("construct ring\n");
if (a->Typ()!=CRING_CMD)
{
WerrorS("expected `cring` [ `id` ... ]");
return TRUE;
}
assume(a->next!=NULL);
leftv names=a->next;
int N=names->listLength();
char **n=(char**)omAlloc0(N*sizeof(char*));
for(int i=0; i<N;i++,names=names->next)
{
n[i]=(char *)names->Name();
}
coeffs cf=(coeffs)a->CopyD();
res->data=rDefault(cf,N,n, ringorder_dp);
omFreeSize(n,N*sizeof(char*));
return FALSE;
}
rDefault
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition ring.cc:103
ringorder_dp
@ ringorder_dp
Definition ring.h:79
CRING_CMD
@ CRING_CMD
Definition tok.h:56

## jjRINGLIST()

BOOLEAN jjRINGLIST | ( | leftv | res,
|  | leftv | v )

static

Definition at line 4985 of file iparith.cc.

{
ring r=(ring)v->Data();
if (r!=NULL)
{
res->data = (char *)rDecompose((ring)v->Data());
if (res->data!=NULL)
{
long mm=r->wanted_maxExp;
if (mm!=0) atSet(res,omStrDup("maxExp"),(void*)mm,INT_CMD);
return FALSE;
}
}
return TRUE;
}
rDecompose
lists rDecompose(const ring r)
Definition ipshell.cc:2153

## jjRINGLIST_C()

BOOLEAN jjRINGLIST_C | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5000 of file iparith.cc.

{
coeffs r=(coeffs)v->Data();
if (r!=NULL)
return rDecompose_CF(res,r);
return TRUE;
}
rDecompose_CF
BOOLEAN rDecompose_CF(leftv res, const coeffs C)
Definition ipshell.cc:1943

## jjRMINUS()

BOOLEAN jjRMINUS | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3324 of file iparith.cc.

{
ring r=rMinusVar((ring)u->Data(),(char*)v->Data());
res->data = (char *)r;
return r==NULL;
}
rMinusVar
ring rMinusVar(const ring r, char *v)
undo rPlusVar
Definition ring.cc:6024

## jjrOrdStr()

BOOLEAN jjrOrdStr | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5751 of file iparith.cc.

{
res->data = rOrdStr((ring)v->Data());
return FALSE;
}
rOrdStr
char * rOrdStr(ring r)
Definition ring.cc:526

## jjROWS()

BOOLEAN jjROWS | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5014 of file iparith.cc.

{
ideal i = (ideal)v->Data();
res->data = (char *)i->rank;
return FALSE;
}

## jjROWS_BIM()

BOOLEAN jjROWS_BIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5020 of file iparith.cc.

{
res->data = (char *)(long)((bigintmat*)(v->Data()))->rows();
return FALSE;
}

## jjROWS_IV()

BOOLEAN jjROWS_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5025 of file iparith.cc.

{
res->data = (char *)(long)((intvec*)(v->Data()))->rows();
return FALSE;
}

## jjRPAR()

BOOLEAN jjRPAR | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5030 of file iparith.cc.

{
res->data = (char *)(long)rPar(((ring)v->Data()));
return FALSE;
}

## jjrParStr()

BOOLEAN jjrParStr | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5761 of file iparith.cc.

{
res->data = rParStr((ring)v->Data());
return FALSE;
}
rParStr
char * rParStr(ring r)
Definition ring.cc:654

## jjRPLUS()

BOOLEAN jjRPLUS | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3330 of file iparith.cc.

{
int left;
if (u->Typ()==RING_CMD) left=0;
else
{
leftv h=u;u=v;v=h;
left=1;
}
ring r=rPlusVar((ring)u->Data(),(char*)v->Data(),left);
res->data = (char *)r;
return r==NULL;
}
rPlusVar
ring rPlusVar(const ring r, char *v, int left)
K[x],"y" -> K[x,y] resp. K[y,x].
Definition ring.cc:5942

## jjRSUM()

BOOLEAN jjRSUM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3343 of file iparith.cc.

{
ring r;
int i=rSum((ring)u->Data(),(ring)v->Data(),r);
res->data = (char *)r;
return (i==-1);
}
rSum
int rSum(ring r1, ring r2, ring &sum)
Definition ring.cc:1408

## jjrVarStr()

BOOLEAN jjrVarStr | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5756 of file iparith.cc.

{
res->data = rVarStr((ring)v->Data());
return FALSE;
}
rVarStr
char * rVarStr(ring r)
Definition ring.cc:628

## jjS2I()

BOOLEAN jjS2I | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5035 of file iparith.cc.

{
res->data = (char *)(long)atoi((char*)v->Data());
return FALSE;
}

## jjSBA()

BOOLEAN jjSBA | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5082 of file iparith.cc.

{
ideal result;
ideal v_id=(ideal)v->Data();
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
}
else
{
hom=isHomog;
w=ivCopy(w);
}
}
result=kSba(v_id,currRing->qideal,hom,&w,1,0,NULL);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}
kSba
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw)
Definition kstd1.cc:2668

## jjSBA_1()

BOOLEAN jjSBA_1 | ( | leftv | res,
|  | leftv | v,
|  | leftv | u )

static

Definition at line 5109 of file iparith.cc.

{
ideal result;
ideal v_id=(ideal)v->Data();
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
}
else
{
hom=isHomog;
w=ivCopy(w);
}
}
result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0,NULL);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}

## jjSBA_2()

BOOLEAN jjSBA_2 | ( | leftv | res,
|  | leftv | v,
|  | leftv | u,
|  | leftv | t )

static

Definition at line 5136 of file iparith.cc.

{
ideal result;
ideal v_id=(ideal)v->Data();
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
}
else
{
hom=isHomog;
w=ivCopy(w);
}
}
result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data(),NULL);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}

## jjSetRing()

BOOLEAN jjSetRing | ( | leftv | ,
|  | leftv | u )

static

Definition at line 3855 of file iparith.cc.

{
if (u->rtyp==IDHDL) rSetHdl((idhdl)u->data);
else
{
ring r=(ring)u->Data();
idhdl h=rFindHdl(r,NULL);
if (h==NULL)
{
char name_buffer[100];
STATIC_VAR int ending=1000000;
ending++;
snprintf(name_buffer,100, "PYTHON_RING_VAR%d",ending);
h=enterid(name_buffer,0,RING_CMD,&IDROOT);
IDRING(h)=rIncRefCnt(r);
}
rSetHdl(h);
}
return FALSE;
}
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
rFindHdl
idhdl rFindHdl(ring r, idhdl n)
Definition ipshell.cc:1701
rSetHdl
void rSetHdl(idhdl h)
Definition ipshell.cc:5129

## jjSIMPL_ID()

BOOLEAN jjSIMPL_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3357 of file iparith.cc.

{
int sw = (int)(long)v->Data();
// CopyD for IDEAL_CMD and MODUL_CMD are identical:
ideal id = (ideal)u->CopyD(IDEAL_CMD);
if (sw & SIMPL_LMDIV)
{
id_DelDiv(id,currRing);
}
if (sw & SIMPL_LMEQ)
{
id_DelLmEquals(id,currRing);
}
if (sw & SIMPL_MULT)
{
id_DelMultiples(id,currRing);
}
else if(sw & SIMPL_EQU)
{
id_DelEquals(id,currRing);
}
if (sw & SIMPL_NULL)
{
idSkipZeroes(id);
}
if (sw & SIMPL_NORM)
{
id_Norm(id,currRing);
}
if (sw & SIMPL_NORMALIZE)
{
id_Normalize(id,currRing);
}
res->data = (char * )id;
return FALSE;
}
SIMPL_EQU
#define SIMPL_EQU
Definition iparith.cc:3354
SIMPL_NORM
#define SIMPL_NORM
Definition iparith.cc:3356
SIMPL_LMEQ
#define SIMPL_LMEQ
Definition iparith.cc:3352
SIMPL_NULL
#define SIMPL_NULL
Definition iparith.cc:3355
SIMPL_MULT
#define SIMPL_MULT
Definition iparith.cc:3353
SIMPL_NORMALIZE
#define SIMPL_NORMALIZE
Definition iparith.cc:3350
SIMPL_LMDIV
#define SIMPL_LMDIV
Definition iparith.cc:3351
id_Norm
void id_Norm(ideal id, const ring r)
ideal id = (id[i]), result is leadcoeff(id[i]) = 1
Definition simpleideals.cc:282
id_Normalize
void id_Normalize(ideal I, const ring r)
normialize all polys in id
Definition simpleideals.cc:1983
id_DelDiv
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
Definition simpleideals.cc:463
id_DelMultiples
void id_DelMultiples(ideal id, const ring r)
ideal id = (id[i]), c any unit if id[i] = c*id[j] then id[j] is deleted for j > i
Definition simpleideals.cc:296
id_DelEquals
void id_DelEquals(ideal id, const ring r)
ideal id = (id[i]) if id[i] = id[j] then id[j] is deleted for j > i
Definition simpleideals.cc:331
id_DelLmEquals
void id_DelLmEquals(ideal id, const ring r)
Delete id[j], if Lm(j) == Lm(i) and both LC(j), LC(i) are units and j > i.
Definition simpleideals.cc:354

## jjSIMPL_P()

BOOLEAN jjSIMPL_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3452 of file iparith.cc.

{
int sw = (int)(long)v->Data();
// CopyD for POLY_CMD and VECTOR_CMD are identical:
poly p = (poly)u->CopyD(POLY_CMD);
if (sw & SIMPL_NORM)
{
pNorm(p);
}
if (sw & SIMPL_NORMALIZE)
{
p_Normalize(p,currRing);
}
res->data = (char * )p;
return FALSE;
}
p_Normalize
void p_Normalize(poly p, const ring r)
Definition p_polys.cc:3939
pNorm
void pNorm(poly p)
Definition polys.h:363

## jjSLIM_GB()

BOOLEAN jjSLIM_GB | ( | leftv | res,
|  | leftv | u )

static

Definition at line 5040 of file iparith.cc.

{
const bool bIsSCA = rIsSCA(currRing);
if ((currRing->qideal!=NULL) && !bIsSCA)
{
WerrorS("qring not supported by slimgb at the moment");
return TRUE;
}
if (rHasLocalOrMixedOrdering(currRing))
{
WerrorS("ordering must be global for slimgb");
return TRUE;
}
if (rField_is_numeric(currRing))
WarnS("groebner base computations with inexact coefficients can not be trusted due to rounding errors");
intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
// tHomog hom=testHomog;
ideal u_id=(ideal)u->Data();
if (w!=NULL)
{
if (!idTestHomModule(u_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
}
else
{
w=ivCopy(w);
// hom=isHomog;
}
}
assume(u_id->rank>=id_RankFreeModule(u_id, currRing));
res->data=(char *)t_rep_gb(currRing,
u_id,u_id->rank);
//res->data=(char *)t_rep_gb(currRing, u_id);
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}
rIsSCA
static bool rIsSCA(const ring r)
Definition nc.h:190
t_rep_gb
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
Definition tgb.cc:3581

## jjSMATRIX_Mo()

BOOLEAN jjSMATRIX_Mo | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7114 of file iparith.cc.

{
int mi=(int)(long)v->Data();
int ni=(int)(long)w->Data();
if ((mi<0)||(ni<1))
{
Werror("converting to smatrix: dimensions must be positive(%dx%d)",mi,ni);
return TRUE;
}
res->data = (char *)id_ResizeModule((ideal)u->CopyD(),
mi,ni,currRing);
return FALSE;
}
id_ResizeModule
ideal id_ResizeModule(ideal mod, int rows, int cols, const ring R)
Definition simpleideals.cc:1672

## jjSort_Id()

BOOLEAN jjSort_Id | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5192 of file iparith.cc.

{
res->data = (char *)idSort((ideal)v->Data());
return FALSE;
}
idSort
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition ideals.h:188

## jjSORTLIST()

BOOLEAN jjSORTLIST | ( | leftv | ,
|  | leftv | arg )

Definition at line 10488 of file iparith.cc.

{
lists l=(lists)arg->Data();
if (l->nr>0)
{
qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
}
return FALSE;
}
jjCOMPARE_ALL
static int jjCOMPARE_ALL(const void *aa, const void *bb)
Definition iparith.cc:10447

## jjSQR_FREE()

BOOLEAN jjSQR_FREE | ( | leftv | res,
|  | leftv | u )

static

Definition at line 5197 of file iparith.cc.

{
singclap_factorize_retry=0;
intvec *v=NULL;
ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, 0, currRing);
if (f==NULL) return TRUE;
ivTest(v);
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=(void *)f;
l->m[1].rtyp=INTVEC_CMD;
l->m[1].data=(void *)v;
res->data=(void *)l;
return FALSE;
}
singclap_sqrfree
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
Definition clapsing.cc:1377

## jjSQR_FREE2()

BOOLEAN jjSQR_FREE2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | dummy )

static

Definition at line 3394 of file iparith.cc.

{
intvec *v=NULL;
int sw=(int)(long)dummy->Data();
int fac_sw=sw;
if (sw<0) fac_sw=1;
singclap_factorize_retry=0;
ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, fac_sw, currRing);
if (f==NULL)
return TRUE;
switch(sw)
{
case 0:
case 2:
{
lists l=(lists)omAllocBin(slists_bin);
l->Init(2);
l->m[0].rtyp=IDEAL_CMD;
l->m[0].data=(void *)f;
l->m[1].rtyp=INTVEC_CMD;
l->m[1].data=(void *)v;
res->data=(void *)l;
res->rtyp=LIST_CMD;
return FALSE;
}
case 1:
res->data=(void *)f;
return FALSE;
case 3:
{
poly p=f->m[0];
int i=IDELEMS(f);
f->m[0]=NULL;
while(i>1)
{
i--;
p=pMult(p,f->m[i]);
f->m[i]=NULL;
}
res->data=(void *)p;
res->rtyp=POLY_CMD;
}
return FALSE;
}
WerrorS("invalid switch");
return FALSE;
}

## jjSTATUS2()

BOOLEAN jjSTATUS2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3441 of file iparith.cc.

{
res->data = omStrDup(slStatus((si_link) u->Data(), (char *) v->Data()));
return FALSE;
}
slStatus
const char * slStatus(si_link l, const char *request)
Definition silink.cc:156

## jjSTATUS2L()

BOOLEAN jjSTATUS2L | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3446 of file iparith.cc.

{
res->data = (void *)(long)slStatusSsiL((lists) u->Data(), (int)(long) v->Data());
//return (res->data== (void*)(long)-2);
return FALSE;
}
slStatusSsiL
int slStatusSsiL(lists L, int timeout, BOOLEAN *ignore=NULL)
Definition ssiLink.cc:2919

## jjSTATUS3()

BOOLEAN jjSTATUS3 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7279 of file iparith.cc.

{
int yes;
jjSTATUS2(res, u, v);
yes = (strcmp((char *) res->data, (char *) w->Data()) == 0);
omFreeBinAddr((ADDRESS) res->data);
res->data = (void *)(long)yes;
return FALSE;
}
jjSTATUS2
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition iparith.cc:3441

## jjSTATUS_M()

BOOLEAN jjSTATUS_M | ( | leftv | res,
|  | leftv | v )

static

Definition at line 8789 of file iparith.cc.

{
if ((v->Typ() != LINK_CMD) ||
(v->next->Typ() != STRING_CMD) ||
(v->next->next->Typ() != STRING_CMD) ||
(v->next->next->next->Typ() != INT_CMD))
return TRUE;
jjSTATUS3(res, v, v->next, v->next->next);
#if defined(HAVE_USLEEP)
if (((long) res->data) == 0L)
{
int i_s = (int)(long) v->next->next->next->Data();
if (i_s > 0)
{
usleep((int)(long) v->next->next->next->Data());
jjSTATUS3(res, v, v->next, v->next->next);
}
}
#elif defined(HAVE_SLEEP)
if (((int) res->data) == 0)
{
int i_s = (int) v->next->next->next->Data();
if (i_s > 0)
{
si_sleep((is - 1)/1000000 + 1);
jjSTATUS3(res, v, v->next, v->next->next);
}
}
#endif
return FALSE;
}
jjSTATUS3
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:7279
LINK_CMD
@ LINK_CMD
Definition tok.h:117

## jjSTD()

BOOLEAN jjSTD | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5163 of file iparith.cc.

{
if (rField_is_numeric(currRing))
WarnS("groebner base computations with inexact coefficients can not be trusted due to rounding errors");
ideal result;
ideal v_id=(ideal)v->Data();
intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if (w!=NULL)
{
if (!idTestHomModule(v_id,currRing->qideal,w))
{
WarnS("wrong weights");
w=NULL;
}
else
{
hom=isHomog;
w=ivCopy(w);
}
}
result=kStd2(v_id,currRing->qideal,hom,&w,(bigintmat*)NULL);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}

## jjSTD_1()

BOOLEAN jjSTD_1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3496 of file iparith.cc.

{
ideal result;
assumeStdFlag(u);
ideal i1=(ideal)(u->Data());
int ii1=idElem(i1); /* size of i1 */
ideal i0;
int r=v->Typ();
BITSET save1;
SI_SAVE_OPT1(save1);
intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
if ((/*v->Typ()*/r==POLY_CMD) ||(r==VECTOR_CMD))
{
poly p=(poly)v->Data();
i0=idInit(1,i1->rank);
i0->m[0]=p;
i1=idSimpleAdd(i1,i0); //
i0->m[0]=NULL;
idDelete(&i0);
if (w!=NULL)
{
if (!idTestHomModule(i1,currRing->qideal,w))
{
// no warnung: this is legal, if i in std(i,p)
// is homogeneous, but p not
w=NULL;
}
else
{
w=ivCopy(w);
hom=isHomog;
}
}
si_opt_1|=Sy_bit(OPT_SB_1);
/* ii1 appears to be the position of the first element of il that
does not belong to the old SB ideal */
result=kStd2(i1,currRing->qideal,hom,&w,(bigintmat*)NULL,0,ii1);
}
else /*IDEAL/MODULE*/
{
i0=(ideal)v->CopyD();
i1=idSimpleAdd(i1,i0); //
memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
idDelete(&i0);
if (w!=NULL)
{
if (!idTestHomModule(i1,currRing->qideal,w))
{
// no warnung: this is legal, if i in std(i,p)
// is homogeneous, but p not
w=NULL;
hom=isNotHomog;
}
else
{
w=ivCopy(w);
hom=isHomog;
}
}
si_opt_1|=Sy_bit(OPT_SB_1);
/* ii1 appears to be the position of the first element of i1 that
does not belong to the old SB ideal */
result=kStd2(i1,currRing->qideal,hom,&w,(bigintmat*)NULL,0,ii1);
}
SI_RESTORE_OPT1(save1);
idDelete(&i1);
if (errorreported) return TRUE;
idSkipZeroes(result);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
res->data = (char *)result;
if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
return FALSE;
}
OPT_SB_1
#define OPT_SB_1
Definition options.h:96
SI_SAVE_OPT1
#define SI_SAVE_OPT1(A)
Definition options.h:21
SI_RESTORE_OPT1
#define SI_RESTORE_OPT1(A)
Definition options.h:24
isNotHomog
@ isNotHomog
Definition structs.h:32

## jjSTD_HILB()

BOOLEAN jjSTD_HILB | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3468 of file iparith.cc.

{
ideal result;
intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
ideal u_id=(ideal)(u->Data());
if (w!=NULL)
{
if (!idTestHomModule(u_id,currRing->qideal,w))
{
WarnS("wrong weights:");w->show();PrintLn();
w=NULL;
}
else
{
w=ivCopy(w);
hom=isHomog;
}
}
bigintmat *vv=(bigintmat*)v->Data();
result=kStd2(u_id,currRing->qideal,hom,&w,vv);
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
setFlag(res,FLAG_STD);
if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
return FALSE;
}

## jjSTD_HILB_W()

BOOLEAN jjSTD_HILB_W | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 7288 of file iparith.cc.

{
intvec *vw=(intvec *)w->Data(); // weights of vars
if (vw->length()!=currRing->N)
{
Werror("%d weights for %d variables",vw->length(),currRing->N);
return TRUE;
}
ideal result;
intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
ideal u_id=(ideal)(u->Data());
if (ww!=NULL)
{
if (!idTestHomModule(u_id,currRing->qideal,ww))
{
WarnS("wrong weights");
ww=NULL;
}
else
{
ww=ivCopy(ww);
hom=isHomog;
}
}
bigintmat *vv=(bigintmat*)v->Data();
result=kStd2(u_id,
currRing->qideal,
hom,
&ww, // module weights
vv, // hilbert series
0,0, // syzComp, newIdeal
vw); // weights of vars
if (errorreported) return TRUE;
idSkipZeroes(result);
res->data = (char *)result;
setFlag(res,FLAG_STD);
if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
return FALSE;
}

## jjSTD_HILB_WP()

BOOLEAN jjSTD_HILB_WP | ( | leftv | res,
|  | leftv | INPUT )

static

Definition at line 8864 of file iparith.cc.

{ ideal result;
leftv u = INPUT; /* an ideal, weighted homogeneous and standard */
leftv v = u->next; /* one additional polynomial or ideal */
leftv h = v->next; /* Hilbert vector */
leftv w = h->next; /* weight vector */
assumeStdFlag(u);
ideal i1=(ideal)(u->Data());
ideal i0;
if (((u->Typ()!=IDEAL_CMD)&&(u->Typ()!=MODUL_CMD))
|| (h->Typ()!=BIGINTVEC_CMD)
|| (w->Typ()!=INTVEC_CMD))
{
WerrorS("expected `std(`ideal/module`,`poly/vector`,`bigintvec`,`intvec`)");
return TRUE;
}
intvec *vw=(intvec *)w->Data(); // weights of vars
/* merging std_hilb_w and std_1 */
if (vw->length()!=currRing->N)
{
Werror("%d weights for %d variables",vw->length(),currRing->N);
return TRUE;
}
int r=v->Typ();
BOOLEAN cleanup_i0=FALSE;
if ((r==POLY_CMD) ||(r==VECTOR_CMD))
{
i0=idInit(1,i1->rank);
i0->m[0]=(poly)v->Data();
cleanup_i0=TRUE;
}
else if (r==IDEAL_CMD)/* IDEAL */
{
i0=(ideal)v->Data();
}
else
{
WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
return TRUE;
}
int ii0=idElem(i0);
i1 = idSimpleAdd(i1,i0);
if (cleanup_i0)
{
memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
idDelete(&i0);
}
intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
tHomog hom=testHomog;
/* u_id from jjSTD_W is now i1 as in jjSTD_1 */
if (ww!=NULL)
{
if (!idTestHomModule(i1,currRing->qideal,ww))
{
WarnS("wrong weights");
ww=NULL;
}
else
{
ww=ivCopy(ww);
hom=isHomog;
}
}
BITSET save1;
SI_SAVE_OPT1(save1);
si_opt_1|=Sy_bit(OPT_SB_1);
result=kStd2(i1,
currRing->qideal,
hom,
&ww, // module weights
(bigintmat *)h->Data(), // hilbert series
0, // syzComp, whatever it is...
IDELEMS(i1)-ii0, // new ideal
vw); // weights of vars
SI_RESTORE_OPT1(save1);
if (errorreported) return TRUE;
idDelete(&i1);
idSkipZeroes(result);
res->data = (char *)result;
if (!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
return FALSE;
}

## jjSTRING_PL()

BOOLEAN jjSTRING_PL | ( | leftv | res,
|  | leftv | v )

static

Definition at line 8604 of file iparith.cc.

{
if (v == NULL)
{
res->data = omStrDup("");
return FALSE;
}
int n = v->listLength();
if (n == 1)
{
res->data = v->String();
return FALSE;
}
char** slist = (char**) omAlloc(n*sizeof(char*));
int i, j;
for (i=0, j=0; i<n; i++, v = v ->next)
{
slist[i] = v->String();
assume(slist[i] != NULL);
j+=strlen(slist[i]);
}
char* s = (char*) omAlloc((j+1)*sizeof(char));
*s='\0';
for (i=0;i<n;i++)
{
strcat(s, slist[i]);
omFree(slist[i]);
}
omFreeSize(slist, n*sizeof(char*));
res->data = s;
return FALSE;
}

## jjstrlen()

BOOLEAN jjstrlen | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5683 of file iparith.cc.

{
res->data = (char *)strlen((char *)v->Data());
return FALSE;
}

## jjSUBST_Bu()

BOOLEAN jjSUBST_Bu | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6836 of file iparith.cc.

{
// generic conversion from polyBucket to poly:
// force this to be the first try everytime
poly p; int l;
sBucket_pt bu=(sBucket_pt)w->CopyD();
sBucketDestroyAdd(bu,&p,&l);
sleftv tmpw;
tmpw.Init();
tmpw.rtyp=POLY_CMD;
tmpw.data=p;
return iiExprArith3(res, iiOp, u, v, &tmpw);
}

## jjSUBST_Id()

BOOLEAN jjSUBST_Id | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6882 of file iparith.cc.

{
int ringvar;
poly monomexpr;
BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
if (nok) return TRUE;
ideal id=(ideal)u->Data();
if (ringvar>0)
{
BOOLEAN overflow=FALSE;
if (!rIsLPRing(currRing) && (monomexpr!=NULL))
{
long deg_monexp=pTotaldegree(monomexpr);
for(int i=IDELEMS(id)-1;i>=0;i--)
{
poly p=id->m[i];
int mm=p_MaxExpPerVar(p,ringvar,currRing);
if ((p!=NULL) && (mm!=0) &&
((unsigned long)deg_monexp > (currRing->bitmask / (unsigned long)mm/2)))
{
overflow=TRUE;
break;
}
}
}
if (overflow)
Warn("possible OVERFLOW in subst, max exponent is %ld",currRing->bitmask/2);
if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
{
if (res->rtyp==MATRIX_CMD) id=(ideal)mp_Copy((matrix)id,currRing);
else id=id_Copy(id,currRing);
res->data = id_Subst(id, ringvar, monomexpr, currRing);
}
else
res->data = idSubstPoly(id,ringvar,monomexpr);
}
else
{
if (rIsLPRing(currRing))
{
WerrorS("Substituting parameters not implemented for Letterplace rings.");
return TRUE;
}
res->data = idSubstPar(id,-ringvar,monomexpr);
}
return FALSE;
}
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition simpleideals.cc:542
jjSUBST_Test
static BOOLEAN jjSUBST_Test(leftv v, leftv w, int &ringvar, poly &monomexpr)
Definition iparith.cc:6808
idSubstPoly
ideal idSubstPoly(ideal id, int n, poly e)
Definition maps_ip.cc:425
idSubstPar
ideal idSubstPar(ideal id, int n, poly e)
Definition maps_ip.cc:386
p_MaxExpPerVar
int p_MaxExpPerVar(poly p, int i, const ring r)
max exponent of variable x_i in p
Definition p_polys.cc:5146
id_Subst
ideal id_Subst(ideal id, int n, poly e, const ring r)
Definition simpleideals.cc:1709

## jjSUBST_Id_I()

BOOLEAN jjSUBST_Id_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6932 of file iparith.cc.

{
return jjSUBST_Id_X(res,u,v,w,INT_CMD);
}
jjSUBST_Id_X
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition iparith.cc:6940

## jjSUBST_Id_N()

BOOLEAN jjSUBST_Id_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6936 of file iparith.cc.

{
return jjSUBST_Id_X(res,u,v,w,NUMBER_CMD);
}

## jjSUBST_Id_X()

BOOLEAN jjSUBST_Id_X | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w,
|  | int | input_type )

static

Definition at line 6940 of file iparith.cc.

{
sleftv tmp;
tmp.Init();
// do not check the result, conversion from int/number to poly works always
iiConvert(input_type,POLY_CMD,iiTestConvert(input_type,POLY_CMD),w,&tmp);
BOOLEAN b=jjSUBST_Id(res,u,v,&tmp);
tmp.CleanUp();
return b;
}
jjSUBST_Id
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition iparith.cc:6882

## jjSUBST_M()

BOOLEAN jjSUBST_M | ( | leftv | res,
|  | leftv | u )

static

Definition at line 8820 of file iparith.cc.

{
leftv v = u->next; // number of args > 0
if (v==NULL) return TRUE;
leftv w = v->next;
if (w==NULL) return TRUE;
leftv rest = w->next;
u->next = NULL;
v->next = NULL;
w->next = NULL;
BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
if ((rest!=NULL) && (!b))
{
leftv tmp_next=res->next;
res->next=rest;
sleftv tmp_res;
tmp_res.Init();
b = iiExprArithM(&tmp_res,res,iiOp);
memcpy(res,&tmp_res,sizeof(tmp_res));
res->next=tmp_next;
}
u->next = v;
v->next = w;
// rest was w->next, but is already cleaned
return b;
}

## jjSUBST_P()

BOOLEAN jjSUBST_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v,
|  | leftv | w )

static

Definition at line 6849 of file iparith.cc.

{
int ringvar;
poly monomexpr;
BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
if (nok) return TRUE;
poly p=(poly)u->Data();
if (ringvar>0)
{
int mm=p_MaxExpPerVar(p,ringvar,currRing);
if (!rIsLPRing(currRing) &&
(monomexpr!=NULL) && (p!=NULL) && (mm!=0) &&
((unsigned long)pTotaldegree(monomexpr) > (currRing->bitmask / (unsigned long)mm/2)))
{
Warn("possible OVERFLOW in subst, max exponent is %ld, substituting deg %d by deg %d",currRing->bitmask/2, pTotaldegree(monomexpr), mm);
//return TRUE;
}
if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
res->data = pSubst((poly)u->CopyD(res->rtyp),ringvar,monomexpr);
else
res->data= pSubstPoly(p,ringvar,monomexpr);
}
else
{
if (rIsLPRing(currRing))
{
WerrorS("Substituting parameters not implemented for Letterplace rings.");
return TRUE;
}
res->data=pSubstPar(p,-ringvar,monomexpr);
}
return FALSE;
}
pSubstPoly
poly pSubstPoly(poly p, int var, poly image)
Definition maps_ip.cc:403
pSubstPar
poly pSubstPar(poly p, int par, poly image)
Definition maps_ip.cc:266

## jjSUBST_Test()

BOOLEAN jjSUBST_Test | ( | leftv | v,
|  | leftv | w,
|  | int & | ringvar,
|  | poly & | monomexpr )

static

Definition at line 6808 of file iparith.cc.

{
monomexpr=(poly)w->Data();
poly p=(poly)v->Data();
#if 0
if (pLength(monomexpr)>1)
{
Werror("`%s` substitutes a ringvar only by a term",
Tok2Cmdname(SUBST_CMD));
return TRUE;
}
#endif
if ((ringvar=pVar(p))==0)
{
if ((p!=NULL) && (currRing->cf->extRing!=NULL))
{
number n = pGetCoeff(p);
ringvar= -n_IsParam(n, currRing);
}
if(ringvar==0)
{
WerrorS("ringvar/par expected");
return TRUE;
}
}
return FALSE;
}
n_IsParam
int n_IsParam(const number m, const ring r)
TODO: rewrite somehow...
Definition ring.cc:5921
SUBST_CMD
@ SUBST_CMD
Definition tok.h:188

## jjSYZ_2()

BOOLEAN jjSYZ_2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3572 of file iparith.cc.

{
// see jjSYZYGY
intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
intvec *w=NULL;
tHomog hom=testHomog;
ideal I=(ideal)u->Data();
GbVariant alg=syGetAlgorithm((char*)v->Data(),currRing,I);
if (ww!=NULL)
{
if (idTestHomModule(I,currRing->qideal,ww))
{
w=ivCopy(ww);
int add_row_shift=w->min_in();
(*w)-=add_row_shift;
hom=isHomog;
}
else
{
//WarnS("wrong weights");
delete ww; ww=NULL;
hom=testHomog;
}
}
else
{
if (u->Typ()==IDEAL_CMD)
if (idHomIdeal(I,currRing->qideal))
hom=isHomog;
}
ideal S=idSyzygies(I,hom,&w,TRUE,FALSE,NULL,alg);
if (w!=NULL) delete w;
res->data = (char *)S;
if (hom==isHomog)
{
int vl=S->rank;
intvec *vv=new intvec(vl);
if ((u->Typ()==IDEAL_CMD)||(ww==NULL))
{
for(int i=0;i<vl;i++)
{
if (I->m[i]!=NULL)
(*vv)[i]=p_Deg(I->m[i],currRing);
}
}
else
{
p_SetModDeg(ww, currRing);
for(int i=0;i<vl;i++)
{
if (I->m[i]!=NULL)
(*vv)[i]=currRing->pFDeg(I->m[i],currRing);
}
p_SetModDeg(NULL, currRing);
}
if (idTestHomModule(S,currRing->qideal,vv))
atSet(res,omStrDup("isHomog"),vv,INTVEC_CMD);
else
delete vv;
}
if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
return FALSE;
}
idSyzygies
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition ideals.cc:836
p_SetModDeg
void p_SetModDeg(intvec *w, ring r)
Definition p_polys.cc:3798
p_Deg
long p_Deg(poly a, const ring r)
Definition p_polys.cc:586

## jjSYZYGY()

BOOLEAN jjSYZYGY | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5224 of file iparith.cc.

{
ideal v_id=(ideal)v->Data();
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (currRing->LPncGenCount < IDELEMS(v_id))
{
Werror("At least %d ncgen variables are needed for this computation.", IDELEMS(v_id));
return TRUE;
}
}
#endif
intvec *ww=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
intvec *w=NULL;
tHomog hom=testHomog;
if (ww!=NULL)
{
if (idTestHomModule(v_id,currRing->qideal,ww))
{
w=ivCopy(ww);
int add_row_shift=w->min_in();
(*w)-=add_row_shift;
hom=isHomog;
}
else
{
//WarnS("wrong weights");
delete ww; ww=NULL;
hom=testHomog;
}
}
else
{
if (v->Typ()==IDEAL_CMD)
if (idHomIdeal(v_id,currRing->qideal))
hom=isHomog;
}
ideal S=idSyzygies(v_id,hom,&w);
res->data = (char *)S;
if (hom==isHomog)
{
int vl=S->rank;
intvec *vv=new intvec(vl);
if ((v->Typ()==IDEAL_CMD)||(ww==NULL))
{
for(int i=0;i<vl;i++)
{
if (v_id->m[i]!=NULL)
(*vv)[i]=p_Deg(v_id->m[i],currRing);
}
}
else
{
p_SetModDeg(ww, currRing);
for(int i=0;i<vl;i++)
{
if (v_id->m[i]!=NULL)
(*vv)[i]=currRing->pFDeg(v_id->m[i],currRing);
}
p_SetModDeg(NULL, currRing);
}
if (idTestHomModule(S,currRing->qideal,vv))
atSet(res,omStrDup("isHomog"),vv,INTVEC_CMD);
else
delete vv;
}
if (w!=NULL) delete w;
return FALSE;
}

## jjTENSOR()

BOOLEAN jjTENSOR | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3644 of file iparith.cc.

{
ideal A=(ideal)u->Data();
ideal B=(ideal)v->Data();
res->data = (char *)sm_Tensor(A,B,currRing);
return FALSE;
}
sm_Tensor
ideal sm_Tensor(ideal A, ideal B, const ring r)
Definition matpol.cc:1827

## jjTENSOR_Ma()

BOOLEAN jjTENSOR_Ma | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3651 of file iparith.cc.

{
sleftv tmp_u,tmp_v,tmp_res;
int index=iiTestConvert(MATRIX_CMD,SMATRIX_CMD,dConvertTypes);
iiConvert(MATRIX_CMD,SMATRIX_CMD,index,u,&tmp_u,dConvertTypes);
iiConvert(MATRIX_CMD,SMATRIX_CMD,index,v,&tmp_v,dConvertTypes);
tmp_res.Init();
tmp_res.rtyp=SMATRIX_CMD;
BOOLEAN bo=jjTENSOR(&tmp_res,&tmp_u,&tmp_v);
if (!bo)
{
index=iiTestConvert(SMATRIX_CMD,MATRIX_CMD,dConvertTypes);
iiConvert(SMATRIX_CMD,MATRIX_CMD,index,&tmp_res,res,dConvertTypes);
}
tmp_u.CleanUp();
tmp_v.CleanUp();
tmp_res.CleanUp();
return bo;
}
jjTENSOR
static BOOLEAN jjTENSOR(leftv res, leftv u, leftv v)
Definition iparith.cc:3644
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592

## jjTEST()

BOOLEAN jjTEST | ( | leftv | ,
|  | leftv | v )

static

Definition at line 8638 of file iparith.cc.

{
do
{
if (v->Typ()!=INT_CMD)
return TRUE;
test_cmd((int)(long)v->Data());
v=v->next;
}
while (v!=NULL);
return FALSE;
}
test_cmd
void test_cmd(int i)
Definition ipshell.cc:513

## jjTIMES_BI()

BOOLEAN jjTIMES_BI | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 991 of file iparith.cc.

{
res->data = (char *)(n_Mult( (number)u->Data(), (number)v->Data(),coeffs_BIGINT));
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
n_Mult
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition coeffs.h:639

## jjTIMES_BIM()

BOOLEAN jjTIMES_BIM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1074 of file iparith.cc.

{
res->data = (char *)bimMult((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
if (res->data==NULL)
{
WerrorS("bigintmat/cmatrix not compatible");
return TRUE;
}
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}

## jjTIMES_I()

BOOLEAN jjTIMES_I | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 978 of file iparith.cc.

{
long a=(long)u->Data();
long b=(long)v->Data();
long c=(long)((unsigned long)a * (unsigned long)b);
// unsigned long has no overflow
if ((a!=0)&&(c/a!=b))
WarnS("int overflow(*), result may be wrong");
res->data = (char *)c;
if ((u->Next()!=NULL) || (v->Next()!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}

## jjTIMES_ID()

BOOLEAN jjTIMES_ID | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1055 of file iparith.cc.

{
res->data = (char *)idMult((ideal)u->Data(),(ideal)v->Data());
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
idMult
static ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition ideals.h:84

## jjTIMES_IV()

BOOLEAN jjTIMES_IV | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1062 of file iparith.cc.

{
res->data = (char *)ivMult((intvec*)(u->Data()), (intvec*)(v->Data()));
if (res->data==NULL)
{
WerrorS("intmat size not compatible");
return TRUE;
}
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
ivMult
intvec * ivMult(intvec *a, intvec *b)
Definition intvec.cc:349

## jjTIMES_MA()

BOOLEAN jjTIMES_MA | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1138 of file iparith.cc.

{
matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
res->data = (char *)mp_Mult(A,B,currRing);
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d) in *",
MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
return TRUE;
}
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
mp_Mult
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition matpol.cc:206

## jjTIMES_MA_BI1()

BOOLEAN jjTIMES_MA_BI1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1086 of file iparith.cc.

{
nMapFunc nMap=n_SetMap(coeffs_BIGINT,currRing->cf);
if (nMap==NULL) return TRUE;
number n=nMap((number)v->Data(),coeffs_BIGINT,currRing->cf);
poly p=pNSet(n);
ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
res->data = (char *)I;
return FALSE;
}
mp_MultP
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
Definition matpol.cc:141

## jjTIMES_MA_BI2()

BOOLEAN jjTIMES_MA_BI2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1096 of file iparith.cc.

{
return jjTIMES_MA_BI1(res,v,u);
}
jjTIMES_MA_BI1
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition iparith.cc:1086

## jjTIMES_MA_I1()

BOOLEAN jjTIMES_MA_I1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1129 of file iparith.cc.

{
res->data = (char *)mp_MultI((matrix)u->CopyD(MATRIX_CMD),(long)v->Data(),currRing);
return FALSE;
}
mp_MultI
matrix mp_MultI(matrix a, long f, const ring R)
c = f*a
Definition matpol.cc:128

## jjTIMES_MA_I2()

BOOLEAN jjTIMES_MA_I2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1134 of file iparith.cc.

{
return jjTIMES_MA_I1(res,v,u);
}
jjTIMES_MA_I1
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition iparith.cc:1129

## jjTIMES_MA_N1()

BOOLEAN jjTIMES_MA_N1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1118 of file iparith.cc.

{
number n=(number)v->CopyD(NUMBER_CMD);
poly p=pNSet(n);
res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
return FALSE;
}

## jjTIMES_MA_N2()

BOOLEAN jjTIMES_MA_N2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1125 of file iparith.cc.

{
return jjTIMES_MA_N1(res,v,u);
}
jjTIMES_MA_N1
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition iparith.cc:1118

## jjTIMES_MA_P1()

BOOLEAN jjTIMES_MA_P1 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1100 of file iparith.cc.

{
poly p=(poly)v->CopyD(POLY_CMD);
int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
if (r>0) I->rank=r;
res->data = (char *)I;
return FALSE;
}

## jjTIMES_MA_P2()

BOOLEAN jjTIMES_MA_P2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1109 of file iparith.cc.

{
poly p=(poly)u->CopyD(POLY_CMD);
int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
ideal I= (ideal)pMultMp(p,(matrix)v->CopyD(MATRIX_CMD),currRing);
if (r>0) I->rank=r;
res->data = (char *)I;
return FALSE;
}
pMultMp
matrix pMultMp(poly p, matrix a, const ring R)
Definition matpol.cc:158

## jjTIMES_N()

BOOLEAN jjTIMES_N | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 998 of file iparith.cc.

{
res->data = (char *)(nMult( (number)u->Data(), (number)v->Data()));
number n=(number)res->data;
nNormalize(n);
res->data=(char *)n;
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
nMult
#define nMult(n1, n2)
Definition numbers.h:17

## jjTIMES_P()

BOOLEAN jjTIMES_P | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1008 of file iparith.cc.

{
poly a;
poly b;
if (v->next==NULL)
{
if (u->next==NULL)
{
a=(poly)u->Data(); // works also for VECTOR_CMD
b=(poly)v->Data(); // works also for VECTOR_CMD
if (!rIsLPRing(currRing)
&& (a!=NULL) && (b!=NULL)
&& ((long)pTotaldegree(a)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)-(long)pTotaldegree(b)))
{
Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
}
res->data = (char *)(pp_Mult_qq( a, b, currRing));
return FALSE;
}
// u->next exists: copy v
a=(poly)u->CopyD(POLY_CMD); // works also for VECTOR_CMD
b=pCopy((poly)v->Data());
if (!rIsLPRing(currRing)
&& (a!=NULL) && (b!=NULL)
&& (pTotaldegree(a)+pTotaldegree(b)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)))
{
Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
}
res->data = (char *)(pMult( a, b));
return jjOP_REST(res,u,v);
}
// v->next exists: copy u
a=pCopy((poly)u->Data());
b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
if ((a!=NULL) && (b!=NULL)
&& ((unsigned long)(pTotaldegree(a)+pTotaldegree(b))>=currRing->bitmask/2))
{
pDelete(&a);
pDelete(&b);
WerrorS("OVERFLOW");
return TRUE;
}
res->data = (char *)(pMult( a, b));
return jjOP_REST(res,u,v);
}
pp_Mult_qq
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition p_polys.h:1167

## jjTIMES_SM()

BOOLEAN jjTIMES_SM | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 1152 of file iparith.cc.

{
ideal A=(ideal)u->Data(); ideal B=(ideal)v->Data();
res->data = (char *)sm_Mult(A,B,currRing);
if (res->data==NULL)
{
Werror("matrix size not compatible(%dx%d, %dx%d) in *",
(int)A->rank,IDELEMS(A),(int)B->rank,IDELEMS(B));
return TRUE;
}
if ((v->next!=NULL) || (u->next!=NULL))
return jjOP_REST(res,u,v);
return FALSE;
}
sm_Mult
ideal sm_Mult(ideal a, ideal b, const ring R)
Definition matpol.cc:1887

## jjTRACE_IV()

BOOLEAN jjTRACE_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5295 of file iparith.cc.

{
res->data = (char *)(long)ivTrace((intvec*)(v->Data()));
return FALSE;
}
ivTrace
int ivTrace(intvec *o)
Definition intvec.cc:339

## jjTRANSP_BIM()

BOOLEAN jjTRANSP_BIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5300 of file iparith.cc.

{
res->data = (char *)(((bigintmat*)(v->Data()))->transpose());
return FALSE;
}

## jjTRANSP_IV()

BOOLEAN jjTRANSP_IV | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5305 of file iparith.cc.

{
res->data = (char *)ivTranp((intvec*)(v->Data()));
return FALSE;
}
ivTranp
intvec * ivTranp(intvec *o)
Definition intvec.cc:327

## jjTWOSTD()

BOOLEAN jjTWOSTD | ( | leftv | res,
|  | leftv | a )

static

Definition at line 5344 of file iparith.cc.

{
#ifdef HAVE_PLURAL
ideal result;
ideal v_id=(ideal)a->Data();
if (rIsPluralRing(currRing))
result=(ideal)twostd(v_id);
else /*commutative or shiftalgebra*/
{
return jjSTD(res,a);
}
res->data = (char *)result;
setFlag(res,FLAG_STD);
setFlag(res,FLAG_TWOSTD);
return FALSE;
#else
return TRUE;
#endif
}
FLAG_TWOSTD
#define FLAG_TWOSTD
Definition ipid.h:107
twostd
ideal twostd(ideal I)
Compute two-sided GB:
Definition nc.cc:18

## jjTYPEOF()

BOOLEAN jjTYPEOF | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5426 of file iparith.cc.

{
int t=(int)(long)v->data;
switch (t)
{
case CRING_CMD:
case INT_CMD:
case POLY_CMD:
case VECTOR_CMD:
case STRING_CMD:
case INTVEC_CMD:
case IDEAL_CMD:
case MATRIX_CMD:
case MODUL_CMD:
case MAP_CMD:
case PROC_CMD:
case RING_CMD:
case SMATRIX_CMD:
//case QRING_CMD:
case INTMAT_CMD:
case BIGINTMAT_CMD:
case BIGINTVEC_CMD:
case NUMBER_CMD:
#ifdef SINGULAR_4_2
case CNUMBER_CMD:
#endif
case BIGINT_CMD:
case BUCKET_CMD:
case LIST_CMD:
case PACKAGE_CMD:
case LINK_CMD:
case RESOLUTION_CMD:
#ifdef HTABLE
case HTABLE_CMD:
#endif
res->data=omStrDup(Tok2Cmdname(t)); break;
case DEF_CMD:
case NONE: res->data=omStrDup("none"); break;
default:
{
if (t>MAX_TOK)
res->data=omStrDup(getBlackboxName(t));
else
res->data=omStrDup("?unknown type?");
break;
}
}
return FALSE;
}
getBlackboxName
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition blackbox.cc:213
CNUMBER_CMD
@ CNUMBER_CMD
Definition tok.h:47

## jjUMINUS_BI()

BOOLEAN jjUMINUS_BI | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3810 of file iparith.cc.

{
number n=(number)u->CopyD(BIGINT_CMD);
n=n_InpNeg(n,coeffs_BIGINT);
res->data = (char *)n;
return FALSE;
}
n_InpNeg
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
Definition coeffs.h:560

## jjUMINUS_BIM()

BOOLEAN jjUMINUS_BIM | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3847 of file iparith.cc.

{
bigintmat *bim=(bigintmat *)u->CopyD(BIGINTMAT_CMD);
(*bim)*=(-1);
res->data = (char *)bim;
return FALSE;
}

## jjUMINUS_I()

BOOLEAN jjUMINUS_I | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3817 of file iparith.cc.

{
res->data = (char *)(-(long)u->Data());
return FALSE;
}

## jjUMINUS_IV()

BOOLEAN jjUMINUS_IV | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3840 of file iparith.cc.

{
intvec *iv=(intvec *)u->CopyD(INTVEC_CMD);
(*iv)*=(-1);
res->data = (char *)iv;
return FALSE;
}

## jjUMINUS_MA()

BOOLEAN jjUMINUS_MA | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3834 of file iparith.cc.

{
poly m1=pISet(-1);
res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),m1,currRing);
return FALSE;
}
pISet
#define pISet(i)
Definition polys.h:313

## jjUMINUS_N()

BOOLEAN jjUMINUS_N | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3822 of file iparith.cc.

{
number n=(number)u->CopyD(NUMBER_CMD);
n=nInpNeg(n);
res->data = (char *)n;
return FALSE;
}
nInpNeg
#define nInpNeg(n)
Definition numbers.h:21

## jjUMINUS_P()

BOOLEAN jjUMINUS_P | ( | leftv | res,
|  | leftv | u )

static

Definition at line 3829 of file iparith.cc.

{
res->data = (char *)pNeg((poly)u->CopyD(POLY_CMD));
return FALSE;
}

## jjUNIQLIST()

BOOLEAN jjUNIQLIST | ( | leftv | ,
|  | leftv | arg )

Definition at line 10497 of file iparith.cc.

{
lists l=(lists)arg->Data();
if (l->nr>0)
{
qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
int i, j, len;
len=l->nr;
i=0;
while(i<len)
{
if(jjCOMPARE_ALL(&(l->m[i]),&(l->m[i+1]))==0)
{
l->m[i].CleanUp();
for(j=i; j<len;j++) l->m[j]=l->m[j+1];
l->m[len].Init();
l->m[len].rtyp=DEF_CMD;
len--;
}
else
i++;
}
//Print("new len:%d\n",len);
}
return FALSE;
}

## jjUNIVARIATE()

BOOLEAN jjUNIVARIATE | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5475 of file iparith.cc.

{
res->data=(char *)(long)pIsUnivariate((poly)v->Data());
return FALSE;
}
pIsUnivariate
#define pIsUnivariate(p)
Definition polys.h:250

## jjVAR1()

BOOLEAN jjVAR1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5480 of file iparith.cc.

{
int i=(int)(long)v->Data();
if ((0<i) && (i<=currRing->N))
{
poly p=pOne();
pSetExp(p,i,1);
pSetm(p);
res->data=(char *)p;
}
else
{
Werror("var number %d out of range 1..%d",i,currRing->N);
return TRUE;
}
return FALSE;
}

## jjVARSTR1()

BOOLEAN jjVARSTR1 | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5497 of file iparith.cc.

{
if (currRing==NULL)
{
WerrorS("no ring active (2)");
return TRUE;
}
int i=(int)(long)v->Data();
if ((0<i) && (i<=currRing->N))
res->data=omStrDup(currRing->names[i-1]);
else
{
Werror("var number %d out of range 1..%d",i,currRing->N);
return TRUE;
}
return FALSE;
}

## jjVARSTR2()

BOOLEAN jjVARSTR2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3670 of file iparith.cc.

{
idhdl h=(idhdl)u->data;
int i=(int)(long)v->Data();
if ((0<i) && (i<=IDRING(h)->N))
res->data=omStrDup(IDRING(h)->names[i-1]);
else
{
Werror("var number %d out of range 1..%d",i,IDRING(h)->N);
return TRUE;
}
return FALSE;
}

## jjVDIM()

BOOLEAN jjVDIM | ( | leftv | res,
|  | leftv | v )

static

Definition at line 5514 of file iparith.cc.

{
assumeStdFlag(v);
#ifdef HAVE_SHIFTBBA
if (rIsLPRing(currRing))
{
if (rField_is_Ring(currRing))
{
WerrorS("`vdim` is not implemented for letterplace rings over rings");
return TRUE;
}
if (currRing->qideal != NULL)
{
WerrorS("qring not supported by `vdim` for letterplace rings at the moment");
return TRUE;
}
int kDim = lp_kDim((ideal)(v->Data()));
res->data = (char *)(long)kDim;
return (kDim == -2);
}
#endif
long l=scMult0Int((ideal)v->Data(),currRing->qideal);
if (l<-1L)
WerrorS("int overflow in vdim");
res->data = (char *)l;
return FALSE;
}
scMult0Int
long scMult0Int(ideal S, ideal Q)
Definition hdegree.cc:924
lp_kDim
int lp_kDim(const ideal _G)
Definition hdegree.cc:2081

## jjWAIT1ST1()

BOOLEAN jjWAIT1ST1 | ( | leftv | res,
|  | leftv | u )

Definition at line 5541 of file iparith.cc.

{
// input: u: a list with links of type
// ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
// returns: -1: the read state of all links is eof or error
// i>0: (at least) u[i] is ready
lists L = (lists)u->Data();
int i = slStatusSsiL(L, -1);
if(i == -2) /* error */
{
return TRUE;
}
res->data = (void*)(long)i;
return FALSE;
}

## jjWAIT1ST2()

BOOLEAN jjWAIT1ST2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3683 of file iparith.cc.

{
// input: u: a list with links of type
// ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
// v: timeout for select in milliseconds
// or 0 for polling
// returns: ERROR (via Werror): timeout negative
// -1: the read state of all links is eof
// 0: timeout (or polling): none ready
// i>0: (at least) L[i] is ready
lists L = (lists)u->Data();
int t = (int)(long)v->Data();
if(t < 0)
{
t= -1;
}
int i = slStatusSsiL(L, t);
if(i == -2) /* error */
{
return TRUE;
}
res->data = (void*)(long)i;
return FALSE;
}

## jjWAITALL1()

BOOLEAN jjWAITALL1 | ( | leftv | res,
|  | leftv | u )

Definition at line 5556 of file iparith.cc.

{
// input: u: a list with links of type
// ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
// returns: -1: the read state of all links is eof or error
// 1: all links are ready
// (caution: at least one is ready, but some maybe dead)
lists L = (lists)u->Data();
int i;
int j = -1;
BOOLEAN* ignore=(BOOLEAN*)omAlloc0((L->nr+1)*sizeof(BOOLEAN));
for(int nfinished = 0; nfinished <= L->nr; nfinished++)
{
i = slStatusSsiL(L, -1, ignore);
if(i == -2) /* error */
{
omFreeSize(ignore,(L->nr+1)*sizeof(BOOLEAN));
return TRUE;
}
if((i == -1)||(j==0))
{
j=-1;
break;
}
if (i>0)
{
j=1;
ignore[i-1]=TRUE;
}
}
omFreeSize(ignore,(L->nr+1)*sizeof(BOOLEAN));
res->data = (void*)(long)j;
return FALSE;
}

## jjWAITALL2()

BOOLEAN jjWAITALL2 | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3707 of file iparith.cc.

{
// input: u: a list with links of type
// ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
// v: timeout for select in milliseconds
// or 0 for polling
// or -1 for infinite
// returns: ERROR (via Werror): timeout negative
// -1: the read state of all links is eof or error
// 0: timeout (or polling): none ready
// 1: all links are ready
// (caution: at least one is ready, but some maybe dead)
lists L = (lists)u->Data();
BOOLEAN* ignore=(BOOLEAN*)omAlloc0((L->nr+1)*sizeof(BOOLEAN));
int timeout = (int)(long)v->Data();
if(timeout < 0)
{
timeout=-1;
}
int t = getRTimer()/TIMER_RESOLUTION; // in seconds
int i;
int ret = -1;
for(unsigned nfinished = 0; nfinished <= ((unsigned)L->nr); nfinished++)
{
i = slStatusSsiL(L, timeout, ignore);
if(i > 0) /* L[i] is ready */
{
ret = 1;
ignore[i-1]=TRUE;
timeout = si_max(0,timeout - 1000*(getRTimer()/TIMER_RESOLUTION - t));
}
else /* terminate the for loop */
{
omFreeSize(ignore,(L->nr+1)*sizeof(BOOLEAN));
if(i == -2) /* error */
{
return TRUE;
}
if(i == 0) /* timeout */
{
ret = 0;
}
break;
}
}
res->data = (void*)(long)ret;
return FALSE;
}
TIMER_RESOLUTION
#define TIMER_RESOLUTION
Definition mod2.h:35
getRTimer
int getRTimer()
Definition timer.cc:150

## jjWEDGE()

BOOLEAN jjWEDGE | ( | leftv | res,
|  | leftv | u,
|  | leftv | v )

static

Definition at line 3755 of file iparith.cc.

{
res->data = (char *)mp_Wedge((matrix)u->Data(),(int)(long)v->Data(),currRing);
return FALSE;
}
mp_Wedge
matrix mp_Wedge(matrix a, int ar, const ring R)
Definition matpol.cc:1745

## jjWRONG()

BOOLEAN jjWRONG | ( | leftv | ,
|  | leftv | )

static

Definition at line 3760 of file iparith.cc.

{
return TRUE;
}

## jjWRONG2()

BOOLEAN jjWRONG2 | ( | leftv | ,
|  | leftv | ,
|  | leftv | )

static

Definition at line 3764 of file iparith.cc.

{
return TRUE;
}

## jjWRONG3()

BOOLEAN jjWRONG3 | ( | leftv | ,
|  | leftv | ,
|  | leftv | ,
|  | leftv | )

static

Definition at line 3768 of file iparith.cc.

{
return TRUE;
}

## Tok2Cmdname()

const char * Tok2Cmdname | ( | int | tok | ) |

Definition at line 9897 of file iparith.cc.

{
if (tok <= 0)
{
return sArithBase.sCmds[0].name;
}
if (tok==ANY_TYPE) return "any_type";
if (tok==COMMAND) return "command";
if (tok==NONE) return "nothing";
if (tok < 128)
{
Tok2Cmdname_buf[0]=(char)tok;
return Tok2Cmdname_buf;
}
//if (tok==IFBREAK) return "if_break";
//if (tok==VECTOR_FROM_POLYS) return "vector_from_polys";
//if (tok==ORDER_VECTOR) return "ordering";
//if (tok==REF_VAR) return "ref";
//if (tok==OBJECT) return "object";
//if (tok==PRINT_EXPR) return "print_expr";
if (tok==IDHDL) return "identifier";
if (tok>MAX_TOK) return getBlackboxName(tok);
unsigned i;
for(i=0; i<sArithBase.nCmdUsed; i++)
//while (sArithBase.sCmds[i].tokval!=0)
{
if ((sArithBase.sCmds[i].tokval == tok)&&
(sArithBase.sCmds[i].alias==0))
{
return sArithBase.sCmds[i].name;
}
}
// try gain for alias/old names:
for(i=0; i<sArithBase.nCmdUsed; i++)
{
if (sArithBase.sCmds[i].tokval == tok)
{
return sArithBase.sCmds[i].name;
}
}
return sArithBase.sCmds[0].name;
}
Tok2Cmdname_buf
STATIC_VAR si_char_2 Tok2Cmdname_buf
Definition iparith.cc:9896
ANY_TYPE
#define ANY_TYPE
Definition tok.h:30

## WerrorS_dummy()

void WerrorS_dummy | ( | const char * |  | ) |

static

Definition at line 5663 of file iparith.cc.

{
WerrorS_dummy_cnt++;
}

## Variable Documentation

## all_farey

long all_farey =0L

Definition at line 8 of file iparith.cc.

## cmdtok

EXTERN_VAR int cmdtok

Definition at line 214 of file iparith.cc.

## expected_parms

EXTERN_VAR BOOLEAN expected_parms

Definition at line 215 of file iparith.cc.

## farey_cnt

long farey_cnt =0L

Definition at line 9 of file iparith.cc.

## iiOp

VAR int iiOp

Definition at line 219 of file iparith.cc.

## sArithBase

STATIC_VAR SArithBase sArithBase

Base entry for arithmetic.

Definition at line 198 of file iparith.cc.

## singclap_factorize_retry

EXTERN_VAR int singclap_factorize_retry

Definition at line 2064 of file iparith.cc.

## Tok2Cmdname_buf

STATIC_VAR si_char_2 Tok2Cmdname_buf =" "

Definition at line 9896 of file iparith.cc.

## WerrorS_dummy_cnt

STATIC_VAR int WerrorS_dummy_cnt =0

Definition at line 5662 of file iparith.cc.