Data Structures | Macros | Typedefs | Functions | Variables
iparith.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.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 <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/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/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/fglm.h>
#include <Singular/blackbox.h>
#include <Singular/newstruct.h>
#include <Singular/ipshell.h>
#include <reporter/si_signals.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <vector>
#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 PLURAL_MASK   3
 
#define RING_MASK   4
 
#define ZERODIVISOR_MASK   8
 
#define ALLOW_PLURAL   1
 
#define NO_PLURAL   0
 
#define COMM_PLURAL   2
 
#define ALLOW_RING   4
 
#define NO_RING   0
 
#define NO_ZERODIVISOR   8
 
#define ALLOW_ZERODIVISOR   0
 
#define ALLOW_ZZ   (ALLOW_RING|NO_ZERODIVISOR)
 
#define WARN_RING   16
 
#define NO_CONVERSION   32
 
#define ii_div_by_0   "div. by 0"
 
#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 jjWRONG2   (proc2)jjWRONG
 
#define jjWRONG3   (proc3)jjWRONG
 
#define D(A)   (A)
 
#define NULL_VAL   NULL
 
#define IPARITH
 

Typedefs

typedef sValCmdTab jjValCmdTab[]
 
typedef BOOLEAN(* proc2) (leftv, leftv, leftv)
 
typedef BOOLEAN(* proc3) (leftv, leftv, leftv, leftv)
 

Functions

ring rCompose (const lists L, const BOOLEAN check_comp=TRUE)
 
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 More...
 
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)
 
poly pHeadProc (poly p)
 
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_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_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_P (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 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 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_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_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 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 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 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 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 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 jjOPPOSE (leftv res, leftv a, leftv b)
 
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 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 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 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 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 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_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 NOTE: the input number is normalized as a side effect. More...
 
static BOOLEAN jjNUMERATOR (leftv res, leftv v)
 Return the numerator of the input number NOTE: the input number is normalized as a side effect. More...
 
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 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 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 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 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 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 More...
 
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_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_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 jjHOMOG_ID_W (leftv res, leftv u, leftv v, leftv)
 
static BOOLEAN jjHOMOG_P_W (leftv res, leftv u, leftv v, leftv)
 
static BOOLEAN jjINTMAT3 (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 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_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 jjLIFT3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjLIFTSTD3 (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 jjJET4 (leftv res, leftv u)
 
static BOOLEAN jjKLAMMER_PL (leftv res, leftv u)
 
BOOLEAN jjLIST_PL (leftv res, leftv v)
 
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 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 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 More...
 
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 More...
 
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 More...
 
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 More...
 
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

static SArithBase sArithBase
 Base entry for arithmetic. More...
 
int cmdtok
 
BOOLEAN expected_parms
 
int iiOp
 
int singclap_factorize_retry
 
static int WerrorS_dummy_cnt =0
 

Data Structure Documentation

◆ sValCmdTab

struct sValCmdTab

Definition at line 129 of file iparith.cc.

Data Fields
short cmd
short start

◆ _scmdnames

struct _scmdnames

Definition at line 51 of file gentable.cc.

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

◆ sValCmd1

struct sValCmd1

Definition at line 70 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 61 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 78 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 88 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 186 of file iparith.cc.

Data Fields
unsigned nCmdAllocated number of commands-slots allocated
unsigned nCmdUsed number of commands used
unsigned nLastIdentifier valid indentifieres 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_PLURAL

#define ALLOW_PLURAL   1

Definition at line 110 of file iparith.cc.

◆ ALLOW_RING

#define ALLOW_RING   4

Definition at line 113 of file iparith.cc.

◆ ALLOW_ZERODIVISOR

#define ALLOW_ZERODIVISOR   0

Definition at line 116 of file iparith.cc.

◆ ALLOW_ZZ

#define ALLOW_ZZ   (ALLOW_RING|NO_ZERODIVISOR)

Definition at line 118 of file iparith.cc.

◆ COMM_PLURAL

#define COMM_PLURAL   2

Definition at line 112 of file iparith.cc.

◆ D

#define D (   A)    (A)

Definition at line 7841 of file iparith.cc.

◆ ii_div_by_0

#define ii_div_by_0   "div. by 0"

Definition at line 222 of file iparith.cc.

◆ IPARITH

#define IPARITH

Definition at line 7843 of file iparith.cc.

◆ jjWRONG2

#define jjWRONG2   (proc2)jjWRONG

Definition at line 3471 of file iparith.cc.

◆ jjWRONG3

#define jjWRONG3   (proc3)jjWRONG

Definition at line 3472 of file iparith.cc.

◆ NO_CONVERSION

#define NO_CONVERSION   32

Definition at line 124 of file iparith.cc.

◆ NO_PLURAL

#define NO_PLURAL   0

Definition at line 111 of file iparith.cc.

◆ NO_RING

#define NO_RING   0

Definition at line 114 of file iparith.cc.

◆ NO_ZERODIVISOR

#define NO_ZERODIVISOR   8

Definition at line 115 of file iparith.cc.

◆ NULL_VAL

#define NULL_VAL   NULL

Definition at line 7842 of file iparith.cc.

◆ PLURAL_MASK

#define PLURAL_MASK   3

Definition at line 98 of file iparith.cc.

◆ RING_MASK

#define RING_MASK   4

Definition at line 104 of file iparith.cc.

◆ SIMPL_EQU

#define SIMPL_EQU   4

Definition at line 3159 of file iparith.cc.

◆ SIMPL_LMDIV

#define SIMPL_LMDIV   32

Definition at line 3156 of file iparith.cc.

◆ SIMPL_LMEQ

#define SIMPL_LMEQ   16

Definition at line 3157 of file iparith.cc.

◆ SIMPL_MULT

#define SIMPL_MULT   8

Definition at line 3158 of file iparith.cc.

◆ SIMPL_NORM

#define SIMPL_NORM   1

Definition at line 3161 of file iparith.cc.

◆ SIMPL_NULL

#define SIMPL_NULL   2

Definition at line 3160 of file iparith.cc.

◆ WARN_RING

#define WARN_RING   16

Definition at line 122 of file iparith.cc.

◆ ZERODIVISOR_MASK

#define ZERODIVISOR_MASK   8

Definition at line 105 of file iparith.cc.

Typedef Documentation

◆ jjValCmdTab

typedef sValCmdTab jjValCmdTab[]

Definition at line 135 of file iparith.cc.

◆ proc2

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

Definition at line 155 of file iparith.cc.

◆ proc3

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

Definition at line 166 of file iparith.cc.

Function Documentation

◆ _gentable_sort_cmds()

static 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 8799 of file iparith.cc.

8800 {
8801  cmdnames *pCmdL = (cmdnames*)a;
8802  cmdnames *pCmdR = (cmdnames*)b;
8803 
8804  if(a==NULL || b==NULL) return 0;
8805 
8806  /* empty entries goes to the end of the list for later reuse */
8807  if(pCmdL->name==NULL) return 1;
8808  if(pCmdR->name==NULL) return -1;
8809 
8810  /* $INVALID$ must come first */
8811  if(strcmp(pCmdL->name, "$INVALID$")==0) return -1;
8812  if(strcmp(pCmdR->name, "$INVALID$")==0) return 1;
8813 
8814  /* tokval=-1 are reserved names at the end */
8815  if (pCmdL->tokval==-1)
8816  {
8817  if (pCmdR->tokval==-1)
8818  return strcmp(pCmdL->name, pCmdR->name);
8819  /* pCmdL->tokval==-1, pCmdL goes at the end */
8820  return 1;
8821  }
8822  /* pCmdR->tokval==-1, pCmdR goes at the end */
8823  if(pCmdR->tokval==-1) return -1;
8824 
8825  return strcmp(pCmdL->name, pCmdR->name);
8826 }
const poly a
Definition: syzextra.cc:212
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213

◆ check_valid()

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

Definition at line 9025 of file iparith.cc.

9026 {
9027  #ifdef HAVE_PLURAL
9028  if (rIsPluralRing(currRing))
9029  {
9030  if ((p & PLURAL_MASK)==0 /*NO_PLURAL*/)
9031  {
9032  WerrorS("not implemented for non-commutative rings");
9033  return TRUE;
9034  }
9035  else if ((p & PLURAL_MASK)==2 /*, COMM_PLURAL */)
9036  {
9037  Warn("assume commutative subalgebra for cmd `%s`",Tok2Cmdname(op));
9038  return FALSE;
9039  }
9040  /* else, ALLOW_PLURAL */
9041  }
9042  #endif
9043 #ifdef HAVE_RINGS
9044  if (rField_is_Ring(currRing))
9045  {
9046  if ((p & RING_MASK)==0 /*NO_RING*/)
9047  {
9048  WerrorS("not implemented for rings with rings as coeffients");
9049  return TRUE;
9050  }
9051  /* else ALLOW_RING */
9052  else if (((p & ZERODIVISOR_MASK)==NO_ZERODIVISOR)
9053  &&(!rField_is_Domain(currRing)))
9054  {
9055  WerrorS("domain required as coeffients");
9056  return TRUE;
9057  }
9058  /* else ALLOW_ZERODIVISOR */
9059  else if(((p & WARN_RING)==WARN_RING)&&(myynest==0))
9060  {
9061  WarnS("considering the image in Q[...]");
9062  }
9063  }
9064 #endif
9065  return FALSE;
9066 }
#define WARN_RING
Definition: iparith.cc:122
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
#define PLURAL_MASK
Definition: iparith.cc:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define ZERODIVISOR_MASK
Definition: iparith.cc:105
#define NO_ZERODIVISOR
Definition: iparith.cc:115
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define RING_MASK
Definition: iparith.cc:104
#define Warn
Definition: emacs.cc:80

◆ iiArithAddCmd()

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

Definition at line 8966 of file iparith.cc.

8973 {
8974  //printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
8975  // nTokval, nToktype, nPos);
8976  if(nPos>=0)
8977  {
8978  // no checks: we rely on a correct generated code in iparith.inc
8979  assume((unsigned)nPos < sArithBase.nCmdAllocated);
8980  assume(szName!=NULL);
8981  sArithBase.sCmds[nPos].name = omStrDup(szName);
8982  sArithBase.sCmds[nPos].alias = nAlias;
8983  sArithBase.sCmds[nPos].tokval = nTokval;
8984  sArithBase.sCmds[nPos].toktype = nToktype;
8985  sArithBase.nCmdUsed++;
8986  //if(nTokval>0) sArithBase.nLastIdentifier++;
8987  }
8988  else
8989  {
8990  if(szName==NULL) return -1;
8991  int nIndex = iiArithFindCmd(szName);
8992  if(nIndex>=0)
8993  {
8994  Print("'%s' already exists at %d\n", szName, nIndex);
8995  return -1;
8996  }
8997 
8999  {
9000  /* needs to create new slots */
9001  unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
9002  sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
9003  if(sArithBase.sCmds==NULL) return -1;
9005  }
9006  /* still free slots available */
9007  sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
9008  sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
9009  sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
9010  sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
9011  sArithBase.nCmdUsed++;
9012 
9013  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9014  (&_gentable_sort_cmds));
9017  {
9018  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9019  }
9020  //Print("L=%d\n", sArithBase.nLastIdentifier);
9021  }
9022  return 0;
9023 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8799
#define Print
Definition: emacs.cc:83
unsigned nCmdAllocated
number of commands-slots allocated
Definition: iparith.cc:194
#define assume(x)
Definition: mod2.h:394
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:195
#define NULL
Definition: omList.c:10
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
#define nSize(n)
Definition: numbers.h:39
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:8871
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188
#define omRealloc(addr, size)
Definition: omAllocDecl.h:225
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ iiArithFindCmd()

int iiArithFindCmd ( const char *  szName)

Definition at line 8871 of file iparith.cc.

8872 {
8873  int an=0;
8874  int i = 0,v = 0;
8875  int en=sArithBase.nLastIdentifier;
8876 
8877  loop
8878  //for(an=0; an<sArithBase.nCmdUsed; )
8879  {
8880  if(an>=en-1)
8881  {
8882  if (strcmp(szName, sArithBase.sCmds[an].name) == 0)
8883  {
8884  //Print("RET-an=%d %s\n", an, sArithBase.sCmds[an].name);
8885  return an;
8886  }
8887  else if (strcmp(szName, sArithBase.sCmds[en].name) == 0)
8888  {
8889  //Print("RET-en=%d %s\n", en, sArithBase.sCmds[en].name);
8890  return en;
8891  }
8892  else
8893  {
8894  //Print("RET- 1\n");
8895  return -1;
8896  }
8897  }
8898  i=(an+en)/2;
8899  if (*szName < *(sArithBase.sCmds[i].name))
8900  {
8901  en=i-1;
8902  }
8903  else if (*szName > *(sArithBase.sCmds[i].name))
8904  {
8905  an=i+1;
8906  }
8907  else
8908  {
8909  v=strcmp(szName,sArithBase.sCmds[i].name);
8910  if(v<0)
8911  {
8912  en=i-1;
8913  }
8914  else if(v>0)
8915  {
8916  an=i+1;
8917  }
8918  else /*v==0*/
8919  {
8920  //Print("RET-i=%d %s\n", i, sArithBase.sCmds[i].name);
8921  return i;
8922  }
8923  }
8924  }
8925  //if(i>=0 && i<sArithBase.nCmdUsed)
8926  // return i;
8927  //PrintS("RET-2\n");
8928  return -2;
8929 }
loop
Definition: myNF.cc:98
int i
Definition: cfEzgcd.cc:123
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:195
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ iiArithGetCmd()

char* iiArithGetCmd ( int  nPos)

Definition at line 8931 of file iparith.cc.

8932 {
8933  if(nPos<0) return NULL;
8934  if(nPos<(int)sArithBase.nCmdUsed)
8935  return sArithBase.sCmds[nPos].name;
8936  return NULL;
8937 }
#define NULL
Definition: omList.c:10
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ iiArithRemoveCmd() [1/2]

int iiArithRemoveCmd ( char *  szName)

◆ iiArithRemoveCmd() [2/2]

int iiArithRemoveCmd ( const char *  szName)

Definition at line 8939 of file iparith.cc.

8940 {
8941  int nIndex;
8942  if(szName==NULL) return -1;
8943 
8944  nIndex = iiArithFindCmd(szName);
8945  if(nIndex<0 || nIndex>=(int)sArithBase.nCmdUsed)
8946  {
8947  Print("'%s' not found (%d)\n", szName, nIndex);
8948  return -1;
8949  }
8950  omFree(sArithBase.sCmds[nIndex].name);
8951  sArithBase.sCmds[nIndex].name=NULL;
8952  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
8953  (&_gentable_sort_cmds));
8954  sArithBase.nCmdUsed--;
8955 
8956  /* fix last-identifier */
8959  {
8960  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
8961  }
8962  //Print("L=%d\n", sArithBase.nLastIdentifier);
8963  return 0;
8964 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8799
#define Print
Definition: emacs.cc:83
#define omFree(addr)
Definition: omAllocDecl.h:261
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:195
#define NULL
Definition: omList.c:10
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:8871
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ iiExprArith1()

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

Definition at line 8215 of file iparith.cc.

8216 {
8217  memset(res,0,sizeof(sleftv));
8218 
8219  if (!errorreported)
8220  {
8221 #ifdef SIQ
8222  if (siq>0)
8223  {
8224  //Print("siq:%d\n",siq);
8226  memcpy(&d->arg1,a,sizeof(sleftv));
8227  a->Init();
8228  d->op=op;
8229  d->argc=1;
8230  res->data=(char *)d;
8231  res->rtyp=COMMAND;
8232  return FALSE;
8233  }
8234 #endif
8235  int at=a->Typ();
8236  // handling bb-objects ----------------------------------------------------
8237  if(op>MAX_TOK) // explicit type conversion to bb
8238  {
8239  blackbox *bb=getBlackboxStuff(op);
8240  if (bb!=NULL)
8241  {
8242  res->rtyp=op;
8243  res->data=bb->blackbox_Init(bb);
8244  if(!bb->blackbox_Assign(res,a)) return FALSE;
8245  if (errorreported) return TRUE;
8246  }
8247  else return TRUE;
8248  }
8249  else if (at>MAX_TOK) // argument is of bb-type
8250  {
8251  blackbox *bb=getBlackboxStuff(at);
8252  if (bb!=NULL)
8253  {
8254  if(!bb->blackbox_Op1(op,res,a)) return FALSE;
8255  if (errorreported) return TRUE;
8256  // else: no op defined
8257  }
8258  else return TRUE;
8259  }
8260 
8261  iiOp=op;
8262  int i=iiTabIndex(dArithTab1,JJTAB1LEN,op);
8263  return iiExprArith1Tab(res,a,op, dArith1+i,at,dConvertTypes);
8264  }
8265  a->CleanUp();
8266  return TRUE;
8267 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:57
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:108
int Typ()
Definition: subexpr.cc:995
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8727
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
omBin sip_command_bin
Definition: ipid.cc:49
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
const struct sValCmd1 dArith1[]
Definition: table.h:19
int iiOp
Definition: iparith.cc:224
BOOLEAN iiExprArith1Tab(leftv res, leftv a, int op, const struct sValCmd1 *dA1, int at, const struct sConvertTypes *dConvertTypes)
apply an operation &#39;op&#39; to an argument a return TRUE on failure
Definition: iparith.cc:8084
#define COMMAND
Definition: tok.h:29
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16

◆ iiExprArith1Tab()

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

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

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

Definition at line 8084 of file iparith.cc.

8085 {
8086  memset(res,0,sizeof(sleftv));
8087  BOOLEAN call_failed=FALSE;
8088 
8089  if (!errorreported)
8090  {
8091  BOOLEAN failed=FALSE;
8092  iiOp=op;
8093  int i = 0;
8094  while (dA1[i].cmd==op)
8095  {
8096  if (at==dA1[i].arg)
8097  {
8098  if (currRing!=NULL)
8099  {
8100  if (check_valid(dA1[i].valid_for,op)) break;
8101  }
8102  else
8103  {
8104  if (RingDependend(dA1[i].res))
8105  {
8106  WerrorS("no ring active");
8107  break;
8108  }
8109  }
8110  if (traceit&TRACE_CALL)
8111  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
8112  res->rtyp=dA1[i].res;
8113  if ((call_failed=dA1[i].p(res,a)))
8114  {
8115  break;// leave loop, goto error handling
8116  }
8117  if (a->Next()!=NULL)
8118  {
8120  failed=iiExprArith1(res->next,a->next,op);
8121  }
8122  a->CleanUp();
8123  return failed;
8124  }
8125  i++;
8126  }
8127  // implicite type conversion --------------------------------------------
8128  if (dA1[i].cmd!=op)
8129  {
8131  i=0;
8132  //Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
8133  while (dA1[i].cmd==op)
8134  {
8135  int ai;
8136  //Print("test %s\n",Tok2Cmdname(dA1[i].arg));
8137  if ((dA1[i].valid_for & NO_CONVERSION)==0)
8138  {
8139  if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
8140  {
8141  if (currRing!=NULL)
8142  {
8143  if (check_valid(dA1[i].valid_for,op)) break;
8144  }
8145  else
8146  {
8147  if (RingDependend(dA1[i].res))
8148  {
8149  WerrorS("no ring active");
8150  break;
8151  }
8152  }
8153  if (traceit&TRACE_CALL)
8154  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
8155  res->rtyp=dA1[i].res;
8156  failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
8157  || (call_failed=dA1[i].p(res,an)));
8158  // everything done, clean up temp. variables
8159  if (failed)
8160  {
8161  // leave loop, goto error handling
8162  break;
8163  }
8164  else
8165  {
8166  if (an->Next() != NULL)
8167  {
8168  res->next = (leftv)omAllocBin(sleftv_bin);
8169  failed=iiExprArith1(res->next,an->next,op);
8170  }
8171  // everything ok, clean up and return
8172  an->CleanUp();
8174  a->CleanUp();
8175  return failed;
8176  }
8177  }
8178  }
8179  i++;
8180  }
8181  an->CleanUp();
8183  }
8184  // error handling
8185  if (!errorreported)
8186  {
8187  if ((at==0) && (a->Fullname()!=sNoName_fe))
8188  {
8189  Werror("`%s` is not defined",a->Fullname());
8190  }
8191  else
8192  {
8193  i=0;
8194  const char *s = iiTwoOps(op);
8195  Werror("%s(`%s`) failed"
8196  ,s,Tok2Cmdname(at));
8197  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8198  {
8199  while (dA1[i].cmd==op)
8200  {
8201  if ((dA1[i].res!=0)
8202  && (dA1[i].p!=jjWRONG))
8203  Werror("expected %s(`%s`)"
8204  ,s,Tok2Cmdname(dA1[i].arg));
8205  i++;
8206  }
8207  }
8208  }
8209  }
8210  res->rtyp = UNKNOWN;
8211  }
8212  a->CleanUp();
8213  return TRUE;
8214 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8215
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
return P p
Definition: myNF.cc:203
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
int traceit
Definition: febase.cc:47
short res
Definition: gentable.cc:74
const char * Fullname()
Definition: subexpr.h:126
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define V_SHOW_USE
Definition: options.h:50
static BOOLEAN check_valid(const int p, const int op)
Definition: iparith.cc:9025
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
int RingDependend(int t)
Definition: gentable.cc:23
const char * iiTwoOps(int t)
Definition: gentable.cc:253
static BOOLEAN jjWRONG(leftv, leftv)
Definition: iparith.cc:3473
leftv Next()
Definition: subexpr.h:137
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:87
#define BVERBOSE(a)
Definition: options.h:33
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#define NO_CONVERSION
Definition: iparith.cc:124
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiExprArith2()

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

Definition at line 8025 of file iparith.cc.

8026 {
8027  memset(res,0,sizeof(sleftv));
8028 
8029  if (!errorreported)
8030  {
8031 #ifdef SIQ
8032  if (siq>0)
8033  {
8034  //Print("siq:%d\n",siq);
8036  memcpy(&d->arg1,a,sizeof(sleftv));
8037  a->Init();
8038  memcpy(&d->arg2,b,sizeof(sleftv));
8039  b->Init();
8040  d->argc=2;
8041  d->op=op;
8042  res->data=(char *)d;
8043  res->rtyp=COMMAND;
8044  return FALSE;
8045  }
8046 #endif
8047  int at=a->Typ();
8048  int bt=b->Typ();
8049  // handling bb-objects ----------------------------------------------------
8050  if (at>MAX_TOK)
8051  {
8052  blackbox *bb=getBlackboxStuff(at);
8053  if (bb!=NULL)
8054  {
8055  if (!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8056  if (errorreported) return TRUE;
8057  // else: no op defined
8058  }
8059  else return TRUE;
8060  }
8061  else if ((bt>MAX_TOK)&&(op!='('))
8062  {
8063  blackbox *bb=getBlackboxStuff(bt);
8064  if (bb!=NULL)
8065  {
8066  if(!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8067  if (errorreported) return TRUE;
8068  // else: no op defined
8069  }
8070  else return TRUE;
8071  }
8072  int i=iiTabIndex(dArithTab2,JJTAB2LEN,op);
8073  return iiExprArith2TabIntern(res,a,op,b,proccall,dArith2+i,at,bt,dConvertTypes);
8074  }
8075  a->CleanUp();
8076  b->CleanUp();
8077  return TRUE;
8078 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:57
const struct sValCmd2 dArith2[]
Definition: table.h:290
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:108
int Typ()
Definition: subexpr.cc:995
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:7852
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8727
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
omBin sip_command_bin
Definition: ipid.cc:49
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#define COMMAND
Definition: tok.h:29
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16

◆ iiExprArith2Tab()

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

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

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

Definition at line 8012 of file iparith.cc.

8016 {
8017  leftv b=a->next;
8018  a->next=NULL;
8019  int bt=b->Typ();
8020  BOOLEAN bo=iiExprArith2TabIntern(res,a,op,b,TRUE,dA2,at,bt,dConvertTypes);
8021  a->next=b;
8022  a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
8023  return bo;
8024 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
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:7852
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ 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 
)
static

Definition at line 7852 of file iparith.cc.

7857 {
7858  memset(res,0,sizeof(sleftv));
7859  BOOLEAN call_failed=FALSE;
7860 
7861  if (!errorreported)
7862  {
7863  int i=0;
7864  iiOp=op;
7865  while (dA2[i].cmd==op)
7866  {
7867  if ((at==dA2[i].arg1)
7868  && (bt==dA2[i].arg2))
7869  {
7870  res->rtyp=dA2[i].res;
7871  if (currRing!=NULL)
7872  {
7873  if (check_valid(dA2[i].valid_for,op)) break;
7874  }
7875  else
7876  {
7877  if (RingDependend(dA2[i].res))
7878  {
7879  WerrorS("no ring active");
7880  break;
7881  }
7882  }
7883  if (traceit&TRACE_CALL)
7884  Print("call %s(%s,%s)\n",iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt));
7885  if ((call_failed=dA2[i].p(res,a,b)))
7886  {
7887  break;// leave loop, goto error handling
7888  }
7889  a->CleanUp();
7890  b->CleanUp();
7891  //Print("op: %d,result typ:%d\n",op,res->rtyp);
7892  return FALSE;
7893  }
7894  i++;
7895  }
7896  // implicite type conversion ----------------------------------------------
7897  if (dA2[i].cmd!=op)
7898  {
7899  int ai,bi;
7902  BOOLEAN failed=FALSE;
7903  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
7904  //Print("op: %c, type: %s %s\n",op,Tok2Cmdname(at),Tok2Cmdname(bt));
7905  while (dA2[i].cmd==op)
7906  {
7907  //Print("test %s %s\n",Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
7908  if ((dA2[i].valid_for & NO_CONVERSION)==0)
7909  {
7910  if ((ai=iiTestConvert(at,dA2[i].arg1,dConvertTypes))!=0)
7911  {
7912  if ((bi=iiTestConvert(bt,dA2[i].arg2,dConvertTypes))!=0)
7913  {
7914  res->rtyp=dA2[i].res;
7915  if (currRing!=NULL)
7916  {
7917  if (check_valid(dA2[i].valid_for,op)) break;
7918  }
7919  else
7920  {
7921  if (RingDependend(dA2[i].res))
7922  {
7923  WerrorS("no ring active");
7924  break;
7925  }
7926  }
7927  if (traceit&TRACE_CALL)
7928  Print("call %s(%s,%s)\n",iiTwoOps(op),
7929  Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
7930  failed= ((iiConvert(at,dA2[i].arg1,ai,a,an))
7931  || (iiConvert(bt,dA2[i].arg2,bi,b,bn))
7932  || (call_failed=dA2[i].p(res,an,bn)));
7933  // everything done, clean up temp. variables
7934  if (failed)
7935  {
7936  // leave loop, goto error handling
7937  break;
7938  }
7939  else
7940  {
7941  // everything ok, clean up and return
7942  an->CleanUp();
7943  bn->CleanUp();
7946  return FALSE;
7947  }
7948  }
7949  }
7950  }
7951  i++;
7952  }
7953  an->CleanUp();
7954  bn->CleanUp();
7957  }
7958  // error handling ---------------------------------------------------
7959  const char *s=NULL;
7960  if (!errorreported)
7961  {
7962  if ((at==0) && (a->Fullname()!=sNoName_fe))
7963  {
7964  s=a->Fullname();
7965  }
7966  else if ((bt==0) && (b->Fullname()!=sNoName_fe))
7967  {
7968  s=b->Fullname();
7969  }
7970  if (s!=NULL)
7971  Werror("`%s` is not defined",s);
7972  else
7973  {
7974  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
7975  s = iiTwoOps(op);
7976  if (proccall)
7977  {
7978  Werror("%s(`%s`,`%s`) failed"
7979  ,s,Tok2Cmdname(at),Tok2Cmdname(bt));
7980  }
7981  else
7982  {
7983  Werror("`%s` %s `%s` failed"
7984  ,Tok2Cmdname(at),s,Tok2Cmdname(bt));
7985  }
7986  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
7987  {
7988  while (dA2[i].cmd==op)
7989  {
7990  if(((at==dA2[i].arg1)||(bt==dA2[i].arg2))
7991  && (dA2[i].res!=0)
7992  && (dA2[i].p!=jjWRONG2))
7993  {
7994  if (proccall)
7995  Werror("expected %s(`%s`,`%s`)"
7996  ,s,Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
7997  else
7998  Werror("expected `%s` %s `%s`"
7999  ,Tok2Cmdname(dA2[i].arg1),s,Tok2Cmdname(dA2[i].arg2));
8000  }
8001  i++;
8002  }
8003  }
8004  }
8005  }
8006  a->CleanUp();
8007  b->CleanUp();
8008  res->rtyp = UNKNOWN;
8009  }
8010  return TRUE;
8011 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
short res
Definition: gentable.cc:65
return P p
Definition: myNF.cc:203
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
int traceit
Definition: febase.cc:47
const char * Fullname()
Definition: subexpr.h:126
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define V_SHOW_USE
Definition: options.h:50
static BOOLEAN check_valid(const int p, const int op)
Definition: iparith.cc:9025
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
int RingDependend(int t)
Definition: gentable.cc:23
const char * iiTwoOps(int t)
Definition: gentable.cc:253
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
#define BVERBOSE(a)
Definition: options.h:33
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
#define jjWRONG2
Definition: iparith.cc:3471
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#define NO_CONVERSION
Definition: iparith.cc:124
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiExprArith3()

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

Definition at line 8430 of file iparith.cc.

8431 {
8432  memset(res,0,sizeof(sleftv));
8433 
8434  if (!errorreported)
8435  {
8436 #ifdef SIQ
8437  if (siq>0)
8438  {
8439  //Print("siq:%d\n",siq);
8441  memcpy(&d->arg1,a,sizeof(sleftv));
8442  a->Init();
8443  memcpy(&d->arg2,b,sizeof(sleftv));
8444  b->Init();
8445  memcpy(&d->arg3,c,sizeof(sleftv));
8446  c->Init();
8447  d->op=op;
8448  d->argc=3;
8449  res->data=(char *)d;
8450  res->rtyp=COMMAND;
8451  return FALSE;
8452  }
8453 #endif
8454  int at=a->Typ();
8455  // handling bb-objects ----------------------------------------------
8456  if (at>MAX_TOK)
8457  {
8458  blackbox *bb=getBlackboxStuff(at);
8459  if (bb!=NULL)
8460  {
8461  if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
8462  if (errorreported) return TRUE;
8463  // else: no op defined
8464  }
8465  else return TRUE;
8466  if (errorreported) return TRUE;
8467  }
8468  int bt=b->Typ();
8469  int ct=c->Typ();
8470 
8471  iiOp=op;
8472  int i=0;
8473  while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
8474  return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
8475  }
8476  a->CleanUp();
8477  b->CleanUp();
8478  c->CleanUp();
8479  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8480  return TRUE;
8481 }
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:8273
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:57
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:108
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
const struct sValCmd3 dArith3[]
Definition: table.h:713
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
omBin sip_command_bin
Definition: ipid.cc:49
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
int iiOp
Definition: iparith.cc:224
#define COMMAND
Definition: tok.h:29
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16

◆ iiExprArith3Tab()

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

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

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

Definition at line 8482 of file iparith.cc.

8486 {
8487  leftv b=a->next;
8488  a->next=NULL;
8489  int bt=b->Typ();
8490  leftv c=b->next;
8491  b->next=NULL;
8492  int ct=c->Typ();
8493  BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
8494  b->next=c;
8495  a->next=b;
8496  a->CleanUp(); // to cleanup the chain, content already done
8497  return bo;
8498 }
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:8273
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
int Typ()
Definition: subexpr.cc:995
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ 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 
)
static

Definition at line 8273 of file iparith.cc.

8276 {
8277  memset(res,0,sizeof(sleftv));
8278  BOOLEAN call_failed=FALSE;
8279 
8280  assume(dA3[0].cmd==op);
8281 
8282  if (!errorreported)
8283  {
8284  int i=0;
8285  iiOp=op;
8286  while (dA3[i].cmd==op)
8287  {
8288  if ((at==dA3[i].arg1)
8289  && (bt==dA3[i].arg2)
8290  && (ct==dA3[i].arg3))
8291  {
8292  res->rtyp=dA3[i].res;
8293  if (currRing!=NULL)
8294  {
8295  if (check_valid(dA3[i].valid_for,op)) break;
8296  }
8297  if (traceit&TRACE_CALL)
8298  Print("call %s(%s,%s,%s)\n",
8299  iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8300  if ((call_failed=dA3[i].p(res,a,b,c)))
8301  {
8302  break;// leave loop, goto error handling
8303  }
8304  a->CleanUp();
8305  b->CleanUp();
8306  c->CleanUp();
8307  return FALSE;
8308  }
8309  i++;
8310  }
8311  // implicite type conversion ----------------------------------------------
8312  if (dA3[i].cmd!=op)
8313  {
8314  int ai,bi,ci;
8318  BOOLEAN failed=FALSE;
8319  i=0;
8320  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8321  while (dA3[i].cmd==op)
8322  {
8323  if ((dA3[i].valid_for & NO_CONVERSION)==0)
8324  {
8325  if ((ai=iiTestConvert(at,dA3[i].arg1,dConvertTypes))!=0)
8326  {
8327  if ((bi=iiTestConvert(bt,dA3[i].arg2,dConvertTypes))!=0)
8328  {
8329  if ((ci=iiTestConvert(ct,dA3[i].arg3,dConvertTypes))!=0)
8330  {
8331  res->rtyp=dA3[i].res;
8332  if (currRing!=NULL)
8333  {
8334  if (check_valid(dA3[i].valid_for,op)) break;
8335  }
8336  if (traceit&TRACE_CALL)
8337  Print("call %s(%s,%s,%s)\n",
8338  iiTwoOps(op),Tok2Cmdname(dA3[i].arg1),
8339  Tok2Cmdname(dA3[i].arg2),Tok2Cmdname(dA3[i].arg3));
8340  failed= ((iiConvert(at,dA3[i].arg1,ai,a,an,dConvertTypes))
8341  || (iiConvert(bt,dA3[i].arg2,bi,b,bn,dConvertTypes))
8342  || (iiConvert(ct,dA3[i].arg3,ci,c,cn,dConvertTypes))
8343  || (call_failed=dA3[i].p(res,an,bn,cn)));
8344  // everything done, clean up temp. variables
8345  if (failed)
8346  {
8347  // leave loop, goto error handling
8348  break;
8349  }
8350  else
8351  {
8352  // everything ok, clean up and return
8353  an->CleanUp();
8354  bn->CleanUp();
8355  cn->CleanUp();
8359  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8360  a->CleanUp();
8361  b->CleanUp();
8362  c->CleanUp();
8363  return FALSE;
8364  }
8365  }
8366  }
8367  }
8368  }
8369  i++;
8370  }
8371  an->CleanUp();
8372  bn->CleanUp();
8373  cn->CleanUp();
8377  }
8378  // error handling ---------------------------------------------------
8379  if (!errorreported)
8380  {
8381  const char *s=NULL;
8382  if ((at==0) && (a->Fullname()!=sNoName_fe))
8383  {
8384  s=a->Fullname();
8385  }
8386  else if ((bt==0) && (b->Fullname()!=sNoName_fe))
8387  {
8388  s=b->Fullname();
8389  }
8390  else if ((ct==0) && (c->Fullname()!=sNoName_fe))
8391  {
8392  s=c->Fullname();
8393  }
8394  if (s!=NULL)
8395  Werror("`%s` is not defined",s);
8396  else
8397  {
8398  i=0;
8399  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8400  const char *s = iiTwoOps(op);
8401  Werror("%s(`%s`,`%s`,`%s`) failed"
8402  ,s,Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8403  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8404  {
8405  while (dA3[i].cmd==op)
8406  {
8407  if(((at==dA3[i].arg1)
8408  ||(bt==dA3[i].arg2)
8409  ||(ct==dA3[i].arg3))
8410  && (dA3[i].res!=0))
8411  {
8412  Werror("expected %s(`%s`,`%s`,`%s`)"
8413  ,s,Tok2Cmdname(dA3[i].arg1)
8414  ,Tok2Cmdname(dA3[i].arg2)
8415  ,Tok2Cmdname(dA3[i].arg3));
8416  }
8417  i++;
8418  }
8419  }
8420  }
8421  }
8422  res->rtyp = UNKNOWN;
8423  }
8424  a->CleanUp();
8425  b->CleanUp();
8426  c->CleanUp();
8427  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8428  return TRUE;
8429 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
return P p
Definition: myNF.cc:203
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
int traceit
Definition: febase.cc:47
const char * Fullname()
Definition: subexpr.h:126
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define V_SHOW_USE
Definition: options.h:50
static BOOLEAN check_valid(const int p, const int op)
Definition: iparith.cc:9025
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
const char * iiTwoOps(int t)
Definition: gentable.cc:253
#define assume(x)
Definition: mod2.h:394
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
#define BVERBOSE(a)
Definition: options.h:33
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
short res
Definition: gentable.cc:82
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#define NO_CONVERSION
Definition: iparith.cc:124
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiExprArithM()

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

Definition at line 8520 of file iparith.cc.

8521 {
8522  memset(res,0,sizeof(sleftv));
8523 
8524  if (!errorreported)
8525  {
8526 #ifdef SIQ
8527  if (siq>0)
8528  {
8529  //Print("siq:%d\n",siq);
8531  d->op=op;
8532  res->data=(char *)d;
8533  if (a!=NULL)
8534  {
8535  d->argc=a->listLength();
8536  // else : d->argc=0;
8537  memcpy(&d->arg1,a,sizeof(sleftv));
8538  switch(d->argc)
8539  {
8540  case 3:
8541  memcpy(&d->arg3,a->next->next,sizeof(sleftv));
8542  a->next->next->Init();
8543  /* no break */
8544  case 2:
8545  memcpy(&d->arg2,a->next,sizeof(sleftv));
8546  a->next->Init();
8547  a->next->next=d->arg2.next;
8548  d->arg2.next=NULL;
8549  /* no break */
8550  case 1:
8551  a->Init();
8552  a->next=d->arg1.next;
8553  d->arg1.next=NULL;
8554  }
8555  if (d->argc>3) a->next=NULL;
8556  a->name=NULL;
8557  a->rtyp=0;
8558  a->data=NULL;
8559  a->e=NULL;
8560  a->attribute=NULL;
8561  a->CleanUp();
8562  }
8563  res->rtyp=COMMAND;
8564  return FALSE;
8565  }
8566 #endif
8567  if ((a!=NULL) && (a->Typ()>MAX_TOK))
8568  {
8569  blackbox *bb=getBlackboxStuff(a->Typ());
8570  if (bb!=NULL)
8571  {
8572  if(!bb->blackbox_OpM(op,res,a)) return FALSE;
8573  if (errorreported) return TRUE;
8574  // else: no op defined
8575  }
8576  else return TRUE;
8577  }
8578  int args=0;
8579  if (a!=NULL) args=a->listLength();
8580 
8581  iiOp=op;
8582  int i=0;
8583  while ((dArithM[i].cmd!=op)&&(dArithM[i].cmd!=0)) i++;
8584  while (dArithM[i].cmd==op)
8585  {
8586  if ((args==dArithM[i].number_of_args)
8587  || (dArithM[i].number_of_args==-1)
8588  || ((dArithM[i].number_of_args==-2)&&(args>0)))
8589  {
8590  res->rtyp=dArithM[i].res;
8591  if (currRing!=NULL)
8592  {
8593  if (check_valid(dArithM[i].valid_for,op)) break;
8594  }
8595  if (traceit&TRACE_CALL)
8596  Print("call %s(... (%d args))\n", iiTwoOps(op),args);
8597  if (dArithM[i].p(res,a))
8598  {
8599  break;// leave loop, goto error handling
8600  }
8601  if (a!=NULL) a->CleanUp();
8602  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8603  return FALSE;
8604  }
8605  i++;
8606  }
8607  // error handling
8608  if (!errorreported)
8609  {
8610  if ((args>0) && (a->rtyp==0) && (a->Name()!=sNoName_fe))
8611  {
8612  Werror("`%s` is not defined",a->Fullname());
8613  }
8614  else
8615  {
8616  const char *s = iiTwoOps(op);
8617  Werror("%s(...) failed",s);
8618  }
8619  }
8620  res->rtyp = UNKNOWN;
8621  }
8622  if (a!=NULL) a->CleanUp();
8623  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8624  return TRUE;
8625 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
ip_command * command
Definition: ipid.h:24
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
const char sNoName_fe[]
Definition: fevoices.cc:65
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:57
int listLength()
Definition: subexpr.cc:60
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:108
#define UNKNOWN
Definition: tok.h:217
const struct sValCmdM dArithM[]
Definition: table.h:823
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:995
const char * Name()
Definition: subexpr.h:121
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN check_valid(const int p, const int op)
Definition: iparith.cc:9025
const char * iiTwoOps(int t)
Definition: gentable.cc:253
const char * name
Definition: subexpr.h:88
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
short res
Definition: gentable.cc:92
#define NULL
Definition: omList.c:10
omBin sip_command_bin
Definition: ipid.cc:49
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
attr attribute
Definition: subexpr.h:90
int iiOp
Definition: iparith.cc:224
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define COMMAND
Definition: tok.h:29
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16

◆ iiInitArithmetic()

int iiInitArithmetic ( )

initialisation of arithmetic structured data

Return values
0on success

Definition at line 8836 of file iparith.cc.

8837 {
8838  //printf("iiInitArithmetic()\n");
8839  memset(&sArithBase, 0, sizeof(sArithBase));
8840  iiInitCmdName();
8841  /* fix last-identifier */
8842 #if 0
8843  /* we expect that gentable allready did every thing */
8846  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
8847  }
8848 #endif
8849  //Print("L=%d\n", sArithBase.nLastIdentifier);
8850 
8851  //iiArithAddCmd(szName, nAlias, nTokval, nToktype);
8852  //iiArithAddCmd("mygcd", 1, GCD_CMD, CMD_2);
8853 
8854  //iiArithAddCmd("Top", 0,-1,0);
8855 
8856 
8857  //for(i=0; i<sArithBase.nCmdUsed; i++) {
8858  // printf("CMD[%03d] %s, %d, %d, %d\n", i,
8859  // sArithBase.sCmds[i].name,
8860  // sArithBase.sCmds[i].alias,
8861  // sArithBase.sCmds[i].tokval,
8862  // sArithBase.sCmds[i].toktype);
8863  //}
8864  //iiArithRemoveCmd("Top");
8865  //iiArithAddCmd("mygcd", 2, GCD_CMD, CMD_2);
8866  //iiArithRemoveCmd("mygcd");
8867  //iiArithAddCmd("kkk", 1, 1234, CMD_1);
8868  return 0;
8869 }
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:195
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ iin_Int()

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

Definition at line 227 of file iparith.cc.

228 {
229  long l=n_Int(n,cf);
230  int i=(int)l;
231  if ((long)i==l) return l;
232  return 0;
233 }
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:551
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94

◆ iiTabIndex()

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

Definition at line 8727 of file iparith.cc.

8728 {
8729  // user defined types are not in the pre-computed table:
8730  if (op>MAX_TOK) return 0;
8731 
8732  int a=0;
8733  int e=len;
8734  int p=len/2;
8735  do
8736  {
8737  if (op==dArithTab[p].cmd) return dArithTab[p].start;
8738  if (op<dArithTab[p].cmd) e=p-1;
8739  else a = p+1;
8740  p=a+(e-a)/2;
8741  }
8742  while ( a <= e);
8743 
8744  // catch missing a cmd:
8745  // may be missing as a op for blackbox, if the first operand is "undef" instead of bb
8746  // Print("op %d (%c) unknown",op,op);
8747  return 0;
8748 }
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
Definition: tok.h:213

◆ iiTokType()

int iiTokType ( int  op)

Definition at line 239 of file iparith.cc.

240 {
241  for (unsigned i=0;i<sArithBase.nCmdUsed;i++)
242  {
243  if (sArithBase.sCmds[i].tokval==op)
244  return sArithBase.sCmds[i].toktype;
245  }
246  return 0;
247 }
int i
Definition: cfEzgcd.cc:123
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ IsCmd()

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

Definition at line 8628 of file iparith.cc.

8629 {
8630  int i;
8631  int an=1;
8632  int en=sArithBase.nLastIdentifier;
8633 
8634  loop
8635  //for(an=0; an<sArithBase.nCmdUsed; )
8636  {
8637  if(an>=en-1)
8638  {
8639  if (strcmp(n, sArithBase.sCmds[an].name) == 0)
8640  {
8641  i=an;
8642  break;
8643  }
8644  else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
8645  {
8646  i=en;
8647  break;
8648  }
8649  else
8650  {
8651  // -- blackbox extensions:
8652  // return 0;
8653  return blackboxIsCmd(n,tok);
8654  }
8655  }
8656  i=(an+en)/2;
8657  if (*n < *(sArithBase.sCmds[i].name))
8658  {
8659  en=i-1;
8660  }
8661  else if (*n > *(sArithBase.sCmds[i].name))
8662  {
8663  an=i+1;
8664  }
8665  else
8666  {
8667  int v=strcmp(n,sArithBase.sCmds[i].name);
8668  if(v<0)
8669  {
8670  en=i-1;
8671  }
8672  else if(v>0)
8673  {
8674  an=i+1;
8675  }
8676  else /*v==0*/
8677  {
8678  break;
8679  }
8680  }
8681  }
8683  tok=sArithBase.sCmds[i].tokval;
8684  if(sArithBase.sCmds[i].alias==2)
8685  {
8686  Warn("outdated identifier `%s` used - please change your code",
8687  sArithBase.sCmds[i].name);
8688  sArithBase.sCmds[i].alias=1;
8689  }
8690  #if 0
8691  if (currRingHdl==NULL)
8692  {
8693  #ifdef SIQ
8694  if (siq<=0)
8695  {
8696  #endif
8697  if ((tok>=BEGIN_RING) && (tok<=END_RING))
8698  {
8699  WerrorS("no ring active");
8700  return 0;
8701  }
8702  #ifdef SIQ
8703  }
8704  #endif
8705  }
8706  #endif
8707  if (!expected_parms)
8708  {
8709  switch (tok)
8710  {
8711  case IDEAL_CMD:
8712  case INT_CMD:
8713  case INTVEC_CMD:
8714  case MAP_CMD:
8715  case MATRIX_CMD:
8716  case MODUL_CMD:
8717  case POLY_CMD:
8718  case PROC_CMD:
8719  case RING_CMD:
8720  case STRING_CMD:
8721  cmdtok = tok;
8722  break;
8723  }
8724  }
8725  return sArithBase.sCmds[i].toktype;
8726 }
Definition: tok.h:95
loop
Definition: myNF.cc:98
BOOLEAN siq
Definition: subexpr.cc:57
int cmdtok
Definition: grammar.cc:174
void WerrorS(const char *s)
Definition: feFopen.cc:24
BOOLEAN expected_parms
Definition: grammar.cc:173
idhdl currRingHdl
Definition: ipid.cc:65
int i
Definition: cfEzgcd.cc:123
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
unsigned nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:195
#define NULL
Definition: omList.c:10
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:191
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188
const char * lastreserved
Definition: ipshell.cc:80
#define Warn
Definition: emacs.cc:80

◆ jjALIGN_M()

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

Definition at line 1759 of file iparith.cc.

1760 {
1761  ideal M=(ideal)u->CopyD();
1762  int s=(int)(long)v->Data();
1763  for(int i=IDELEMS(M)-1; i>=0;i--)
1764  {
1765  if (s+p_MinComp(M->m[i],currRing)<=0)
1766  { id_Delete(&M,currRing);return TRUE;}
1767  }
1768  id_Shift(M,s,currRing);
1769  res->data=M;
1770  return FALSE;
1771 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void id_Shift(ideal M, int s, const ring r)
int i
Definition: cfEzgcd.cc:123
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:308
#define IDELEMS(i)
Definition: simpleideals.h:24
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjALIGN_V()

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

Definition at line 1749 of file iparith.cc.

1750 {
1751  poly p=(poly)u->CopyD();
1752  int s=(int)(long)v->Data();
1753  if (s+p_MinComp(p,currRing)<=0)
1754  { p_Delete(&p,currRing);return TRUE;}
1755  p_Shift(&p,s,currRing);
1756  res->data=p;
1757  return FALSE;
1758 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:308
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition: p_polys.cc:4553
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjAND_I()

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

Definition at line 1359 of file iparith.cc.

1360 {
1361  res->data = (char *)((long)u->Data() && (long)v->Data());
1362  return FALSE;
1363 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjBAREISS()

static BOOLEAN jjBAREISS ( leftv  res,
leftv  v 
)
static

Definition at line 3561 of file iparith.cc.

3562 {
3563  //matrix m=(matrix)v->Data();
3564  //lists l=mpBareiss(m,FALSE);
3565  intvec *iv;
3566  ideal m;
3567  sm_CallBareiss((ideal)v->Data(),0,0,m,&iv, currRing);
3569  l->Init(2);
3570  l->m[0].rtyp=MODUL_CMD;
3571  l->m[1].rtyp=INTVEC_CMD;
3572  l->m[0].data=(void *)m;
3573  l->m[1].data=(void *)iv;
3574  res->data = (char *)l;
3575  return FALSE;
3576 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
int m
Definition: cfEzgcd.cc:119
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
Definition: sparsmat.cc:403
omBin slists_bin
Definition: lists.cc:23
int l
Definition: cfEzgcd.cc:94

◆ jjBAREISS3()

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

Definition at line 5578 of file iparith.cc.

5579 {
5580  intvec *iv;
5581  ideal m;
5583  int k=(int)(long)w->Data();
5584  if (k>=0)
5585  {
5586  sm_CallBareiss((ideal)u->Data(),(int)(long)v->Data(),(int)(long)w->Data(),m,&iv, currRing);
5587  l->Init(2);
5588  l->m[0].rtyp=MODUL_CMD;
5589  l->m[1].rtyp=INTVEC_CMD;
5590  l->m[0].data=(void *)m;
5591  l->m[1].data=(void *)iv;
5592  }
5593  else
5594  {
5595  m=sm_CallSolv((ideal)u->Data(), currRing);
5596  l->Init(1);
5597  l->m[0].rtyp=IDEAL_CMD;
5598  l->m[0].data=(void *)m;
5599  }
5600  res->data = (char *)l;
5601  return FALSE;
5602 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
int m
Definition: cfEzgcd.cc:119
INLINE_THIS void Init(int l=0)
slists * lists
Definition: mpr_numeric.h:146
ideal sm_CallSolv(ideal I, const ring R)
Definition: sparsmat.cc:2371
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
Definition: sparsmat.cc:403
omBin slists_bin
Definition: lists.cc:23
int l
Definition: cfEzgcd.cc:94

◆ jjBAREISS_BIM()

static BOOLEAN jjBAREISS_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 3584 of file iparith.cc.

3585 {
3587  b->hnf();
3588  res->data=(char*)b;
3589  return FALSE;
3590 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
void hnf()
transforms INPLACE to HNF
Definition: bigintmat.cc:1668
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjBI2IM()

static BOOLEAN jjBI2IM ( leftv  res,
leftv  u 
)
static

Definition at line 3606 of file iparith.cc.

3607 {
3608  bigintmat *b=(bigintmat*)u->Data();
3609  res->data=(void *)bim2iv(b);
3610  return FALSE;
3611 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
intvec * bim2iv(bigintmat *b)
Definition: bigintmat.cc:342
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjBI2N()

static BOOLEAN jjBI2N ( leftv  res,
leftv  u 
)
static

Definition at line 3591 of file iparith.cc.

3592 {
3593  BOOLEAN bo=FALSE;
3594  number n=(number)u->CopyD();
3596  if (nMap!=NULL)
3597  res->data=nMap(n,coeffs_BIGINT,currRing->cf);
3598  else
3599  {
3600  Werror("cannot convert bigint to cring %s", nCoeffName(currRing->cf));
3601  bo=TRUE;
3602  }
3603  n_Delete(&n,coeffs_BIGINT);
3604  return bo;
3605 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
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:725
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjBI2P()

static BOOLEAN jjBI2P ( leftv  res,
leftv  u 
)
static

Definition at line 3612 of file iparith.cc.

3613 {
3614  sleftv tmp;
3615  BOOLEAN bo=jjBI2N(&tmp,u);
3616  if (!bo)
3617  {
3618  number n=(number) tmp.data;
3619  if (nIsZero(n)) { res->data=NULL;nDelete(&n); }
3620  else
3621  {
3622  res->data=(void *)pNSet(n);
3623  }
3624  }
3625  return bo;
3626 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define pNSet(n)
Definition: polys.h:295
if(0 > strat->sl)
Definition: myNF.cc:73
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition: iparith.cc:3591
void * data
Definition: subexpr.h:89
#define nDelete(n)
Definition: numbers.h:16
#define nIsZero(n)
Definition: numbers.h:19
#define NULL
Definition: omList.c:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjBRACK_Bim()

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

Definition at line 5351 of file iparith.cc.

5352 {
5353  bigintmat *bim = (bigintmat *)u->Data();
5354  int r = (int)(long)v->Data();
5355  int c = (int)(long)w->Data();
5356  if ((r<1)||(r>bim->rows())||(c<1)||(c>bim->cols()))
5357  {
5358  Werror("wrong range[%d,%d] in bigintmat %s(%d x %d)",
5359  r,c,u->Fullname(),bim->rows(),bim->cols());
5360  return TRUE;
5361  }
5362  res->data=u->data; u->data=NULL;
5363  res->rtyp=u->rtyp; u->rtyp=0;
5364  res->name=u->name; u->name=NULL;
5365  Subexpr e=jjMakeSub(v);
5366  e->next=jjMakeSub(w);
5367  if (u->e==NULL)
5368  res->e=e;
5369  else
5370  {
5371  Subexpr h=u->e;
5372  while (h->next!=NULL) h=h->next;
5373  h->next=e;
5374  res->e=u->e;
5375  u->e=NULL;
5376  }
5377  return FALSE;
5378 }
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:98
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:88
int cols() const
Definition: bigintmat.h:145
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7834
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjBRACK_Im()

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

Definition at line 5324 of file iparith.cc.

5325 {
5326  intvec *iv = (intvec *)u->Data();
5327  int r = (int)(long)v->Data();
5328  int c = (int)(long)w->Data();
5329  if ((r<1)||(r>iv->rows())||(c<1)||(c>iv->cols()))
5330  {
5331  Werror("wrong range[%d,%d] in intmat %s(%d x %d)",
5332  r,c,u->Fullname(),iv->rows(),iv->cols());
5333  return TRUE;
5334  }
5335  res->data=u->data; u->data=NULL;
5336  res->rtyp=u->rtyp; u->rtyp=0;
5337  res->name=u->name; u->name=NULL;
5338  Subexpr e=jjMakeSub(v);
5339  e->next=jjMakeSub(w);
5340  if (u->e==NULL) res->e=e;
5341  else
5342  {
5343  Subexpr h=u->e;
5344  while (h->next!=NULL) h=h->next;
5345  h->next=e;
5346  res->e=u->e;
5347  u->e=NULL;
5348  }
5349  return FALSE;
5350 }
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:98
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int cols() const
Definition: intvec.h:87
int rtyp
Definition: subexpr.h:92
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7834
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjBRACK_Ma()

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

Definition at line 5379 of file iparith.cc.

5380 {
5381  matrix m= (matrix)u->Data();
5382  int r = (int)(long)v->Data();
5383  int c = (int)(long)w->Data();
5384  //Print("gen. elem %d, %d\n",r,c);
5385  if ((r<1)||(r>MATROWS(m))||(c<1)||(c>MATCOLS(m)))
5386  {
5387  Werror("wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->Fullname(),
5388  MATROWS(m),MATCOLS(m));
5389  return TRUE;
5390  }
5391  res->data=u->data; u->data=NULL;
5392  res->rtyp=u->rtyp; u->rtyp=0;
5393  res->name=u->name; u->name=NULL;
5394  Subexpr e=jjMakeSub(v);
5395  e->next=jjMakeSub(w);
5396  if (u->e==NULL)
5397  res->e=e;
5398  else
5399  {
5400  Subexpr h=u->e;
5401  while (h->next!=NULL) h=h->next;
5402  h->next=e;
5403  res->e=u->e;
5404  u->e=NULL;
5405  }
5406  return FALSE;
5407 }
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:88
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7834
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjBRACK_Ma_I_IV()

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

Definition at line 5408 of file iparith.cc.

5409 {
5410  sleftv t;
5411  sleftv ut;
5412  leftv p=NULL;
5413  intvec *iv=(intvec *)w->Data();
5414  int l;
5415  BOOLEAN nok;
5416 
5417  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5418  {
5419  WerrorS("cannot build expression lists from unnamed objects");
5420  return TRUE;
5421  }
5422  memcpy(&ut,u,sizeof(ut));
5423  memset(&t,0,sizeof(t));
5424  t.rtyp=INT_CMD;
5425  for (l=0;l< iv->length(); l++)
5426  {
5427  t.data=(char *)(long)((*iv)[l]);
5428  if (p==NULL)
5429  {
5430  p=res;
5431  }
5432  else
5433  {
5435  p=p->next;
5436  }
5437  memcpy(u,&ut,sizeof(ut));
5438  if (u->Typ() == MATRIX_CMD)
5439  nok=jjBRACK_Ma(p,u,v,&t);
5440  else if (u->Typ() == BIGINTMAT_CMD)
5441  nok=jjBRACK_Bim(p,u,v,&t);
5442  else /* INTMAT_CMD */
5443  nok=jjBRACK_Im(p,u,v,&t);
5444  if (nok)
5445  {
5446  while (res->next!=NULL)
5447  {
5448  p=res->next->next;
5449  omFreeBin((ADDRESS)res->next, sleftv_bin);
5450  // res->e aufraeumen !!!!
5451  res->next=p;
5452  }
5453  return TRUE;
5454  }
5455  }
5456  return FALSE;
5457 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5351
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5324
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5379
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:94

◆ jjBRACK_Ma_IV_I()

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

Definition at line 5458 of file iparith.cc.

5459 {
5460  sleftv t;
5461  sleftv ut;
5462  leftv p=NULL;
5463  intvec *iv=(intvec *)v->Data();
5464  int l;
5465  BOOLEAN nok;
5466 
5467  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5468  {
5469  WerrorS("cannot build expression lists from unnamed objects");
5470  return TRUE;
5471  }
5472  memcpy(&ut,u,sizeof(ut));
5473  memset(&t,0,sizeof(t));
5474  t.rtyp=INT_CMD;
5475  for (l=0;l< iv->length(); l++)
5476  {
5477  t.data=(char *)(long)((*iv)[l]);
5478  if (p==NULL)
5479  {
5480  p=res;
5481  }
5482  else
5483  {
5485  p=p->next;
5486  }
5487  memcpy(u,&ut,sizeof(ut));
5488  if (u->Typ() == MATRIX_CMD)
5489  nok=jjBRACK_Ma(p,u,&t,w);
5490  else if (u->Typ() == BIGINTMAT_CMD)
5491  nok=jjBRACK_Bim(p,u,&t,w);
5492  else /* INTMAT_CMD */
5493  nok=jjBRACK_Im(p,u,&t,w);
5494  if (nok)
5495  {
5496  while (res->next!=NULL)
5497  {
5498  p=res->next->next;
5499  omFreeBin((ADDRESS)res->next, sleftv_bin);
5500  // res->e aufraeumen !!
5501  res->next=p;
5502  }
5503  return TRUE;
5504  }
5505  }
5506  return FALSE;
5507 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5351
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5324
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5379
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:94

◆ jjBRACK_Ma_IV_IV()

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

Definition at line 5508 of file iparith.cc.

5509 {
5510  sleftv t1,t2,ut;
5511  leftv p=NULL;
5512  intvec *vv=(intvec *)v->Data();
5513  intvec *wv=(intvec *)w->Data();
5514  int vl;
5515  int wl;
5516  BOOLEAN nok;
5517 
5518  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5519  {
5520  WerrorS("cannot build expression lists from unnamed objects");
5521  return TRUE;
5522  }
5523  memcpy(&ut,u,sizeof(ut));
5524  memset(&t1,0,sizeof(sleftv));
5525  memset(&t2,0,sizeof(sleftv));
5526  t1.rtyp=INT_CMD;
5527  t2.rtyp=INT_CMD;
5528  for (vl=0;vl< vv->length(); vl++)
5529  {
5530  t1.data=(char *)(long)((*vv)[vl]);
5531  for (wl=0;wl< wv->length(); wl++)
5532  {
5533  t2.data=(char *)(long)((*wv)[wl]);
5534  if (p==NULL)
5535  {
5536  p=res;
5537  }
5538  else
5539  {
5541  p=p->next;
5542  }
5543  memcpy(u,&ut,sizeof(ut));
5544  if (u->Typ() == MATRIX_CMD)
5545  nok=jjBRACK_Ma(p,u,&t1,&t2);
5546  else if (u->Typ() == BIGINTMAT_CMD)
5547  nok=jjBRACK_Bim(p,u,&t1,&t2);
5548  else /* INTMAT_CMD */
5549  nok=jjBRACK_Im(p,u,&t1,&t2);
5550  if (nok)
5551  {
5552  res->CleanUp();
5553  return TRUE;
5554  }
5555  }
5556  }
5557  return FALSE;
5558 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5351
#define TRUE
Definition: auxiliary.h:98
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
static BOOLEAN jjBRACK_Im(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5324
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5379
int BOOLEAN
Definition: auxiliary.h:85

◆ jjBRACK_S()

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

Definition at line 5308 of file iparith.cc.

5309 {
5310  char *s= (char *)u->Data();
5311  int r = (int)(long)v->Data();
5312  int c = (int)(long)w->Data();
5313  int l = strlen(s);
5314 
5315  if ( (r<1) || (r>l) || (c<0) )
5316  {
5317  Werror("wrong range[%d,%d] in string %s",r,c,u->Fullname());
5318  return TRUE;
5319  }
5320  res->data = (char *)omAlloc((long)(c+1));
5321  sprintf((char *)res->data,"%-*.*s",c,c,s+r-1);
5322  return FALSE;
5323 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

◆ jjBRACKET()

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

Definition at line 2735 of file iparith.cc.

2736 {
2737  res->data=NULL;
2738 
2739  if (rIsPluralRing(currRing))
2740  {
2741  const poly q = (poly)b->Data();
2742 
2743  if( q != NULL )
2744  {
2745  if( (poly)a->Data() != NULL )
2746  {
2747  poly p = (poly)a->CopyD(POLY_CMD); // p = copy!
2748  res->data = nc_p_Bracket_qq(p,q, currRing); // p will be destroyed!
2749  }
2750  }
2751  }
2752  return FALSE;
2753 }
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
Definition: old.gring.cc:2307
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjBREAK0()

static BOOLEAN jjBREAK0 ( leftv  ,
leftv   
)
static

Definition at line 6480 of file iparith.cc.

6481 {
6482 #ifdef HAVE_SDB
6483  sdb_show_bp();
6484 #endif
6485  return FALSE;
6486 }
#define FALSE
Definition: auxiliary.h:94
void sdb_show_bp()
Definition: sdb.cc:58

◆ jjBREAK1()

static BOOLEAN jjBREAK1 ( leftv  ,
leftv  v 
)
static

Definition at line 6487 of file iparith.cc.

6488 {
6489 #ifdef HAVE_SDB
6490  if(v->Typ()==PROC_CMD)
6491  {
6492  int lineno=0;
6493  if((v->next!=NULL) && (v->next->Typ()==INT_CMD))
6494  {
6495  lineno=(int)(long)v->next->Data();
6496  }
6497  return sdb_set_breakpoint(v->Name(),lineno);
6498  }
6499  return TRUE;
6500 #else
6501  return FALSE;
6502 #endif
6503 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
const char * Name()
Definition: subexpr.h:121
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
Definition: sdb.cc:65
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjCALL1ARG()

static BOOLEAN jjCALL1ARG ( leftv  res,
leftv  v 
)
static

Definition at line 6504 of file iparith.cc.

6505 {
6506  return iiExprArith1(res,v,iiOp);
6507 }
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8215
int iiOp
Definition: iparith.cc:224

◆ jjCALL1MANY()

static BOOLEAN jjCALL1MANY ( leftv  res,
leftv  u 
)
static

Definition at line 3627 of file iparith.cc.

3628 {
3629  return iiExprArithM(res,u,iiOp);
3630 }
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8520
int iiOp
Definition: iparith.cc:224

◆ jjCALL2ARG()

static BOOLEAN jjCALL2ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6508 of file iparith.cc.

6509 {
6510  leftv v=u->next;
6511  u->next=NULL;
6512  BOOLEAN b=iiExprArith2(res,u,iiOp,v, (iiOp > 255));
6513  u->next=v;
6514  return b;
6515 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025

◆ jjCALL3ARG()

static BOOLEAN jjCALL3ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6516 of file iparith.cc.

6517 {
6518  leftv v = u->next;
6519  leftv w = v->next;
6520  u->next = NULL;
6521  v->next = NULL;
6522  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
6523  u->next = v;
6524  v->next = w;
6525  return b;
6526 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8430
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ jjCHAR()

static BOOLEAN jjCHAR ( leftv  res,
leftv  v 
)
static

Definition at line 3631 of file iparith.cc.

3632 {
3633  res->data = (char *)(long)rChar((ring)v->Data());
3634  return FALSE;
3635 }
#define FALSE
Definition: auxiliary.h:94
int rChar(ring r)
Definition: ring.cc:686
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjCHINREM_BI()

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

Definition at line 1662 of file iparith.cc.

1663 {
1664  intvec *c=(intvec*)u->Data();
1665  intvec* p=(intvec*)v->Data();
1666  int rl=p->length();
1667  number *x=(number *)omAlloc(rl*sizeof(number));
1668  number *q=(number *)omAlloc(rl*sizeof(number));
1669  int i;
1670  for(i=rl-1;i>=0;i--)
1671  {
1672  q[i]=n_Init((*p)[i], coeffs_BIGINT);
1673  x[i]=n_Init((*c)[i], coeffs_BIGINT);
1674  }
1675  CFArray iv(rl);
1676  number n=n_ChineseRemainderSym(x,q,rl,FALSE,iv,coeffs_BIGINT);
1677  for(i=rl-1;i>=0;i--)
1678  {
1679  n_Delete(&(q[i]),coeffs_BIGINT);
1680  n_Delete(&(x[i]),coeffs_BIGINT);
1681  }
1682  omFree(x); omFree(q);
1683  res->data=(char *)n;
1684  return FALSE;
1685 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
coeffs coeffs_BIGINT
Definition: ipid.cc:54
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
#define omFree(addr)
Definition: omAllocDecl.h:261
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
Definition: coeffs.h:798
int i
Definition: cfEzgcd.cc:123
int length() const
Definition: intvec.h:86
Variable x
Definition: cfModGcd.cc:4023
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459

◆ jjCHINREM_ID()

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

Definition at line 9068 of file iparith.cc.

9069 {
9070  coeffs cf;
9071  lists c=(lists)u->CopyD(); // list of ideal or bigint/int
9072  int rl=c->nr+1;
9073  int return_type=c->m[0].Typ();
9074  if ((return_type!=IDEAL_CMD)
9075  && (return_type!=MODUL_CMD)
9076  && (return_type!=MATRIX_CMD)
9077  && (return_type!=POLY_CMD))
9078  {
9079  if((return_type==BIGINT_CMD)
9080  ||(return_type==INT_CMD))
9081  return_type=BIGINT_CMD;
9082  else if (return_type==LIST_CMD)
9083  {
9084  // create a tmp list of the correct size
9085  lists res_l=(lists)omAllocBin(slists_bin);
9086  res_l->Init(rl /*c->nr+1*/);
9087  BOOLEAN bo=FALSE;
9088  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,CHINREM_CMD);
9089  for (unsigned i=0;i<=(unsigned)c->nr;i++)
9090  {
9091  sleftv tmp;
9092  tmp.Copy(v);
9093  bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],CHINREM_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
9094  if (bo) { Werror("chinrem failed for list entry %d",i+1); break;}
9095  }
9096  c->Clean();
9097  res->data=res_l;
9098  res->rtyp=LIST_CMD;
9099  return bo;
9100  }
9101  else
9102  {
9103  c->Clean();
9104  WerrorS("poly/ideal/module/matrix/list expected");
9105  return TRUE;
9106  }
9107  }
9108  if (return_type==BIGINT_CMD)
9109  cf=coeffs_BIGINT;
9110  else
9111  {
9112  cf=currRing->cf;
9113  if (nCoeff_is_Extension(cf) && (cf->extRing!=NULL))
9114  cf=cf->extRing->cf;
9115  }
9116  lists pl=NULL;
9117  intvec *p=NULL;
9118  if (v->Typ()==LIST_CMD) pl=(lists)v->Data();
9119  else p=(intvec*)v->Data();
9120  ideal result;
9121  ideal *x=(ideal *)omAlloc(rl*sizeof(ideal));
9122  number *xx=NULL;
9123  nMapFunc nMap=n_SetMap(coeffs_BIGINT,cf);
9124  int i;
9125  if (return_type!=BIGINT_CMD)
9126  {
9127  for(i=rl-1;i>=0;i--)
9128  {
9129  if (c->m[i].Typ()!=return_type)
9130  {
9131  Werror("%s expected at pos %d",Tok2Cmdname(return_type),i+1);
9132  omFree(x); // delete c
9133  return TRUE;
9134  }
9135  if (return_type==POLY_CMD)
9136  {
9137  x[i]=idInit(1,1);
9138  x[i]->m[0]=(poly)c->m[i].CopyD();
9139  }
9140  else
9141  {
9142  x[i]=(ideal)c->m[i].CopyD();
9143  }
9144  //c->m[i].Init();
9145  }
9146  }
9147  else
9148  {
9149  if (nMap==NULL)
9150  {
9151  Werror("not implemented: map bigint -> %s", nCoeffName(cf));
9152  return TRUE;
9153  }
9154  xx=(number *)omAlloc(rl*sizeof(number));
9155  for(i=rl-1;i>=0;i--)
9156  {
9157  if (c->m[i].Typ()==INT_CMD)
9158  {
9159  xx[i]=n_Init(((int)(long)c->m[i].Data()),cf);
9160  }
9161  else if (c->m[i].Typ()==BIGINT_CMD)
9162  {
9163  xx[i]=nMap((number)c->m[i].Data(),coeffs_BIGINT,cf);
9164  }
9165  else
9166  {
9167  Werror("bigint expected at pos %d",i+1);
9168  omFree(x); // delete c
9169  omFree(xx); // delete c
9170  return TRUE;
9171  }
9172  }
9173  }
9174  number *q=(number *)omAlloc(rl*sizeof(number));
9175  if (p!=NULL)
9176  {
9177  for(i=rl-1;i>=0;i--)
9178  {
9179  q[i]=n_Init((*p)[i], cf);
9180  }
9181  }
9182  else
9183  {
9184  for(i=rl-1;i>=0;i--)
9185  {
9186  if (pl->m[i].Typ()==INT_CMD)
9187  {
9188  q[i]=n_Init((int)(long)pl->m[i].Data(),cf);
9189  }
9190  else if (pl->m[i].Typ()==BIGINT_CMD)
9191  {
9192  q[i]=nMap((number)(pl->m[i].Data()),coeffs_BIGINT,cf);
9193  }
9194  else
9195  {
9196  Werror("bigint expected at pos %d",i+1);
9197  for(i++;i<rl;i++)
9198  {
9199  n_Delete(&(q[i]),cf);
9200  }
9201  omFree(x); // delete c
9202  omFree(q); // delete pl
9203  if (xx!=NULL) omFree(xx); // delete c
9204  return TRUE;
9205  }
9206  }
9207  }
9208  if (return_type==BIGINT_CMD)
9209  {
9210  CFArray i_v(rl);
9211  number n=n_ChineseRemainderSym(xx,q,rl,TRUE,i_v,coeffs_BIGINT);
9212  res->data=(char *)n;
9213  }
9214  else
9215  {
9216  result=id_ChineseRemainder(x,q,rl,currRing); // deletes also x
9217  c->Clean();
9218  if ((return_type==POLY_CMD) &&(result!=NULL))
9219  {
9220  res->data=(char *)result->m[0];
9221  result->m[0]=NULL;
9222  idDelete(&result);
9223  }
9224  else
9225  res->data=(char *)result;
9226  }
9227  for(i=rl-1;i>=0;i--)
9228  {
9229  n_Delete(&(q[i]),cf);
9230  }
9231  omFree(q);
9232  res->rtyp=return_type;
9233  return result==NULL;
9234 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
Definition: lists.h:22
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
return P p
Definition: myNF.cc:203
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
const struct sValCmd2 dArith2[]
Definition: table.h:290
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:995
#define omAlloc(size)
Definition: omAllocDecl.h:210
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:7852
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8727
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
Definition: intvec.h:14
#define omFree(addr)
Definition: omAllocDecl.h:261
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs r)
Definition: coeffs.h:798
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
void Copy(leftv e)
Definition: subexpr.cc:688
int i
Definition: cfEzgcd.cc:123
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:725
INLINE_THIS void Init(int l=0)
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int nr
Definition: lists.h:43
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
Variable x
Definition: cfModGcd.cc:4023
int rtyp
Definition: subexpr.h:92
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:863
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707
return result
Definition: facAbsBiFact.cc:76

◆ jjCOEF()

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

Definition at line 1773 of file iparith.cc.

1774 {
1775  poly p=(poly)v->Data();
1776  if ((p==NULL)||(pNext(p)!=NULL)) return TRUE;
1777  res->data=(char *)mp_CoeffProc((poly)u->Data(),p /*(poly)v->Data()*/,currRing);
1778  return FALSE;
1779 }
matrix mp_CoeffProc(poly f, poly vars, const ring R)
Definition: matpol.cc:413
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjCOEF_M()

static BOOLEAN jjCOEF_M ( leftv  ,
leftv  v 
)
static

Definition at line 6528 of file iparith.cc.

6529 {
6530  const short t[]={5,VECTOR_CMD,POLY_CMD,MATRIX_CMD,MATRIX_CMD,IDHDL};
6531  if (iiCheckTypes(v,t))
6532  return TRUE;
6533  idhdl c=(idhdl)v->next->next->data;
6534  if (v->next->next->next->rtyp!=IDHDL) return TRUE;
6535  idhdl m=(idhdl)v->next->next->next->data;
6536  idDelete((ideal *)&(c->data.uideal));
6537  idDelete((ideal *)&(m->data.uideal));
6538  mp_Coef2((poly)v->Data(),(poly)v->next->Data(),
6539  (matrix *)&(c->data.umatrix),(matrix *)&(m->data.umatrix),currRing);
6540  return FALSE;
6541 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int m
Definition: cfEzgcd.cc:119
idrec * idhdl
Definition: ring.h:18
leftv next
Definition: subexpr.h:87
void mp_Coef2(poly v, poly mon, matrix *c, matrix *m, const ring R)
corresponds to Macauley&#39;s coef: the exponent vector of vars has to contain the variables, eg &#39;xy&#39;; then the poly f is searched for monomials in x and y, these monimials are written to the first row of the matrix co. the second row of co contains the respective factors in f. Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.
Definition: matpol.cc:515
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:6470
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
utypes data
Definition: idrec.h:40

◆ jjCOEFFS2_KB()

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

Definition at line 1791 of file iparith.cc.

1792 {
1793  poly p = pInit();
1794  int i;
1795  for (i=1; i<=currRing->N; i++)
1796  {
1797  pSetExp(p, i, 1);
1798  }
1799  pSetm(p);
1800  res->data = (void*)idCoeffOfKBase((ideal)(u->Data()),
1801  (ideal)(v->Data()), p);
1802  pDelete(&p);
1803  return FALSE;
1804 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2232
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
#define pInit()
allocates a new monomial and initializes everything to 0
Definition: polys.h:61
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjCOEFFS3_Id()

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

Definition at line 5603 of file iparith.cc.

5604 {
5605  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5606  {
5607  WerrorS("3rd argument must be a name of a matrix");
5608  return TRUE;
5609  }
5610  ideal i=(ideal)u->Data();
5611  int rank=(int)i->rank;
5612  BOOLEAN r=jjCOEFFS_Id(res,u,v);
5613  if (r) return TRUE;
5614  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5615  return FALSE;
5616 }
#define pVar(m)
Definition: polys.h:364
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition: iparith.cc:1780
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
Definition: matpol.cc:376
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjCOEFFS3_KB()

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

Definition at line 5617 of file iparith.cc.

5618 {
5619  res->data=(void*)idCoeffOfKBase((ideal)(u->Data()),
5620  (ideal)(v->Data()),(poly)(w->Data()));
5621  return FALSE;
5622 }
#define FALSE
Definition: auxiliary.h:94
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2232
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjCOEFFS3_P()

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

Definition at line 5623 of file iparith.cc.

5624 {
5625  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5626  {
5627  WerrorS("3rd argument must be a name of a matrix");
5628  return TRUE;
5629  }
5630  // CopyD for POLY_CMD and VECTOR_CMD are identical:
5631  poly p=(poly)u->CopyD(POLY_CMD);
5632  ideal i=idInit(1,1);
5633  i->m[0]=p;
5634  sleftv t;
5635  memset(&t,0,sizeof(t));
5636  t.data=(char *)i;
5637  t.rtyp=IDEAL_CMD;
5638  int rank=1;
5639  if (u->Typ()==VECTOR_CMD)
5640  {
5641  i->rank=rank=pMaxComp(p);
5642  t.rtyp=MODUL_CMD;
5643  }
5644  BOOLEAN r=jjCOEFFS_Id(res,&t,v);
5645  t.CleanUp();
5646  if (r) return TRUE;
5647  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5648  return FALSE;
5649 }
#define pVar(m)
Definition: polys.h:364
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition: iparith.cc:1780
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
void mp_Monomials(matrix c, int r, int var, matrix m, const ring R)
Definition: matpol.cc:376
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjCOEFFS_Id()

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

Definition at line 1780 of file iparith.cc.

1781 {
1782  int i=pVar((poly)v->Data());
1783  if (i==0)
1784  {
1785  WerrorS("ringvar expected");
1786  return TRUE;
1787  }
1788  res->data=(char *)mp_Coeffs((ideal)u->CopyD(),i,currRing);
1789  return FALSE;
1790 }
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
matrix mp_Coeffs(ideal I, int var, const ring R)
corresponds to Maple&#39;s coeffs: var has to be the number of a variable
Definition: matpol.cc:326
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjCOLCOL()

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

Definition at line 699 of file iparith.cc.

700 {
701  switch(u->Typ())
702  {
703  case 0:
704  {
705  int name_err=0;
706  if(isupper(u->name[0]))
707  {
708  const char *c=u->name+1;
709  while((*c!='\0')&&(islower(*c)||(isdigit(*c)))) c++;
710  if (*c!='\0')
711  name_err=1;
712  else
713  {
714  Print("%s of type 'ANY'. Trying load.\n", u->name);
715  if(iiTryLoadLib(u, u->name))
716  {
717  Werror("'%s' no such package", u->name);
718  return TRUE;
719  }
720  syMake(u,u->name,NULL);
721  }
722  }
723  else name_err=1;
724  if(name_err)
725  { Werror("'%s' is an invalid package name",u->name);return TRUE;}
726  // and now, after the loading: use next case !!! no break !!!
727  }
728  case PACKAGE_CMD:
729  {
730  package pa=(package)u->Data();
731  if (u->rtyp==IDHDL) pa=IDPACKAGE((idhdl)u->data);
732  if((!pa->loaded)
733  && (pa->language > LANG_TOP))
734  {
735  Werror("'%s' not loaded", u->name);
736  return TRUE;
737  }
738  if(v->rtyp == IDHDL)
739  {
740  v->name = omStrDup(v->name);
741  }
742  else if (v->rtyp!=0)
743  {
744  WerrorS("reserved name with ::");
745  return TRUE;
746  }
747  v->req_packhdl=pa;
748  syMake(v, v->name, pa);
749  memcpy(res, v, sizeof(sleftv));
750  memset(v, 0, sizeof(sleftv));
751  }
752  break;
753  case DEF_CMD:
754  break;
755  default:
756  WerrorS("<package>::<id> expected");
757  return TRUE;
758  }
759  return FALSE;
760 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiTryLoadLib(leftv v, const char *id)
Definition: iplib.cc:656
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
#define IDPACKAGE(a)
Definition: ipid.h:136
Definition: tok.h:58
const char * name
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:107
int rtyp
Definition: subexpr.h:92
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1500
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjCOLON()

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

Definition at line 329 of file iparith.cc.

330 {
331  int l=(int)(long)v->Data();
332  if (l>=0)
333  {
334  int d=(int)(long)u->Data();
335  intvec *vv=new intvec(l);
336  int i;
337  for(i=l-1;i>=0;i--) { (*vv)[i]=d; }
338  res->data=(char *)vv;
339  }
340  return (l<0);
341 }
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
int l
Definition: cfEzgcd.cc:94

◆ jjCOLS()

static BOOLEAN jjCOLS ( leftv  res,
leftv  v 
)
static

Definition at line 3636 of file iparith.cc.

3637 {
3638  res->data = (char *)(long)MATCOLS((matrix)(v->Data()));
3639  return FALSE;
3640 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define MATCOLS(i)
Definition: matpol.h:28
void * Data()
Definition: subexpr.cc:1137

◆ jjCOLS_BIM()

static BOOLEAN jjCOLS_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 3641 of file iparith.cc.

3642 {
3643  res->data = (char *)(long)((bigintmat*)(v->Data()))->cols();
3644  return FALSE;
3645 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjCOLS_IV()

static BOOLEAN jjCOLS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 3646 of file iparith.cc.

3647 {
3648  res->data = (char *)(long)((intvec*)(v->Data()))->cols();
3649  return FALSE;
3650 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjCOMPARE_ALL()

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

Definition at line 9254 of file iparith.cc.

9255 {
9256  leftv a=(leftv)aa;
9257  int at=a->Typ();
9258  leftv b=(leftv)bb;
9259  int bt=b->Typ();;
9260  if (at < bt) return -1;
9261  if (at > bt) return 1;
9262  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,'<');
9263  sleftv tmp;
9264  memset(&tmp,0,sizeof(sleftv));
9265  iiOp='<';
9266  BOOLEAN bo=iiExprArith2TabIntern(&tmp,a,'<',b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
9267  if (bo)
9268  {
9269  Werror(" no `<` for %s",Tok2Cmdname(at));
9270  unsigned long ad=(unsigned long)a->Data();
9271  unsigned long bd=(unsigned long)b->Data();
9272  if (ad<bd) return -1;
9273  else if (ad==bd) return 0;
9274  else return 1;
9275  }
9276  else if (tmp.data==NULL) /* not < */
9277  {
9278  iiOp=EQUAL_EQUAL;
9279  tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,EQUAL_EQUAL);
9280  bo=iiExprArith2TabIntern(&tmp,a,EQUAL_EQUAL,b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
9281  if (bo)
9282  {
9283  Werror(" no `==` for %s",Tok2Cmdname(at));
9284  unsigned long ad=(unsigned long)a->Data();
9285  unsigned long bd=(unsigned long)b->Data();
9286  if (ad<bd) return -1;
9287  else if (ad==bd) return 0;
9288  else return 1;
9289  }
9290  else if (tmp.data==NULL) /* not <,== */ return 1;
9291  else return 0;
9292  }
9293  else return -1;
9294 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
const poly a
Definition: syzextra.cc:212
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
const struct sValCmd2 dArith2[]
Definition: table.h:290
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:995
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:7852
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8727
void * data
Definition: subexpr.h:89
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjCOMPARE_BIM()

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

Definition at line 376 of file iparith.cc.

377 {
378  bigintmat* a = (bigintmat * )(u->Data());
379  bigintmat* b = (bigintmat * )(v->Data());
380  int r=a->compare(b);
381  switch (iiOp)
382  {
383  case '<':
384  res->data = (char *) (r<0);
385  break;
386  case '>':
387  res->data = (char *) (r>0);
388  break;
389  case LE:
390  res->data = (char *) (r<=0);
391  break;
392  case GE:
393  res->data = (char *) (r>=0);
394  break;
395  case EQUAL_EQUAL:
396  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
397  res->data = (char *) (r==0);
398  break;
399  }
400  jjEQUAL_REST(res,u,v);
401  if(r==-2) { WerrorS("size incompatible"); return TRUE; }
402  return FALSE;
403 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
Definition: grammar.cc:270
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
int compare(const bigintmat *op) const
Definition: bigintmat.cc:363
const poly b
Definition: syzextra.cc:213

◆ jjCOMPARE_IV()

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

Definition at line 348 of file iparith.cc.

349 {
350  intvec* a = (intvec * )(u->Data());
351  intvec* b = (intvec * )(v->Data());
352  int r=a->compare(b);
353  switch (iiOp)
354  {
355  case '<':
356  res->data = (char *) (r<0);
357  break;
358  case '>':
359  res->data = (char *) (r>0);
360  break;
361  case LE:
362  res->data = (char *) (r<=0);
363  break;
364  case GE:
365  res->data = (char *) (r>=0);
366  break;
367  case EQUAL_EQUAL:
368  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
369  res->data = (char *) (r==0);
370  break;
371  }
372  jjEQUAL_REST(res,u,v);
373  if(r==-2) { WerrorS("size incompatible"); return TRUE; }
374  return FALSE;
375 }
int compare(const intvec *o) const
Definition: intvec.cc:207
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
Definition: grammar.cc:270
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
const poly b
Definition: syzextra.cc:213

◆ jjCOMPARE_IV_I()

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

Definition at line 404 of file iparith.cc.

405 {
406  intvec* a = (intvec * )(u->Data());
407  int b = (int)(long)(v->Data());
408  int r=a->compare(b);
409  switch (iiOp)
410  {
411  case '<':
412  res->data = (char *) (r<0);
413  break;
414  case '>':
415  res->data = (char *) (r>0);
416  break;
417  case LE:
418  res->data = (char *) (r<=0);
419  break;
420  case GE:
421  res->data = (char *) (r>=0);
422  break;
423  case EQUAL_EQUAL:
424  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
425  res->data = (char *) (r==0);
426  break;
427  }
428  jjEQUAL_REST(res,u,v);
429  return FALSE;
430 }
int compare(const intvec *o) const
Definition: intvec.cc:207
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
Definition: grammar.cc:270
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
const poly b
Definition: syzextra.cc:213

◆ jjCOMPARE_MA()

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

Definition at line 431 of file iparith.cc.

432 {
433  //Print("in: >>%s<<\n",my_yylinebuf);
434  matrix a=(matrix)u->Data();
435  matrix b=(matrix)v->Data();
436  int r=mp_Compare(a,b,currRing);
437  switch (iiOp)
438  {
439  case '<':
440  res->data = (char *) (long)(r < 0);
441  break;
442  case '>':
443  res->data = (char *) (long)(r > 0);
444  break;
445  case LE:
446  res->data = (char *) (long)(r <= 0);
447  break;
448  case GE:
449  res->data = (char *) (long)(r >= 0);
450  break;
451  case EQUAL_EQUAL:
452  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
453  res->data = (char *)(long) (r == 0);
454  break;
455  }
456  jjEQUAL_REST(res,u,v);
457  return FALSE;
458 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
Definition: grammar.cc:270
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: grammar.cc:269
ip_smatrix * matrix
void * Data()
Definition: subexpr.cc:1137
int mp_Compare(matrix a, matrix b, const ring R)
Definition: matpol.cc:577
int iiOp
Definition: iparith.cc:224
const poly b
Definition: syzextra.cc:213

◆ jjCOMPARE_P()

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

Definition at line 459 of file iparith.cc.

460 {
461  poly p=(poly)u->Data();
462  poly q=(poly)v->Data();
463  int r=p_Compare(p,q,currRing);
464  switch (iiOp)
465  {
466  case '<':
467  res->data = (char *) (r < 0);
468  break;
469  case '>':
470  res->data = (char *) (r > 0);
471  break;
472  case LE:
473  res->data = (char *) (r <= 0);
474  break;
475  case GE:
476  res->data = (char *) (r >= 0);
477  break;
478  //case EQUAL_EQUAL:
479  //case NOTEQUAL: /* negation handled by jjEQUAL_REST */
480  // res->data = (char *) (r == 0);
481  // break;
482  }
483  jjEQUAL_REST(res,u,v);
484  return FALSE;
485 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
Definition: grammar.cc:270
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: grammar.cc:269
int p_Compare(const poly a, const poly b, const ring R)
Definition: p_polys.cc:4752
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224

◆ jjCOMPARE_S()

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

Definition at line 486 of file iparith.cc.

487 {
488  char* a = (char * )(u->Data());
489  char* b = (char * )(v->Data());
490  int result = strcmp(a,b);
491  switch (iiOp)
492  {
493  case '<':
494  res->data = (char *) (result < 0);
495  break;
496  case '>':
497  res->data = (char *) (result > 0);
498  break;
499  case LE:
500  res->data = (char *) (result <= 0);
501  break;
502  case GE:
503  res->data = (char *) (result >= 0);
504  break;
505  case EQUAL_EQUAL:
506  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
507  res->data = (char *) (result == 0);
508  break;
509  }
510  jjEQUAL_REST(res,u,v);
511  return FALSE;
512 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
Definition: grammar.cc:270
void * data
Definition: subexpr.h:89
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
const poly b
Definition: syzextra.cc:213
return result
Definition: facAbsBiFact.cc:76

◆ jjCONTENT()

static BOOLEAN jjCONTENT ( leftv  res,
leftv  v 
)
static

Definition at line 3651 of file iparith.cc.

3652 {
3653  // CopyD for POLY_CMD and VECTOR_CMD are identical:
3654  poly p=(poly)v->CopyD(POLY_CMD);
3655  if (p!=NULL) p_Cleardenom(p, currRing);
3656  res->data = (char *)p;
3657  return FALSE;
3658 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2747
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjCONTRACT()

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

Definition at line 1805 of file iparith.cc.

1806 {
1807  res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data(),FALSE);
1808  return FALSE;
1809 }
#define FALSE
Definition: auxiliary.h:94
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
Definition: ideals.cc:1917
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_BI()

static BOOLEAN jjCOUNT_BI ( leftv  res,
leftv  v 
)
static

Definition at line 3659 of file iparith.cc.

3660 {
3661  res->data = (char *)(long)n_Size((number)v->Data(),coeffs_BIGINT);
3662  return FALSE;
3663 }
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
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:574

◆ jjCOUNT_IV()

static BOOLEAN jjCOUNT_IV ( leftv  res,
leftv  v 
)
static

Definition at line 3681 of file iparith.cc.

3682 {
3683  res->data = (char *)(long)((intvec*)(v->Data()))->length();
3684  return FALSE;
3685 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_L()

static BOOLEAN jjCOUNT_L ( leftv  res,
leftv  v 
)
static

Definition at line 3669 of file iparith.cc.

3670 {
3671  lists l=(lists)v->Data();
3672  res->data = (char *)(long)(lSize(l)+1);
3673  return FALSE;
3674 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int lSize(lists L)
Definition: lists.cc:25
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137
int l
Definition: cfEzgcd.cc:94

◆ jjCOUNT_M()

static BOOLEAN jjCOUNT_M ( leftv  res,
leftv  v 
)
static

Definition at line 3675 of file iparith.cc.

3676 {
3677  matrix m=(matrix)v->Data();
3678  res->data = (char *)(long)(MATROWS(m)*MATCOLS(m));
3679  return FALSE;
3680 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
#define MATCOLS(i)
Definition: matpol.h:28
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27

◆ jjCOUNT_N()

static BOOLEAN jjCOUNT_N ( leftv  res,
leftv  v 
)
static

Definition at line 3664 of file iparith.cc.

3665 {
3666  res->data = (char *)(long)nSize((number)v->Data());
3667  return FALSE;
3668 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define nSize(n)
Definition: numbers.h:39
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_RES()

static BOOLEAN jjCOUNT_RES ( leftv  res,
leftv  v 
)
static

Definition at line 5277 of file iparith.cc.

5278 {
5279  res->data=(char *)(long)sySize((syStrategy)v->Data());
5280  return FALSE;
5281 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int sySize(syStrategy syzstr)
Definition: syz1.cc:1837
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_RG()

static BOOLEAN jjCOUNT_RG ( leftv  res,
leftv  v 
)
static

Definition at line 3686 of file iparith.cc.

3687 {
3688  ring r=(ring)v->Data();
3689  int elems=-1;
3690  if (rField_is_Zp(r)) elems=r->cf->ch;
3691  else if (rField_is_GF(r)) elems=r->cf->m_nfCharQ;
3692  else if (rField_is_Zp_a(r) && (r->cf->type==n_algExt))
3693  {
3694  extern int ipower ( int b, int n ); /* factory/cf_util */
3695  elems=ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));
3696  }
3697  res->data = (char *)(long)elems;
3698  return FALSE;
3699 }
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:521
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:513
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
int ipower(int b, int m)
int ipower ( int b, int m )
Definition: cf_util.cc:25
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjDEFINED()

static BOOLEAN jjDEFINED ( leftv  res,
leftv  v 
)
static

Definition at line 3738 of file iparith.cc.

3739 {
3740  if ((v->rtyp==IDHDL)
3741  && ((myynest==IDLEV((idhdl)v->data))||(0==IDLEV((idhdl)v->data))))
3742  {
3743  res->data=(void *)(long)(IDLEV((idhdl)v->data)+1);
3744  }
3745  else if (v->rtyp!=0) res->data=(void *)(-1);
3746  return FALSE;
3747 }
#define FALSE
Definition: auxiliary.h:94
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
#define IDLEV(a)
Definition: ipid.h:118
int rtyp
Definition: subexpr.h:92

◆ jjDEG()

static BOOLEAN jjDEG ( leftv  res,
leftv  v 
)
static

Definition at line 3700 of file iparith.cc.

3701 {
3702  int dummy;
3703  poly p=(poly)v->Data();
3704  if (p!=NULL) res->data = (char *)currRing->pLDeg(p,&dummy,currRing);
3705  else res->data=(char *)-1;
3706  return FALSE;
3707 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjDEG_IV()

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

Definition at line 1821 of file iparith.cc.

1822 {
1823  poly p=(poly)u->Data();
1824  if (p!=NULL)
1825  {
1826  short *iv=iv2array((intvec *)v->Data(),currRing);
1827  const long d = p_DegW(p,iv,currRing);
1828  omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(short) );
1829  res->data = (char *)(d);
1830  }
1831  else
1832  res->data=(char *)(long)(-1);
1833  return FALSE;
1834 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
long p_DegW(poly p, const short *w, const ring R)
Definition: p_polys.cc:689
Definition: intvec.h:14
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjDEG_M()

static BOOLEAN jjDEG_M ( leftv  res,
leftv  u 
)
static

Definition at line 3708 of file iparith.cc.

3709 {
3710  ideal I=(ideal)u->Data();
3711  int d=-1;
3712  int dummy;
3713  int i;
3714  for(i=IDELEMS(I)-1;i>=0;i--)
3715  if (I->m[i]!=NULL) d=si_max(d,(int)currRing->pLDeg(I->m[i],&dummy,currRing));
3716  res->data = (char *)(long)d;
3717  return FALSE;
3718 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjDEG_M_IV()

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

Definition at line 1810 of file iparith.cc.

1811 {
1812  short *iv=iv2array((intvec *)v->Data(),currRing);
1813  ideal I=(ideal)u->Data();
1814  int d=-1;
1815  int i;
1816  for(i=IDELEMS(I);i>=0;i--) d=si_max(d,(int)p_DegW(I->m[i],iv,currRing));
1817  omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(short) );
1818  res->data = (char *)((long)d);
1819  return FALSE;
1820 }
#define FALSE
Definition: auxiliary.h:94
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
long p_DegW(poly p, const short *w, const ring R)
Definition: p_polys.cc:689
Definition: intvec.h:14
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
void * Data()
Definition: subexpr.cc:1137

◆ jjDEGREE()

static BOOLEAN jjDEGREE ( leftv  res,
leftv  v 
)
static

Definition at line 3719 of file iparith.cc.

3720 {
3721  SPrintStart();
3722 #ifdef HAVE_RINGS
3724  {
3725  PrintS("// NOTE: computation of degree is being performed for\n");
3726  PrintS("// generic fibre, that is, over Q\n");
3727  }
3728 #endif
3729  assumeStdFlag(v);
3730  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
3731  scDegree((ideal)v->Data(),module_w,currRing->qideal);
3732  char *s=SPrintEnd();
3733  int l=strlen(s)-1;
3734  s[l]='\0';
3735  res->data=(void*)s;
3736  return FALSE;
3737 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
void scDegree(ideal S, intvec *modulweight, ideal Q)
Definition: hdegree.cc:822
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void PrintS(const char *s)
Definition: reporter.cc:284
char * SPrintEnd()
Definition: reporter.cc:273
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1137
void SPrintStart()
Definition: reporter.cc:246
int l
Definition: cfEzgcd.cc:94

◆ jjDENOMINATOR()

static BOOLEAN jjDENOMINATOR ( leftv  res,
leftv  v 
)
static

Return the denominator of the input number NOTE: the input number is normalized as a side effect.

Definition at line 3751 of file iparith.cc.

3752 {
3753  number n = reinterpret_cast<number>(v->Data());
3754  res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing->cf));
3755  return FALSE;
3756 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
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:607
void * Data()
Definition: subexpr.cc:1137

◆ jjDET()

static BOOLEAN jjDET ( leftv  res,
leftv  v 
)
static

Definition at line 3767 of file iparith.cc.

3768 {
3769  matrix m=(matrix)v->Data();
3770  poly p;
3771  if (sm_CheckDet((ideal)m,m->cols(),TRUE, currRing))
3772  {
3774  p=sm_CallDet(I, currRing);
3775  idDelete(&I);
3776  }
3777  else
3778  p=singclap_det(m,currRing);
3779  res ->data = (char *)p;
3780  return FALSE;
3781 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
poly sm_CallDet(ideal I, const ring R)
Definition: sparsmat.cc:358
#define TRUE
Definition: auxiliary.h:98
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1568
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN sm_CheckDet(ideal I, int d, BOOLEAN sw, const ring r)
Definition: sparsmat.cc:307
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int & cols()
Definition: matpol.h:25
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
ideal id_Matrix2Module(matrix mat, const ring R)

◆ jjDET_BI()

static BOOLEAN jjDET_BI ( leftv  res,
leftv  v 
)
static

Definition at line 3782 of file iparith.cc.

3783 {
3784  bigintmat * m=(bigintmat*)v->Data();
3785  int i,j;
3786  i=m->rows();j=m->cols();
3787  if(i==j)
3788  res->data = (char *)(long)singclap_det_bi(m,coeffs_BIGINT);
3789  else
3790  {
3791  Werror("det of %d x %d bigintmat",i,j);
3792  return TRUE;
3793  }
3794  return FALSE;
3795 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
int j
Definition: myNF.cc:70
int cols() const
Definition: bigintmat.h:145
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
number singclap_det_bi(bigintmat *m, const coeffs cf)
Definition: clapsing.cc:1609
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjDET_I()

static BOOLEAN jjDET_I ( leftv  res,
leftv  v 
)
static

Definition at line 3818 of file iparith.cc.

3819 {
3820  intvec * m=(intvec*)v->Data();
3821  int i,j;
3822  i=m->rows();j=m->cols();
3823  if(i==j)
3824  res->data = (char *)(long)singclap_det_i(m,currRing);
3825  else
3826  {
3827  Werror("det of %d x %d intmat",i,j);
3828  return TRUE;
3829  }
3830  return FALSE;
3831 }
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
int singclap_det_i(intvec *m, const ring)
Definition: clapsing.cc:1591
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjDET_S()

static BOOLEAN jjDET_S ( leftv  res,
leftv  v 
)
static

Definition at line 3832 of file iparith.cc.

3833 {
3834  ideal I=(ideal)v->Data();
3835  poly p;
3836  if (IDELEMS(I)<1) return TRUE;
3837  if (sm_CheckDet(I,IDELEMS(I),FALSE, currRing))
3838  {
3840  p=singclap_det(m,currRing);
3841  idDelete((ideal *)&m);
3842  }
3843  else
3844  p=sm_CallDet(I, currRing);
3845  res->data = (char *)p;
3846  return FALSE;
3847 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
poly sm_CallDet(ideal I, const ring R)
Definition: sparsmat.cc:358
#define TRUE
Definition: auxiliary.h:98
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1568
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN sm_CheckDet(ideal I, int d, BOOLEAN sw, const ring r)
Definition: sparsmat.cc:307
int m
Definition: cfEzgcd.cc:119
matrix id_Module2Matrix(ideal mod, const ring R)
#define IDELEMS(i)
Definition: simpleideals.h:24
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjDIFF_COEF()

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

Definition at line 4251 of file iparith.cc.

4252 {
4253  if (!nCoeff_is_transExt(currRing->cf))
4254  {
4255  WerrorS("differentiation not defined in the coefficient ring");
4256  return TRUE;
4257  }
4258  number n = (number) u->Data();
4259  number k = (number) v->Data();
4260  res->data = ntDiff(n,k,currRing->cf);
4261  return FALSE;
4262 }
number ntDiff(number a, number d, const coeffs cf)
Definition: transext.cc:887
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:935
void * Data()
Definition: subexpr.cc:1137

◆ jjDIFF_ID()

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

Definition at line 1846 of file iparith.cc.

1847 {
1848  int i=pVar((poly)v->Data());
1849  if (i==0)
1850  {
1851  WerrorS("ringvar expected");
1852  return TRUE;
1853  }
1854  res->data=(char *)idDiff((matrix)(u->Data()),i);
1855  return FALSE;
1856 }
matrix idDiff(matrix i, int k)
Definition: ideals.cc:1904
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjDIFF_ID_ID()

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

Definition at line 1857 of file iparith.cc.

1858 {
1859  res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data());
1860  return FALSE;
1861 }
#define FALSE
Definition: auxiliary.h:94
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
Definition: ideals.cc:1917
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjDIFF_P()

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

Definition at line 1835 of file iparith.cc.

1836 {
1837  int i=pVar((poly)v->Data());
1838  if (i==0)
1839  {
1840  WerrorS("ringvar expected");
1841  return TRUE;
1842  }
1843  res->data=(char *)pDiff((poly)(u->Data()),i);
1844  return FALSE;
1845 }
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
#define pDiff(a, b)
Definition: polys.h:278
polyrec * poly
Definition: hilb.h:10

◆ jjDIM()

static BOOLEAN jjDIM ( leftv  res,
leftv  v 
)
static

Definition at line 3848 of file iparith.cc.

3849 {
3850  assumeStdFlag(v);
3852  {
3853  Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
3854  }
3855 #ifdef HAVE_RINGS
3856  if (rField_is_Ring(currRing))
3857  {
3858  ideal vid = (ideal)v->Data();
3859  int i = idPosConstant(vid);
3860  if ((i != -1) && (n_IsUnit(pGetCoeff(vid->m[i]),currRing->cf)))
3861  { /* ideal v contains unit; dim = -1 */
3862  res->data = (char *)-1L;
3863  return FALSE;
3864  }
3865  ideal vv = id_Head(vid,currRing);
3866  idSkipZeroes(vv);
3867  int j = idPosConstant(vv);
3868  long d;
3869  if(j == -1)
3870  {
3871  d = (long)scDimInt(vv, currRing->qideal);
3873  d++;
3874  }
3875  else
3876  {
3877  if(n_IsUnit(pGetCoeff(vv->m[j]),currRing->cf))
3878  d = -1;
3879  else
3880  d = (long)scDimInt(vv, currRing->qideal);
3881  }
3882  //Anne's Idea for std(4,2x) = 0 bug
3883  long dcurr = d;
3884  for(unsigned ii=0;ii<(unsigned)IDELEMS(vv);ii++)
3885  {
3886  if(vv->m[ii] != NULL && !n_IsUnit(pGetCoeff(vv->m[ii]),currRing->cf))
3887  {
3888  ideal vc = idCopy(vv);
3889  poly c = pInit();
3890  pSetCoeff0(c,nCopy(pGetCoeff(vv->m[ii])));
3891  idInsertPoly(vc,c);
3892  idSkipZeroes(vc);
3893  for(unsigned jj = 0;jj<(unsigned)IDELEMS(vc)-1;jj++)
3894  {
3895  if((vc->m[jj]!=NULL)
3896  && (n_DivBy(pGetCoeff(vc->m[jj]),pGetCoeff(c),currRing->cf)))
3897  {
3898  pDelete(&vc->m[jj]);
3899  }
3900  }
3901  idSkipZeroes(vc);
3902  j = idPosConstant(vc);
3903  if (j != -1) pDelete(&vc->m[j]);
3904  dcurr = (long)scDimInt(vc, currRing->qideal);
3905  // the following assumes the ground rings to be either zero- or one-dimensional
3906  if((j==-1) && rField_is_Ring_Z(currRing))
3907  {
3908  // should also be activated for other euclidean domains as groundfield
3909  dcurr++;
3910  }
3911  idDelete(&vc);
3912  }
3913  if(dcurr > d)
3914  d = dcurr;
3915  }
3916  res->data = (char *)d;
3917  idDelete(&vv);
3918  return FALSE;
3919  }
3920 #endif
3921  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
3922  return FALSE;
3923 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:37
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
Definition: coeffs.h:519
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const char * Name()
Definition: subexpr.h:121
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int j
Definition: myNF.cc:70
int scDimInt(ideal S, ideal Q)
Definition: hdegree.cc:72
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether &#39;a&#39; is divisible &#39;b&#39;; for r encoding a field: TRUE iff &#39;b&#39; does not represent zero in Z:...
Definition: coeffs.h:787
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
BOOLEAN rHasMixedOrdering(const ring r)
Definition: ring.h:752
ideal idCopy(ideal A)
Definition: ideals.h:60
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define pInit()
allocates a new monomial and initializes everything to 0
Definition: polys.h:61
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
#define pDelete(p_ptr)
Definition: polys.h:169
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1137
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
#define Warn
Definition: emacs.cc:80

◆ jjDIM2()

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

Definition at line 1862 of file iparith.cc.

1863 {
1864  assumeStdFlag(v);
1866  {
1867  Warn("dim(%s,...) may be wrong because the mixed monomial ordering",v->Name());
1868  }
1869 #ifdef HAVE_RINGS
1870  if (rField_is_Ring(currRing))
1871  {
1872  ideal vid = (ideal)v->Data();
1873  int i = idPosConstant(vid);
1874  if ((i != -1) && (n_IsUnit(pGetCoeff(vid->m[i]),currRing->cf)))
1875  { /* ideal v contains unit; dim = -1 */
1876  res->data = (char *)-1;
1877  return FALSE;
1878  }
1879  ideal vv = id_Copy(vid, currRing);
1880  ideal ww = id_Copy((ideal)w->Data(), currRing);
1881  /* drop degree zero generator from vv (if any) */
1882  if (i != -1) pDelete(&vv->m[i]);
1883  long d = (long)scDimInt(vv, ww);
1884  if (rField_is_Ring_Z(currRing) && (i == -1)) d++;
1885  res->data = (char *)d;
1886  idDelete(&vv); idDelete(&ww);
1887  return FALSE;
1888  }
1889 #endif
1890  if(currRing->qideal==NULL)
1891  res->data = (char *)((long)scDimInt((ideal)(v->Data()),(ideal)w->Data()));
1892  else
1893  {
1894  ideal q=idSimpleAdd(currRing->qideal,(ideal)w->Data());
1895  res->data = (char *)((long)scDimInt((ideal)(v->Data()),q));
1896  idDelete(&q);
1897  }
1898  return FALSE;
1899 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:37
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
Definition: coeffs.h:519
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define idSimpleAdd(A, B)
Definition: ideals.h:42
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const char * Name()
Definition: subexpr.h:121
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int scDimInt(ideal S, ideal Q)
Definition: hdegree.cc:72
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
int i
Definition: cfEzgcd.cc:123
BOOLEAN rHasMixedOrdering(const ring r)
Definition: ring.h:752
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
#define Warn
Definition: emacs.cc:80

◆ jjDIM_R()

static BOOLEAN jjDIM_R ( leftv  res,
leftv  v 
)
static

Definition at line 5282 of file iparith.cc.

5283 {
5284  res->data = (char *)(long)syDim((syStrategy)v->Data());
5285  return FALSE;
5286 }
#define FALSE
Definition: auxiliary.h:94
int syDim(syStrategy syzstr)
Definition: syz1.cc:1857
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjDIV_BI()

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

Definition at line 1177 of file iparith.cc.

1178 {
1179  number q=(number)v->Data();
1180  if (n_IsZero(q,coeffs_BIGINT))
1181  {
1183  return TRUE;
1184  }
1185  q = n_Div((number)u->Data(),q,coeffs_BIGINT);
1187  res->data = (char *)q;
1188  return FALSE;
1189 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:582
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:468
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:619
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222

◆ jjDIV_Ma()

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

Definition at line 1278 of file iparith.cc.

1279 {
1280  poly q=(poly)v->Data();
1281  if (q==NULL)
1282  {
1284  return TRUE;
1285  }
1286  matrix m=(matrix)(u->Data());
1287  int r=m->rows();
1288  int c=m->cols();
1289  matrix mm=mpNew(r,c);
1290  unsigned i,j;
1291  for(i=r;i>0;i--)
1292  {
1293  for(j=c;j>0;j--)
1294  {
1295  if (pNext(q)!=NULL)
1296  {
1297  MATELEM(mm,i,j) = singclap_pdivide( MATELEM(m,i,j) ,
1298  q /*(poly)(v->Data())*/, currRing );
1299  }
1300  else
1301  MATELEM(mm,i,j) = pDivideM(pCopy(MATELEM(m,i,j)),pHead(q));
1302  }
1303  }
1304  id_Normalize((ideal)mm,currRing);
1305  res->data=(char *)mm;
1306  return FALSE;
1307 }
int & rows()
Definition: matpol.h:24
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:534
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define pDivideM(a, b)
Definition: polys.h:276
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
int & cols()
Definition: matpol.h:25
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222
polyrec * poly
Definition: hilb.h:10
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define MATELEM(mat, i, j)
Definition: matpol.h:29

◆ jjDIV_N()

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

Definition at line 1190 of file iparith.cc.

1191 {
1192  number q=(number)v->Data();
1193  if (nIsZero(q))
1194  {
1196  return TRUE;
1197  }
1198  q = nDiv((number)u->Data(),q);
1199  nNormalize(q);
1200  res->data = (char *)q;
1201  return FALSE;
1202 }
#define nNormalize(n)
Definition: numbers.h:30
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
#define nDiv(a, b)
Definition: numbers.h:32
#define nIsZero(n)
Definition: numbers.h:19
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222

◆ jjDIV_P()

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

Definition at line 1203 of file iparith.cc.

1204 {
1205  poly q=(poly)v->Data();
1206  if (q==NULL)
1207  {
1209  return TRUE;
1210  }
1211  poly p=(poly)(u->Data());
1212  if (p==NULL)
1213  {
1214  res->data=NULL;
1215  return FALSE;
1216  }
1217  if ((pNext(q)!=NULL) && (!rField_is_Ring(currRing)))
1218  { /* This means that q != 0 consists of at least two terms.
1219  Moreover, currRing is over a field. */
1220  if(pGetComp(p)==0)
1221  {
1222  res->data=(void*)(singclap_pdivide(p /*(poly)(u->Data())*/ ,
1223  q /*(poly)(v->Data())*/ ,currRing));
1224  }
1225  else
1226  {
1227  int comps=pMaxComp(p);
1228  ideal I=idInit(comps,1);
1229  p=pCopy(p);
1230  poly h;
1231  int i;
1232  // conversion to a list of polys:
1233  while (p!=NULL)
1234  {
1235  i=pGetComp(p)-1;
1236  h=pNext(p);
1237  pNext(p)=NULL;
1238  pSetComp(p,0);
1239  I->m[i]=pAdd(I->m[i],p);
1240  p=h;
1241  }
1242  // division and conversion to vector:
1243  h=NULL;
1244  p=NULL;
1245  for(i=comps-1;i>=0;i--)
1246  {
1247  if (I->m[i]!=NULL)
1248  {
1249  h=singclap_pdivide(I->m[i],q,currRing);
1250  pSetCompP(h,i+1);
1251  p=pAdd(p,h);
1252  }
1253  }
1254  idDelete(&I);
1255  res->data=(void *)p;
1256  }
1257  }
1258  else
1259  { /* This means that q != 0 consists of just one term,
1260  or that currRing is over a coefficient ring. */
1261 #ifdef HAVE_RINGS
1262  if (!rField_is_Domain(currRing))
1263  {
1264  WerrorS("division only defined over coefficient domains");
1265  return TRUE;
1266  }
1267  if (pNext(q)!=NULL)
1268  {
1269  WerrorS("division over a coefficient domain only implemented for terms");
1270  return TRUE;
1271  }
1272 #endif
1273  res->data = (char *)pDivideM(pCopy(p),pHead(q));
1274  }
1275  pNormalize((poly)res->data);
1276  return FALSE;
1277 }
#define pAdd(p, q)
Definition: polys.h:186
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
void WerrorS(const char *s)
Definition: feFopen.cc:24
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:534
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pSetCompP(a, i)
Definition: polys.h:285
#define pDivideM(a, b)
Definition: polys.h:276
pNormalize(P.p)
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

◆ jjDIVISION()

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

Definition at line 1900 of file iparith.cc.

1901 {
1902  ideal vi=(ideal)v->Data();
1903  int vl= IDELEMS(vi);
1904  ideal ui=(ideal)u->Data();
1905  unsigned ul= IDELEMS(ui);
1906  ideal R; matrix U;
1907  ideal m = idLift(vi,ui,&R, FALSE,hasFlag(v,FLAG_STD),TRUE,&U);
1908  if (m==NULL) return TRUE;
1909  // now make sure that all matices have the corect size:
1911  int i;
1912  if (MATCOLS(U) != (int)ul)
1913  {
1914  unsigned mul=si_min(ul,MATCOLS(U));
1915  matrix UU=mpNew(ul,ul);
1916  unsigned j;
1917  for(i=mul;i>0;i--)
1918  {
1919  for(j=mul;j>0;j--)
1920  {
1921  MATELEM(UU,i,j)=MATELEM(U,i,j);
1922  MATELEM(U,i,j)=NULL;
1923  }
1924  }
1925  idDelete((ideal *)&U);
1926  U=UU;
1927  }
1928  // make sure that U is a diagonal matrix of units
1929  for(i=ul;i>0;i--)
1930  {
1931  if(MATELEM(U,i,i)==NULL) MATELEM(U,i,i)=pOne();
1932  }
1934  L->Init(3);
1935  L->m[0].rtyp=MATRIX_CMD; L->m[0].data=(void *)T;
1936  L->m[1].rtyp=u->Typ(); L->m[1].data=(void *)R;
1937  L->m[2].rtyp=MATRIX_CMD; L->m[2].data=(void *)U;
1938  res->data=(char *)L;
1939  return FALSE;
1940 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
Definition: lists.h:22
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int j
Definition: myNF.cc:70
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FLAG_STD
Definition: ipid.h:106
INLINE_THIS void Init(int l=0)
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
slists * lists
Definition: mpr_numeric.h:146
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891
omBin slists_bin
Definition: lists.cc:23
static jList * T
Definition: janet.cc:37
#define MATELEM(mat, i, j)
Definition: matpol.h:29

◆ jjDIVISION4()

static BOOLEAN jjDIVISION4 ( leftv  res,
leftv  v 
)
static

Definition at line 6543 of file iparith.cc.

6544 { // may have 3 or 4 arguments
6545  leftv v1=v;
6546  leftv v2=v1->next;
6547  leftv v3=v2->next;
6548  leftv v4=v3->next;
6549  assumeStdFlag(v2);
6550 
6551  int i1=iiTestConvert(v1->Typ(),MODUL_CMD);
6552  int i2=iiTestConvert(v2->Typ(),MODUL_CMD);
6553 
6554  if((i1==0)||(i2==0)
6555  ||(v3->Typ()!=INT_CMD)||((v4!=NULL)&&(v4->Typ()!=INTVEC_CMD)))
6556  {
6557  WarnS("<module>,<module>,<int>[,<intvec>] expected!");
6558  return TRUE;
6559  }
6560 
6561  sleftv w1,w2;
6562  iiConvert(v1->Typ(),MODUL_CMD,i1,v1,&w1);
6563  iiConvert(v2->Typ(),MODUL_CMD,i2,v2,&w2);
6564  ideal P=(ideal)w1.Data();
6565  ideal Q=(ideal)w2.Data();
6566 
6567  int n=(int)(long)v3->Data();
6568  short *w=NULL;
6569  if(v4!=NULL)
6570  {
6571  w = iv2array((intvec *)v4->Data(),currRing);
6572  short * w0 = w + 1;
6573  int i = currRing->N;
6574  while( (i > 0) && ((*w0) > 0) )
6575  {
6576  w0++;
6577  i--;
6578  }
6579  if(i>0)
6580  WarnS("not all weights are positive!");
6581  }
6582 
6583  matrix T;
6584  ideal R;
6585  idLiftW(P,Q,n,T,R,w);
6586 
6587  w1.CleanUp();
6588  w2.CleanUp();
6589  if(w!=NULL)
6590  omFreeSize( (ADDRESS)w, (rVar(currRing)+1)*sizeof(short) );
6591 
6593  L->Init(2);
6594  L->m[1].rtyp=v1->Typ();
6595  if(v1->Typ()==POLY_CMD||v1->Typ()==VECTOR_CMD)
6596  {
6597  if(v1->Typ()==POLY_CMD)
6598  p_Shift(&R->m[0],-1,currRing);
6599  L->m[1].data=(void *)R->m[0];
6600  R->m[0]=NULL;
6601  idDelete(&R);
6602  }
6603  else if(v1->Typ()==IDEAL_CMD||v1->Typ()==MATRIX_CMD)
6604  L->m[1].data=(void *)id_Module2Matrix(R,currRing);
6605  else
6606  {
6607  L->m[1].rtyp=MODUL_CMD;
6608  L->m[1].data=(void *)R;
6609  }
6610  L->m[0].rtyp=MATRIX_CMD;
6611  L->m[0].data=(char *)T;
6612 
6613  res->data=L;
6614  res->rtyp=LIST_CMD;
6615 
6616  return FALSE;
6617 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
Definition: lists.h:22
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, short *w)
Definition: ideals.cc:1086
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
#define Q
Definition: sirandom.c:25
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
const ring R
Definition: DebugPrint.cc:36
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
int i
Definition: cfEzgcd.cc:123
matrix id_Module2Matrix(ideal mod, const ring R)
leftv next
Definition: subexpr.h:87
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition: p_polys.cc:4553
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
kBucketDestroy & P
Definition: myNF.cc:191
static jList * T
Definition: janet.cc:37

◆ jjDIVMOD_I()

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

Definition at line 1154 of file iparith.cc.

1155 {
1156  if (iiOp=='/') Warn("int division with `/`: use `div` instead in line >>%s<<",my_yylinebuf);
1157  int a= (int)(long)u->Data();
1158  int b= (int)(long)v->Data();
1159  if (b==0)
1160  {
1162  return TRUE;
1163  }
1164  int c=a%b;
1165  int r=0;
1166  switch (iiOp)
1167  {
1168  case '%':
1169  r=c; break;
1170  case '/':
1171  case INTDIV_CMD:
1172  r=((a-c) /b); break;
1173  }
1174  res->data=(void *)((long)r);
1175  return FALSE;
1176 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
char my_yylinebuf[80]
Definition: febase.cc:48
const ring r
Definition: syzextra.cc:208
Definition: tok.h:96
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222
int iiOp
Definition: iparith.cc:224
const poly b
Definition: syzextra.cc:213
#define Warn
Definition: emacs.cc:80

◆ jjDOTDOT()

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

Definition at line 342 of file iparith.cc.

343 {
344  res->data=(char *)new intvec((int)(long)u->Data(),(int)(long)v->Data());
345  return FALSE;
346 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjDUMMY()

static BOOLEAN jjDUMMY ( leftv  res,
leftv  u 
)
static

Definition at line 3482 of file iparith.cc.

3483 {
3484  res->data = (char *)u->CopyD();
3485  return FALSE;
3486 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjDUMP()

static BOOLEAN jjDUMP ( leftv  ,
leftv  v 
)
static

Definition at line 3924 of file iparith.cc.

3925 {
3926  si_link l = (si_link)v->Data();
3927  if (slDump(l))
3928  {
3929  const char *s;
3930  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
3931  else s=sNoName_fe;
3932  Werror("cannot dump to `%s`",s);
3933  return TRUE;
3934  }
3935  else
3936  return FALSE;
3937 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

◆ jjE()

static BOOLEAN jjE ( leftv  res,
leftv  v 
)
static

Definition at line 3938 of file iparith.cc.

3939 {
3940  res->data = (char *)pOne();
3941  int co=(int)(long)v->Data();
3942  if (co>0)
3943  {
3944  pSetComp((poly)res->data,co);
3945  pSetm((poly)res->data);
3946  }
3947  else WerrorS("argument of gen must be positive");
3948  return (co<=0);
3949 }
#define pSetm(p)
Definition: polys.h:253
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
#define pSetComp(p, v)
Definition: polys.h:38
#define pOne()
Definition: polys.h:297
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjELIMIN()

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

Definition at line 1941 of file iparith.cc.

1942 {
1943  res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data());
1944  //setFlag(res,FLAG_STD);
1945  return v->next!=NULL; //do not allow next like in eliminate(I,a(1..4))
1946 }
void * data
Definition: subexpr.h:89
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjELIMIN_HILB()

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

Definition at line 5650 of file iparith.cc.

5651 {
5652  res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data(),
5653  (intvec *)w->Data());
5654  //setFlag(res,FLAG_STD);
5655  return FALSE;
5656 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjELIMIN_IV()

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

Definition at line 1947 of file iparith.cc.

1948 {
1949  poly p=pOne();
1950  intvec *iv=(intvec*)v->Data();
1951  for(int i=iv->length()-1; i>=0; i--)
1952  {
1953  pSetExp(p,(*iv)[i],1);
1954  }
1955  pSetm(p);
1956  res->data=(char *)idElimination((ideal)u->Data(),p);
1957  pLmDelete(&p);
1958  //setFlag(res,FLAG_STD);
1959  return FALSE;
1960 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
void * data
Definition: subexpr.h:89
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjENVELOPE()

static BOOLEAN jjENVELOPE ( leftv  res,
leftv  a 
)
static

Definition at line 4962 of file iparith.cc.

4963 {
4964  ring r = (ring)a->Data();
4965  if (rIsPluralRing(r))
4966  {
4967  ring s = rEnvelope(r);
4968  res->data = s;
4969  }
4970  else res->data = rCopy(r);
4971  return FALSE;
4972 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
ring rEnvelope(ring R)
Definition: ring.cc:5483
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
ring rCopy(ring r)
Definition: ring.cc:1612
void * Data()
Definition: subexpr.cc:1137

◆ jjEQUAL_BI()

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

Definition at line 1308 of file iparith.cc.

1309 {
1310  res->data = (char *)((long)n_Equal((number)u->Data(),(number)v->Data(),coeffs_BIGINT));
1311  jjEQUAL_REST(res,u,v);
1312  return FALSE;
1313 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff &#39;a&#39; and &#39;b&#39; represent the same number; they may have different representations.
Definition: coeffs.h:464

◆ jjEQUAL_I()

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

Definition at line 1314 of file iparith.cc.

1315 {
1316  res->data = (char *)((int)((long)u->Data()) == (int)((long)v->Data()));
1317  jjEQUAL_REST(res,u,v);
1318  return FALSE;
1319 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjEQUAL_Ma()

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

Definition at line 1320 of file iparith.cc.

1321 {
1322  res->data = (char *)((long)mp_Equal((matrix)u->Data(),(matrix)v->Data(),currRing));
1323  jjEQUAL_REST(res,u,v);
1324  return FALSE;
1325 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ip_smatrix * matrix
void * Data()
Definition: subexpr.cc:1137
BOOLEAN mp_Equal(matrix a, matrix b, const ring R)
Definition: matpol.cc:596

◆ jjEQUAL_N()

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

Definition at line 1332 of file iparith.cc.

1333 {
1334  res->data = (char *)((long)nEqual((number)u->Data(),(number)v->Data()));
1335  jjEQUAL_REST(res,u,v);
1336  return FALSE;
1337 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
#define nEqual(n1, n2)
Definition: numbers.h:20
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjEQUAL_P()

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

Definition at line 1338 of file iparith.cc.

1339 {
1340  poly p=(poly)u->Data();
1341  poly q=(poly)v->Data();
1342  res->data = (char *) ((long)pEqualPolys(p,q));
1343  jjEQUAL_REST(res,u,v);
1344  return FALSE;
1345 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define pEqualPolys(p1, p2)
Definition: polys.h:383
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjEQUAL_R()

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

Definition at line 1326 of file iparith.cc.

1327 {
1328  res->data = (char *)(long)(u->Data()==v->Data());
1329  jjEQUAL_REST(res,u,v);
1330  return FALSE;
1331 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1346
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjEQUAL_REST()

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

Definition at line 1346 of file iparith.cc.

1347 {
1348  if ((res->data) && (u->next!=NULL) && (v->next!=NULL))
1349  {
1350  int save_iiOp=iiOp;
1351  if (iiOp==NOTEQUAL)
1352  iiExprArith2(res,u->next,EQUAL_EQUAL,v->next);
1353  else
1354  iiExprArith2(res,u->next,iiOp,v->next);
1355  iiOp=save_iiOp;
1356  }
1357  if (iiOp==NOTEQUAL) res->data=(char *)(!(long)res->data);
1358 }
void * data
Definition: subexpr.h:89
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
int iiOp
Definition: iparith.cc:224
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025

◆ jjERROR()

static BOOLEAN jjERROR ( leftv  ,
leftv  u 
)
static

Definition at line 1966 of file iparith.cc.

1967 {
1968  WerrorS((char *)u->Data());
1969  extern int inerror;
1970  inerror=3;
1971  return TRUE;
1972 }
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int inerror
Definition: grammar.cc:175
void * Data()
Definition: subexpr.cc:1137

◆ jjEXECUTE()

static BOOLEAN jjEXECUTE ( leftv  ,
leftv  v 
)
static

Definition at line 3950 of file iparith.cc.

3951 {
3952  char * d = (char *)v->Data();
3953  char * s = (char *)omAlloc(strlen(d) + 13);
3954  strcpy( s, (char *)d);
3955  strcat( s, "\n;RETURN();\n");
3956  newBuffer(s,BT_execute);
3957  return yyparse();
3958 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define omAlloc(size)
Definition: omAllocDecl.h:210
int yyparse(void)
Definition: grammar.cc:2101
void * Data()
Definition: subexpr.cc:1137
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition: fevoices.cc:171

◆ jjEXPORTTO()

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

Definition at line 1961 of file iparith.cc.

1962 {
1963  //Print("exportto %s -> %s\n",v->Name(),u->Name() );
1964  return iiExport(v,0,IDPACKAGE((idhdl)u->data));
1965 }
BOOLEAN iiExport(leftv v, int toLev)
Definition: ipshell.cc:1413
Definition: idrec.h:34
void * data
Definition: subexpr.h:89
#define IDPACKAGE(a)
Definition: ipid.h:136

◆ jjEXTGCD_BI()

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

Definition at line 1973 of file iparith.cc.

1974 {
1975  number uu=(number)u->Data();number vv=(number)v->Data();
1977  number a,b;
1978  number p0=n_ExtGcd(uu,vv,&a,&b,coeffs_BIGINT);
1979  L->Init(3);
1980  L->m[0].rtyp=BIGINT_CMD; L->m[0].data=(void *)p0;
1981  L->m[1].rtyp=BIGINT_CMD; L->m[1].data=(void *)a;
1982  L->m[2].rtyp=BIGINT_CMD; L->m[2].data=(void *)b;
1983  res->rtyp=LIST_CMD;
1984  res->data=(char *)L;
1985  return FALSE;
1986 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
const poly a
Definition: syzextra.cc:212
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
INLINE_THIS void Init(int l=0)
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:697
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
const poly b
Definition: syzextra.cc:213

◆ jjEXTGCD_I()

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

Definition at line 1987 of file iparith.cc.

1988 {
1989  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
1990  int p0=ABS(uu),p1=ABS(vv);
1991  int f0 = 1, f1 = 0, g0 = 0, g1 = 1, q, r;
1992 
1993  while ( p1!=0 )
1994  {
1995  q=p0 / p1;
1996  r=p0 % p1;
1997  p0 = p1; p1 = r;
1998  r = g0 - g1 * q;
1999  g0 = g1; g1 = r;
2000  r = f0 - f1 * q;
2001  f0 = f1; f1 = r;
2002  }
2003  int a = f0;
2004  int b = g0;
2005  if ( uu /*(int)(long)u->Data()*/ < 0 ) a=-a;
2006  if ( vv /*(int)(long)v->Data()*/ < 0 ) b=-b;
2008  L->Init(3);
2009  L->m[0].rtyp=INT_CMD; L->m[0].data=(void *)(long)p0;
2010  L->m[1].rtyp=INT_CMD; L->m[1].data=(void *)(long)a;
2011  L->m[2].rtyp=INT_CMD; L->m[2].data=(void *)(long)b;
2012  res->rtyp=LIST_CMD;
2013  res->data=(char *)L;
2014  return FALSE;
2015 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
const poly a
Definition: syzextra.cc:212
Definition: tok.h:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
INLINE_THIS void Init(int l=0)
slists * lists
Definition: mpr_numeric.h:146
#define ABS(x)
Definition: auxiliary.h:111
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
const poly b
Definition: syzextra.cc:213

◆ jjEXTGCD_P()

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

Definition at line 2016 of file iparith.cc.

2017 {
2018  poly r,pa,pb;
2019  BOOLEAN ret=singclap_extgcd((poly)u->Data(),(poly)v->Data(),r,pa,pb,currRing);
2020  if (ret) return TRUE;
2022  L->Init(3);
2023  res->data=(char *)L;
2024  L->m[0].data=(void *)r;
2025  L->m[0].rtyp=POLY_CMD;
2026  L->m[1].data=(void *)pa;
2027  L->m[1].rtyp=POLY_CMD;
2028  L->m[2].data=(void *)pb;
2029  L->m[2].rtyp=POLY_CMD;
2030  return FALSE;
2031 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
INLINE_THIS void Init(int l=0)
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
BOOLEAN singclap_extgcd(poly f, poly g, poly &res, poly &pa, poly &pb, const ring r)
Definition: clapsing.cc:447
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjFAC_P()

static BOOLEAN jjFAC_P ( leftv  res,
leftv  u 
)
static

Definition at line 3999 of file iparith.cc.

4000 {
4001  intvec *v=NULL;
4003  ideal f=singclap_factorize((poly)(u->CopyD()), &v, 0,currRing);
4004  if (f==NULL) return TRUE;
4005  ivTest(v);
4007  l->Init(2);
4008  l->m[0].rtyp=IDEAL_CMD;
4009  l->m[0].data=(void *)f;
4010  l->m[1].rtyp=INTVEC_CMD;
4011  l->m[1].data=(void *)v;
4012  res->data=(void *)l;
4013  return FALSE;
4014 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
FILE * f
Definition: checklibs.c:9
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
int singclap_factorize_retry
Definition: iparith.cc:3194
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
omBin slists_bin
Definition: lists.cc:23
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:771
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jjFAC_P2()

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

Definition at line 2033 of file iparith.cc.

2034 {
2035  intvec *v=NULL;
2036  int sw=(int)(long)dummy->Data();
2037  int fac_sw=sw;
2038  if ((sw<0)||(sw>2)) fac_sw=1;
2040  ideal f=singclap_factorize((poly)(u->CopyD()), &v, fac_sw,currRing);
2041  if (f==NULL)
2042  return TRUE;
2043  switch(sw)
2044  {
2045  case 0:
2046  case 2:
2047  {
2049  l->Init(2);
2050  l->m[0].rtyp=IDEAL_CMD;
2051  l->m[0].data=(void *)f;
2052  l->m[1].rtyp=INTVEC_CMD;
2053  l->m[1].data=(void *)v;
2054  res->data=(void *)l;
2055  res->rtyp=LIST_CMD;
2056  return FALSE;
2057  }
2058  case 1:
2059  res->data=(void *)f;
2060  return FALSE;
2061  case 3:
2062  {
2063  poly p=f->m[0];
2064  int i=IDELEMS(f);
2065  f->m[0]=NULL;
2066  while(i>1)
2067  {
2068  i--;
2069  p=pMult(p,f->m[i]);
2070  f->m[i]=NULL;
2071  }
2072  res->data=(void *)p;
2073  res->rtyp=POLY_CMD;
2074  }
2075  return FALSE;
2076  }
2077  WerrorS("invalid switch");
2078  return TRUE;
2079 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
FILE * f
Definition: checklibs.c:9
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
int singclap_factorize_retry
Definition: iparith.cc:3194
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
#define pMult(p, q)
Definition: polys.h:190
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:771
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jjFACSTD()

static BOOLEAN jjFACSTD ( leftv  res,
leftv  v 
)
static

Definition at line 3959 of file iparith.cc.

3960 {
3962  if (currRing->cf->convSingNFactoryN!=NULL) /* conversion to factory*/
3963  {
3964  ideal_list p,h;
3965  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL);
3966  if (h==NULL)
3967  {
3968  L->Init(1);
3969  L->m[0].data=(char *)idInit(1);
3970  L->m[0].rtyp=IDEAL_CMD;
3971  }
3972  else
3973  {
3974  p=h;
3975  int l=0;
3976  while (p!=NULL) { p=p->next;l++; }
3977  L->Init(l);
3978  l=0;
3979  while(h!=NULL)
3980  {
3981  L->m[l].data=(char *)h->d;
3982  L->m[l].rtyp=IDEAL_CMD;
3983  p=h->next;
3984  omFreeSize(h,sizeof(*h));
3985  h=p;
3986  l++;
3987  }
3988  }
3989  }
3990  else
3991  {
3992  WarnS("no factorization implemented");
3993  L->Init(1);
3994  iiExprArith1(&(L->m[0]),v,STD_CMD);
3995  }
3996  res->data=(void *)L;
3997  return FALSE;
3998 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
ideal_list kStdfac(ideal F, ideal Q, tHomog h, intvec **w, ideal D)
Definition: kstdfac.cc:808
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8215
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:180
INLINE_THIS void Init(int l=0)
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
static Poly * h
Definition: janet.cc:978
int l
Definition: cfEzgcd.cc:94

◆ jjFACSTD2()

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

Definition at line 2080 of file iparith.cc.

2081 {
2082  ideal_list p,h;
2083  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL,(ideal)w->Data());
2084  p=h;
2085  int l=0;
2086  while (p!=NULL) { p=p->next;l++; }
2088  L->Init(l);
2089  l=0;
2090  while(h!=NULL)
2091  {
2092  L->m[l].data=(char *)h->d;
2093  L->m[l].rtyp=IDEAL_CMD;
2094  p=h->next;
2095  omFreeSize(h,sizeof(*h));
2096  h=p;
2097  l++;
2098  }
2099  res->data=(void *)L;
2100  return FALSE;
2101 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
ideal_list kStdfac(ideal F, ideal Q, tHomog h, intvec **w, ideal D)
Definition: kstdfac.cc:808
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * data
Definition: subexpr.h:89
INLINE_THIS void Init(int l=0)
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
static Poly * h
Definition: janet.cc:978
int l
Definition: cfEzgcd.cc:94

◆ jjFactModD_M()

static BOOLEAN jjFactModD_M ( leftv  res,
leftv  v 
)
static

Definition at line 7522 of file iparith.cc.

7523 {
7524  /* compute two factors of h(x,y) modulo x^(d+1) in K[[x]][y],
7525  see a detailed documentation in /kernel/linear_algebra/linearAlgebra.h
7526 
7527  valid argument lists:
7528  - (poly h, int d),
7529  - (poly h, int d, poly f0, poly g0), optional: factors of h(0,y),
7530  - (poly h, int d, int xIndex, int yIndex), optional: indices of vars x & y
7531  in list of ring vars,
7532  - (poly h, int d, poly f0, poly g0, int xIndex, int yIndec),
7533  optional: all 4 optional args
7534  (The defaults are xIndex = 1, yIndex = 2, f0 and g0 polynomials as found
7535  by singclap_factorize and h(0, y)
7536  has exactly two distinct monic factors [possibly with exponent > 1].)
7537  result:
7538  - list with the two factors f and g such that
7539  h(x,y) = f(x,y)*g(x,y) mod x^(d+1) */
7540 
7541  poly h = NULL;
7542  int d = 1;
7543  poly f0 = NULL;
7544  poly g0 = NULL;
7545  int xIndex = 1; /* default index if none provided */
7546  int yIndex = 2; /* default index if none provided */
7547 
7548  leftv u = v; int factorsGiven = 0;
7549  if ((u == NULL) || (u->Typ() != POLY_CMD))
7550  {
7551  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7552  return TRUE;
7553  }
7554  else h = (poly)u->Data();
7555  u = u->next;
7556  if ((u == NULL) || (u->Typ() != INT_CMD))
7557  {
7558  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7559  return TRUE;
7560  }
7561  else d = (int)(long)u->Data();
7562  u = u->next;
7563  if ((u != NULL) && (u->Typ() == POLY_CMD))
7564  {
7565  if ((u->next == NULL) || (u->next->Typ() != POLY_CMD))
7566  {
7567  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7568  return TRUE;
7569  }
7570  else
7571  {
7572  f0 = (poly)u->Data();
7573  g0 = (poly)u->next->Data();
7574  factorsGiven = 1;
7575  u = u->next->next;
7576  }
7577  }
7578  if ((u != NULL) && (u->Typ() == INT_CMD))
7579  {
7580  if ((u->next == NULL) || (u->next->Typ() != INT_CMD))
7581  {
7582  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7583  return TRUE;
7584  }
7585  else
7586  {
7587  xIndex = (int)(long)u->Data();
7588  yIndex = (int)(long)u->next->Data();
7589  u = u->next->next;
7590  }
7591  }
7592  if (u != NULL)
7593  {
7594  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7595  return TRUE;
7596  }
7597 
7598  /* checks for provided arguments */
7599  if (pIsConstant(h) || (factorsGiven && (pIsConstant(f0) || pIsConstant(g0))))
7600  {
7601  WerrorS("expected non-constant polynomial argument(s)");
7602  return TRUE;
7603  }
7604  int n = rVar(currRing);
7605  if ((xIndex < 1) || (n < xIndex))
7606  {
7607  Werror("index for variable x (%d) out of range [1..%d]", xIndex, n);
7608  return TRUE;
7609  }
7610  if ((yIndex < 1) || (n < yIndex))
7611  {
7612  Werror("index for variable y (%d) out of range [1..%d]", yIndex, n);
7613  return TRUE;
7614  }
7615  if (xIndex == yIndex)
7616  {
7617  WerrorS("expected distinct indices for variables x and y");
7618  return TRUE;
7619  }
7620 
7621  /* computation of f0 and g0 if missing */
7622  if (factorsGiven == 0)
7623  {
7624  poly h0 = pSubst(pCopy(h), xIndex, NULL);
7625  intvec* v = NULL;
7626  ideal i = singclap_factorize(h0, &v, 0,currRing);
7627 
7628  ivTest(v);
7629 
7630  if (i == NULL) return TRUE;
7631 
7632  idTest(i);
7633 
7634  if ((v->rows() != 3) || ((*v)[0] =! 1) || (!nIsOne(pGetCoeff(i->m[0]))))
7635  {
7636  WerrorS("expected h(0,y) to have exactly two distinct monic factors");
7637  return TRUE;
7638  }
7639  f0 = pPower(pCopy(i->m[1]), (*v)[1]);
7640  g0 = pPower(pCopy(i->m[2]), (*v)[2]);
7641  idDelete(&i);
7642  }
7643 
7644  poly f; poly g;
7645  henselFactors(xIndex, yIndex, h, f0, g0, d, f, g);
7647  L->Init(2);
7648  L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f;
7649  L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g;
7650  res->rtyp = LIST_CMD;
7651  res->data = (char*)L;
7652  return FALSE;
7653 }
#define pSubst(p, n, e)
Definition: polys.h:348
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
Definition: lists.h:22
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...
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
#define TRUE
Definition: auxiliary.h:98
#define nIsOne(n)
Definition: numbers.h:25
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
int Typ()
Definition: subexpr.cc:995
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
FILE * f
Definition: checklibs.c:9
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
#define pPower(p, q)
Definition: polys.h:187
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:771
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189
idhdl h0
Definition: libparse.cc:1141
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define idTest(id)
Definition: ideals.h:47

◆ jjFAREY_BI()

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

Definition at line 2102 of file iparith.cc.

2103 {
2104  if (rField_is_Q(currRing))
2105  {
2106  number uu=(number)u->Data();
2107  number vv=(number)v->Data();
2108  res->data=(char *)n_Farey(uu,vv,currRing->cf);
2109  return FALSE;
2110  }
2111  else return TRUE;
2112 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
Definition: coeffs.h:801
void * Data()
Definition: subexpr.cc:1137

◆ jjFAREY_ID()

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

Definition at line 2113 of file iparith.cc.

2114 {
2115  ideal uu=(ideal)u->Data();
2116  number vv=(number)v->Data();
2117  res->data=(void*)id_Farey(uu,vv,currRing);
2118  return FALSE;
2119 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal id_Farey(ideal x, number N, const ring r)
Definition: ideals.cc:2456
void * Data()
Definition: subexpr.cc:1137

◆ jjFAREY_LI()

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

Definition at line 9235 of file iparith.cc.

9236 {
9237  lists c=(lists)u->CopyD();
9238  lists res_l=(lists)omAllocBin(slists_bin);
9239  res_l->Init(c->nr+1);
9240  BOOLEAN bo=FALSE;
9241  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,FAREY_CMD);
9242  for (unsigned i=0;i<=(unsigned)c->nr;i++)
9243  {
9244  sleftv tmp;
9245  tmp.Copy(v);
9246  bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],FAREY_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
9247  if (bo) { Werror("farey failed for list entry %d",i+1); break;}
9248  }
9249  c->Clean();
9250  res->data=res_l;
9251  return bo;
9252 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:22
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1177
#define FALSE
Definition: auxiliary.h:94
const struct sValCmd2 dArith2[]
Definition: table.h:290
#define TRUE
Definition: auxiliary.h:98
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:7852
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8727
void * data
Definition: subexpr.h:89
Definition: tok.h:77
void Copy(leftv e)
Definition: subexpr.cc:688
int i
Definition: cfEzgcd.cc:123
INLINE_THIS void Init(int l=0)
int nr
Definition: lists.h:43
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void Clean(ring r=currRing)
Definition: lists.h:25
omBin slists_bin
Definition: lists.cc:23
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjFETCH()

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

Definition at line 2121 of file iparith.cc.

2122 {
2123  ring r=(ring)u->Data();
2124  idhdl w;
2125  int op=iiOp;
2126  nMapFunc nMap;
2127 
2128  if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
2129  {
2130  int *perm=NULL;
2131  int *par_perm=NULL;
2132  int par_perm_size=0;
2133  BOOLEAN bo;
2134  if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
2135  {
2136  // Allow imap/fetch to be make an exception only for:
2137  if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2140  ||
2141  (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp
2142  (rField_is_Zp(currRing, r->cf->ch) ||
2143  rField_is_Zp_a(currRing, r->cf->ch))) )
2144  {
2145  par_perm_size=rPar(r);
2146  }
2147  else
2148  {
2149  goto err_fetch;
2150  }
2151  }
2152  if ((iiOp!=FETCH_CMD) || (r->N!=currRing->N) || (rPar(r)!=rPar(currRing)))
2153  {
2154  perm=(int *)omAlloc0((r->N+1)*sizeof(int));
2155  if (par_perm_size!=0)
2156  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2157  op=IMAP_CMD;
2158  if (iiOp==IMAP_CMD)
2159  {
2160  int r_par=0;
2161  char ** r_par_names=NULL;
2162  if (r->cf->extRing!=NULL)
2163  {
2164  r_par=r->cf->extRing->N;
2165  r_par_names=r->cf->extRing->names;
2166  }
2167  int c_par=0;
2168  char ** c_par_names=NULL;
2169  if (currRing->cf->extRing!=NULL)
2170  {
2171  c_par=currRing->cf->extRing->N;
2172  c_par_names=currRing->cf->extRing->names;
2173  }
2174  maFindPerm(r->names, r->N, r_par_names, r_par,
2175  currRing->names,currRing->N,c_par_names, c_par,
2176  perm,par_perm, currRing->cf->type);
2177  }
2178  else
2179  {
2180  unsigned i;
2181  if (par_perm_size!=0)
2182  for(i=si_min(rPar(r),rPar(currRing));i>0;i--) par_perm[i-1]=-i;
2183  for(i=si_min(r->N,currRing->N);i>0;i--) perm[i]=i;
2184  }
2185  }
2186  if ((iiOp==FETCH_CMD) &&(BVERBOSE(V_IMAP)))
2187  {
2188  unsigned i;
2189  for(i=0;i<(unsigned)si_min(r->N,currRing->N);i++)
2190  {
2191  Print("// var nr %d: %s -> %s\n",i,r->names[i],currRing->names[i]);
2192  }
2193  for(i=0;i<(unsigned)si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
2194  {
2195  Print("// par nr %d: %s -> %s\n",
2196  i,rParameter(r)[i],rParameter(currRing)[i]);
2197  }
2198  }
2199  if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
2200  sleftv tmpW;
2201  memset(&tmpW,0,sizeof(sleftv));
2202  tmpW.rtyp=IDTYP(w);
2203  tmpW.data=IDDATA(w);
2204  if ((bo=maApplyFetch(op,NULL,res,&tmpW, r,
2205  perm,par_perm,par_perm_size,nMap)))
2206  {
2207  Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
2208  }
2209  if (perm!=NULL)
2210  omFreeSize((ADDRESS)perm,(r->N+1)*sizeof(int));
2211  if (par_perm!=NULL)
2212  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2213  return bo;
2214  }
2215  else
2216  {
2217  Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
2218  }
2219  return TRUE;
2220 err_fetch:
2221  char *s1=nCoeffString(r->cf);
2222  char *s2=nCoeffString(currRing->cf);
2223  Werror("no identity map from %s (%s -> %s)",u->Fullname(),s1,s2);
2224  omFree(s2); omFree(s1);
2225  return TRUE;
2226 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:521
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:531
#define TRUE
Definition: auxiliary.h:98
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:49
void * ADDRESS
Definition: auxiliary.h:115
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:616
const char * Name()
Definition: subexpr.h:121
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:126
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
idrec * idhdl
Definition: ring.h:18
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
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:725
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
#define BVERBOSE(a)
Definition: options.h:33
Definition: tok.h:34
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:169
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
int typ
Definition: idrec.h:43
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:976
#define IDDATA(a)
Definition: ipid.h:123
int iiOp
Definition: iparith.cc:224
int perm[100]
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define V_IMAP
Definition: options.h:51

◆ jjFETCH_M()

static BOOLEAN jjFETCH_M ( leftv  res,
leftv  u 
)
static

Definition at line 6736 of file iparith.cc.

6737 {
6738  ring r=(ring)u->Data();
6739  leftv v=u->next;
6740  leftv perm_var_l=v->next;
6741  leftv perm_par_l=v->next->next;
6742  if ((perm_var_l->Typ()!=INTVEC_CMD)
6743  ||((perm_par_l!=NULL)&&(perm_par_l->Typ()!=INTVEC_CMD))
6744  ||(u->Typ()!=RING_CMD))
6745  {
6746  WerrorS("fetch(<ring>,<name>[,<intvec>[,<intvec>])");
6747  return TRUE;
6748  }
6749  intvec *perm_var_v=(intvec*)perm_var_l->Data();
6750  intvec *perm_par_v=NULL;
6751  if (perm_par_l!=NULL)
6752  perm_par_v=(intvec*)perm_par_l->Data();
6753  idhdl w;
6754  nMapFunc nMap;
6755 
6756  if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
6757  {
6758  int *perm=NULL;
6759  int *par_perm=NULL;
6760  int par_perm_size=0;
6761  BOOLEAN bo;
6762  if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
6763  {
6764  // Allow imap/fetch to be make an exception only for:
6765  if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
6768  ||
6769  (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp
6770  (rField_is_Zp(currRing, r->cf->ch) ||
6771  rField_is_Zp_a(currRing, r->cf->ch))) )
6772  {
6773  par_perm_size=rPar(r);
6774  }
6775  else
6776  {
6777  goto err_fetch;
6778  }
6779  }
6780  else
6781  par_perm_size=rPar(r);
6782  perm=(int *)omAlloc0((rVar(r)+1)*sizeof(int));
6783  if (par_perm_size!=0)
6784  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
6785  int i;
6786  if (perm_par_l==NULL)
6787  {
6788  if (par_perm_size!=0)
6789  for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
6790  }
6791  else
6792  {
6793  if (par_perm_size==0) WarnS("source ring has no parameters");
6794  else
6795  {
6796  for(i=rPar(r)-1;i>=0;i--)
6797  {
6798  if (i<perm_par_v->length()) par_perm[i]=(*perm_par_v)[i];
6799  if ((par_perm[i]<-rPar(currRing))
6800  || (par_perm[i]>rVar(currRing)))
6801  {
6802  Warn("invalid entry for par %d: %d\n",i,par_perm[i]);
6803  par_perm[i]=0;
6804  }
6805  }
6806  }
6807  }
6808  for(i=rVar(r)-1;i>=0;i--)
6809  {
6810  if (i<perm_var_v->length()) perm[i+1]=(*perm_var_v)[i];
6811  if ((perm[i]<-rPar(currRing))
6812  || (perm[i]>rVar(currRing)))
6813  {
6814  Warn("invalid entry for var %d: %d\n",i,perm[i]);
6815  perm[i]=0;
6816  }
6817  }
6818  if (BVERBOSE(V_IMAP))
6819  {
6820  for(i=1;i<=si_min(rVar(r),rVar(currRing));i++)
6821  {
6822  if (perm[i]>0)
6823  Print("// var nr %d: %s -> var %s\n",i,r->names[i-1],currRing->names[perm[i]-1]);
6824  else if (perm[i]<0)
6825  Print("// var nr %d: %s -> par %s\n",i,r->names[i-1],rParameter(currRing)[-perm[i]-1]);
6826  }
6827  for(i=1;i<=si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
6828  {
6829  if (par_perm[i-1]<0)
6830  Print("// par nr %d: %s -> par %s\n",
6831  i,rParameter(r)[i-1],rParameter(currRing)[-par_perm[i-1]-1]);
6832  else if (par_perm[i-1]>0)
6833  Print("// par nr %d: %s -> var %s\n",
6834  i,rParameter(r)[i-1],currRing->names[par_perm[i-1]-1]);
6835  }
6836  }
6837  if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
6838  sleftv tmpW;
6839  memset(&tmpW,0,sizeof(sleftv));
6840  tmpW.rtyp=IDTYP(w);
6841  tmpW.data=IDDATA(w);
6842  if ((bo=maApplyFetch(IMAP_CMD,NULL,res,&tmpW, r,
6843  perm,par_perm,par_perm_size,nMap)))
6844  {
6845  Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
6846  }
6847  if (perm!=NULL)
6848  omFreeSize((ADDRESS)perm,(rVar(r)+1)*sizeof(int));
6849  if (par_perm!=NULL)
6850  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
6851  return bo;
6852  }
6853  else
6854  {
6855  Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
6856  }
6857  return TRUE;
6858 err_fetch:
6859  char *s1=nCoeffString(r->cf);
6860  char *s2=nCoeffString(currRing->cf);
6861  Werror("no identity map from %s (%s -> %s)",u->Fullname(),s1,s2);
6862  omFree(s2);omFree(s1);
6863  return TRUE;
6864 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:521
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:531
#define TRUE
Definition: auxiliary.h:98
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:49
void * ADDRESS
Definition: auxiliary.h:115
void WerrorS(const char *s)
Definition: feFopen.cc:24
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:616
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:995
const char * Name()
Definition: subexpr.h:121
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:126
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
idrec * idhdl
Definition: ring.h:18
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
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:725
leftv next
Definition: subexpr.h:87
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
#define BVERBOSE(a)
Definition: options.h:33
Definition: tok.h:34
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
int typ
Definition: idrec.h:43
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:976
#define IDDATA(a)
Definition: ipid.h:123
int perm[100]
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define V_IMAP
Definition: options.h:51
#define Warn
Definition: emacs.cc:80

◆ jjFIND2()

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

Definition at line 2227 of file iparith.cc.

2228 {
2229  /*4
2230  * look for the substring what in the string where
2231  * return the position of the first char of what in where
2232  * or 0
2233  */
2234  char *where=(char *)u->Data();
2235  char *what=(char *)v->Data();
2236  char *found = strstr(where,what);
2237  if (found != NULL)
2238  {
2239  res->data=(char *)((found-where)+1);
2240  }
2241  /*else res->data=NULL;*/
2242  return FALSE;
2243 }
#define FALSE
Definition: auxiliary.h:94
bool found
Definition: facFactorize.cc:56
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjFIND3()

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

Definition at line 5657 of file iparith.cc.

5658 {
5659  /*4
5660  * look for the substring what in the string where
5661  * starting at position n
5662  * return the position of the first char of what in where
5663  * or 0
5664  */
5665  int n=(int)(long)w->Data();
5666  char *where=(char *)u->Data();
5667  char *what=(char *)v->Data();
5668  char *found;
5669  if ((1>n)||(n>(int)strlen(where)))
5670  {
5671  Werror("start position %d out of range",n);
5672  return TRUE;
5673  }
5674  found = strchr(where+n-1,*what);
5675  if (*(what+1)!='\0')
5676  {
5677  while((found !=NULL) && (strncmp(found+1,what+1,strlen(what+1))!=0))
5678  {
5679  found=strchr(found+1,*what);
5680  }
5681  }
5682  if (found != NULL)
5683  {
5684  res->data=(char *)((found-where)+1);
5685  }
5686  return FALSE;
5687 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
bool found
Definition: facFactorize.cc:56
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjFWALK()

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

Definition at line 2244 of file iparith.cc.

2245 {
2246  res->data=(char *)fractalWalkProc(u,v);
2247  setFlag( res, FLAG_STD );
2248  return FALSE;
2249 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
ideal fractalWalkProc(leftv first, leftv second)
Definition: walk_ip.cc:167

◆ jjFWALK3()

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

Definition at line 5688 of file iparith.cc.

5689 {
5690  if ((int)(long)w->Data()==0)
5691  res->data=(char *)walkProc(u,v);
5692  else
5693  res->data=(char *)fractalWalkProc(u,v);
5694  setFlag( res, FLAG_STD );
5695  return FALSE;
5696 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
ideal walkProc(leftv first, leftv second)
Definition: walk_ip.cc:61
ideal fractalWalkProc(leftv first, leftv second)
Definition: walk_ip.cc:167
void * Data()
Definition: subexpr.cc:1137

◆ jjGCD_BI()

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

Definition at line 2264 of file iparith.cc.

2265 {
2266  number n1 = (number) u->Data();
2267  number n2 = (number) v->Data();
2268  res->data = n_Gcd(n1,n2,coeffs_BIGINT);
2269  return FALSE;
2270 }
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of &#39;a&#39; and &#39;b&#39; in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
Definition: coeffs.h:690
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjGCD_I()

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

Definition at line 2250 of file iparith.cc.

2251 {
2252  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
2253  int p0=ABS(uu),p1=ABS(vv);
2254  int r;
2255  while ( p1!=0 )
2256  {
2257  r=p0 % p1;
2258  p0 = p1; p1 = r;
2259  }
2260  res->rtyp=INT_CMD;
2261  res->data=(char *)(long)p0;
2262  return FALSE;
2263 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
#define ABS(x)
Definition: auxiliary.h:111
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137

◆ jjGCD_N()

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

Definition at line 2271 of file iparith.cc.

2272 {
2273  number a=(number) u->Data();
2274  number b=(number) v->Data();
2275  if (nIsZero(a))
2276  {
2277  if (nIsZero(b)) res->data=(char *)nInit(1);
2278  else res->data=(char *)nCopy(b);
2279  }
2280  else
2281  {
2282  if (nIsZero(b)) res->data=(char *)nCopy(a);
2283  //else res->data=(char *)n_Gcd(a, b, currRing->cf);
2284  else res->data=(char *)n_SubringGcd(a, b, currRing->cf);
2285  }
2286  return FALSE;
2287 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define nIsZero(n)
Definition: numbers.h:19
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:692
#define nInit(i)
Definition: numbers.h:24
const poly b
Definition: syzextra.cc:213

◆ jjGCD_P()

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

Definition at line 2288 of file iparith.cc.

2289 {
2290  res->data=(void *)singclap_gcd((poly)(u->CopyD(POLY_CMD)),
2291  (poly)(v->CopyD(POLY_CMD)),currRing);
2292  return FALSE;
2293 }
#define FALSE
Definition: auxiliary.h:94
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
Definition: clapsing.cc:264
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjGE_BI()

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

Definition at line 1093 of file iparith.cc.

1094 {
1095  number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
1096  res->data = (char *) (n_GreaterZero(h,coeffs_BIGINT)||(n_IsZero(h,coeffs_BIGINT)));
1097  n_Delete(&h,coeffs_BIGINT);
1098  return FALSE;
1099 }
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of &#39;a&#39; and &#39;b&#39;, i.e., a-b
Definition: coeffs.h:673
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:468
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:498
static Poly * h
Definition: janet.cc:978

◆ jjGE_I()

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

Definition at line 1100 of file iparith.cc.

1101 {
1102  res->data = (char *)(long)((int)((long)u->Data()) >= (int)((long)v->Data()));
1103  return FALSE;
1104 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjGE_N()

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

Definition at line 1105 of file iparith.cc.

1106 {
1107  res->data = (char *)(long) (nGreater((number)u->Data(),(number)v->Data())
1108  || nEqual((number)u->Data(),(number)v->Data()));
1109  return FALSE;
1110 }
#define FALSE
Definition: auxiliary.h:94
#define nEqual(n1, n2)
Definition: numbers.h:20
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
#define nGreater(a, b)
Definition: numbers.h:28

◆ jjGETDUMP()

static BOOLEAN jjGETDUMP ( leftv  ,
leftv  v 
)
static

Definition at line 4015 of file iparith.cc.

4016 {
4017  si_link l = (si_link)v->Data();
4018  if (slGetDump(l))
4019  {
4020  const char *s;
4021  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
4022  else s=sNoName_fe;
4023  Werror("cannot get dump from `%s`",s);
4024  return TRUE;
4025  }
4026  else
4027  return FALSE;
4028 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

◆ jjGT_BI()

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

Definition at line 1111 of file iparith.cc.

1112 {
1113  number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
1114  res->data = (char *)(long) (n_GreaterZero(h,coeffs_BIGINT)&&(!n_IsZero(h,coeffs_BIGINT)));
1115  n_Delete(&h,coeffs_BIGINT);
1116  return FALSE;
1117 }
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of &#39;a&#39; and &#39;b&#39;, i.e., a-b
Definition: coeffs.h:673
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:468
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff &#39;n&#39; is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
Definition: coeffs.h:498
static Poly * h
Definition: janet.cc:978

◆ jjGT_I()

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

Definition at line 1118 of file iparith.cc.

1119 {
1120  res->data = (char *)(long)((int)((long)u->Data()) > (int)((long)v->Data()));
1121  return FALSE;
1122 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjGT_N()

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

Definition at line 1123 of file iparith.cc.

1124 {
1125  res->data = (char *)(long)(nGreater((number)u->Data(),(number)v->Data()));
1126  return FALSE;
1127 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
#define nGreater(a, b)
Definition: numbers.h:28

◆ jjHIGHCORNER()

static BOOLEAN jjHIGHCORNER ( leftv  res,
leftv  v 
)
static

Definition at line 4029 of file iparith.cc.

4030 {
4031  assumeStdFlag(v);
4032  ideal I=(ideal)v->Data();
4033  res->data=(void *)iiHighCorner(I,0);
4034  return FALSE;
4035 }
#define FALSE
Definition: auxiliary.h:94
poly iiHighCorner(ideal I, int ak)
Definition: ipshell.cc:1511
void * data
Definition: subexpr.h:89
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjHIGHCORNER_M()

static BOOLEAN jjHIGHCORNER_M ( leftv  res,
leftv  v 
)
static

Definition at line 4036 of file iparith.cc.

4037 {
4038  assumeStdFlag(v);
4039  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4040  BOOLEAN delete_w=FALSE;
4041  ideal I=(ideal)v->Data();
4042  int i;
4043  poly p=NULL,po=NULL;
4044  int rk=id_RankFreeModule(I,currRing);
4045  if (w==NULL)
4046  {
4047  w = new intvec(rk);
4048  delete_w=TRUE;
4049  }
4050  for(i=rk;i>0;i--)
4051  {
4052  p=iiHighCorner(I,i);
4053  if (p==NULL)
4054  {
4055  WerrorS("module must be zero-dimensional");
4056  if (delete_w) delete w;
4057  return TRUE;
4058  }
4059  if (po==NULL)
4060  {
4061  po=p;
4062  }
4063  else
4064  {
4065  // now po!=NULL, p!=NULL
4066  int d=(currRing->pFDeg(po,currRing)-(*w)[pGetComp(po)-1] - currRing->pFDeg(p,currRing)+(*w)[i-1]);
4067  if (d==0)
4068  d=pLmCmp(po,p);
4069  if (d > 0)
4070  {
4071  pDelete(&p);
4072  }
4073  else // (d < 0)
4074  {
4075  pDelete(&po); po=p;
4076  }
4077  }
4078  }
4079  if (delete_w) delete w;
4080  res->data=(void *)po;
4081  return FALSE;
4082 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
#define TRUE
Definition: auxiliary.h:98
poly iiHighCorner(ideal I, int ak)
Definition: ipshell.cc:1511
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
int i
Definition: cfEzgcd.cc:123
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjHILBERT()

static BOOLEAN jjHILBERT ( leftv  ,
leftv  v 
)
static

Definition at line 4083 of file iparith.cc.

4084 {
4085 #ifdef HAVE_RINGS
4087  {
4088  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4089  PrintS("// performed for generic fibre, that is, over Q\n");
4090  }
4091 #endif
4092  assumeStdFlag(v);
4093  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4094  //scHilbertPoly((ideal)v->Data(),currRing->qideal);
4095  hLookSeries((ideal)v->Data(),module_w,currRing->qideal);
4096  return FALSE;
4097 }
#define FALSE
Definition: auxiliary.h:94
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void PrintS(const char *s)
Definition: reporter.cc:284
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1137
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1372

◆ jjHILBERT2()

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

Definition at line 2294 of file iparith.cc.

2295 {
2296 #ifdef HAVE_RINGS
2298  {
2299  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
2300  PrintS("// performed for generic fibre, that is, over Q\n");
2301  }
2302 #endif
2303  assumeStdFlag(u);
2304  intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
2305  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal);
2306  switch((int)(long)v->Data())
2307  {
2308  case 1:
2309  res->data=(void *)iv;
2310  return FALSE;
2311  case 2:
2312  res->data=(void *)hSecondSeries(iv);
2313  delete iv;
2314  return FALSE;
2315  }
2316  delete iv;
2318  return TRUE;
2319 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
const char feNotImplemented[]
Definition: reporter.cc:54
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void PrintS(const char *s)
Definition: reporter.cc:284
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1301
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1137
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1293

◆ jjHILBERT3()

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

Definition at line 5697 of file iparith.cc.

5698 {
5699  intvec *wdegree=(intvec*)w->Data();
5700  if (wdegree->length()!=currRing->N)
5701  {
5702  Werror("weight vector must have size %d, not %d",
5703  currRing->N,wdegree->length());
5704  return TRUE;
5705  }
5706 #ifdef HAVE_RINGS
5708  {
5709  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
5710  PrintS("// performed for generic fibre, that is, over Q\n");
5711  }
5712 #endif
5713  assumeStdFlag(u);
5714  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
5715  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal,wdegree);
5716  switch((int)(long)v->Data())
5717  {
5718  case 1:
5719  res->data=(void *)iv;
5720  return FALSE;
5721  case 2:
5722  res->data=(void *)hSecondSeries(iv);
5723  delete iv;
5724  return FALSE;
5725  }
5726  delete iv;
5728  return TRUE;
5729 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
const char feNotImplemented[]
Definition: reporter.cc:54
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void PrintS(const char *s)
Definition: reporter.cc:284
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
int length() const
Definition: intvec.h:86
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1301
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1137
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1293
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjHILBERT_IV()

static BOOLEAN jjHILBERT_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4098 of file iparith.cc.

4099 {
4100 #ifdef HAVE_RINGS
4102  {
4103  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4104  PrintS("// performed for generic fibre, that is, over Q\n");
4105  }
4106 #endif
4107  res->data=(void *)hSecondSeries((intvec *)v->Data());
4108  return FALSE;
4109 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
void PrintS(const char *s)
Definition: reporter.cc:284
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1301
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1137

◆ jjHOMOG1()

static BOOLEAN jjHOMOG1 ( leftv  res,
leftv  v 
)
static

Definition at line 4110 of file iparith.cc.

4111 {
4112  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4113  ideal v_id=(ideal)v->Data();
4114  if (w==NULL)
4115  {
4116  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
4117  if (res->data!=NULL)
4118  {
4119  if (v->rtyp==IDHDL)
4120  {
4121  char *s_isHomog=omStrDup("isHomog");
4122  if (v->e==NULL)
4123  atSet((idhdl)(v->data),s_isHomog,w,INTVEC_CMD);
4124  else
4125  atSet((idhdl)(v->LData()),s_isHomog,w,INTVEC_CMD);
4126  }
4127  else if (w!=NULL) delete w;
4128  } // if res->data==NULL then w==NULL
4129  }
4130  else
4131  {
4132  res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w);
4133  if((res->data==NULL) && (v->rtyp==IDHDL))
4134  {
4135  if (v->e==NULL)
4136  atKill((idhdl)(v->data),"isHomog");
4137  else
4138  atKill((idhdl)(v->LData()),"isHomog");
4139  }
4140  }
4141  return FALSE;
4142 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
#define atKill(H, A)
Definition: attrib.h:44
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
leftv LData()
Definition: subexpr.cc:1406
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjHOMOG1_W()

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

Definition at line 2359 of file iparith.cc.

2360 {
2361  intvec *w=new intvec(rVar(currRing));
2362  intvec *vw=(intvec*)u->Data();
2363  ideal v_id=(ideal)v->Data();
2364  pFDegProc save_FDeg=currRing->pFDeg;
2365  pLDegProc save_LDeg=currRing->pLDeg;
2366  BOOLEAN save_pLexOrder=currRing->pLexOrder;
2367  currRing->pLexOrder=FALSE;
2368  kHomW=vw;
2369  kModW=w;
2371  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
2372  currRing->pLexOrder=save_pLexOrder;
2373  kHomW=NULL;
2374  kModW=NULL;
2375  pRestoreDegProcs(currRing,save_FDeg,save_LDeg);
2376  if (w!=NULL) delete w;
2377  return FALSE;
2378 }
#define FALSE
Definition: auxiliary.h:94
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:45
void * data
Definition: subexpr.h:89
intvec * kHomW
Definition: kstd1.cc:2206
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
intvec * kModW
Definition: kstd1.cc:2206
Definition: intvec.h:14
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3535
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2218
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3547
#define NULL
Definition: omList.c:10
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
int BOOLEAN
Definition: auxiliary.h:85
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96

◆ jjHOMOG_ID()

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

Definition at line 2337 of file iparith.cc.

2338 {
2339  int i=pVar((poly)v->Data());
2340  if (i==0)
2341  {
2342  WerrorS("ringvar expected");
2343  return TRUE;
2344  }
2345  pFDegProc deg;
2346  if (currRing->pLexOrder && (currRing->order[0]==ringorder_lp))
2347  deg=p_Totaldegree;
2348  else
2349  deg=currRing->pFDeg;
2350  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
2351  int d=deg(p,currRing);
2352  pLmDelete(p);
2353  if (d==1)
2354  res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
2355  else
2356  WerrorS("variable must have weight 1");
2357  return (d!=1);
2358 }
#define pVar(m)
Definition: polys.h:364
ideal id_Homogen(ideal h, int varnum, const ring r)
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define TRUE
Definition: auxiliary.h:98
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1430
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjHOMOG_ID_W()

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

Definition at line 5730 of file iparith.cc.

5731 {
5732  PrintS("TODO\n");
5733  int i=pVar((poly)v->Data());
5734  if (i==0)
5735  {
5736  WerrorS("ringvar expected");
5737  return TRUE;
5738  }
5739  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5740  int d=pWTotaldegree(p);
5741  pLmDelete(p);
5742  if (d==1)
5743  res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
5744  else
5745  WerrorS("variable must have weight 1");
5746  return (d!=1);
5747 }
#define pVar(m)
Definition: polys.h:364
ideal id_Homogen(ideal h, int varnum, const ring r)
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define pOne()
Definition: polys.h:297
#define pWTotaldegree(p)
Definition: polys.h:265
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjHOMOG_P()

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

Definition at line 2320 of file iparith.cc.

2321 {
2322  int i=pVar((poly)v->Data());
2323  if (i==0)
2324  {
2325  WerrorS("ringvar expected");
2326  return TRUE;
2327  }
2328  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
2329  int d=pWTotaldegree(p);
2330  pLmDelete(p);
2331  if (d==1)
2332  res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
2333  else
2334  WerrorS("variable must have weight 1");
2335  return (d!=1);
2336 }
#define pVar(m)
Definition: polys.h:364
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
poly p_Homogen(poly p, int varnum, const ring r)
Definition: p_polys.cc:3192
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
#define pWTotaldegree(p)
Definition: polys.h:265
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjHOMOG_P_W()

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

Definition at line 5748 of file iparith.cc.

5749 {
5750  PrintS("TODO\n");
5751  int i=pVar((poly)v->Data());
5752  if (i==0)
5753  {
5754  WerrorS("ringvar expected");
5755  return TRUE;
5756  }
5757  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5758  int d=pWTotaldegree(p);
5759  pLmDelete(p);
5760  if (d==1)
5761  res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
5762  else
5763  WerrorS("variable must have weight 1");
5764  return (d!=1);
5765 }
#define pVar(m)
Definition: polys.h:364
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
poly p_Homogen(poly p, int varnum, const ring r)
Definition: p_polys.cc:3192
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define pOne()
Definition: polys.h:297
#define pWTotaldegree(p)
Definition: polys.h:265
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjIDEAL_Ma()

static BOOLEAN jjIDEAL_Ma ( leftv  res,
leftv  v 
)
static

Definition at line 4149 of file iparith.cc.

4150 {
4151  matrix mat=(matrix)v->CopyD(MATRIX_CMD);
4152  IDELEMS((ideal)mat)=MATCOLS(mat)*MATROWS(mat);
4153  if (IDELEMS((ideal)mat)==0)
4154  {
4155  idDelete((ideal *)&mat);
4156  mat=(matrix)idInit(1,1);
4157  }
4158  else
4159  {
4160  MATROWS(mat)=1;
4161  mat->rank=1;
4162  idTest((ideal)mat);
4163  }
4164  res->data=(char *)mat;
4165  return FALSE;
4166 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define MATCOLS(i)
Definition: matpol.h:28
#define MATROWS(i)
Definition: matpol.h:27
void * CopyD(int t)
Definition: subexpr.cc:707
#define idTest(id)
Definition: ideals.h:47

◆ jjIDEAL_Map()

static BOOLEAN jjIDEAL_Map ( leftv  res,
leftv  v 
)
static

Definition at line 4167 of file iparith.cc.

4168 {
4169  map m=(map)v->CopyD(MAP_CMD);
4170  omFree((ADDRESS)m->preimage);
4171  m->preimage=NULL;
4172  ideal I=(ideal)m;
4173  I->rank=1;
4174  res->data=(char *)I;
4175  return FALSE;
4176 }
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:400
#define FALSE
Definition: auxiliary.h:94
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:89
#define omFree(addr)
Definition: omAllocDecl.h:261
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjIDEAL_PL()

static BOOLEAN jjIDEAL_PL ( leftv  res,
leftv  v 
)
static

Definition at line 6643 of file iparith.cc.

6644 {
6645  int s=1;
6646  leftv h=v;
6647  if (h!=NULL) s=exprlist_length(h);
6648  ideal id=idInit(s,1);
6649  int rank=1;
6650  int i=0;
6651  poly p;
6652  while (h!=NULL)
6653  {
6654  switch(h->Typ())
6655  {
6656  case POLY_CMD:
6657  {
6658  p=(poly)h->CopyD(POLY_CMD);
6659  break;
6660  }
6661  case INT_CMD:
6662  {
6663  number n=nInit((int)(long)h->Data());
6664  if (!nIsZero(n))
6665  {
6666  p=pNSet(n);
6667  }
6668  else
6669  {
6670  p=NULL;
6671  nDelete(&n);
6672  }
6673  break;
6674  }
6675  case BIGINT_CMD:
6676  {
6677  number b=(number)h->Data();
6679  if (nMap==NULL) return TRUE;
6680  number n=nMap(b,coeffs_BIGINT,currRing->cf);
6681  if (!nIsZero(n))
6682  {
6683  p=pNSet(n);
6684  }
6685  else
6686  {
6687  p=NULL;
6688  nDelete(&n);
6689  }
6690  break;
6691  }
6692  case NUMBER_CMD:
6693  {
6694  number n=(number)h->CopyD(NUMBER_CMD);
6695  if (!nIsZero(n))
6696  {
6697  p=pNSet(n);
6698  }
6699  else
6700  {
6701  p=NULL;
6702  nDelete(&n);
6703  }
6704  break;
6705  }
6706  case VECTOR_CMD:
6707  {
6708  p=(poly)h->CopyD(VECTOR_CMD);
6709  if (iiOp!=MODUL_CMD)
6710  {
6711  idDelete(&id);
6712  pDelete(&p);
6713  return TRUE;
6714  }
6715  rank=si_max(rank,(int)pMaxComp(p));
6716  break;
6717  }
6718  default:
6719  {
6720  idDelete(&id);
6721  return TRUE;
6722  }
6723  }
6724  if ((iiOp==MODUL_CMD)&&(p!=NULL)&&(pGetComp(p)==0))
6725  {
6726  pSetCompP(p,1);
6727  }
6728  id->m[i]=p;
6729  i++;
6730  h=h->next;
6731  }
6732  id->rank=rank;
6733  res->data=(char *)id;
6734  return FALSE;
6735 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define pNSet(n)
Definition: polys.h:295
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
return P p
Definition: myNF.cc:203
int exprlist_length(leftv v)
Definition: ipshell.cc:544
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:995
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pSetCompP(a, i)
Definition: polys.h:285
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
int i
Definition: cfEzgcd.cc:123
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:725
#define nDelete(n)
Definition: numbers.h:16
leftv next
Definition: subexpr.h:87
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define nIsZero(n)
Definition: numbers.h:19
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24
int iiOp
Definition: iparith.cc:224
static Poly * h
Definition: janet.cc:978
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjIDEAL_R()

static BOOLEAN jjIDEAL_R ( leftv  res,
leftv  v 
)
static

Definition at line 4177 of file iparith.cc.

4178 {
4179  if (currRing!=NULL)
4180  {
4181  ring q=(ring)v->Data();
4182  if (rSamePolyRep(currRing, q))
4183  {
4184  if (q->qideal==NULL)
4185  res->data=(char *)idInit(1,1);
4186  else
4187  res->data=(char *)idCopy(q->qideal);
4188  return FALSE;
4189  }
4190  }
4191  WerrorS("can only get ideal from identical qring");
4192  return TRUE;
4193 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
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:1675
ideal idCopy(ideal A)
Definition: ideals.h:60
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjidElem()

static BOOLEAN jjidElem ( leftv  res,
leftv  v 
)
static

Definition at line 5204 of file iparith.cc.

5205 {
5206  res->data = (char *)(long)idElem((ideal)v->Data());
5207  return FALSE;
5208 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
int idElem(const ideal F)
count non-zero elements

◆ jjidFreeModule()

static BOOLEAN jjidFreeModule ( leftv  res,
leftv  v 
)
static

Definition at line 5209 of file iparith.cc.

5210 {
5211  res->data = (char *)id_FreeModule((int)(long)v->Data(), currRing);
5212  return FALSE;
5213 }
ideal id_FreeModule(int i, const ring r)
the free module of rank i
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjidHead()

static BOOLEAN jjidHead ( leftv  res,
leftv  v 
)
static

Definition at line 5229 of file iparith.cc.

5230 {
5231  res->data = (char *)id_Head((ideal)v->Data(),currRing);
5232  setFlag(res,FLAG_STD);
5233  return FALSE;
5234 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
void * Data()
Definition: subexpr.cc:1137

◆ jjidMaxIdeal()

static BOOLEAN jjidMaxIdeal ( leftv  res,
leftv  v 
)
static

Definition at line 4143 of file iparith.cc.

4144 {
4145  res->data = (char *)idMaxIdeal((int)(long)v->Data());
4146  setFlag(res,FLAG_STD);
4147  return FALSE;
4148 }
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition: ideals.h:33
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
void * Data()
Definition: subexpr.cc:1137

◆ jjidMinBase()

static BOOLEAN jjidMinBase ( leftv  res,
leftv  v 
)
static

Definition at line 5235 of file iparith.cc.

5236 {
5237  res->data = (char *)idMinBase((ideal)v->Data());
5238  return FALSE;
5239 }
#define FALSE
Definition: auxiliary.h:94
ideal idMinBase(ideal h1)
Definition: ideals.cc:45
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjidTransp()

static BOOLEAN jjidTransp ( leftv  res,
leftv  v 
)
static

Definition at line 5287 of file iparith.cc.

5288 {
5289  res->data = (char *)id_Transp((ideal)v->Data(),currRing);
5290  return FALSE;
5291 }
ideal id_Transp(ideal a, const ring rRing)
transpose a module
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjidVec2Ideal()

static BOOLEAN jjidVec2Ideal ( leftv  res,
leftv  v 
)
static

Definition at line 5214 of file iparith.cc.

5215 {
5216  res->data = (char *)id_Vec2Ideal((poly)v->Data(), currRing);
5217  return FALSE;
5218 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137
ideal id_Vec2Ideal(poly vec, const ring R)
polyrec * poly
Definition: hilb.h:10

◆ jjIm2Iv()

static BOOLEAN jjIm2Iv ( leftv  res,
leftv  v 
)
static

Definition at line 4194 of file iparith.cc.

4195 {
4196  intvec *iv = (intvec *)v->CopyD(INTMAT_CMD);
4197  iv->makeVector();
4198  res->data = iv;
4199  return FALSE;
4200 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void makeVector()
Definition: intvec.h:94
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjIMPART()

static BOOLEAN jjIMPART ( leftv  res,
leftv  v 
)
static

Definition at line 4201 of file iparith.cc.

4202 {
4203  res->data = (char *)n_ImPart((number)v->Data(),currRing->cf);
4204  return FALSE;
4205 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
Definition: coeffs.h:827
void * Data()
Definition: subexpr.cc:1137

◆ jjINDEPSET()

static BOOLEAN jjINDEPSET ( leftv  res,
leftv  v 
)
static

Definition at line 4206 of file iparith.cc.

4207 {
4208  assumeStdFlag(v);
4209  res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal);
4210  return FALSE;
4211 }
intvec * scIndIntvec(ideal S, ideal Q)
Definition: hdegree.cc:212
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjINDEPSET2()

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

Definition at line 2379 of file iparith.cc.

2380 {
2381  assumeStdFlag(u);
2382  res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()),
2383  currRing->qideal);
2384  return FALSE;
2385 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
lists scIndIndset(ideal S, BOOLEAN all, ideal Q)
Definition: ipshell.cc:1022
void * Data()
Definition: subexpr.cc:1137

◆ jjINDEX_I()

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

Definition at line 1369 of file iparith.cc.

1370 {
1371  res->rtyp=u->rtyp; u->rtyp=0;
1372  res->data=u->data; u->data=NULL;
1373  res->name=u->name; u->name=NULL;
1374  res->e=u->e; u->e=NULL;
1375  if (res->e==NULL) res->e=jjMakeSub(v);
1376  else
1377  {
1378  Subexpr sh=res->e;
1379  while (sh->next != NULL) sh=sh->next;
1380  sh->next=jjMakeSub(v);
1381  }
1382  if (u->next!=NULL)
1383  {
1385  BOOLEAN bo=iiExprArith2(rn,u->next,iiOp,v);
1386  res->next=rn;
1387  return bo;
1388  }
1389  return FALSE;
1390 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
sleftv * leftv
Definition: structs.h:60
void * data
Definition: subexpr.h:89
const char * name
Definition: subexpr.h:88
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7834
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025

◆ jjINDEX_IV()

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

Definition at line 1391 of file iparith.cc.

1392 {
1393  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
1394  {
1395  WerrorS("indexed object must have a name");
1396  return TRUE;
1397  }
1398  intvec * iv=(intvec *)v->Data();
1399  leftv p=NULL;
1400  int i;
1401  sleftv t;
1402  memset(&t,0,sizeof(t));
1403  t.rtyp=INT_CMD;
1404  for (i=0;i<iv->length(); i++)
1405  {
1406  t.data=(char *)((long)(*iv)[i]);
1407  if (p==NULL)
1408  {
1409  p=res;
1410  }
1411  else
1412  {
1414  p=p->next;
1415  }
1416  p->rtyp=IDHDL;
1417  p->data=u->data;
1418  p->name=u->name;
1419  p->flag=u->flag;
1420  p->e=jjMakeSub(&t);
1421  }
1422  u->rtyp=0;
1423  u->data=NULL;
1424  u->name=NULL;
1425  return FALSE;
1426 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:106
BITSET flag
Definition: subexpr.h:91
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
const char * name
Definition: subexpr.h:88
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:92
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7834
void * Data()
Definition: subexpr.cc:1137

◆ jjINDEX_P()

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

Definition at line 1427 of file iparith.cc.

1428 {
1429  poly p=(poly)u->Data();
1430  int i=(int)(long)v->Data();
1431  int j=0;
1432  while (p!=NULL)
1433  {
1434  j++;
1435  if (j==i)
1436  {
1437  res->data=(char *)pHead(p);
1438  return FALSE;
1439  }
1440  pIter(p);
1441  }
1442  return FALSE;
1443 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
#define pIter(p)
Definition: monomials.h:44
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjINDEX_P_IV()

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

Definition at line 1444 of file iparith.cc.

1445 {
1446  poly p=(poly)u->Data();
1447  poly r=NULL;
1448  intvec *iv=(intvec *)v->CopyD(INTVEC_CMD);
1449  int i;
1450  int sum=0;
1451  for(i=iv->length()-1;i>=0;i--)
1452  sum+=(*iv)[i];
1453  int j=0;
1454  while ((p!=NULL) && (sum>0))
1455  {
1456  j++;
1457  for(i=iv->length()-1;i>=0;i--)
1458  {
1459  if (j==(*iv)[i])
1460  {
1461  r=pAdd(r,pHead(p));
1462  sum-=j;
1463  (*iv)[i]=0;
1464  break;
1465  }
1466  }
1467  pIter(p);
1468  }
1469  delete iv;
1470  res->data=(char *)r;
1471  return FALSE;
1472 }
#define pAdd(p, q)
Definition: polys.h:186
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjINDEX_V()

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

Definition at line 1473 of file iparith.cc.

1474 {
1475  poly p=(poly)u->CopyD(VECTOR_CMD);
1476  poly r=p; // pointer to the beginning of component i
1477  poly o=NULL;
1478  int i=(int)(long)v->Data();
1479  while (p!=NULL)
1480  {
1481  if (pGetComp(p)!=i)
1482  {
1483  if (r==p) r=pNext(p);
1484  if (o!=NULL)
1485  {
1486  if (pNext(o)!=NULL) pLmDelete(&pNext(o));
1487  p=pNext(o);
1488  }
1489  else
1490  pLmDelete(&p);
1491  }
1492  else
1493  {
1494  pSetComp(p, 0);
1495  p_SetmComp(p, currRing);
1496  o=p;
1497  p=pNext(o);
1498  }
1499  }
1500  res->data=(char *)r;
1501  return FALSE;
1502 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:123
#define p_SetmComp
Definition: p_polys.h:239
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjINDEX_V_IV()

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

Definition at line 1503 of file iparith.cc.

1504 {
1505  poly p=(poly)u->CopyD(VECTOR_CMD);
1506  if (p!=NULL)
1507  {
1508  poly r=pOne();
1509  poly hp=r;
1510  intvec *iv=(intvec *)v->Data();
1511  int i;
1512  loop
1513  {
1514  for(i=0;i<iv->length();i++)
1515  {
1516  if (((int)pGetComp(p))==(*iv)[i])
1517  {
1518  poly h;
1519  pSplit(p,&h);
1520  pNext(hp)=p;
1521  p=h;
1522  pIter(hp);
1523  break;
1524  }
1525  }
1526  if (p==NULL) break;
1527  if (i==iv->length())
1528  {
1529  pLmDelete(&p);
1530  if (p==NULL) break;
1531  }
1532  }
1533  pLmDelete(&r);
1534  res->data=(char *)r;
1535  }
1536  return FALSE;
1537 }
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
#define pSplit(p, r)
Definition: polys.h:247
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjINTERPOLATION()

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

Definition at line 2392 of file iparith.cc.

2393 {
2394  const lists L = (lists)l->Data();
2395  const int n = L->nr; assume (n >= 0);
2396  std::vector<ideal> V(n + 1);
2397 
2398  for(int i = n; i >= 0; i--) V[i] = (ideal)(L->m[i].Data());
2399 
2400  res->data=interpolation(V, (intvec*)v->Data());
2401  setFlag(res,FLAG_STD);
2402  return errorreported;
2403 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
ideal interpolation(const std::vector< ideal > &L, intvec *v)
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
#define assume(x)
Definition: mod2.h:394
#define setFlag(A, F)
Definition: ipid.h:110
int i
Definition: cfEzgcd.cc:123
#define FLAG_STD
Definition: ipid.h:106
short errorreported
Definition: feFopen.cc:23
int nr
Definition: lists.h:43
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137

◆ jjINTERRED()

static BOOLEAN jjINTERRED ( leftv  res,
leftv  v 
)
static

Definition at line 4212 of file iparith.cc.

4213 {
4214  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
4215 #ifdef HAVE_RINGS
4217  WarnS("interred: this command is experimental over the integers");
4218 #endif
4219  if (TEST_OPT_PROT) { PrintLn(); mflush(); }
4220  res->data = result;
4221  return FALSE;
4222 }
void PrintLn()
Definition: reporter.cc:310
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:94
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
#define mflush()
Definition: reporter.h:57
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal kInterRed(ideal F, ideal Q)
Definition: kstd1.cc:3542
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76

◆ jjINTERSECT()

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

Definition at line 2386 of file iparith.cc.

2387 {
2388  res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data());
2390  return FALSE;
2391 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ideal idSect(ideal h1, ideal h2)
Definition: ideals.cc:201
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define TEST_OPT_RETURN_SB
Definition: options.h:107
void * Data()
Definition: subexpr.cc:1137

◆ jjINTERSECT_PL()

static BOOLEAN jjINTERSECT_PL ( leftv  res,
leftv  v 
)
static

Definition at line 6865 of file iparith.cc.

6866 {
6867  leftv h=v;
6868  int l=v->listLength();
6869  resolvente r=(resolvente)omAlloc0(l*sizeof(ideal));
6870  BOOLEAN *copied=(BOOLEAN *)omAlloc0(l*sizeof(BOOLEAN));
6871  int t=0;
6872  // try to convert to IDEAL_CMD
6873  while (h!=NULL)
6874  {
6875  if (iiTestConvert(h->Typ(),IDEAL_CMD)!=0)
6876  {
6877  t=IDEAL_CMD;
6878  }
6879  else break;
6880  h=h->next;
6881  }
6882  // if failure, try MODUL_CMD
6883  if (t==0)
6884  {
6885  h=v;
6886  while (h!=NULL)
6887  {
6888  if (iiTestConvert(h->Typ(),MODUL_CMD)!=0)
6889  {
6890  t=MODUL_CMD;
6891  }
6892  else break;
6893  h=h->next;
6894  }
6895  }
6896  // check for success in converting
6897  if (t==0)
6898  {
6899  WerrorS("cannot convert to ideal or module");
6900  return TRUE;
6901  }
6902  // call idMultSect
6903  h=v;
6904  int i=0;
6905  sleftv tmp;
6906  while (h!=NULL)
6907  {
6908  if (h->Typ()==t)
6909  {
6910  r[i]=(ideal)h->Data(); /*no copy*/
6911  h=h->next;
6912  }
6913  else if(iiConvert(h->Typ(),t,iiTestConvert(h->Typ(),t),h,&tmp))
6914  {
6915  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
6916  omFreeSize((ADDRESS)r,l*sizeof(ideal));
6917  Werror("cannot convert arg. %d to %s",i+1,Tok2Cmdname(t));
6918  return TRUE;
6919  }
6920  else
6921  {
6922  r[i]=(ideal)tmp.Data(); /*now it's a copy*/
6923  copied[i]=TRUE;
6924  h=tmp.next;
6925  }
6926  i++;
6927  }
6928  res->rtyp=t;
6929  res->data=(char *)idMultSect(r,i);
6930  while(i>0)
6931  {
6932  i--;
6933  if (copied[i]) idDelete(&(r[i]));
6934  }
6935  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
6936  omFreeSize((ADDRESS)r,l*sizeof(ideal));
6937  return FALSE;
6938 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:60
#define TRUE
Definition: auxiliary.h:98
ideal idMultSect(resolvente arg, int length)
Definition: ideals.cc:340
void * ADDRESS
Definition: auxiliary.h:115
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
ideal * resolvente
Definition: ideals.h:18
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94

◆ jjINTMAT3()

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

Definition at line 5766 of file iparith.cc.

5767 {
5768  intvec* im= new intvec((int)(long)v->Data(),(int)(long)w->Data(), 0);
5769  intvec* arg = (intvec*) u->Data();
5770  int i, n = si_min(im->cols()*im->rows(), arg->cols()*arg->rows());
5771 
5772  for (i=0; i<n; i++)
5773  {
5774  (*im)[i] = (*arg)[i];
5775  }
5776 
5777  res->data = (char *)im;
5778  return FALSE;
5779 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1137

◆ jjINTVEC_PL()

static BOOLEAN jjINTVEC_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7101 of file iparith.cc.

7102 {
7103  int i=0;
7104  leftv h=v;
7105  if (h!=NULL) i=exprlist_length(h);
7106  intvec *iv=new intvec(i);
7107  i=0;
7108  while (h!=NULL)
7109  {
7110  if(h->Typ()==INT_CMD)
7111  {
7112  (*iv)[i]=(int)(long)h->Data();
7113  }
7114  else if (h->Typ()==INTVEC_CMD)
7115  {
7116  intvec *ivv=(intvec*)h->Data();
7117  for(int j=0;j<ivv->length();j++,i++)
7118  {
7119  (*iv)[i]=(*ivv)[j];
7120  }
7121  i--;
7122  }
7123  else
7124  {
7125  delete iv;
7126  return TRUE;
7127  }
7128  i++;
7129  h=h->next;
7130  }
7131  res->data=(char *)iv;
7132  return FALSE;
7133 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
int exprlist_length(leftv v)
Definition: ipshell.cc:544
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978

◆ jjIS_RINGVAR0()

static BOOLEAN jjIS_RINGVAR0 ( leftv  res,
leftv   
)
static

Definition at line 4234 of file iparith.cc.

4235 {
4236  res->data = (char *)0;
4237  return FALSE;
4238 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89

◆ jjIS_RINGVAR_P()

static BOOLEAN jjIS_RINGVAR_P ( leftv  res,
leftv  v 
)
static

Definition at line 4223 of file iparith.cc.

4224 {
4225  res->data = (char *)(long)pVar((poly)v->Data());
4226  return FALSE;
4227 }
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjIS_RINGVAR_S()

static BOOLEAN jjIS_RINGVAR_S ( leftv  res,
leftv  v 
)
static

Definition at line 4228 of file iparith.cc.

4229 {
4230  res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing->names,
4231  currRing->N)+1);
4232  return FALSE;
4233 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:222
void * Data()
Definition: subexpr.cc:1137

◆ jjJACOB_M()

static BOOLEAN jjJACOB_M ( leftv  res,
leftv  a 
)
static

Definition at line 4270 of file iparith.cc.

4271 {
4272  ideal id = (ideal)a->Data();
4273  id = id_Transp(id,currRing);
4274  int W = IDELEMS(id);
4275 
4276  ideal result = idInit(W * currRing->N, id->rank);
4277  poly *p = result->m;
4278 
4279  for( int v = 1; v <= currRing->N; v++ )
4280  {
4281  poly* q = id->m;
4282  for( int i = 0; i < W; i++, p++, q++ )
4283  *p = pDiff( *q, v );
4284  }
4285  idDelete(&id);
4286 
4287  res->data = (char *)result;
4288  return FALSE;
4289 }
ideal id_Transp(ideal a, const ring rRing)
transpose a module
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void * Data()
Definition: subexpr.cc:1137
#define pDiff(a, b)
Definition: polys.h:278
polyrec * poly
Definition: hilb.h:10
return result
Definition: facAbsBiFact.cc:76

◆ jjJACOB_P()

static BOOLEAN jjJACOB_P ( leftv  res,
leftv  v 
)
static

Definition at line 4239 of file iparith.cc.

4240 {
4241  ideal i=idInit(currRing->N,1);
4242  int k;
4243  poly p=(poly)(v->Data());
4244  for (k=currRing->N;k>0;k--)
4245  {
4246  i->m[k-1]=pDiff(p,k);
4247  }
4248  res->data = (char *)i;
4249  return FALSE;
4250 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
void * Data()
Definition: subexpr.cc:1137
#define pDiff(a, b)
Definition: polys.h:278
polyrec * poly
Definition: hilb.h:10

◆ jjJanetBasis()

static BOOLEAN jjJanetBasis ( leftv  res,
leftv  v 
)
static

Definition at line 2410 of file iparith.cc.

2411 {
2412  extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
2413  return jjStdJanetBasis(res,v,0);
2414 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
Definition: wrapper.cc:52
int BOOLEAN
Definition: auxiliary.h:85

◆ jjJanetBasis2()

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

Definition at line 2404 of file iparith.cc.

2405 {
2406  extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
2407  return jjStdJanetBasis(res,u,(int)(long)v->Data());
2408 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
Definition: wrapper.cc:52
void * Data()
Definition: subexpr.cc:1137
int BOOLEAN
Definition: auxiliary.h:85

◆ jjJET4()

static BOOLEAN jjJET4 ( leftv  res,
leftv  u 
)
static

Definition at line 7134 of file iparith.cc.

7135 {
7136  const short t1[]={4,POLY_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7137  const short t2[]={4,VECTOR_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7138  const short t3[]={4,IDEAL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7139  const short t4[]={4,MODUL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7140  leftv u1=u;
7141  leftv u2=u1->next;
7142  leftv u3=u2->next;
7143  leftv u4=u3->next;
7144  if (iiCheckTypes(u,t1)||iiCheckTypes(u,t2))
7145  {
7146  if(!pIsUnit((poly)u2->Data()))
7147  {
7148  WerrorS("2nd argument must be a unit");
7149  return TRUE;
7150  }
7151  res->rtyp=u1->Typ();
7152  res->data=(char*)pSeries((int)(long)u3->Data(),pCopy((poly)u1->Data()),
7153  pCopy((poly)u2->Data()),(intvec*)u4->Data());
7154  return FALSE;
7155  }
7156  else
7157  if (iiCheckTypes(u,t3)||iiCheckTypes(u,t4))
7158  {
7159  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7160  {
7161  WerrorS("2nd argument must be a diagonal matrix of units");
7162  return TRUE;
7163  }
7164  res->rtyp=u1->Typ();
7165  res->data=(char*)idSeries(
7166  (int)(long)u3->Data(),
7167  idCopy((ideal)u1->Data()),
7168  mp_Copy((matrix)u2->Data(), currRing),
7169  (intvec*)u4->Data()
7170  );
7171  return FALSE;
7172  }
7173  else
7174  {
7175  Werror("%s(`poly`,`poly`,`int`,`intvec`) exppected",
7176  Tok2Cmdname(iiOp));
7177  return TRUE;
7178  }
7179 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
ideal idSeries(int n, ideal M, matrix U, intvec *w)
Definition: ideals.cc:1887
Definition: intvec.h:14
ideal idCopy(ideal A)
Definition: ideals.h:60
leftv next
Definition: subexpr.h:87
#define pSeries(n, p, u, w)
Definition: polys.h:354
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:6470
int rtyp
Definition: subexpr.h:92
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:728
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

◆ jjJET_ID()

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

Definition at line 2420 of file iparith.cc.

2421 {
2422  res->data = (char *)id_Jet((ideal)u->Data(),(int)(long)v->Data(),currRing);
2423  return FALSE;
2424 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal id_Jet(ideal i, int d, const ring R)
void * Data()
Definition: subexpr.cc:1137

◆ jjJET_ID_IV()

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

Definition at line 5797 of file iparith.cc.

5798 {
5799  res->data = (char *)id_JetW((ideal)u->Data(),(int)(long)v->Data(),
5800  (intvec *)w->Data(),currRing);
5801  return FALSE;
5802 }
#define FALSE
Definition: auxiliary.h:94
ideal id_JetW(ideal i, int d, intvec *iv, const ring R)
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjJET_ID_M()

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

Definition at line 5803 of file iparith.cc.

5804 {
5805  if (!mp_IsDiagUnit((matrix)v->Data(), currRing))
5806  {
5807  WerrorS("2nd argument must be a diagonal matrix of units");
5808  return TRUE;
5809  }
5810  res->data = (char *)idSeries((int)(long)w->Data(),(ideal)u->CopyD(),
5811  (matrix)v->CopyD());
5812  return FALSE;
5813 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal idSeries(int n, ideal M, matrix U, intvec *w)
Definition: ideals.cc:1887
ip_smatrix * matrix
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:728
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjJET_P()

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

Definition at line 2415 of file iparith.cc.

2416 {
2417  res->data = (char *)pJet((poly)u->CopyD(), (int)(long)v->Data());
2418  return FALSE;
2419 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define pJet(p, m)
Definition: polys.h:350
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjJET_P_IV()

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

Definition at line 5780 of file iparith.cc.

5781 {
5782  short *iw=iv2array((intvec *)w->Data(),currRing);
5783  res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
5784  omFreeSize( (ADDRESS)iw, (rVar(currRing)+1)*sizeof(short) );
5785  return FALSE;
5786 }
#define FALSE
Definition: auxiliary.h:94
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:208
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
#define ppJetW(p, m, iv)
Definition: polys.h:351

◆ jjJET_P_P()

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

Definition at line 5787 of file iparith.cc.

5788 {
5789  if (!pIsUnit((poly)v->Data()))
5790  {
5791  WerrorS("2nd argument must be a unit");
5792  return TRUE;
5793  }
5794  res->data = (char *)p_Series((int)(long)w->Data(),(poly)u->CopyD(),(poly)v->CopyD(),NULL,currRing);
5795  return FALSE;
5796 }
#define FALSE
Definition: auxiliary.h:94
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly p_Series(int n, poly p, poly u, intvec *w, const ring R)
Definition: p_polys.cc:4317
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjKBASE()

static BOOLEAN jjKBASE ( leftv  res,
leftv  v 
)
static

Definition at line 4292 of file iparith.cc.

4293 {
4294  assumeStdFlag(v);
4295  res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal);
4296  return FALSE;
4297 }
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition: hdegree.cc:1353
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjKBASE2()

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

Definition at line 2425 of file iparith.cc.

2426 {
2427  assumeStdFlag(u);
2428  intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
2429  res->data = (char *)scKBase((int)(long)v->Data(),
2430  (ideal)(u->Data()),currRing->qideal, w_u);
2431  if (w_u!=NULL)
2432  {
2433  atSet(res,omStrDup("isHomog"),ivCopy(w_u),INTVEC_CMD);
2434  }
2435  return FALSE;
2436 }
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition: hdegree.cc:1353
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:94
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjKERNEL()

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

Definition at line 2438 of file iparith.cc.

2439 {
2440  return jjPREIMAGE(res,u,v,NULL);
2441 }
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6023
#define NULL
Definition: omList.c:10

◆ jjKLAMMER()

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

Definition at line 1539 of file iparith.cc.

1540 {
1541  if(u->name==NULL) return TRUE;
1542  char * nn = (char *)omAlloc(strlen(u->name) + 14);
1543  sprintf(nn,"%s(%d)",u->name,(int)(long)v->Data());
1544  omFree((ADDRESS)u->name);
1545  u->name=NULL;
1546  char *n=omStrDup(nn);
1547  omFree((ADDRESS)nn);
1548  syMake(res,n);
1549  if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
1550  return FALSE;
1551 }
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
Definition: iparith.cc:1580
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1500
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjKLAMMER_IV()

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

Definition at line 1552 of file iparith.cc.

1553 {
1554  intvec * iv=(intvec *)v->Data();
1555  leftv p=NULL;
1556  int i;
1557  long slen = strlen(u->name) + 14;
1558  char *n = (char*) omAlloc(slen);
1559 
1560  for (i=0;i<iv->length(); i++)
1561  {
1562  if (p==NULL)
1563  {
1564  p=res;
1565  }
1566  else
1567  {
1569  p=p->next;
1570  }
1571  sprintf(n,"%s(%d)",u->name,(*iv)[i]);
1572  syMake(p,omStrDup(n));
1573  }
1574  omFree((ADDRESS)u->name);
1575  u->name = NULL;
1576  omFreeSize(n, slen);
1577  if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
1578  return FALSE;
1579 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
Definition: iparith.cc:1580
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
#define omAlloc(size)
Definition: omAllocDecl.h:210
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1500
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjKLAMMER_PL()

static BOOLEAN jjKLAMMER_PL ( leftv  res,
leftv  u 
)
static

Definition at line 7217 of file iparith.cc.

7218 {
7219  if ((yyInRingConstruction)
7220  && ((strcmp(u->Name(),"real")==0) || (strcmp(u->Name(),"complex")==0)))
7221  {
7222  memcpy(res,u,sizeof(sleftv));
7223  memset(u,0,sizeof(sleftv));
7224  return FALSE;
7225  }
7226  leftv v=u->next;
7227  BOOLEAN b;
7228  if(v==NULL) // p()
7229  b=iiExprArith1(res,u,iiOp);
7230  else if ((v->next==NULL) // p(1)
7231  || (u->Typ()!=UNKNOWN)) // p(1,2), p proc or map
7232  {
7233  u->next=NULL;
7234  b=iiExprArith2(res,u,iiOp,v);
7235  u->next=v;
7236  }
7237  else // p(1,2), p undefined
7238  {
7239  if (v->Typ()!=INT_CMD)
7240  {
7241  Werror("`int` expected while building `%s(`",u->name);
7242  return TRUE;
7243  }
7244  int l=u->listLength();
7245  char * nn = (char *)omAlloc(strlen(u->name) + 12*l);
7246  sprintf(nn,"%s(%d",u->name,(int)(long)v->Data());
7247  char *s=nn;
7248  do
7249  {
7250  while (*s!='\0') s++;
7251  v=v->next;
7252  if (v->Typ()!=INT_CMD)
7253  {
7254  Werror("`int` expected while building `%s`",nn);
7255  omFree((ADDRESS)nn);
7256  return TRUE;
7257  }
7258  sprintf(s,",%d",(int)(long)v->Data());
7259  } while (v->next!=NULL);
7260  while (*s!='\0') s++;
7261  nn=strcat(nn,")");
7262  char *n=omStrDup(nn);
7263  omFree((ADDRESS)nn);
7264  syMake(res,n);
7265  b=FALSE;
7266  }
7267  return b;
7268 }
BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8215
#define FALSE
Definition: auxiliary.h:94
int listLength()
Definition: subexpr.cc:60
#define TRUE
Definition: auxiliary.h:98
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:115
int Typ()
Definition: subexpr.cc:995
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * Name()
Definition: subexpr.h:121
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1500
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjKLAMMER_rest()

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

Definition at line 1580 of file iparith.cc.

1581 {
1583  memset(tmp,0,sizeof(sleftv));
1584  BOOLEAN b;
1585  if (v->Typ()==INTVEC_CMD)
1586  b=jjKLAMMER_IV(tmp,u,v);
1587  else
1588  b=jjKLAMMER(tmp,u,v);
1589  if (b)
1590  {
1591  omFreeBin(tmp,sleftv_bin);
1592  return TRUE;
1593  }
1594  leftv h=res;
1595  while (h->next!=NULL) h=h->next;
1596  h->next=tmp;
1597  return FALSE;
1598 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition: iparith.cc:1552
#define TRUE
Definition: auxiliary.h:98
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:995
poly res
Definition: myNF.cc:322
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition: iparith.cc:1539
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ jjKoszul()

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

Definition at line 2442 of file iparith.cc.

2443 {
2444  return mpKoszul(res, u,v,NULL);
2445 }
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition: ipshell.cc:3013
#define NULL
Definition: omList.c:10

◆ jjKoszul_Id()

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

Definition at line 2446 of file iparith.cc.

2447 {
2448  sleftv h;
2449  memset(&h,0,sizeof(sleftv));
2450  h.rtyp=INT_CMD;
2451  h.data=(void *)(long)IDELEMS((ideal)v->Data());
2452  return mpKoszul(res, u, &h, v);
2453 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition: ipshell.cc:3013
void * data
Definition: subexpr.h:89
#define IDELEMS(i)
Definition: simpleideals.h:24
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978

◆ jjL2R()

static BOOLEAN jjL2R ( leftv  res,
leftv  v 
)
static

Definition at line 4298 of file iparith.cc.

4299 {
4300  res->data=(char *)syConvList((lists)v->Data());
4301  if (res->data != NULL)
4302  return FALSE;
4303  else
4304  return TRUE;
4305 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
syStrategy syConvList(lists li)
Definition: ipshell.cc:3176
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjLE_BI()

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

Definition at line 1128 of file iparith.cc.

1129 {
1130  return jjGE_BI(res,v,u);
1131 }
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:1093

◆ jjLE_I()

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

Definition at line 1132 of file iparith.cc.

1133 {
1134  res->data = (char *)(long)((int)((long)u->Data()) <= (int)((long)v->Data()));
1135  return FALSE;
1136 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjLE_N()

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

Definition at line 1137 of file iparith.cc.

1138 {
1139  return jjGE_N(res,v,u);
1140 }
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition: iparith.cc:1105

◆ jjLEADCOEF()

static BOOLEAN jjLEADCOEF ( leftv  res,
leftv  v 
)
static

Definition at line 4306 of file iparith.cc.

4307 {
4308  poly p=(poly)v->Data();
4309  if (p==NULL)
4310  {
4311  res->data=(char *)nInit(0);
4312  }
4313  else
4314  {
4315  res->data=(char *)nCopy(pGetCoeff(p));
4316  }
4317  return FALSE;
4318 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24

◆ jjLEADEXP()

static BOOLEAN jjLEADEXP ( leftv  res,
leftv  v 
)
static

Definition at line 4319 of file iparith.cc.

4320 {
4321  poly p=(poly)v->Data();
4322  int s=currRing->N;
4323  if (v->Typ()==VECTOR_CMD) s++;
4324  intvec *iv=new intvec(s);
4325  if (p!=NULL)
4326  {
4327  for(int i = currRing->N;i;i--)
4328  {
4329  (*iv)[i-1]=pGetExp(p,i);
4330  }
4331  if (s!=currRing->N)
4332  (*iv)[currRing->N]=pGetComp(p);
4333  }
4334  res->data=(char *)iv;
4335  return FALSE;
4336 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
int Typ()
Definition: subexpr.cc:995
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjLEADMONOM()

static BOOLEAN jjLEADMONOM ( leftv  res,
leftv  v 
)
static

Definition at line 4337 of file iparith.cc.

4338 {
4339  poly p=(poly)v->Data();
4340  if (p == NULL)
4341  {
4342  res->data = (char*) NULL;
4343  }
4344  else
4345  {
4346  poly lm = pLmInit(p);
4347  pSetCoeff(lm, nInit(1));
4348  res->data = (char*) lm;
4349  }
4350  return FALSE;
4351 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
Definition: polys.h:64
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31

◆ jjLIFT()

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

Definition at line 2454 of file iparith.cc.

2455 {
2456  int ul= IDELEMS((ideal)u->Data());
2457  int vl= IDELEMS((ideal)v->Data());
2458  ideal m = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,
2459  hasFlag(u,FLAG_STD));
2460  if (m==NULL) return TRUE;
2461  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
2462  return FALSE;
2463 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int m
Definition: cfEzgcd.cc:119
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
#define hasFlag(A, F)
Definition: ipid.h:109
void * Data()
Definition: subexpr.cc:1137
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891

◆ jjLIFT3()

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

Definition at line 6322 of file iparith.cc.

6323 {
6324  if (w->rtyp!=IDHDL) return TRUE;
6325  int ul= IDELEMS((ideal)u->Data());
6326  int vl= IDELEMS((ideal)v->Data());
6327  ideal m
6328  = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
6329  FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))));
6330  if (m==NULL) return TRUE;
6331  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
6332  return FALSE;
6333 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int m
Definition: cfEzgcd.cc:119
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891
#define IDMATRIX(a)
Definition: ipid.h:131

◆ jjLIFTSTD()

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

Definition at line 2464 of file iparith.cc.

2465 {
2466  if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
2467  idhdl h=(idhdl)v->data;
2468  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
2469  res->data = (char *)idLiftStd((ideal)u->Data(),
2470  &(h->data.umatrix),testHomog);
2471  setFlag(res,FLAG_STD); v->flag=0;
2472  return FALSE;
2473 }
Subexpr e
Definition: subexpr.h:106
BITSET flag
Definition: subexpr.h:91
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz)
Definition: ideals.cc:704
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
utypes data
Definition: idrec.h:40

◆ jjLIFTSTD3()

static BOOLEAN jjLIFTSTD3 ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6334 of file iparith.cc.

6335 {
6336  if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
6337  if ((w->rtyp!=IDHDL)||(w->e!=NULL)) return TRUE;
6338  idhdl hv=(idhdl)v->data;
6339  idhdl hw=(idhdl)w->data;
6340  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
6341  res->data = (char *)idLiftStd((ideal)u->Data(),
6342  &(hv->data.umatrix),testHomog,
6343  &(hw->data.uideal));
6344  setFlag(res,FLAG_STD); v->flag=0; w->flag=0;
6345  return FALSE;
6346 }
Subexpr e
Definition: subexpr.h:106
BITSET flag
Definition: subexpr.h:91
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz)
Definition: ideals.cc:704
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
utypes data
Definition: idrec.h:40

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv  res,
leftv  v 
)

Definition at line 7269 of file iparith.cc.

7270 {
7271  int sl=0;
7272  if (v!=NULL) sl = v->listLength();
7273  lists L;
7274  if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
7275  {
7276  int add_row_shift = 0;
7277  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
7278  if (weights!=NULL) add_row_shift=weights->min_in();
7279  L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
7280  }
7281  else
7282  {
7284  leftv h=NULL;
7285  int i;
7286  int rt;
7287 
7288  L->Init(sl);
7289  for (i=0;i<sl;i++)
7290  {
7291  if (h!=NULL)
7292  { /* e.g. not in the first step:
7293  * h is the pointer to the old sleftv,
7294  * v is the pointer to the next sleftv
7295  * (in this moment) */
7296  h->next=v;
7297  }
7298  h=v;
7299  v=v->next;
7300  h->next=NULL;
7301  rt=h->Typ();
7302  if (rt==0)
7303  {
7304  L->Clean();
7305  Werror("`%s` is undefined",h->Fullname());
7306  return TRUE;
7307  }
7308  if (rt==RING_CMD)
7309  {
7310  L->m[i].rtyp=rt; L->m[i].data=h->Data();
7311  ((ring)L->m[i].data)->ref++;
7312  }
7313  else
7314  L->m[i].Copy(h);
7315  }
7316  }
7317  res->data=(char *)L;
7318  return FALSE;
7319 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3103
int listLength()
Definition: subexpr.cc:60
#define TRUE
Definition: auxiliary.h:98
int min_in()
Definition: intvec.h:113
int Typ()
Definition: subexpr.cc:995
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void Copy(leftv e)
Definition: subexpr.cc:688
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjLISTRING()

static BOOLEAN jjLISTRING ( leftv  res,
leftv  v 
)
static

Definition at line 4356 of file iparith.cc.

4357 {
4358  ring r=rCompose((lists)v->Data());
4359  if (r==NULL) return TRUE;
4360  res->data=(char *)r;
4361  return FALSE;
4362 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
ring rCompose(const lists L, const BOOLEAN check_comp=TRUE)
Definition: ipshell.cc:2725
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD()

BOOLEAN jjLOAD ( const char *  s,
BOOLEAN  autoexport 
)

load lib/module given in v

Definition at line 5117 of file iparith.cc.

5118 {
5119  char libnamebuf[1024];
5120  lib_types LT = type_of_LIB(s, libnamebuf);
5121 
5122 #ifdef HAVE_DYNAMIC_LOADING
5123  extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
5124 #endif /* HAVE_DYNAMIC_LOADING */
5125  switch(LT)
5126  {
5127  default:
5128  case LT_NONE:
5129  Werror("%s: unknown type", s);
5130  break;
5131  case LT_NOTFOUND:
5132  Werror("cannot open %s", s);
5133  break;
5134 
5135  case LT_SINGULAR:
5136  {
5137  char *plib = iiConvName(s);
5138  idhdl pl = IDROOT->get(plib,0);
5139  if (pl==NULL)
5140  {
5141  pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
5142  IDPACKAGE(pl)->language = LANG_SINGULAR;
5143  IDPACKAGE(pl)->libname=omStrDup(plib);
5144  }
5145  else if (IDTYP(pl)!=PACKAGE_CMD)
5146  {
5147  Werror("can not create package `%s`",plib);
5148  omFree(plib);
5149  return TRUE;
5150  }
5151  package savepack=currPack;
5152  currPack=IDPACKAGE(pl);
5153  IDPACKAGE(pl)->loaded=TRUE;
5154  char libnamebuf[1024];
5155  FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
5156  BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
5157  currPack=savepack;
5158  IDPACKAGE(pl)->loaded=(!bo);
5159  return bo;
5160  }
5161  case LT_BUILTIN:
5162  SModulFunc_t iiGetBuiltinModInit(const char*);
5163  return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
5164  case LT_MACH_O:
5165  case LT_ELF:
5166  case LT_HPUX:
5167 #ifdef HAVE_DYNAMIC_LOADING
5168  return load_modules(s, libnamebuf, autoexport);
5169 #else /* HAVE_DYNAMIC_LOADING */
5170  WerrorS("Dynamic modules are not supported by this version of Singular");
5171  break;
5172 #endif /* HAVE_DYNAMIC_LOADING */
5173  }
5174  return TRUE;
5175 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
CanonicalForm fp
Definition: cfModGcd.cc:4043
Definition: mod_raw.h:16
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:98
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
Definition: mod_lib.cc:24
void WerrorS(const char *s)
Definition: feFopen.cc:24
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:136
#define IDTYP(a)
Definition: ipid.h:116
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:258
#define omFree(addr)
Definition: omAllocDecl.h:261
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:47
lib_types
Definition: mod_raw.h:16
char libnamebuf[1024]
Definition: libparse.cc:1096
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition: iplib.cc:1080
#define NULL
Definition: omList.c:10
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition: iplib.cc:643
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
int(* SModulFunc_t)(SModulFunctions *)
Definition: ipid.h:82
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
Definition: iplib.cc:807
char * iiConvName(const char *libname)
Definition: iplib.cc:1214
int BOOLEAN
Definition: auxiliary.h:85
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition: iplib.cc:982
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjLOAD1()

static BOOLEAN jjLOAD1 ( leftv  ,
leftv  v 
)
static

Definition at line 4352 of file iparith.cc.

4353 {
4354  return jjLOAD((char*)v->Data(),FALSE);
4355 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5117
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD2()

static BOOLEAN jjLOAD2 ( leftv  ,
leftv  ,
leftv  v 
)
static

Definition at line 2474 of file iparith.cc.

2475 {
2476  return jjLOAD((char*)v->Data(),TRUE);
2477 }
#define TRUE
Definition: auxiliary.h:98
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5117
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD_E()

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

Definition at line 2478 of file iparith.cc.

2479 {
2480  char * s=(char *)u->Data();
2481  if(strcmp(s, "with")==0)
2482  return jjLOAD((char*)v->Data(), TRUE);
2483  if (strcmp(s,"try")==0)
2484  return jjLOAD_TRY((char*)v->Data());
2485  WerrorS("invalid second argument");
2486  WerrorS("load(\"libname\" [,option]);");
2487  return TRUE;
2488 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5117
BOOLEAN jjLOAD_TRY(const char *s)
Definition: iparith.cc:5181
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD_TRY()

BOOLEAN jjLOAD_TRY ( const char *  s)

Definition at line 5181 of file iparith.cc.

5182 {
5183  void (*WerrorS_save)(const char *s) = WerrorS_callback;
5186  BOOLEAN bo=jjLOAD(s,TRUE);
5187  if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5188  Print("loading of >%s< failed\n",s);
5189  WerrorS_callback=WerrorS_save;
5190  errorreported=0;
5191  return FALSE;
5192 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:83
#define TEST_OPT_PROT
Definition: options.h:98
static int WerrorS_dummy_cnt
Definition: iparith.cc:5176
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5117
static void WerrorS_dummy(const char *)
Definition: iparith.cc:5177
void(* WerrorS_callback)(const char *s)
Definition: feFopen.cc:21
short errorreported
Definition: feFopen.cc:23
int BOOLEAN
Definition: auxiliary.h:85

◆ jjLT_BI()

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

Definition at line 1141 of file iparith.cc.

1142 {
1143  return jjGT_BI(res,v,u);
1144 }
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:1111

◆ jjLT_I()

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

Definition at line 1145 of file iparith.cc.

1146 {
1147  res->data = (char *)(long)((int)((long)u->Data()) < (int)((long)v->Data()));
1148  return FALSE;
1149 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjLT_N()

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

Definition at line 1150 of file iparith.cc.

1151 {
1152  return jjGT_N(res,v,u);
1153 }
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition: iparith.cc:1123

◆ jjLU_DECOMP()

static BOOLEAN jjLU_DECOMP ( leftv  res,
leftv  v 
)
static

Definition at line 4372 of file iparith.cc.

4373 {
4374  /* computes the LU-decomposition of a matrix M;
4375  i.e., M = P * L * U, where
4376  - P is a row permutation matrix,
4377  - L is in lower triangular form,
4378  - U is in upper row echelon form
4379  Then, we also have P * M = L * U.
4380  A list [P, L, U] is returned. */
4381  matrix mat = (const matrix)v->Data();
4382  if (!idIsConstant((ideal)mat))
4383  {
4384  WerrorS("matrix must be constant");
4385  return TRUE;
4386  }
4387  matrix pMat;
4388  matrix lMat;
4389  matrix uMat;
4390 
4391  luDecomp(mat, pMat, lMat, uMat);
4392 
4394  ll->Init(3);
4395  ll->m[0].rtyp=MATRIX_CMD; ll->m[0].data=(void *)pMat;
4396  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)lMat;
4397  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)uMat;
4398  res->data=(char*)ll;
4399 
4400  return FALSE;
4401 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
ip_smatrix * matrix
INLINE_THIS void Init(int l=0)
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
#define idIsConstant(I)
Definition: ideals.h:40

◆ jjLU_INVERSE()

static BOOLEAN jjLU_INVERSE ( leftv  res,
leftv  v 
)
static

Definition at line 6939 of file iparith.cc.

6940 {
6941  /* computation of the inverse of a quadratic matrix A
6942  using the L-U-decomposition of A;
6943  There are two valid parametrisations:
6944  1) exactly one argument which is just the matrix A,
6945  2) exactly three arguments P, L, U which already
6946  realise the L-U-decomposition of A, that is,
6947  P * A = L * U, and P, L, and U satisfy the
6948  properties decribed in method 'jjLU_DECOMP';
6949  see there;
6950  If A is invertible, the list [1, A^(-1)] is returned,
6951  otherwise the list [0] is returned. Thus, the user may
6952  inspect the first entry of the returned list to see
6953  whether A is invertible. */
6954  matrix iMat; int invertible;
6955  const short t1[]={1,MATRIX_CMD};
6956  const short t2[]={3,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
6957  if (iiCheckTypes(v,t1))
6958  {
6959  matrix aMat = (matrix)v->Data();
6960  int rr = aMat->rows();
6961  int cc = aMat->cols();
6962  if (rr != cc)
6963  {
6964  Werror("given matrix (%d x %d) is not quadratic, hence not invertible", rr, cc);
6965  return TRUE;
6966  }
6967  if (!idIsConstant((ideal)aMat))
6968  {
6969  WerrorS("matrix must be constant");
6970  return TRUE;
6971  }
6972  invertible = luInverse(aMat, iMat);
6973  }
6974  else if (iiCheckTypes(v,t2))
6975  {
6976  matrix pMat = (matrix)v->Data();
6977  matrix lMat = (matrix)v->next->Data();
6978  matrix uMat = (matrix)v->next->next->Data();
6979  int rr = uMat->rows();
6980  int cc = uMat->cols();
6981  if (rr != cc)
6982  {
6983  Werror("third matrix (%d x %d) is not quadratic, hence not invertible",
6984  rr, cc);
6985  return TRUE;
6986  }
6987  if (!idIsConstant((ideal)pMat)
6988  || (!idIsConstant((ideal)lMat))
6989  || (!idIsConstant((ideal)uMat))
6990  )
6991  {
6992  WerrorS("matricesx must be constant");
6993  return TRUE;
6994  }
6995  invertible = luInverseFromLUDecomp(pMat, lMat, uMat, iMat);
6996  }
6997  else
6998  {
6999  Werror("expected either one or three matrices");
7000  return TRUE;
7001  }
7002 
7003  /* build the return structure; a list with either one or two entries */
7005  if (invertible)
7006  {
7007  ll->Init(2);
7008  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7009  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)iMat;
7010  }
7011  else
7012  {
7013  ll->Init(1);
7014  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7015  }
7016 
7017  res->data=(char*)ll;
7018  return FALSE;
7019 }
int & rows()
Definition: matpol.h:24
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: tok.h:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
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...
leftv next
Definition: subexpr.h:87
INLINE_THIS void Init(int l=0)
int & cols()
Definition: matpol.h:25
slists * lists
Definition: mpr_numeric.h:146
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:6470
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...
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define idIsConstant(I)
Definition: ideals.h:40

◆ jjLU_SOLVE()

static BOOLEAN jjLU_SOLVE ( leftv  res,
leftv  v 
)
static

Definition at line 7020 of file iparith.cc.

7021 {
7022  /* for solving a linear equation system A * x = b, via the
7023  given LU-decomposition of the matrix A;
7024  There is one valid parametrisation:
7025  1) exactly four arguments P, L, U, b;
7026  P, L, and U realise the L-U-decomposition of A, that is,
7027  P * A = L * U, and P, L, and U satisfy the
7028  properties decribed in method 'jjLU_DECOMP';
7029  see there;
7030  b is the right-hand side vector of the equation system;
7031  The method will return a list of either 1 entry or three entries:
7032  1) [0] if there is no solution to the system;
7033  2) [1, x, H] if there is at least one solution;
7034  x is any solution of the given linear system,
7035  H is the matrix with column vectors spanning the homogeneous
7036  solution space.
7037  The method produces an error if matrix and vector sizes do not fit. */
7038  const short t[]={4,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
7039  if (!iiCheckTypes(v,t))
7040  {
7041  WerrorS("expected exactly three matrices and one vector as input");
7042  return TRUE;
7043  }
7044  matrix pMat = (matrix)v->Data();
7045  matrix lMat = (matrix)v->next->Data();
7046  matrix uMat = (matrix)v->next->next->Data();
7047  matrix bVec = (matrix)v->next->next->next->Data();
7048  matrix xVec; int solvable; matrix homogSolSpace;
7049  if (pMat->rows() != pMat->cols())
7050  {
7051  Werror("first matrix (%d x %d) is not quadratic",
7052  pMat->rows(), pMat->cols());
7053  return TRUE;
7054  }
7055  if (lMat->rows() != lMat->cols())
7056  {
7057  Werror("second matrix (%d x %d) is not quadratic",
7058  lMat->rows(), lMat->cols());
7059  return TRUE;
7060  }
7061  if (lMat->rows() != uMat->rows())
7062  {
7063  Werror("second matrix (%d x %d) and third matrix (%d x %d) do not fit",
7064  lMat->rows(), lMat->cols(), uMat->rows(), uMat->cols());
7065  return TRUE;
7066  }
7067  if (uMat->rows() != bVec->rows())
7068  {
7069  Werror("third matrix (%d x %d) and vector (%d x 1) do not fit",
7070  uMat->rows(), uMat->cols(), bVec->rows());
7071  return TRUE;
7072  }
7073  if (!idIsConstant((ideal)pMat)
7074  ||(!idIsConstant((ideal)lMat))
7075  ||(!idIsConstant((ideal)uMat))
7076  )
7077  {
7078  WerrorS("matrices must be constant");
7079  return TRUE;
7080  }
7081  solvable = luSolveViaLUDecomp(pMat, lMat, uMat, bVec, xVec, homogSolSpace);
7082 
7083  /* build the return structure; a list with either one or three entries */
7085  if (solvable)
7086  {
7087  ll->Init(3);
7088  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7089  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
7090  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
7091  }
7092  else
7093  {
7094  ll->Init(1);
7095  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7096  }
7097 
7098  res->data=(char*)ll;
7099  return FALSE;
7100 }
int & rows()
Definition: matpol.h:24
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
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: tok.h:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
leftv next
Definition: subexpr.h:87
INLINE_THIS void Init(int l=0)
int & cols()
Definition: matpol.h:25
slists * lists
Definition: mpr_numeric.h:146
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:6470
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define idIsConstant(I)
Definition: ideals.h:40

◆ jjMakeSub()

static Subexpr jjMakeSub ( leftv  e)
static

Definition at line 7834 of file iparith.cc.

7835 {
7836  assume( e->Typ()==INT_CMD );
7837  Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
7838  r->start =(int)(long)e->Data();
7839  return r;
7840 }
Definition: tok.h:95
int Typ()
Definition: subexpr.cc:995
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:394
omBin sSubexpr_bin
Definition: subexpr.cc:49
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void * Data()
Definition: subexpr.cc:1137

◆ jjMAP()

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

Definition at line 1635 of file iparith.cc.

1636 {
1637  //Print("try to map %s with %s\n",$3.Name(),$1.Name());
1638  leftv sl=NULL;
1639  if ((v->e==NULL)&&(v->name!=NULL))
1640  {
1641  map m=(map)u->Data();
1642  sl=iiMap(m,v->name);
1643  }
1644  else
1645  {
1646  Werror("%s(<name>) expected",u->Name());
1647  }
1648  if (sl==NULL) return TRUE;
1649  memcpy(res,sl,sizeof(sleftv));
1651  return FALSE;
1652 }
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:400
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
const char * Name()
Definition: subexpr.h:121
const char * name
Definition: subexpr.h:88
int m
Definition: cfEzgcd.cc:119
omBin sleftv_bin
Definition: subexpr.cc:50
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
leftv iiMap(map theMap, const char *what)
Definition: ipshell.cc:607
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjMATRIX_Id()

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

Definition at line 6260 of file iparith.cc.

6261 {
6262  int mi=(int)(long)v->Data();
6263  int ni=(int)(long)w->Data();
6264  if ((mi<1)||(ni<1))
6265  {
6266  Werror("converting ideal to matrix: dimensions must be positive(%dx%d)",mi,ni);
6267  return TRUE;
6268  }
6269  matrix m=mpNew(mi,ni);
6270  ideal I=(ideal)u->CopyD(IDEAL_CMD);
6271  int i=si_min(IDELEMS(I),mi*ni);
6272  //for(i=i-1;i>=0;i--)
6273  //{
6274  // m->m[i]=I->m[i];
6275  // I->m[i]=NULL;
6276  //}
6277  memcpy(m->m,I->m,i*sizeof(poly));
6278  memset(I->m,0,i*sizeof(poly));
6279  id_Delete(&I,currRing);
6280  res->data = (char *)m;
6281  return FALSE;
6282 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly * m
Definition: matpol.h:19
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjMATRIX_Ma()

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

Definition at line 6296 of file iparith.cc.

6297 {
6298  int mi=(int)(long)v->Data();
6299  int ni=(int)(long)w->Data();
6300  if ((mi<1)||(ni<1))
6301  {
6302  Werror("converting matrix to matrix: dimensions must be positive(%dx%d)",mi,ni);
6303  return TRUE;
6304  }
6305  matrix m=mpNew(mi,ni);
6306  matrix I=(matrix)u->CopyD(MATRIX_CMD);
6307  int r=si_min(MATROWS(I),mi);
6308  int c=si_min(MATCOLS(I),ni);
6309  int i,j;
6310  for(i=r;i>0;i--)
6311  {
6312  for(j=c;j>0;j--)
6313  {
6314  MATELEM(m,i,j)=MATELEM(I,i,j);
6315  MATELEM(I,i,j)=NULL;
6316  }
6317  }
6318  id_Delete((ideal *)&I,currRing);
6319  res->data = (char *)m;
6320  return FALSE;
6321 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707
#define MATELEM(mat, i, j)
Definition: matpol.h:29

◆ jjMATRIX_Mo()

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

Definition at line 6283 of file iparith.cc.

6284 {
6285  int mi=(int)(long)v->Data();
6286  int ni=(int)(long)w->Data();
6287  if ((mi<1)||(ni<1))
6288  {
6289  Werror("converting module to matrix: dimensions must be positive(%dx%d)",mi,ni);
6290  return TRUE;
6291  }
6292  res->data = (char *)id_Module2formatedMatrix((ideal)u->CopyD(MODUL_CMD),
6293  mi,ni,currRing);
6294  return FALSE;
6295 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjMEMORY()

static BOOLEAN jjMEMORY ( leftv  res,
leftv  v 
)
static

Definition at line 4402 of file iparith.cc.

4403 {
4404  // clean out "_":
4406  memset(&sLastPrinted,0,sizeof(sleftv));
4407  // collect all info:
4408  omUpdateInfo();
4409  switch(((int)(long)v->Data()))
4410  {
4411  case 0:
4412  res->data=(char *)n_Init(om_Info.UsedBytes,coeffs_BIGINT);
4413  break;
4414  case 1:
4415  res->data = (char *)n_Init(om_Info.CurrentBytesSystem,coeffs_BIGINT);
4416  break;
4417  case 2:
4418  res->data = (char *)n_Init(om_Info.MaxBytesSystem,coeffs_BIGINT);
4419  break;
4420  default:
4421  omPrintStats(stdout);
4422  omPrintInfo(stdout);
4423  omPrintBinStats(stdout);
4424  res->data = (char *)0;
4425  res->rtyp = NONE;
4426  }
4427  return FALSE;
4428  res->data = (char *)0;
4429  return FALSE;
4430 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void omPrintInfo(FILE *fd)
Definition: omStats.c:129
#define FALSE
Definition: auxiliary.h:94
void omPrintBinStats(FILE *fd)
Definition: omBin.c:692
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
void omPrintStats(FILE *fd)
Definition: omStats.c:115
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
omInfo_t om_Info
Definition: omStats.c:13
void omUpdateInfo()
Definition: omStats.c:24
int rtyp
Definition: subexpr.h:92
sleftv sLastPrinted
Definition: subexpr.cc:55
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
#define NONE
Definition: tok.h:216

◆ jjMINOR_M()

static BOOLEAN jjMINOR_M ( leftv  res,
leftv  v 
)
static

Definition at line 5814 of file iparith.cc.

5815 {
5816  /* Here's the use pattern for the minor command:
5817  minor ( matrix_expression m, int_expression minorSize,
5818  optional ideal_expression IasSB, optional int_expression k,
5819  optional string_expression algorithm,
5820  optional int_expression cachedMinors,
5821  optional int_expression cachedMonomials )
5822  This method here assumes that there are at least two arguments.
5823  - If IasSB is present, it must be a std basis. All minors will be
5824  reduced w.r.t. IasSB.
5825  - If k is absent, all non-zero minors will be computed.
5826  If k is present and k > 0, the first k non-zero minors will be
5827  computed.
5828  If k is present and k < 0, the first |k| minors (some of which
5829  may be zero) will be computed.
5830  If k is present and k = 0, an error is reported.
5831  - If algorithm is absent, all the following arguments must be absent too.
5832  In this case, a heuristic picks the best-suited algorithm (among
5833  Bareiss, Laplace, and Laplace with caching).
5834  If algorithm is present, it must be one of "Bareiss", "bareiss",
5835  "Laplace", "laplace", "Cache", "cache". In the cases "Cache" and
5836  "cache" two more arguments may be given, determining how many entries
5837  the cache may have at most, and how many cached monomials there are at
5838  most. (Cached monomials are counted over all cached polynomials.)
5839  If these two additional arguments are not provided, 200 and 100000
5840  will be used as defaults.
5841  */
5842  matrix m;
5843  leftv u=v->next;
5844  v->next=NULL;
5845  int v_typ=v->Typ();
5846  if (v_typ==MATRIX_CMD)
5847  {
5848  m = (const matrix)v->Data();
5849  }
5850  else
5851  {
5852  if (v_typ==0)
5853  {
5854  Werror("`%s` is undefined",v->Fullname());
5855  return TRUE;
5856  }
5857  // try to convert to MATRIX:
5858  int ii=iiTestConvert(v_typ,MATRIX_CMD);
5859  BOOLEAN bo;
5860  sleftv tmp;
5861  if (ii>0) bo=iiConvert(v_typ,MATRIX_CMD,ii,v,&tmp);
5862  else bo=TRUE;
5863  if (bo)
5864  {
5865  Werror("cannot convert %s to matrix",Tok2Cmdname(v_typ));
5866  return TRUE;
5867  }
5868  m=(matrix)tmp.data;
5869  }
5870  const int mk = (const int)(long)u->Data();
5871  bool noIdeal = true; bool noK = true; bool noAlgorithm = true;
5872  bool noCacheMinors = true; bool noCacheMonomials = true;
5873  ideal IasSB; int k; char* algorithm; int cacheMinors; int cacheMonomials;
5874 
5875  /* here come the different cases of correct argument sets */
5876  if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD))
5877  {
5878  IasSB = (ideal)u->next->Data();
5879  noIdeal = false;
5880  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
5881  {
5882  k = (int)(long)u->next->next->Data();
5883  noK = false;
5884  assume(k != 0);
5885  if ((u->next->next->next != NULL) &&
5886  (u->next->next->next->Typ() == STRING_CMD))
5887  {
5888  algorithm = (char*)u->next->next->next->Data();
5889  noAlgorithm = false;
5890  if ((u->next->next->next->next != NULL) &&
5891  (u->next->next->next->next->Typ() == INT_CMD))
5892  {
5893  cacheMinors = (int)(long)u->next->next->next->next->Data();
5894  noCacheMinors = false;
5895  if ((u->next->next->next->next->next != NULL) &&
5896  (u->next->next->next->next->next->Typ() == INT_CMD))
5897  {
5898  cacheMonomials =
5899  (int)(long)u->next->next->next->next->next->Data();
5900  noCacheMonomials = false;
5901  }
5902  }
5903  }
5904  }
5905  }
5906  else if ((u->next != NULL) && (u->next->Typ() == INT_CMD))
5907  {
5908  k = (int)(long)u->next->Data();
5909  noK = false;
5910  assume(k != 0);
5911  if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD))
5912  {
5913  algorithm = (char*)u->next->next->Data();
5914  noAlgorithm = false;
5915  if ((u->next->next->next != NULL) &&
5916  (u->next->next->next->Typ() == INT_CMD))
5917  {
5918  cacheMinors = (int)(long)u->next->next->next->Data();
5919  noCacheMinors = false;
5920  if ((u->next->next->next->next != NULL) &&
5921  (u->next->next->next->next->Typ() == INT_CMD))
5922  {
5923  cacheMonomials = (int)(long)u->next->next->next->next->Data();
5924  noCacheMonomials = false;
5925  }
5926  }
5927  }
5928  }
5929  else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD))
5930  {
5931  algorithm = (char*)u->next->Data();
5932  noAlgorithm = false;
5933  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
5934  {
5935  cacheMinors = (int)(long)u->next->next->Data();
5936  noCacheMinors = false;
5937  if ((u->next->next->next != NULL) &&
5938  (u->next->next->next->Typ() == INT_CMD))
5939  {
5940  cacheMonomials = (int)(long)u->next->next->next->Data();
5941  noCacheMonomials = false;
5942  }
5943  }
5944  }
5945 
5946  /* upper case conversion for the algorithm if present */
5947  if (!noAlgorithm)
5948  {
5949  if (strcmp(algorithm, "bareiss") == 0)
5950  algorithm = (char*)"Bareiss";
5951  if (strcmp(algorithm, "laplace") == 0)
5952  algorithm = (char*)"Laplace";
5953  if (strcmp(algorithm, "cache") == 0)
5954  algorithm = (char*)"Cache";
5955  }
5956 
5957  v->next=u;
5958  /* here come some tests */
5959  if (!noIdeal)
5960  {
5961  assumeStdFlag(u->next);
5962  }
5963  if ((!noK) && (k == 0))
5964  {
5965  WerrorS("Provided number of minors to be computed is zero.");
5966  return TRUE;
5967  }
5968  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") != 0)
5969  && (strcmp(algorithm, "Laplace") != 0)
5970  && (strcmp(algorithm, "Cache") != 0))
5971  {
5972  WerrorS("Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
5973  return TRUE;
5974  }
5975  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
5976  && (!rField_is_Domain(currRing)))
5977  {
5978  Werror("Bareiss algorithm not defined over coefficient rings %s",
5979  "with zero divisors.");
5980  return TRUE;
5981  }
5982  res->rtyp=IDEAL_CMD;
5983  if ((mk < 1) || (mk > m->rows()) || (mk > m->cols()))
5984  {
5985  ideal I=idInit(1,1);
5986  if (mk<1) I->m[0]=p_One(currRing);
5987  //Werror("invalid size of minors: %d (matrix is (%d x %d))", mk,
5988  // m->rows(), m->cols());
5989  res->data=(void*)I;
5990  return FALSE;
5991  }
5992  if ((!noAlgorithm) && (strcmp(algorithm, "Cache") == 0)
5993  && (noCacheMinors || noCacheMonomials))
5994  {
5995  cacheMinors = 200;
5996  cacheMonomials = 100000;
5997  }
5998 
5999  /* here come the actual procedure calls */
6000  if (noAlgorithm)
6001  res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k),
6002  (noIdeal ? 0 : IasSB), false);
6003  else if (strcmp(algorithm, "Cache") == 0)
6004  res->data = getMinorIdealCache(m, mk, (noK ? 0 : k),
6005  (noIdeal ? 0 : IasSB), 3, cacheMinors,
6006  cacheMonomials, false);
6007  else
6008  res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm,
6009  (noIdeal ? 0 : IasSB), false);
6010  if (v_typ!=MATRIX_CMD) idDelete((ideal *)&m);
6011  return FALSE;
6012 }
int & rows()
Definition: matpol.h:24
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.
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
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.
#define TRUE
Definition: auxiliary.h:98
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
int Typ()
Definition: subexpr.cc:995
const char * Fullname()
Definition: subexpr.h:126
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
poly p_One(const ring r)
Definition: p_polys.cc:1312
#define assume(x)
Definition: mod2.h:394
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
leftv next
Definition: subexpr.h:87
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int & cols()
Definition: matpol.h:25
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.
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjMINRES_R()

static BOOLEAN jjMINRES_R ( leftv  res,
leftv  v 
)
static

Definition at line 4456 of file iparith.cc.

4457 {
4458  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4459 
4460  syStrategy tmp=(syStrategy)v->Data();
4461  tmp = syMinimize(tmp); // enrich itself!
4462 
4463  res->data=(char *)tmp;
4464 
4465  if (weights!=NULL)
4466  atSet(res, omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
4467 
4468  return FALSE;
4469 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:94
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
syStrategy syMinimize(syStrategy syzstr)
Definition: syz1.cc:2402
ssyStrategy * syStrategy
Definition: syz.h:35
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjMINUS_BI()

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

Definition at line 866 of file iparith.cc.

867 {
868  res->data = (char *)(n_Sub((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
869  return jjPLUSMINUS_Gen(res,u,v);
870 }
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of &#39;a&#39; and &#39;b&#39;, i.e., a-b
Definition: coeffs.h:673
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjMINUS_BIM()

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

Definition at line 891 of file iparith.cc.

892 {
893  res->data = (char *)bimSub((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
894  if (res->data==NULL)
895  {
896  WerrorS("bigintmat/cmatrix not compatible");
897  return TRUE;
898  }
899  return jjPLUSMINUS_Gen(res,u,v);
900 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
bigintmat * bimSub(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:219
Matrices of numbers.
Definition: bigintmat.h:51
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjMINUS_I()

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

Definition at line 850 of file iparith.cc.

851 {
852  void *ap=u->Data(); void *bp=v->Data();
853  int aa=(int)(long)ap;
854  int bb=(int)(long)bp;
855  int cc=aa-bb;
856  unsigned int a=(unsigned int)(unsigned long)ap;
857  unsigned int b=(unsigned int)(unsigned long)bp;
858  unsigned int c=a-b;
859  if (((Sy_bit(31)&a)!=(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c)))
860  {
861  WarnS("int overflow(-), result may be wrong");
862  }
863  res->data = (char *)((long)cc);
864  return jjPLUSMINUS_Gen(res,u,v);
865 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
const poly a
Definition: syzextra.cc:212
#define WarnS
Definition: emacs.cc:81
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjMINUS_IV()

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

Definition at line 881 of file iparith.cc.

882 {
883  res->data = (char *)ivSub((intvec*)(u->Data()), (intvec*)(v->Data()));
884  if (res->data==NULL)
885  {
886  WerrorS("intmat size not compatible");
887  return TRUE;
888  }
889  return jjPLUSMINUS_Gen(res,u,v);
890 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define TRUE
Definition: auxiliary.h:98
intvec * ivSub(intvec *a, intvec *b)
Definition: intvec.cc:280
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjMINUS_MA()

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

Definition at line 901 of file iparith.cc.

902 {
903  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
904  res->data = (char *)(mp_Sub(A , B, currRing));
905  if (res->data==NULL)
906  {
907  Werror("matrix size not compatible(%dx%d, %dx%d)",
908  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
909  return TRUE;
910  }
911  return jjPLUSMINUS_Gen(res,u,v);
912  return FALSE;
913 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define A
Definition: sirandom.c:23
ip_smatrix * matrix
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
b *CanonicalForm B
Definition: facBivar.cc:51
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:206
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjMINUS_N()

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

Definition at line 871 of file iparith.cc.

872 {
873  res->data = (char *)(nSub((number)u->Data(), (number)v->Data()));
874  return jjPLUSMINUS_Gen(res,u,v);
875 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
void * data
Definition: subexpr.h:89
#define nSub(n1, n2)
Definition: numbers.h:22
void * Data()
Definition: subexpr.cc:1137

◆ jjMINUS_P()

static BOOLEAN jjMINUS_P ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 876 of file iparith.cc.

877 {
878  res->data = (char *)(pSub((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
879  return jjPLUSMINUS_Gen(res,u,v);
880 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
void * data
Definition: subexpr.h:89
#define pSub(a, b)
Definition: polys.h:269
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjMOD_BI()

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

Definition at line 2538 of file iparith.cc.

2539 {
2540  number q=(number)v->Data();
2541  if (n_IsZero(q,coeffs_BIGINT))
2542  {
2544  return TRUE;
2545  }
2546  res->data =(char *) n_IntMod((number)u->Data(),q,coeffs_BIGINT);
2547  return FALSE;
2548 }
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,b,r) >=0
Definition: coeffs.h:632
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:468
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222

◆ jjMOD_N()

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

Definition at line 2549 of file iparith.cc.

2550 {
2551  number q=(number)v->Data();
2552  if (nIsZero(q))
2553  {
2555  return TRUE;
2556  }
2557  res->data =(char *) n_IntMod((number)u->Data(),q,currRing->cf);
2558  return FALSE;
2559 }
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,b,r) >=0
Definition: coeffs.h:632
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define nIsZero(n)
Definition: numbers.h:19
void * Data()
Definition: subexpr.cc:1137
#define ii_div_by_0
Definition: iparith.cc:222

◆ jjMODULO()

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

Definition at line 2489 of file iparith.cc.

2490 {
2491  intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
2492  tHomog hom=testHomog;
2493  if (w_u!=NULL)
2494  {
2495  w_u=ivCopy(w_u);
2496  hom=isHomog;
2497  }
2498  intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
2499  if (w_v!=NULL)
2500  {
2501  w_v=ivCopy(w_v);
2502  hom=isHomog;
2503  }
2504  if ((w_u!=NULL) && (w_v==NULL))
2505  w_v=ivCopy(w_u);
2506  if ((w_v!=NULL) && (w_u==NULL))
2507  w_u=ivCopy(w_v);
2508  ideal u_id=(ideal)u->Data();
2509  ideal v_id=(ideal)v->Data();
2510  if (w_u!=NULL)
2511  {
2512  if ((*w_u).compare((w_v))!=0)
2513  {
2514  WarnS("incompatible weights");
2515  delete w_u; w_u=NULL;
2516  hom=testHomog;
2517  }
2518  else
2519  {
2520  if ((!idTestHomModule(u_id,currRing->qideal,w_v))
2521  || (!idTestHomModule(v_id,currRing->qideal,w_v)))
2522  {
2523  WarnS("wrong weights");
2524  delete w_u; w_u=NULL;
2525  hom=testHomog;
2526  }
2527  }
2528  }
2529  res->data = (char *)idModulo(u_id,v_id ,hom,&w_u);
2530  if (w_u!=NULL)
2531  {
2532  atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
2533  }
2534  delete w_v;
2535  //if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
2536  return FALSE;
2537 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w)
Definition: ideals.cc:1989
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjMONITOR1()

static BOOLEAN jjMONITOR1 ( leftv  res,
leftv  v 
)
static

Definition at line 2561 of file iparith.cc.

2562 {
2563  return jjMONITOR2(res,v,NULL);
2564 }
#define NULL
Definition: omList.c:10
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition: iparith.cc:2565

◆ jjMONITOR2()

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

Definition at line 2565 of file iparith.cc.

2566 {
2567 #if 0
2568  char *opt=(char *)v->Data();
2569  int mode=0;
2570  while(*opt!='\0')
2571  {
2572  if (*opt=='i') mode |= SI_PROT_I;
2573  else if (*opt=='o') mode |= SI_PROT_O;
2574  opt++;
2575  }
2576  monitor((char *)(u->Data()),mode);
2577 #else
2578  si_link l=(si_link)u->Data();
2579  if (slOpen(l,SI_LINK_WRITE,u)) return TRUE;
2580  if(strcmp(l->m->type,"ASCII")!=0)
2581  {
2582  Werror("ASCII link required, not `%s`",l->m->type);
2583  slClose(l);
2584  return TRUE;
2585  }
2586  SI_LINK_SET_CLOSE_P(l); // febase handles the FILE*
2587  if ( l->name[0]!='\0') // "" is the stop condition
2588  {
2589  const char *opt;
2590  int mode=0;
2591  if (v==NULL) opt=(const char*)"i";
2592  else opt=(const char *)v->Data();
2593  while(*opt!='\0')
2594  {
2595  if (*opt=='i') mode |= SI_PROT_I;
2596  else if (*opt=='o') mode |= SI_PROT_O;
2597  opt++;
2598  }
2599  monitor((FILE *)l->data,mode);
2600  }
2601  else
2602  monitor(NULL,0);
2603  return FALSE;
2604 #endif
2605 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
#define SI_PROT_I
Definition: reporter.h:52
void monitor(void *F, int mode)
Definition: febase.cc:72
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#define SI_PROT_O
Definition: reporter.h:53
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

◆ jjMONOM()

static BOOLEAN jjMONOM ( leftv  res,
leftv  v 
)
static

Definition at line 2606 of file iparith.cc.

2607 {
2608  intvec *iv=(intvec *)v->Data();
2609  poly p=pOne();
2610  int e;
2611  BOOLEAN err=FALSE;
2612  for(unsigned i=si_min(currRing->N,iv->length()); i>0; i--)
2613  {
2614  e=(*iv)[i-1];
2615  if (e>=0) pSetExp(p,i,e);
2616  else err=TRUE;
2617  }
2618  if (iv->length()==(currRing->N+1))
2619  {
2620  res->rtyp=VECTOR_CMD;
2621  e=(*iv)[currRing->N];
2622  if (e>=0) pSetComp(p,e);
2623  else err=TRUE;
2624  }
2625  pSetm(p);
2626  res->data=(char*)p;
2627  if(err) { pDelete(&p); WerrorS("no negative exponent allowed"); }
2628  return err;
2629 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
int length() const
Definition: intvec.h:86
#define pDelete(p_ptr)
Definition: polys.h:169
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjmpTrace()

static BOOLEAN jjmpTrace ( leftv  res,
leftv  v 
)
static

Definition at line 5252 of file iparith.cc.

5253 {
5254  res->data = (char *)mp_Trace((matrix)v->Data(),currRing);
5255  return FALSE;
5256 }
#define FALSE
Definition: auxiliary.h:94
poly mp_Trace(matrix a, const ring R)
Definition: matpol.cc:288
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjmpTransp()

static BOOLEAN jjmpTransp ( leftv  res,
leftv  v 
)
static

Definition at line 5257 of file iparith.cc.

5258 {
5259  res->data = (char *)mp_Transp((matrix)v->Data(),currRing);
5260  return FALSE;
5261 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
matrix mp_Transp(matrix a, const ring R)
Definition: matpol.cc:267
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjMSTD()

static BOOLEAN jjMSTD ( leftv  res,
leftv  v 
)
static

Definition at line 4435 of file iparith.cc.

4436 {
4437  int t=v->Typ();
4438  ideal r,m;
4439  r=kMin_std((ideal)v->Data(),currRing->qideal,testHomog,NULL,m);
4441  l->Init(2);
4442  l->m[0].rtyp=t;
4443  l->m[0].data=(char *)r;
4444  setFlag(&(l->m[0]),FLAG_STD);
4445  l->m[1].rtyp=t;
4446  l->m[1].data=(char *)m;
4447  res->data=(char *)l;
4448  return FALSE;
4449 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
#define setFlag(A, F)
Definition: ipid.h:110
int m
Definition: cfEzgcd.cc:119
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp, int reduced)
Definition: kstd1.cc:2822
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
int l
Definition: cfEzgcd.cc:94

◆ jjMULT()

static BOOLEAN jjMULT ( leftv  res,
leftv  v 
)
static

Definition at line 4450 of file iparith.cc.

4451 {
4452  assumeStdFlag(v);
4453  res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal);
4454  return FALSE;
4455 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int scMultInt(ideal S, ideal Q)
Definition: hdegree.cc:799
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjN2BI()

static BOOLEAN jjN2BI ( leftv  res,
leftv  v 
)
static

Definition at line 4470 of file iparith.cc.

4471 {
4472  number n,i; i=(number)v->Data();
4474  if (nMap!=NULL)
4475  n=nMap(i,currRing->cf,coeffs_BIGINT);
4476  else goto err;
4477  res->data=(void *)n;
4478  return FALSE;
4479 err:
4480  WerrorS("cannot convert to bigint"); return TRUE;
4481 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
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:725
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjNAMEOF()

static BOOLEAN jjNAMEOF ( leftv  res,
leftv  v 
)
static

Definition at line 4482 of file iparith.cc.

4483 {
4484  res->data = (char *)v->name;
4485  if (res->data==NULL) res->data=omStrDup("");
4486  v->name=NULL;
4487  return FALSE;
4488 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
const char * name
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjNAMES()

static BOOLEAN jjNAMES ( leftv  res,
leftv  v 
)
static

Definition at line 4489 of file iparith.cc.

4490 {
4491  res->data=ipNameList(((ring)v->Data())->idroot);
4492  return FALSE;
4493 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
lists ipNameList(idhdl root)
Definition: ipid.cc:532
void * Data()
Definition: subexpr.cc:1137

◆ jjNAMES0()

static BOOLEAN jjNAMES0 ( leftv  res,
leftv   
)
static

Definition at line 7320 of file iparith.cc.

7321 {
7322  res->data=(void *)ipNameList(IDROOT);
7323  return FALSE;
7324 }
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:89
lists ipNameList(idhdl root)
Definition: ipid.cc:532

◆ jjNAMES_I()

static BOOLEAN jjNAMES_I ( leftv  res,
leftv  v 
)
static

Definition at line 4494 of file iparith.cc.

4495 {
4496  res->data=ipNameListLev((IDROOT),(int)(long)v->Data());
4497  return FALSE;
4498 }
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:89
lists ipNameListLev(idhdl root, int lev)
Definition: ipid.cc:555
void * Data()
Definition: subexpr.cc:1137

◆ jjNEWSTRUCT2()

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

Definition at line 2630 of file iparith.cc.

2631 {
2632  // u: the name of the new type
2633  // v: the elements
2634  newstruct_desc d=newstructFromString((const char *)v->Data());
2635  if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
2636  return d==NULL;
2637 }
newstruct_desc newstructFromString(const char *s)
Definition: newstruct.cc:796
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void newstruct_setup(const char *n, newstruct_desc d)
Definition: newstruct.cc:692

◆ jjNEWSTRUCT3()

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

Definition at line 6013 of file iparith.cc.

6014 {
6015  // u: the name of the new type
6016  // v: the parent type
6017  // w: the elements
6018  newstruct_desc d=newstructChildFromString((const char *)v->Data(),
6019  (const char *)w->Data());
6020  if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
6021  return (d==NULL);
6022 }
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void newstruct_setup(const char *n, newstruct_desc d)
Definition: newstruct.cc:692
newstruct_desc newstructChildFromString(const char *parent, const char *s)
Definition: newstruct.cc:803

◆ jjnInt()

static BOOLEAN jjnInt ( leftv  res,
leftv  u 
)
static

Definition at line 5292 of file iparith.cc.

5293 {
5294  number n=(number)u->CopyD(); // n_Int may call n_Normalize
5295  res->data=(char *)(long)iin_Int(n,currRing->cf);
5296  n_Delete(&n,currRing->cf);
5297  return FALSE;
5298 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
static int iin_Int(number &n, coeffs cf)
Definition: iparith.cc:227
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjnlInt()

static BOOLEAN jjnlInt ( leftv  res,
leftv  u 
)
static

Definition at line 5299 of file iparith.cc.

5300 {
5301  number n=(number)u->Data();
5302  res->data=(char *)(long)iin_Int(n,coeffs_BIGINT );
5303  return FALSE;
5304 }
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
static int iin_Int(number &n, coeffs cf)
Definition: iparith.cc:227

◆ jjNOT()

static BOOLEAN jjNOT ( leftv  res,
leftv  v 
)
static

Definition at line 4499 of file iparith.cc.

4500 {
4501  res->data=(char*)(long)((long)v->Data()==0 ? 1 : 0);
4502  return FALSE;
4503 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjNULL()

static BOOLEAN jjNULL ( leftv  ,
leftv   
)
static

Definition at line 3487 of file iparith.cc.

3488 {
3489  return FALSE;
3490 }
#define FALSE
Definition: auxiliary.h:94

◆ jjNUMERATOR()

static BOOLEAN jjNUMERATOR ( leftv  res,
leftv  v 
)
static

Return the numerator of the input number NOTE: the input number is normalized as a side effect.

Definition at line 3760 of file iparith.cc.

3761 {
3762  number n = reinterpret_cast<number>(v->Data());
3763  res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing->cf));
3764  return FALSE;
3765 }
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:612
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjNVARS()

static BOOLEAN jjNVARS ( leftv  res,
leftv  v 
)
static

Definition at line 4504 of file iparith.cc.

4505 {
4506  res->data = (char *)(long)(((ring)(v->Data()))->N);
4507  return FALSE;
4508 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjOP_BI_BIM()

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

Definition at line 285 of file iparith.cc.

286 {
287  return jjOP_BIM_BI(res, v, u);
288 }
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:272

◆ jjOP_BIM_BI()

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

Definition at line 272 of file iparith.cc.

273 {
274  bigintmat* aa= (bigintmat *)u->Data();
275  number bb = (number)(v->Data());
276  if (errorreported) return TRUE;
277  bigintmat *cc=NULL;
278  switch (iiOp)
279  {
280  case '*': cc=bimMult(aa,bb,coeffs_BIGINT); break;
281  }
282  res->data=(char *)cc;
283  return cc==NULL;
284 }
Matrices of numbers.
Definition: bigintmat.h:51
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:256
short errorreported
Definition: feFopen.cc:23
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224

◆ jjOP_BIM_I()

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

Definition at line 253 of file iparith.cc.

254 {
255  bigintmat* aa= (bigintmat *)u->Data();
256  int bb = (int)(long)(v->Data());
257  if (errorreported) return TRUE;
258  bigintmat *cc=NULL;
259  switch (iiOp)
260  {
261  case '+': cc=bimAdd(aa,bb); break;
262  case '-': cc=bimSub(aa,bb); break;
263  case '*': cc=bimMult(aa,bb); break;
264  }
265  res->data=(char *)cc;
266  return cc==NULL;
267 }
bigintmat * bimSub(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:219
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? : NULL as a result means an error (non-compatible m...
Definition: bigintmat.cc:183
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:256
short errorreported
Definition: feFopen.cc:23
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224

◆ jjOP_I_BIM()

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

Definition at line 268 of file iparith.cc.

269 {
270  return jjOP_BIM_I(res, v, u);
271 }
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:253

◆ jjOP_I_IM()

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

Definition at line 325 of file iparith.cc.

326 {
327  return jjOP_IM_I(res,v,u);
328 }
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:310

◆ jjOP_I_IV()

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

Definition at line 306 of file iparith.cc.

307 {
308  return jjOP_IV_I(res,v,u);
309 }
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:289

◆ jjOP_IM_I()

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

Definition at line 310 of file iparith.cc.

311 {
312  intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
313  int bb = (int)(long)(v->Data());
314  int i=si_min(aa->rows(),aa->cols());
315  switch (iiOp)
316  {
317  case '+': for (;i>0;i--) IMATELEM(*aa,i,i) += bb;
318  break;
319  case '-': for (;i>0;i--) IMATELEM(*aa,i,i) -= bb;
320  break;
321  }
322  res->data=(char *)aa;
323  return FALSE;
324 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjOP_IV_I()

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

Definition at line 289 of file iparith.cc.

290 {
291  intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
292  int bb = (int)(long)(v->Data());
293  if (errorreported) return TRUE;
294  switch (iiOp)
295  {
296  case '+': (*aa) += bb; break;
297  case '-': (*aa) -= bb; break;
298  case '*': (*aa) *= bb; break;
299  case '/':
300  case INTDIV_CMD: (*aa) /= bb; break;
301  case '%': (*aa) %= bb; break;
302  }
303  res->data=(char *)aa;
304  return FALSE;
305 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
short errorreported
Definition: feFopen.cc:23
Definition: tok.h:96
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjOP_REST()

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

Definition at line 513 of file iparith.cc.

514 {
515  if (u->Next()!=NULL)
516  {
517  u=u->next;
518  res->next = (leftv)omAllocBin(sleftv_bin);
519  return iiExprArith2(res->next,u,iiOp,v);
520  }
521  else if (v->Next()!=NULL)
522  {
523  v=v->next;
524  res->next = (leftv)omAllocBin(sleftv_bin);
525  return iiExprArith2(res->next,u,iiOp,v);
526  }
527  return FALSE;
528 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
#define FALSE
Definition: auxiliary.h:94
sleftv * leftv
Definition: structs.h:60
leftv Next()
Definition: subexpr.h:137
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
int iiOp
Definition: iparith.cc:224
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025

◆ jjOpenClose()

static BOOLEAN jjOpenClose ( leftv  ,
leftv  v 
)
static

Definition at line 4509 of file iparith.cc.

4510 {
4511  si_link l=(si_link)v->Data();
4512  if (iiOp==OPEN_CMD) return slOpen(l, SI_LINK_OPEN,v);
4513  else { slPrepClose(l); return slClose(l);}
4514 }
Definition: tok.h:143
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
int l
Definition: cfEzgcd.cc:94

◆ jjOPPOSE()

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

Definition at line 2754 of file iparith.cc.

2755 {
2756  /* number, poly, vector, ideal, module, matrix */
2757  ring r = (ring)a->Data();
2758  if (r == currRing)
2759  {
2760  res->data = b->Data();
2761  res->rtyp = b->rtyp;
2762  return FALSE;
2763  }
2764  if (!rIsLikeOpposite(currRing, r))
2765  {
2766  Werror("%s is not an opposite ring to current ring",a->Fullname());
2767  return TRUE;
2768  }
2769  idhdl w;
2770  if( ((w=r->idroot->get(b->Name(),myynest))!=NULL) && (b->e==NULL))
2771  {
2772  int argtype = IDTYP(w);
2773  switch (argtype)
2774  {
2775  case NUMBER_CMD:
2776  {
2777  /* since basefields are equal, we can apply nCopy */
2778  res->data = nCopy((number)IDDATA(w));
2779  res->rtyp = argtype;
2780  break;
2781  }
2782  case POLY_CMD:
2783  case VECTOR_CMD:
2784  {
2785  poly q = (poly)IDDATA(w);
2786  res->data = pOppose(r,q,currRing);
2787  res->rtyp = argtype;
2788  break;
2789  }
2790  case IDEAL_CMD:
2791  case MODUL_CMD:
2792  {
2793  ideal Q = (ideal)IDDATA(w);
2794  res->data = idOppose(r,Q,currRing);
2795  res->rtyp = argtype;
2796  break;
2797  }
2798  case MATRIX_CMD:
2799  {
2800  ring save = currRing;
2801  rChangeCurrRing(r);
2802  matrix m = (matrix)IDDATA(w);
2803  ideal Q = id_Matrix2Module(mp_Copy(m, currRing),currRing);
2804  rChangeCurrRing(save);
2805  ideal S = idOppose(r,Q,currRing);
2806  id_Delete(&Q, r);
2807  res->data = id_Module2Matrix(S,currRing);
2808  res->rtyp = argtype;
2809  break;
2810  }
2811  default:
2812  {
2813  WerrorS("unsupported type in oppose");
2814  return TRUE;
2815  }
2816  }
2817  }
2818  else
2819  {
2820  Werror("identifier %s not found in %s",b->Fullname(),a->Fullname());
2821  return TRUE;
2822  }
2823  return FALSE;
2824 }
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3426
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:3399
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define Q
Definition: sirandom.c:25
const char * Name()
Definition: subexpr.h:121
Definition: idrec.h:34
ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst)
opposes a module I from Rop to currRing(dst)
Definition: old.gring.cc:3465
const char * Fullname()
Definition: subexpr.h:126
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
const ring r
Definition: syzextra.cc:208
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
matrix id_Module2Matrix(ideal mod, const ring R)
void rChangeCurrRing(ring r)
Definition: polys.cc:12
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
#define IDDATA(a)
Definition: ipid.h:123
ideal id_Matrix2Module(matrix mat, const ring R)
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjOPPOSITE()

static BOOLEAN jjOPPOSITE ( leftv  res,
leftv  a 
)
static

Definition at line 4947 of file iparith.cc.

4948 {
4949  ring r = (ring)a->Data();
4950  //if (rIsPluralRing(r))
4951  if (r->OrdSgn==1)
4952  {
4953  res->data = rOpposite(r);
4954  }
4955  else
4956  {
4957  WarnS("opposite only for global orderings");
4958  res->data = rCopy(r);
4959  }
4960  return FALSE;
4961 }
#define FALSE
Definition: auxiliary.h:94
ring rOpposite(ring src)
Definition: ring.cc:5155
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
ring rCopy(ring r)
Definition: ring.cc:1612
void * Data()
Definition: subexpr.cc:1137

◆ jjOPTION_PL()

static BOOLEAN jjOPTION_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7325 of file iparith.cc.

7326 {
7327  if(v==NULL)
7328  {
7329  res->data=(char *)showOption();
7330  return FALSE;
7331  }
7332  res->rtyp=NONE;
7333  return setOption(res,v);
7334 }
#define FALSE
Definition: auxiliary.h:94
char * showOption()
Definition: misc_ip.cc:717
void * data
Definition: subexpr.h:89
BOOLEAN setOption(leftv res, leftv v)
Definition: misc_ip.cc:575
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define NONE
Definition: tok.h:216

◆ jjOR_I()

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

Definition at line 1364 of file iparith.cc.

1365 {
1366  res->data = (char *)((long)u->Data() || (long)v->Data());
1367  return FALSE;
1368 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjORD()

static BOOLEAN jjORD ( leftv  res,
leftv  v 
)
static

Definition at line 4515 of file iparith.cc.

4516 {
4517  poly p=(poly)v->Data();
4518  res->data=(char *)( p==NULL ? -1 : currRing->pFDeg(p,currRing) );
4519  return FALSE;
4520 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjP2BI()

static BOOLEAN jjP2BI ( leftv  res,
leftv  v 
)
static

Definition at line 4561 of file iparith.cc.

4562 {
4563  poly p=(poly)v->Data();
4564  if (p==NULL) { res->data=(char *)n_Init(0,coeffs_BIGINT); return FALSE; }
4565  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4566  {
4567  WerrorS("poly must be constant");
4568  return TRUE;
4569  }
4570  number i=pGetCoeff(p);
4571  number n;
4573  if (nMap!=NULL)
4574  n=nMap(i,currRing->cf,coeffs_BIGINT);
4575  else goto err;
4576  res->data=(void *)n;
4577  return FALSE;
4578 err:
4579  WerrorS("cannot convert to bigint"); return TRUE;
4580 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
int i
Definition: cfEzgcd.cc:123
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:725
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjP2I()

static BOOLEAN jjP2I ( leftv  res,
leftv  v 
)
static

Definition at line 4581 of file iparith.cc.

4582 {
4583  poly p=(poly)v->Data();
4584  if (p==NULL) { /*res->data=(char *)0;*/ return FALSE; }
4585  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4586  {
4587  WerrorS("poly must be constant");
4588  return TRUE;
4589  }
4590  res->data = (char *)(long)iin_Int(pGetCoeff(p),currRing->cf);
4591  return FALSE;
4592 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
static int iin_Int(number &n, coeffs cf)
Definition: iparith.cc:227

◆ jjP2N()

static BOOLEAN jjP2N ( leftv  res,
leftv  v 
)
static

Definition at line 4629 of file iparith.cc.

4630 {
4631  number n;
4632  poly p;
4633  if (((p=(poly)v->Data())!=NULL)
4634  && (pIsConstant(p)))
4635  {
4636  n=nCopy(pGetCoeff(p));
4637  }
4638  else
4639  {
4640  n=nInit(0);
4641  }
4642  res->data = (char *)n;
4643  return FALSE;
4644 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
void * data
Definition: subexpr.h:89
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
#define NULL
Definition: omList.c:10
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24

◆ jjPAR1()

static BOOLEAN jjPAR1 ( leftv  res,
leftv  v 
)
static

Definition at line 4521 of file iparith.cc.

4522 {
4523  int i=(int)(long)v->Data();
4524  int p=0;
4525  p=rPar(currRing);
4526  if ((0<i) && (i<=p))
4527  {
4528  res->data=(char *)n_Param(i,currRing);
4529  }
4530  else
4531  {
4532  Werror("par number %d out of range 1..%d",i,p);
4533  return TRUE;
4534  }
4535  return FALSE;
4536 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
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..n_NumberOfParameters(...)
Definition: coeffs.h:817
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjPARDEG()

static BOOLEAN jjPARDEG ( leftv  res,
leftv  v 
)
static

Definition at line 4537 of file iparith.cc.

4538 {
4539  number nn=(number)v->Data();
4540  res->data = (char *)(long)n_ParDeg(nn, currRing->cf);
4541  return FALSE;
4542 }
#define FALSE
Definition: auxiliary.h:94
static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
Definition: coeffs.h:804
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void * Data()
Definition: subexpr.cc:1137

◆ jjPARSTR1()

static BOOLEAN jjPARSTR1 ( leftv  res,
leftv  v 
)
static

Definition at line 4543 of file iparith.cc.

4544 {
4545  if (currRing==NULL)
4546  {
4547  WerrorS("no ring active");
4548  return TRUE;
4549  }
4550  int i=(int)(long)v->Data();
4551  int p=0;
4552  if ((0<i) && (rParameter(currRing)!=NULL) && (i<=(p=rPar(currRing))))
4553  res->data=omStrDup(rParameter(currRing)[i-1]);
4554  else
4555  {
4556  Werror("par number %d out of range 1..%d",i,p);
4557  return TRUE;
4558  }
4559  return FALSE;
4560 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:616
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjPARSTR2()

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

Definition at line 2638 of file iparith.cc.

2639 {
2640  idhdl h=(idhdl)u->data;
2641  int i=(int)(long)v->Data();
2642  int p=0;
2643  if ((0<i)
2644  && (rParameter(IDRING(h))!=NULL)
2645  && (i<=(p=rPar(IDRING(h)))))
2646  res->data=omStrDup(rParameter(IDRING(h))[i-1]);
2647  else
2648  {
2649  Werror("par number %d out of range 1..%d",i,p);
2650  return TRUE;
2651  }
2652  return FALSE;
2653 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define TRUE
Definition: auxiliary.h:98
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:616
Definition: idrec.h:34
void * data
Definition: subexpr.h:89
idrec * idhdl
Definition: ring.h:18
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:124
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjPFAC1()

static BOOLEAN jjPFAC1 ( leftv  res,
leftv  v 
)
static

Definition at line 4363 of file iparith.cc.

4364 {
4365  /* call method jjPFAC2 with second argument = 0 (meaning that no
4366  valid bound for the prime factors has been given) */
4367  sleftv tmp;
4368  memset(&tmp, 0, sizeof(tmp));
4369  tmp.rtyp = INT_CMD;
4370  return jjPFAC2(res, v, &tmp);
4371 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3123
int rtyp
Definition: subexpr.h:92

◆ jjPFAC2()

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

Definition at line 3123 of file iparith.cc.

3124 {
3125  number n1; int i;
3126 
3127  if ((u->Typ() == BIGINT_CMD) ||
3128  ((u->Typ() == NUMBER_CMD) && rField_is_Q(currRing)))
3129  {
3130  n1 = (number)u->CopyD();
3131  }
3132  else if (u->Typ() == INT_CMD)
3133  {
3134  i = (int)(long)u->Data();
3135  n1 = n_Init(i, coeffs_BIGINT);
3136  }
3137  else
3138  {
3139  return TRUE;
3140  }
3141 
3142  i = (int)(long)v->Data();
3143 
3144  lists l = primeFactorisation(n1, i);
3145  n_Delete(&n1, coeffs_BIGINT);
3146  res->data = (char*)l;
3147  return FALSE;
3148 }
Definition: tok.h:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
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:333
void * Data()
Definition: subexpr.cc:1137
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jjpHead()

static BOOLEAN jjpHead ( leftv  res,
leftv  v 
)
static

Definition at line 5224 of file iparith.cc.

5225 {
5226  res->data = (char *)pHead((poly)v->Data());
5227  return FALSE;
5228 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjpLength()

static BOOLEAN jjpLength ( leftv  res,
leftv  v 
)
static

Definition at line 5199 of file iparith.cc.

5200 {
5201  res->data = (char *)(long)pLength((poly)v->Data());
5202  return FALSE;
5203 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
static unsigned pLength(poly a)
Definition: p_polys.h:189
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjPlural_mat_mat()

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

Definition at line 2715 of file iparith.cc.

2716 {
2717  if( currRing->qideal != NULL )
2718  {
2719  WerrorS("basering must NOT be a qring!");
2720  return TRUE;
2721  }
2722 
2723  if (iiOp==NCALGEBRA_CMD)
2724  {
2725  return nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,currRing,false,true,false,currRing);
2726  }
2727  else
2728  {
2729  ring r=rCopy(currRing);
2730  BOOLEAN result=nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,r,false,true,false,currRing);
2731  res->data=r;
2732  return result;
2733  }
2734 }
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
ip_smatrix * matrix
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:2746
ring rCopy(ring r)
Definition: ring.cc:1612
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76

◆ jjPlural_mat_poly()

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

Definition at line 2695 of file iparith.cc.

2696 {
2697  if( currRing->qideal != NULL )
2698  {
2699  WerrorS("basering must NOT be a qring!");
2700  return TRUE;
2701  }
2702 
2703  if (iiOp==NCALGEBRA_CMD)
2704  {
2705  return nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),currRing,false,true,false,currRing);
2706  }
2707  else
2708  {
2709  ring r=rCopy(currRing);
2710  BOOLEAN result=nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),r,false,true,false,currRing);
2711  res->data=r;
2712  return result;
2713  }
2714 }
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
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:2746
ring rCopy(ring r)
Definition: ring.cc:1612
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76

◆ jjPlural_num_mat()

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

Definition at line 2675 of file iparith.cc.

2676 {
2677  if( currRing->qideal != NULL )
2678  {
2679  WerrorS("basering must NOT be a qring!");
2680  return TRUE;
2681  }
2682 
2683  if (iiOp==NCALGEBRA_CMD)
2684  {
2685  return nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,currRing,false,true,false,currRing);
2686  }
2687  else
2688  {
2689  ring r=rCopy(currRing);
2690  BOOLEAN result=nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,r,false,true,false,currRing);
2691  res->data=r;
2692  return result;
2693  }
2694 }
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
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:2746
ring rCopy(ring r)
Definition: ring.cc:1612
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76

◆ jjPlural_num_poly()

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

Definition at line 2655 of file iparith.cc.

2656 {
2657  if( currRing->qideal != NULL )
2658  {
2659  WerrorS("basering must NOT be a qring!");
2660  return TRUE;
2661  }
2662 
2663  if (iiOp==NCALGEBRA_CMD)
2664  {
2665  return nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),currRing,false,true,false,currRing);
2666  }
2667  else
2668  {
2669  ring r=rCopy(currRing);
2670  BOOLEAN result=nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),r,false,true,false,currRing);
2671  res->data=r;
2672  return result;
2673  }
2674 }
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
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:2746
ring rCopy(ring r)
Definition: ring.cc:1612
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76

◆ jjPLUS_BI()

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

Definition at line 773 of file iparith.cc.

774 {
775  res->data = (char *)(n_Add((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
776  return jjPLUSMINUS_Gen(res,u,v);
777 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of &#39;a&#39; and &#39;b&#39;, i.e., a+b
Definition: coeffs.h:660
void * Data()
Definition: subexpr.cc:1137

◆ jjPLUS_BIM()

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

Definition at line 798 of file iparith.cc.

799 {
800  res->data = (char *)bimAdd((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
801  if (res->data==NULL)
802  {
803  WerrorS("bigintmat/cmatrix not compatible");
804  return TRUE;
805  }
806  return jjPLUSMINUS_Gen(res,u,v);
807 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * bimAdd(bigintmat *a, bigintmat *b)
Matrix-Add/-Sub/-Mult so oder mit operator+/-/* ? : NULL as a result means an error (non-compatible m...
Definition: bigintmat.cc:183
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjPLUS_I()

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

Definition at line 761 of file iparith.cc.

762 {
763  unsigned int a=(unsigned int)(unsigned long)u->Data();
764  unsigned int b=(unsigned int)(unsigned long)v->Data();
765  unsigned int c=a+b;
766  res->data = (char *)((long)c);
767  if (((Sy_bit(31)&a)==(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c)))
768  {
769  WarnS("int overflow(+), result may be wrong");
770  }
771  return jjPLUSMINUS_Gen(res,u,v);
772 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
const poly a
Definition: syzextra.cc:212
#define WarnS
Definition: emacs.cc:81
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjPLUS_ID()

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

Definition at line 845 of file iparith.cc.

846 {
847  res->data = (char *)idAdd((ideal)u->Data(),(ideal)v->Data());
848  return jjPLUSMINUS_Gen(res,u,v);
849 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition: ideals.h:68

◆ jjPLUS_IV()

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

Definition at line 788 of file iparith.cc.

789 {
790  res->data = (char *)ivAdd((intvec*)(u->Data()), (intvec*)(v->Data()));
791  if (res->data==NULL)
792  {
793  WerrorS("intmat size not compatible");
794  return TRUE;
795  }
796  return jjPLUSMINUS_Gen(res,u,v);
797 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
intvec * ivAdd(intvec *a, intvec *b)
Definition: intvec.cc:250

◆ jjPLUS_MA()

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

Definition at line 808 of file iparith.cc.

809 {
810  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
811  res->data = (char *)(mp_Add(A , B, currRing));
812  if (res->data==NULL)
813  {
814  Werror("matrix size not compatible(%dx%d, %dx%d)",
815  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
816  return TRUE;
817  }
818  return jjPLUSMINUS_Gen(res,u,v);
819 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define A
Definition: sirandom.c:23
ip_smatrix * matrix
#define MATCOLS(i)
Definition: matpol.h:28
matrix mp_Add(matrix a, matrix b, const ring R)
Definition: matpol.cc:189
#define NULL
Definition: omList.c:10
b *CanonicalForm B
Definition: facBivar.cc:51
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjPLUS_MA_P()

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

Definition at line 820 of file iparith.cc.

821 {
822  matrix m=(matrix)u->Data();
824  if (iiOp=='+')
825  res->data = (char *)mp_Add(m , p,currRing);
826  else
827  res->data = (char *)mp_Sub(m , p,currRing);
828  idDelete((ideal *)&p);
829  return jjPLUSMINUS_Gen(res,u,v);
830 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
int ncols
Definition: matpol.h:22
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
Definition: matpol.cc:123
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int nrows
Definition: matpol.h:21
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
matrix mp_Add(matrix a, matrix b, const ring R)
Definition: matpol.cc:189
void * Data()
Definition: subexpr.cc:1137
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:206
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjPLUS_N()

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

Definition at line 778 of file iparith.cc.

779 {
780  res->data = (char *)(nAdd((number)u->Data(), (number)v->Data()));
781  return jjPLUSMINUS_Gen(res,u,v);
782 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
#define nAdd(n1, n2)
Definition: numbers.h:18

◆ jjPLUS_P()

static BOOLEAN jjPLUS_P ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 783 of file iparith.cc.

784 {
785  res->data = (char *)(pAdd((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
786  return jjPLUSMINUS_Gen(res,u,v);
787 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
#define pAdd(p, q)
Definition: polys.h:186
void * data
Definition: subexpr.h:89
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjPLUS_P_MA()

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

Definition at line 831 of file iparith.cc.

832 {
833  return jjPLUS_MA_P(res,v,u);
834 }
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition: iparith.cc:820

◆ jjPLUS_S()

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

Definition at line 835 of file iparith.cc.

836 {
837  char* a = (char * )(u->Data());
838  char* b = (char * )(v->Data());
839  char* r = (char * )omAlloc(strlen(a) + strlen(b) + 1);
840  strcpy(r,a);
841  strcat(r,b);
842  res->data=r;
843  return jjPLUSMINUS_Gen(res,u,v);
844 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:637
const poly a
Definition: syzextra.cc:212
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjPLUSMINUS_Gen()

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

Definition at line 637 of file iparith.cc.

638 {
639  u=u->next;
640  v=v->next;
641  if (u==NULL)
642  {
643  if (v==NULL) return FALSE; /* u==NULL, v==NULL */
644  if (iiOp=='-') /* u==NULL, v<>NULL, iiOp=='-'*/
645  {
646  do
647  {
648  if (res->next==NULL)
649  res->next = (leftv)omAlloc0Bin(sleftv_bin);
650  leftv tmp_v=v->next;
651  v->next=NULL;
652  BOOLEAN b=iiExprArith1(res->next,v,'-');
653  v->next=tmp_v;
654  if (b)
655  return TRUE;
656  v=tmp_v;
657  res=res->next;
658  } while (v!=NULL);
659  return FALSE;
660  }
661  loop /* u==NULL, v<>NULL, iiOp=='+' */
662  {
663  res->next = (leftv)omAlloc0Bin(sleftv_bin);
664  res=res->next;
665  res->data = v->CopyD();
666  res->rtyp = v->Typ();
667  v=v->next;
668  if (v==NULL) return FALSE;
669  }
670  }
671  if (v!=NULL) /* u<>NULL, v<>NULL */
672  {
673  do
674  {
675  res->next = (leftv)omAlloc0Bin(sleftv_bin);
676  leftv tmp_u=u->next; u->next=NULL;
677  leftv tmp_v=v->next; v->next=NULL;
678  BOOLEAN b=iiExprArith2(res->next,u,iiOp,v);
679  u->next=tmp_u;
680  v->next=tmp_v;
681  if (b)
682  return TRUE;
683  u=tmp_u;
684  v=tmp_v;
685  res=res->next;
686  } while ((u!=NULL) && (v!=NULL));
687  return FALSE;
688  }
689  loop /* u<>NULL, v==NULL */
690  {
691  res->next = (leftv)omAlloc0Bin(sleftv_bin);
692  res=res->next;
693  res->data = u->CopyD();
694  res->rtyp = u->Typ();
695  u=u->next;
696  if (u==NULL) return FALSE;
697  }
698 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
loop
Definition: myNF.cc:98
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8215
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8025
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjPLUSPLUS()

static BOOLEAN jjPLUSPLUS ( leftv  ,
leftv  u 
)
static

Definition at line 3501 of file iparith.cc.

3502 {
3503  if (IDTYP((idhdl)u->data)==INT_CMD)
3504  {
3505  int i=IDINT((idhdl)u->data);
3506  if (iiOp==PLUSPLUS) i++;
3507  else i--;
3508  IDDATA((idhdl)u->data)=(char *)(long)i;
3509  return FALSE;
3510  }
3511  return TRUE;
3512 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
void * data
Definition: subexpr.h:89
#define IDTYP(a)
Definition: ipid.h:116
int i
Definition: cfEzgcd.cc:123
#define IDINT(a)
Definition: ipid.h:122
#define IDDATA(a)
Definition: ipid.h:123
int iiOp
Definition: iparith.cc:224

◆ jjpMaxComp()

static BOOLEAN jjpMaxComp ( leftv  res,
leftv  v 
)
static

Definition at line 5247 of file iparith.cc.

5248 {
5249  res->data = (char *)pMaxComp((poly)v->Data());
5250  return FALSE;
5251 }
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjPOWER_BI()

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

Definition at line 575 of file iparith.cc.

576 {
577  int e=(int)(long)v->Data();
578  number n=(number)u->Data();
579  if (e>=0)
580  {
581  n_Power(n,e,(number*)&res->data,coeffs_BIGINT);
582  }
583  else
584  {
585  WerrorS("exponent must be non-negative");
586  return TRUE;
587  }
588  if (u!=NULL) return jjOP_REST(res,u,v);
589  return FALSE;
590 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
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:636
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjPOWER_I()

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

Definition at line 529 of file iparith.cc.

530 {
531  int b=(int)(long)u->Data();
532  int e=(int)(long)v->Data();
533  int rc = 1;
534  BOOLEAN overflow=FALSE;
535  if (e >= 0)
536  {
537  if (b==0)
538  {
539  rc=(e==0);
540  }
541  else if ((e==0)||(b==1))
542  {
543  rc= 1;
544  }
545  else if (b== -1)
546  {
547  if (e&1) rc= -1;
548  else rc= 1;
549  }
550  else
551  {
552  int oldrc;
553  while ((e--)!=0)
554  {
555  oldrc=rc;
556  rc *= b;
557  if (!overflow)
558  {
559  if(rc/b!=oldrc) overflow=TRUE;
560  }
561  }
562  if (overflow)
563  WarnS("int overflow(^), result may be wrong");
564  }
565  res->data = (char *)((long)rc);
566  if (u!=NULL) return jjOP_REST(res,u,v);
567  return FALSE;
568  }
569  else
570  {
571  WerrorS("exponent must be non-negative");
572  return TRUE;
573  }
574 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ jjPOWER_ID()

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

Definition at line 631 of file iparith.cc.

632 {
633  res->data = (char *)id_Power((ideal)(u->Data()),(int)(long)(v->Data()), currRing);
634  if (u!=NULL) return jjOP_REST(res,u,v);
635  return FALSE;
636 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal id_Power(ideal given, int exp, const ring r)
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjPOWER_N()

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

Definition at line 591 of file iparith.cc.

592 {
593  int e=(int)(long)v->Data();
594  number n=(number)u->Data();
595  int d=0;
596  if (e<0)
597  {
598  n=nInvers(n);
599  e=-e;
600  d=1;
601  }
602  number r;
603  nPower(n,e,(number*)&r);
604  res->data=(char*)r;
605  if (d) nDelete(&n);
606  if (u!=NULL) return jjOP_REST(res,u,v);
607  return FALSE;
608 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
#define nPower(a, b, res)
Definition: numbers.h:38
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
#define nDelete(n)
Definition: numbers.h:16
#define nInvers(a)
Definition: numbers.h:33
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjPOWER_P()

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

Definition at line 609 of file iparith.cc.

610 {
611  int v_i=(int)(long)v->Data();
612  if (v_i<0)
613  {
614  WerrorS("exponent must be non-negative");
615  return TRUE;
616  }
617  poly u_p=(poly)u->CopyD(POLY_CMD);
618  if ((u_p!=NULL)
619  && ((v_i!=0) &&
620  ((long)pTotaldegree(u_p) > (signed long)currRing->bitmask / (signed long)v_i/2)))
621  {
622  Werror("OVERFLOW in power(d=%ld, e=%d, max=%ld)",
623  pTotaldegree(u_p),v_i,currRing->bitmask/2);
624  pDelete(&u_p);
625  return TRUE;
626  }
627  res->data = (char *)pPower(u_p,v_i);
628  if (u!=NULL) return jjOP_REST(res,u,v);
629  return errorreported; /* pPower may set errorreported via Werror */
630 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static long pTotaldegree(poly p)
Definition: polys.h:264
short errorreported
Definition: feFopen.cc:23
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
#define pPower(p, q)
Definition: polys.h:187
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjPREIMAGE()

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

Definition at line 6023 of file iparith.cc.

6024 {
6025  // handles preimage(r,phi,i) and kernel(r,phi)
6026  idhdl h;
6027  ring rr;
6028  map mapping;
6029  BOOLEAN kernel_cmd= (iiOp==KERNEL_CMD);
6030 
6031  if ((v->name==NULL) || (!kernel_cmd && (w->name==NULL)))
6032  {
6033  WerrorS("2nd/3rd arguments must have names");
6034  return TRUE;
6035  }
6036  rr=(ring)u->Data();
6037  const char *ring_name=u->Name();
6038  if ((h=rr->idroot->get(v->name,myynest))!=NULL)
6039  {
6040  if (h->typ==MAP_CMD)
6041  {
6042  mapping=IDMAP(h);
6043  idhdl preim_ring=IDROOT->get(mapping->preimage,myynest);
6044  if ((preim_ring==NULL)
6045  || (IDRING(preim_ring)!=currRing))
6046  {
6047  Werror("preimage ring `%s` is not the basering",mapping->preimage);
6048  return TRUE;
6049  }
6050  }
6051  else if (h->typ==IDEAL_CMD)
6052  {
6053  mapping=IDMAP(h);
6054  }
6055  else
6056  {
6057  Werror("`%s` is no map nor ideal",IDID(h));
6058  return TRUE;
6059  }
6060  }
6061  else
6062  {
6063  Werror("`%s` is not defined in `%s`",v->name,ring_name);
6064  return TRUE;
6065  }
6066  ideal image;
6067  if (kernel_cmd) image=idInit(1,1);
6068  else
6069  {
6070  if ((h=rr->idroot->get(w->name,myynest))!=NULL)
6071  {
6072  if (h->typ==IDEAL_CMD)
6073  {
6074  image=IDIDEAL(h);
6075  }
6076  else
6077  {
6078  Werror("`%s` is no ideal",IDID(h));
6079  return TRUE;
6080  }
6081  }
6082  else
6083  {
6084  Werror("`%s` is not defined in `%s`",w->name,ring_name);
6085  return TRUE;
6086  }
6087  }
6088  if (((currRing->qideal!=NULL) && (rHasLocalOrMixedOrdering_currRing()))
6089  || ((rr->qideal!=NULL) && (rHasLocalOrMixedOrdering(rr))))
6090  {
6091  WarnS("preimage in local qring may be wrong: use Ring::preimageLoc instead");
6092  }
6093  res->data=(char *)maGetPreimage(rr,mapping,image,currRing);
6094  if (kernel_cmd) idDelete(&image);
6095  return (res->data==NULL/* is of type ideal, should not be NULL*/);
6096 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:751
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:400
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define IDID(a)
Definition: ipid.h:119
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:98
#define IDIDEAL(a)
Definition: ipid.h:130
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
const char * Name()
Definition: subexpr.h:121
Definition: idrec.h:34
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * name
Definition: subexpr.h:88
#define IDMAP(a)
Definition: ipid.h:132
#define rHasLocalOrMixedOrdering_currRing()
Definition: ring.h:758
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:124
void * Data()
Definition: subexpr.cc:1137
int typ
Definition: idrec.h:43
ideal maGetPreimage(ring theImageRing, map theMap, ideal id, const ring dst_r)
Definition: preimage.cc:61
int iiOp
Definition: iparith.cc:224
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjPREIMAGE_R()

static BOOLEAN jjPREIMAGE_R ( leftv  res,
leftv  v 
)
static

Definition at line 4593 of file iparith.cc.

4594 {
4595  map mapping=(map)v->Data();
4596  syMake(res,omStrDup(mapping->preimage));
4597  return FALSE;
4598 }
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:400
#define FALSE
Definition: auxiliary.h:94
void * Data()
Definition: subexpr.cc:1137
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1500
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjPRIME()

static BOOLEAN jjPRIME ( leftv  res,
leftv  v 
)
static

Definition at line 4599 of file iparith.cc.

4600 {
4601  int i = IsPrime((int)(long)(v->Data()));
4602  res->data = (char *)(long)(i > 1 ? i : 2);
4603  return FALSE;
4604 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
int IsPrime(int p)
Definition: prime.cc:61
void * Data()
Definition: subexpr.cc:1137

◆ jjPROC()

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

Definition at line 1599 of file iparith.cc.

1600 {
1601  void *d;
1602  Subexpr e;
1603  int typ;
1604  BOOLEAN t=FALSE;
1605  idhdl tmp_proc=NULL;
1606  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
1607  {
1608  tmp_proc=(idhdl)omAlloc0(sizeof(idrec));
1609  tmp_proc->id="_auto";
1610  tmp_proc->typ=PROC_CMD;
1611  tmp_proc->data.pinf=(procinfo *)u->Data();
1612  tmp_proc->ref=1;
1613  d=u->data; u->data=(void *)tmp_proc;
1614  e=u->e; u->e=NULL;
1615  t=TRUE;
1616  typ=u->rtyp; u->rtyp=IDHDL;
1617  }
1618  BOOLEAN sl;
1619  if (u->req_packhdl==currPack)
1620  sl = iiMake_proc((idhdl)u->data,NULL,v);
1621  else
1622  sl = iiMake_proc((idhdl)u->data,u->req_packhdl,v);
1623  if (t)
1624  {
1625  u->rtyp=typ;
1626  u->data=d;
1627  u->e=e;
1628  omFreeSize(tmp_proc,sizeof(idrec));
1629  }
1630  if (sl) return TRUE;
1631  memcpy(res,&iiRETURNEXPR,sizeof(sleftv));
1632  iiRETURNEXPR.Init();
1633  return FALSE;
1634 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:94
sleftv iiRETURNEXPR
Definition: iplib.cc:471
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:108
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:89
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
Definition: iplib.cc:501
short ref
Definition: idrec.h:46
idrec * idhdl
Definition: ring.h:18
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:107
package currPack
Definition: ipid.cc:63
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
int typ
Definition: idrec.h:43
const char * id
Definition: idrec.h:39
int BOOLEAN
Definition: auxiliary.h:85
#define omAlloc0(size)
Definition: omAllocDecl.h:211
utypes data
Definition: idrec.h:40

◆ jjPROC1()

static BOOLEAN jjPROC1 ( leftv  res,
leftv  u 
)
static

Definition at line 3557 of file iparith.cc.

3558 {
3559  return jjPROC(res,u,NULL);
3560 }
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition: iparith.cc:1599
#define NULL
Definition: omList.c:10

◆ jjPROC3()

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

Definition at line 5559 of file iparith.cc.

5560 {
5562  memcpy(v->next,w,sizeof(sleftv));
5563  memset(w,0,sizeof(sleftv));
5564  return jjPROC(res,u,v);
5565 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition: iparith.cc:1599
sleftv * leftv
Definition: structs.h:60
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:87

◆ jjPRUNE()

static BOOLEAN jjPRUNE ( leftv  res,
leftv  v 
)
static

Definition at line 4605 of file iparith.cc.

4606 {
4607  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4608  ideal v_id=(ideal)v->Data();
4609  if (w!=NULL)
4610  {
4611  if (!idTestHomModule(v_id,currRing->qideal,w))
4612  {
4613  WarnS("wrong weights");
4614  w=NULL;
4615  // and continue at the non-homog case below
4616  }
4617  else
4618  {
4619  w=ivCopy(w);
4620  intvec **ww=&w;
4621  res->data = (char *)idMinEmbedding(v_id,FALSE,ww);
4622  atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD);
4623  return FALSE;
4624  }
4625  }
4626  res->data = (char *)idMinEmbedding(v_id);
4627  return FALSE;
4628 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
Definition: ideals.cc:2298
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjQRDS()

static BOOLEAN jjQRDS ( leftv  res,
leftv  INPUT 
)
static

Definition at line 7712 of file iparith.cc.

7713 {
7714  if ((INPUT->Typ() != MATRIX_CMD) ||
7715  (INPUT->next->Typ() != NUMBER_CMD) ||
7716  (INPUT->next->next->Typ() != NUMBER_CMD) ||
7717  (INPUT->next->next->next->Typ() != NUMBER_CMD))
7718  {
7719  WerrorS("expected (matrix, number, number, number) as arguments");
7720  return TRUE;
7721  }
7722  leftv u = INPUT; leftv v = u->next; leftv w = v->next; leftv x = w->next;
7723  res->data = (char *)qrDoubleShift((matrix)(u->Data()),
7724  (number)(v->Data()),
7725  (number)(w->Data()),
7726  (number)(x->Data()));
7727  return FALSE;
7728 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
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.
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
const CanonicalForm & w
Definition: facAbsFact.cc:55
Variable x
Definition: cfModGcd.cc:4023
void * Data()
Definition: subexpr.cc:1137

◆ jjQUOT()

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

Definition at line 2827 of file iparith.cc.

2828 {
2829  res->data = (char *)idQuot((ideal)u->Data(),(ideal)v->Data(),
2830  hasFlag(u,FLAG_STD),u->Typ()==v->Typ());
2831  id_DelMultiples((ideal)(res->data),currRing);
2833  return FALSE;
2834 }
#define FALSE
Definition: auxiliary.h:94
int Typ()
Definition: subexpr.cc:995
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
Definition: ideals.cc:1260
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
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 ...
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define TEST_OPT_RETURN_SB
Definition: options.h:107
#define hasFlag(A, F)
Definition: ipid.h:109
void * Data()
Definition: subexpr.cc:1137

◆ jjRANDOM()

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

Definition at line 2835 of file iparith.cc.

2836 {
2837  int i=(int)(long)u->Data();
2838  int j=(int)(long)v->Data();
2839  if (j-i <0) {WerrorS("invalid range for random"); return TRUE;}
2840  res->data =(char *)(long)((i > j) ? i : (siRand() % (j-i+1)) + i);
2841  return FALSE;
2842 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137
int siRand()
Definition: sirandom.c:41

◆ jjRANDOM_Im()

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

Definition at line 6097 of file iparith.cc.

6098 {
6099  int di, k;
6100  int i=(int)(long)u->Data();
6101  int r=(int)(long)v->Data();
6102  int c=(int)(long)w->Data();
6103  if ((r<=0) || (c<=0)) return TRUE;
6104  intvec *iv = new intvec(r, c, 0);
6105  if (iv->rows()==0)
6106  {
6107  delete iv;
6108  return TRUE;
6109  }
6110  if (i!=0)
6111  {
6112  if (i<0) i = -i;
6113  di = 2 * i + 1;
6114  for (k=0; k<iv->length(); k++)
6115  {
6116  (*iv)[k] = ((siRand() % di) - i);
6117  }
6118  }
6119  res->data = (char *)iv;
6120  return FALSE;
6121 }
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:98
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
int siRand()
Definition: sirandom.c:41

◆ jjRANK1()

static BOOLEAN jjRANK1 ( leftv  res,
leftv  v 
)
static

Definition at line 4660 of file iparith.cc.

4661 {
4662  matrix m =(matrix)v->Data();
4663  int rank = luRank(m, 0);
4664  res->data =(char *)(long)rank;
4665  return FALSE;
4666 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int luRank(const matrix aMat, const bool isRowEchelon, const ring R)
Computes the rank of a given (m x n)-matrix.
void * Data()
Definition: subexpr.cc:1137

◆ jjRANK2()

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

Definition at line 2843 of file iparith.cc.

2844 {
2845  matrix m =(matrix)u->Data();
2846  int isRowEchelon = (int)(long)v->Data();
2847  if (isRowEchelon != 1) isRowEchelon = 0;
2848  int rank = luRank(m, isRowEchelon);
2849  res->data =(char *)(long)rank;
2850  return FALSE;
2851 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int luRank(const matrix aMat, const bool isRowEchelon, const ring R)
Computes the rank of a given (m x n)-matrix.
void * Data()
Definition: subexpr.cc:1137

◆ jjrCharStr()

static BOOLEAN jjrCharStr ( leftv  res,
leftv  v 
)
static

Definition at line 5219 of file iparith.cc.

5220 {
5221  res->data = rCharStr((ring)v->Data());
5222  return FALSE;
5223 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
Definition: ring.cc:620

◆ jjREAD()

static BOOLEAN jjREAD ( leftv  res,
leftv  v 
)
static

Definition at line 4667 of file iparith.cc.

4668 {
4669  return jjREAD2(res,v,NULL);
4670 }
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition: iparith.cc:2852
#define NULL
Definition: omList.c:10

◆ jjREAD2()

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

Definition at line 2852 of file iparith.cc.

2853 {
2854  si_link l=(si_link)u->Data();
2855  leftv r=slRead(l,v);
2856  if (r==NULL)
2857  {
2858  const char *s;
2859  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
2860  else s=sNoName_fe;
2861  Werror("cannot read from `%s`",s);
2862  return TRUE;
2863  }
2864  memcpy(res,r,sizeof(sleftv));
2866  return FALSE;
2867 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
const char sNoName_fe[]
Definition: fevoices.cc:65
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
const ring r
Definition: syzextra.cc:208
omBin sleftv_bin
Definition: subexpr.cc:50
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

◆ jjREDUCE3_CID()

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

Definition at line 6359 of file iparith.cc.

6360 {
6361  assumeStdFlag(v);
6362  if (!idIsZeroDim((ideal)v->Data()))
6363  {
6364  Werror("`%s` must be 0-dimensional",v->Name());
6365  return TRUE;
6366  }
6367  res->data = (char *)redNF((ideal)v->CopyD(),(ideal)u->CopyD(),
6368  (matrix)w->CopyD());
6369  return FALSE;
6370 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:121
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:161
void * data
Definition: subexpr.h:89
ip_smatrix * matrix
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjREDUCE3_CP()

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

Definition at line 6347 of file iparith.cc.

6348 {
6349  assumeStdFlag(v);
6350  if (!idIsZeroDim((ideal)v->Data()))
6351  {
6352  Werror("`%s` must be 0-dimensional",v->Name());
6353  return TRUE;
6354  }
6355  res->data = (char *)redNF((ideal)v->CopyD(),(poly)u->CopyD(),
6356  (poly)w->CopyD());
6357  return FALSE;
6358 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:121
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:161
void * data
Definition: subexpr.h:89
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjREDUCE3_ID()

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

Definition at line 6378 of file iparith.cc.

6379 {
6380  assumeStdFlag(v);
6381  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(),
6382  0,(int)(long)w->Data());
6383  return FALSE;
6384 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjREDUCE3_P()

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

Definition at line 6371 of file iparith.cc.

6372 {
6373  assumeStdFlag(v);
6374  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(),
6375  0,(int)(long)w->Data());
6376  return FALSE;
6377 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjREDUCE4()

static BOOLEAN jjREDUCE4 ( leftv  res,
leftv  u 
)
static

Definition at line 7335 of file iparith.cc.

7336 {
7337  leftv u1=u;
7338  leftv u2=u1->next;
7339  leftv u3=u2->next;
7340  leftv u4=u3->next;
7341  if((u3->Typ()==INT_CMD)&&(u4->Typ()==INTVEC_CMD))
7342  {
7343  int save_d=Kstd1_deg;
7344  Kstd1_deg=(int)(long)u3->Data();
7345  kModW=(intvec *)u4->Data();
7346  BITSET save2;
7347  SI_SAVE_OPT2(save2);
7349  u2->next=NULL;
7350  BOOLEAN r=jjCALL2ARG(res,u);
7351  kModW=NULL;
7352  Kstd1_deg=save_d;
7353  SI_RESTORE_OPT2(save2);
7354  u->next->next=u3;
7355  return r;
7356  }
7357  else
7358  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7359  (u4->Typ()==INT_CMD))
7360  {
7361  assumeStdFlag(u3);
7362  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7363  {
7364  WerrorS("2nd argument must be a diagonal matrix of units");
7365  return TRUE;
7366  }
7367  res->rtyp=IDEAL_CMD;
7368  res->data=(char*)redNF(
7369  idCopy((ideal)u3->Data()),
7370  idCopy((ideal)u1->Data()),
7371  mp_Copy((matrix)u2->Data(), currRing),
7372  (int)(long)u4->Data()
7373  );
7374  return FALSE;
7375  }
7376  else
7377  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7378  (u4->Typ()==INT_CMD))
7379  {
7380  assumeStdFlag(u3);
7381  if(!pIsUnit((poly)u2->Data()))
7382  {
7383  WerrorS("2nd argument must be a unit");
7384  return TRUE;
7385  }
7386  res->rtyp=POLY_CMD;
7387  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7388  pCopy((poly)u2->Data()),(int)(long)u4->Data());
7389  return FALSE;
7390  }
7391  else
7392  {
7393  Werror("%s(`poly`,`ideal`,`int`,`intvec`) expected",Tok2Cmdname(iiOp));
7394  Werror("%s(`ideal`,`matrix`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
7395  Werror("%s(`poly`,`poly`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
7396  return TRUE;
7397  }
7398 }
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition: iparith.cc:6508
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define BITSET
Definition: structs.h:18
int Typ()
Definition: subexpr.cc:995
#define Sy_bit(x)
Definition: options.h:30
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
const ring r
Definition: syzextra.cc:208
intvec * kModW
Definition: kstd1.cc:2206
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
#define V_DEG_STOP
Definition: options.h:67
ideal idCopy(ideal A)
Definition: ideals.h:60
leftv next
Definition: subexpr.h:87
#define SI_RESTORE_OPT2(A)
Definition: options.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:728
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:236
int iiOp
Definition: iparith.cc:224
unsigned si_opt_2
Definition: options.c:6
int BOOLEAN
Definition: auxiliary.h:85
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define SI_SAVE_OPT2(A)
Definition: options.h:21

◆ jjREDUCE5()

static BOOLEAN jjREDUCE5 ( leftv  res,
leftv  u 
)
static

Definition at line 7399 of file iparith.cc.

7400 {
7401  leftv u1=u;
7402  leftv u2=u1->next;
7403  leftv u3=u2->next;
7404  leftv u4=u3->next;
7405  leftv u5=u4->next;
7406  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7407  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7408  {
7409  assumeStdFlag(u3);
7410  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7411  {
7412  WerrorS("2nd argument must be a diagonal matrix of units");
7413  return TRUE;
7414  }
7415  res->rtyp=IDEAL_CMD;
7416  res->data=(char*)redNF(
7417  idCopy((ideal)u3->Data()),
7418  idCopy((ideal)u1->Data()),
7419  mp_Copy((matrix)u2->Data(),currRing),
7420  (int)(long)u4->Data(),
7421  (intvec*)u5->Data()
7422  );
7423  return FALSE;
7424  }
7425  else
7426  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7427  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7428  {
7429  assumeStdFlag(u3);
7430  if(!pIsUnit((poly)u2->Data()))
7431  {
7432  WerrorS("2nd argument must be a unit");
7433  return TRUE;
7434  }
7435  res->rtyp=POLY_CMD;
7436  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7437  pCopy((poly)u2->Data()),
7438  (int)(long)u4->Data(),(intvec*)u5->Data());
7439  return FALSE;
7440  }
7441  else
7442  {
7443  Werror("%s(`ideal`,`ideal`,`matrix`,`int`,`intvec`) exppected",
7444  Tok2Cmdname(iiOp));
7445  return TRUE;
7446  }
7447 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
ideal idCopy(ideal A)
Definition: ideals.h:60
leftv next
Definition: subexpr.h:87
int rtyp
Definition: subexpr.h:92
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:728
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:224
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

◆ jjREDUCE_ID()

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

Definition at line 2876 of file iparith.cc.

2877 {
2878  ideal ui=(ideal)u->Data();
2879  ideal vi=(ideal)v->Data();
2880  if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
2881  assumeStdFlag(v);
2882  res->data = (char *)kNF(vi,currRing->qideal,ui);
2883  return FALSE;
2884 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjREDUCE_P()

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

Definition at line 2868 of file iparith.cc.

2869 {
2870  ideal vi=(ideal)v->Data();
2871  if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
2872  assumeStdFlag(v);
2873  res->data = (char *)kNF(vi,currRing->qideal,(poly)u->Data());
2874  return FALSE;
2875 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10

◆ jjREGULARITY()

static BOOLEAN jjREGULARITY ( leftv  res,
leftv  v 
)
static

Definition at line 4671 of file iparith.cc.

4672 {
4673  res->data = (char *)(long)iiRegularity((lists)v->Data());
4674  return FALSE;
4675 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
int iiRegularity(lists L)
Definition: ipshell.cc:956
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjREPART()

static BOOLEAN jjREPART ( leftv  res,
leftv  v 
)
static

Definition at line 4676 of file iparith.cc.

4677 {
4678  res->data = (char *)n_RePart((number)v->Data(),currRing->cf);
4679  return FALSE;
4680 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
Definition: coeffs.h:824
void * Data()
Definition: subexpr.cc:1137

◆ jjRES()

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

Definition at line 3003 of file iparith.cc.

3004 {
3005  int maxl=(int)(long)v->Data();
3006  if (maxl<0)
3007  {
3008  WerrorS("length for res must not be negative");
3009  return TRUE;
3010  }
3011  syStrategy r;
3012  intvec *weights=NULL;
3013  int wmaxl=maxl;
3014  ideal u_id=(ideal)u->Data();
3015 
3016  maxl--;
3017  if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/
3018  {
3019  maxl = currRing->N-1+2*(iiOp==MRES_CMD);
3020  if (currRing->qideal!=NULL)
3021  {
3022  Warn(
3023  "full resolution in a qring may be infinite, setting max length to %d",
3024  maxl+1);
3025  }
3026  }
3027  weights=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
3028  if (weights!=NULL)
3029  {
3030  if (!idTestHomModule(u_id,currRing->qideal,weights))
3031  {
3032  WarnS("wrong weights given:");weights->show();PrintLn();
3033  weights=NULL;
3034  }
3035  }
3036  intvec *ww=NULL;
3037  int add_row_shift=0;
3038  if (weights!=NULL)
3039  {
3040  ww=ivCopy(weights);
3041  add_row_shift = ww->min_in();
3042  (*ww) -= add_row_shift;
3043  }
3044  if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
3045  {
3046  r=syResolution(u_id,maxl, ww, iiOp==MRES_CMD);
3047  }
3048  else if (iiOp==SRES_CMD)
3049  // r=sySchreyerResolvente(u_id,maxl+1,&l);
3050  r=sySchreyer(u_id,maxl+1);
3051  else if (iiOp == LRES_CMD)
3052  {
3053  int dummy;
3054  if((currRing->qideal!=NULL)||
3055  (!idHomIdeal (u_id,NULL)))
3056  {
3057  WerrorS
3058  ("`lres` not implemented for inhomogeneous input or qring");
3059  return TRUE;
3060  }
3061  if(currRing->N == 1)
3062  WarnS("the current implementation of `lres` may not work in the case of a single variable");
3063  r=syLaScala3(u_id,&dummy);
3064  }
3065  else if (iiOp == KRES_CMD)
3066  {
3067  int dummy;
3068  if((currRing->qideal!=NULL)||
3069  (!idHomIdeal (u_id,NULL)))
3070  {
3071  WerrorS
3072  ("`kres` not implemented for inhomogeneous input or qring");
3073  return TRUE;
3074  }
3075  r=syKosz(u_id,&dummy);
3076  }
3077  else
3078  {
3079  int dummy;
3080  if((currRing->qideal!=NULL)||
3081  (!idHomIdeal (u_id,NULL)))
3082  {
3083  WerrorS
3084  ("`hres` not implemented for inhomogeneous input or qring");
3085  return TRUE;
3086  }
3087  ideal u_id_copy=idCopy(u_id);
3088  idSkipZeroes(u_id_copy);
3089  r=syHilb(u_id_copy,&dummy);
3090  idDelete(&u_id_copy);
3091  }
3092  if (r==NULL) return TRUE;
3093  //res->data=(void *)liMakeResolv(r,l,wmaxl,u->Typ(),weights);
3094  r->list_length=wmaxl;
3095  res->data=(void *)r;
3096  if ((weights!=NULL) && (ww!=NULL)) { delete ww; ww=NULL; }
3097  if ((r->weights!=NULL) && (r->weights[0]!=NULL))
3098  {
3099  ww=ivCopy(r->weights[0]);
3100  if (weights!=NULL) (*ww) += add_row_shift;
3101  atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
3102  }
3103  else
3104  {
3105  if (weights!=NULL)
3106  {
3107  atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
3108  }
3109  }
3110 
3111  // test the La Scala case' output
3112  assume( ((iiOp == LRES_CMD) || (iiOp == HRES_CMD)) == (r->syRing != NULL) );
3113  assume( (r->syRing != NULL) == (r->resPairs != NULL) );
3114 
3115  if(iiOp != HRES_CMD)
3116  assume( (r->minres != NULL) || (r->fullres != NULL) ); // is wrong for HRES_CMD...
3117  else
3118  assume( (r->orderedRes != NULL) || (r->res != NULL) ); // analog for hres...
3119 
3120  return FALSE;
3121 }
intvec ** weights
Definition: syz.h:45
syStrategy syKosz(ideal arg, int *length)
Definition: syz3.cc:1764
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Definition: tok.h:108
void PrintLn()
Definition: reporter.cc:310
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:178
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:98
syStrategy syResolution(ideal arg, int maxlength, intvec *w, BOOLEAN minim)
Definition: syz.cc:621
void WerrorS(const char *s)
Definition: feFopen.cc:24
int min_in()
Definition: intvec.h:113
Definition: tok.h:119
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:14
#define assume(x)
Definition: mod2.h:394
syStrategy sySchreyer(ideal arg, int maxlength)
Definition: syz0.cc:1024
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente fullres
Definition: syz.h:57
ideal idCopy(ideal A)
Definition: ideals.h:60
resolvente minres
Definition: syz.h:58
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
Definition: tok.h:130
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:91
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
Definition: tok.h:90
void * Data()
Definition: subexpr.cc:1137
short list_length
Definition: syz.h:62
Definition: tok.h:166
syStrategy syHilb(ideal arg, int *length)
Definition: syz2.cc:956
int iiOp
Definition: iparith.cc:224
syStrategy syLaScala3(ideal arg, int *length)
Definition: syz1.cc:2434
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjRES3()

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

Definition at line 6386 of file iparith.cc.

6387 {
6388  int maxl=(int)v->Data();
6389  ideal u_id=(ideal)u->Data();
6390  int l=0;
6391  resolvente r;
6392  intvec **weights=NULL;
6393  int wmaxl=maxl;
6394  maxl--;
6395  if ((maxl==-1) && (iiOp!=MRES_CMD))
6396  maxl = currRing->N-1;
6397  if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
6398  {
6399  intvec * iv=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
6400  if (iv!=NULL)
6401  {
6402  l=1;
6403  if (!idTestHomModule(u_id,currRing->qideal,iv))
6404  {
6405  WarnS("wrong weights");
6406  iv=NULL;
6407  }
6408  else
6409  {
6410  weights = (intvec**)omAlloc0Bin(char_ptr_bin);
6411  weights[0] = ivCopy(iv);
6412  }
6413  }
6414  r=syResolvente(u_id,maxl,&l, &weights, iiOp==MRES_CMD);
6415  }
6416  else
6417  r=sySchreyerResolvente((ideal)u->Data(),maxl+1,&l);
6418  if (r==NULL) return TRUE;
6419  int t3=u->Typ();
6420  iiMakeResolv(r,l,wmaxl,w->name,t3,weights);
6421  return FALSE;
6422 }
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition: syz.cc:394
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:995
omBin char_ptr_bin
Definition: ring.cc:55
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:88
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
Definition: syz0.cc:861
void iiMakeResolv(resolvente r, int length, int rlen, char *name, int typ0, intvec **weights)
Definition: ipshell.cc:766
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
Definition: tok.h:130
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
ideal * resolvente
Definition: ideals.h:18
Definition: tok.h:166
int iiOp
Definition: iparith.cc:224
int l
Definition: cfEzgcd.cc:94

◆ jjRESERVED0()

static BOOLEAN jjRESERVED0 ( leftv  ,
leftv   
)
static

Definition at line 7448 of file iparith.cc.

7449 {
7450  unsigned i=1;
7451  unsigned nCount = (sArithBase.nCmdUsed-1)/3;
7452  if((3*nCount)<sArithBase.nCmdUsed) nCount++;
7453  //Print("CMDS: %d/%d\n", sArithBase.nCmdUsed,
7454  // sArithBase.nCmdAllocated);
7455  for(i=0; i<nCount; i++)
7456  {
7457  Print("%-20s",sArithBase.sCmds[i+1].name);
7458  if(i+1+nCount<sArithBase.nCmdUsed)
7459  Print("%-20s",sArithBase.sCmds[i+1+nCount].name);
7460  if(i+1+2*nCount<sArithBase.nCmdUsed)
7461  Print("%-20s",sArithBase.sCmds[i+1+2*nCount].name);
7462  //if ((i%3)==1) PrintLn();
7463  PrintLn();
7464  }
7465  PrintLn();
7467  return FALSE;
7468 }
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:94
void printBlackboxTypes()
list all defined type (for debugging)
Definition: blackbox.cc:208
int i
Definition: cfEzgcd.cc:123
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ jjRESERVEDNAME()

static BOOLEAN jjRESERVEDNAME ( leftv  res,
leftv  v 
)
static

Definition at line 4645 of file iparith.cc.

4646 {
4647  char *s= (char *)v->Data();
4648  for(unsigned i=0; i<sArithBase.nCmdUsed; i++)
4649  {
4650  //Print("test %d, >>%s<<, tab:>>%s<<\n",i,s,sArithBase.sCmds[i].name);
4651  if (strcmp(s, sArithBase.sCmds[i].name) == 0)
4652  {
4653  res->data = (char *)1;
4654  return FALSE;
4655  }
4656  }
4657  //res->data = (char *)0;
4658  return FALSE;
4659 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
void * Data()
Definition: subexpr.cc:1137
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ jjRING3()

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

Definition at line 6424 of file iparith.cc.

6425 {
6426  res->data=(void *)rInit(u,v,w);
6427  return (res->data==NULL);
6428 }
void * data
Definition: subexpr.h:89
ring rInit(leftv pn, leftv rv, leftv ord)
Definition: ipshell.cc:5518
#define NULL
Definition: omList.c:10

◆ jjRING_1()

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

Definition at line 1653 of file iparith.cc.

1654 {
1655  u->next=(leftv)omAlloc(sizeof(sleftv));
1656  memcpy(u->next,v,sizeof(sleftv));
1657  memset(v,0,sizeof(sleftv));
1658  BOOLEAN bo=iiExprArithM(res,u,'[');
1659  u->next=NULL;
1660  return bo;
1661 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
sleftv * leftv
Definition: structs.h:60
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8520
#define omAlloc(size)
Definition: omAllocDecl.h:210
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjRING_2()

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

Definition at line 5566 of file iparith.cc.

5567 {
5568  u->next=(leftv)omAlloc(sizeof(sleftv));
5569  memcpy(u->next,v,sizeof(sleftv));
5570  memset(v,0,sizeof(sleftv));
5571  u->next->next=(leftv)omAlloc(sizeof(sleftv));
5572  memcpy(u->next->next,w,sizeof(sleftv));
5573  memset(w,0,sizeof(sleftv));
5574  BOOLEAN bo=iiExprArithM(res,u,'[');
5575  u->next=NULL;
5576  return bo;
5577 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
sleftv * leftv
Definition: structs.h:60
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8520
#define omAlloc(size)
Definition: omAllocDecl.h:210
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
int BOOLEAN
Definition: auxiliary.h:85

◆ jjRING_LIST()

static BOOLEAN jjRING_LIST ( leftv  res,
leftv  v 
)
static

Definition at line 4695 of file iparith.cc.

4696 {
4697  ring r=(ring)v->Data();
4698  if (r!=NULL)
4699  res->data = (char *)rDecompose_list_cf((ring)v->Data());
4700  return (r==NULL)||(res->data==NULL);
4701 }
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
lists rDecompose_list_cf(const ring r)
Definition: ipshell.cc:1909

◆ jjRING_PL()

static BOOLEAN jjRING_PL ( leftv  res,
leftv  a 
)
static

Definition at line 7812 of file iparith.cc.

7813 {
7814  //Print("construct ring\n");
7815  if (a->Typ()!=CRING_CMD)
7816  {
7817  WerrorS("expected `cring` [ `id` ... ]");
7818  return TRUE;
7819  }
7820  assume(a->next!=NULL);
7821  leftv names=a->next;
7822  int N=names->listLength();
7823  char **n=(char**)omAlloc0(N*sizeof(char*));
7824  for(int i=0; i<N;i++,names=names->next)
7825  {
7826  n[i]=(char *)names->Name();
7827  }
7828  coeffs cf=(coeffs)a->CopyD();
7829  res->data=rDefault(cf,N,n, ringorder_dp);
7830  omFreeSize(n,N*sizeof(char*));
7831  return FALSE;
7832 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:60
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
Definition: tok.h:56
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
#define assume(x)
Definition: mod2.h:394
The main handler for Singular numbers which are suitable for Singular polynomials.
int i
Definition: cfEzgcd.cc:123
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl)
Definition: ring.cc:113
leftv next
Definition: subexpr.h:87
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ jjRINGLIST()

static BOOLEAN jjRINGLIST ( leftv  res,
leftv  v 
)
static

Definition at line 4681 of file iparith.cc.

4682 {
4683  ring r=(ring)v->Data();
4684  if (r!=NULL)
4685  res->data = (char *)rDecompose((ring)v->Data());
4686  return (r==NULL)||(res->data==NULL);
4687 }
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
lists rDecompose(const ring r)
Definition: ipshell.cc:2040
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjRINGLIST_C()

static BOOLEAN jjRINGLIST_C ( leftv  res,
leftv  v 
)
static

Definition at line 4688 of file iparith.cc.

4689 {
4690  coeffs r=(coeffs)v->Data();
4691  if (r!=NULL)
4692  return rDecompose_CF(res,r);
4693  return TRUE;
4694 }
#define TRUE
Definition: auxiliary.h:98
const ring r
Definition: syzextra.cc:208
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
BOOLEAN rDecompose_CF(leftv res, const coeffs C)
Definition: ipshell.cc:1838

◆ jjrOrdStr()

static BOOLEAN jjrOrdStr ( leftv  res,
leftv  v 
)
static

Definition at line 5262 of file iparith.cc.

5263 {
5264  res->data = rOrdStr((ring)v->Data());
5265  return FALSE;
5266 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
char * rOrdStr(ring r)
Definition: ring.cc:524

◆ jjROWS()

static BOOLEAN jjROWS ( leftv  res,
leftv  v 
)
static

Definition at line 4702 of file iparith.cc.

4703 {
4704  ideal i = (ideal)v->Data();
4705  res->data = (char *)i->rank;
4706  return FALSE;
4707 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137

◆ jjROWS_BIM()

static BOOLEAN jjROWS_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 4708 of file iparith.cc.

4709 {
4710  res->data = (char *)(long)((bigintmat*)(v->Data()))->rows();
4711  return FALSE;
4712 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjROWS_IV()

static BOOLEAN jjROWS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4713 of file iparith.cc.

4714 {
4715  res->data = (char *)(long)((intvec*)(v->Data()))->rows();
4716  return FALSE;
4717 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjRPAR()

static BOOLEAN jjRPAR ( leftv  res,
leftv  v 
)
static

Definition at line 4718 of file iparith.cc.

4719 {
4720  res->data = (char *)(long)rPar(((ring)v->Data()));
4721  return FALSE;
4722 }
#define FALSE
Definition: auxiliary.h:94
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjrParStr()

static BOOLEAN jjrParStr ( leftv  res,
leftv  v 
)
static

Definition at line 5272 of file iparith.cc.

5273 {
5274  res->data = rParStr((ring)v->Data());
5275  return FALSE;
5276 }
#define FALSE
Definition: auxiliary.h:94
char * rParStr(ring r)
Definition: ring.cc:622
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjRSUM()

static BOOLEAN jjRSUM ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3149 of file iparith.cc.

3150 {
3151  ring r;
3152  int i=rSum((ring)u->Data(),(ring)v->Data(),r);
3153  res->data = (char *)r;
3154  return (i==-1);
3155 }
void * data
Definition: subexpr.h:89
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1304
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1137

◆ jjrVarStr()

static BOOLEAN jjrVarStr ( leftv  res,
leftv  v 
)
static

Definition at line 5267 of file iparith.cc.

5268 {
5269  res->data = rVarStr((ring)v->Data());
5270  return FALSE;
5271 }
char * rVarStr(ring r)
Definition: ring.cc:596
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjSBA()

static BOOLEAN jjSBA ( leftv  res,
leftv  v 
)
static

Definition at line 4767 of file iparith.cc.

4768 {
4769  ideal result;
4770  ideal v_id=(ideal)v->Data();
4771  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4772  tHomog hom=testHomog;
4773  if (w!=NULL)
4774  {
4775  if (!idTestHomModule(v_id,currRing->qideal,w))
4776  {
4777  WarnS("wrong weights");
4778  w=NULL;
4779  }
4780  else
4781  {
4782  hom=isHomog;
4783  w=ivCopy(w);
4784  }
4785  }
4786  result=kSba(v_id,currRing->qideal,hom,&w,1,0);
4787  idSkipZeroes(result);
4788  res->data = (char *)result;
4790  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4791  return FALSE;
4792 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:94
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
Definition: kstd1.cc:2416
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSBA_1()

static BOOLEAN jjSBA_1 ( leftv  res,
leftv  v,
leftv  u 
)
static

Definition at line 4793 of file iparith.cc.

4794 {
4795  ideal result;
4796  ideal v_id=(ideal)v->Data();
4797  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4798  tHomog hom=testHomog;
4799  if (w!=NULL)
4800  {
4801  if (!idTestHomModule(v_id,currRing->qideal,w))
4802  {
4803  WarnS("wrong weights");
4804  w=NULL;
4805  }
4806  else
4807  {
4808  hom=isHomog;
4809  w=ivCopy(w);
4810  }
4811  }
4812  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0);
4813  idSkipZeroes(result);
4814  res->data = (char *)result;
4816  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4817  return FALSE;
4818 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:94
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
Definition: kstd1.cc:2416
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSBA_2()

static BOOLEAN jjSBA_2 ( leftv  res,
leftv  v,
leftv  u,
leftv  t 
)
static

Definition at line 4819 of file iparith.cc.

4820 {
4821  ideal result;
4822  ideal v_id=(ideal)v->Data();
4823  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4824  tHomog hom=testHomog;
4825  if (w!=NULL)
4826  {
4827  if (!idTestHomModule(v_id,currRing->qideal,w))
4828  {
4829  WarnS("wrong weights");
4830  w=NULL;
4831  }
4832  else
4833  {
4834  hom=isHomog;
4835  w=ivCopy(w);
4836  }
4837  }
4838  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());
4839  idSkipZeroes(result);
4840  res->data = (char *)result;
4842  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4843  return FALSE;
4844 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:94
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
Definition: kstd1.cc:2416
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSIMPL_ID()

static BOOLEAN jjSIMPL_ID ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3162 of file iparith.cc.

3163 {
3164  int sw = (int)(long)v->Data();
3165  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
3166  ideal id = (ideal)u->CopyD(IDEAL_CMD);
3167  if (sw & SIMPL_LMDIV)
3168  {
3169  id_DelDiv(id,currRing);
3170  }
3171  if (sw & SIMPL_LMEQ)
3172  {
3174  }
3175  if (sw & SIMPL_MULT)
3176  {
3178  }
3179  else if(sw & SIMPL_EQU)
3180  {
3181  id_DelEquals(id,currRing);
3182  }
3183  if (sw & SIMPL_NULL)
3184  {
3185  idSkipZeroes(id);
3186  }
3187  if (sw & SIMPL_NORM)
3188  {
3189  id_Norm(id,currRing);
3190  }
3191  res->data = (char * )id;
3192  return FALSE;
3193 }
#define SIMPL_LMDIV
Definition: iparith.cc:3156
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...
#define SIMPL_MULT
Definition: iparith.cc:3158
#define FALSE
Definition: auxiliary.h:94
void id_Norm(ideal id, const ring r)
ideal id = (id[i]), result is leadcoeff(id[i]) = 1
#define SIMPL_EQU
Definition: iparith.cc:3159
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
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 ...
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.
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
#define SIMPL_NORM
Definition: iparith.cc:3161
#define SIMPL_LMEQ
Definition: iparith.cc:3157
#define SIMPL_NULL
Definition: iparith.cc:3160
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjSIMPL_P()

static BOOLEAN jjSIMPL_P ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3253 of file iparith.cc.

3254 {
3255  int sw = (int)(long)v->Data();
3256  // CopyD for POLY_CMD and VECTOR_CMD are identical:
3257  poly p = (poly)u->CopyD(POLY_CMD);
3258  if (sw & SIMPL_NORM)
3259  {
3260  pNorm(p);
3261  }
3262  res->data = (char * )p;
3263  return FALSE;
3264 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
#define SIMPL_NORM
Definition: iparith.cc:3161
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjSLIM_GB()

static BOOLEAN jjSLIM_GB ( leftv  res,
leftv  u 
)
static

Definition at line 4723 of file iparith.cc.

4724 {
4725 #ifdef HAVE_PLURAL
4726  const bool bIsSCA = rIsSCA(currRing);
4727 #else
4728  const bool bIsSCA = false;
4729 #endif
4730 
4731  if ((currRing->qideal!=NULL) && !bIsSCA)
4732  {
4733  WerrorS("qring not supported by slimgb at the moment");
4734  return TRUE;
4735  }
4737  {
4738  WerrorS("ordering must be global for slimgb");
4739  return TRUE;
4740  }
4741  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
4742  // tHomog hom=testHomog;
4743  ideal u_id=(ideal)u->Data();
4744  if (w!=NULL)
4745  {
4746  if (!idTestHomModule(u_id,currRing->qideal,w))
4747  {
4748  WarnS("wrong weights");
4749  w=NULL;
4750  }
4751  else
4752  {
4753  w=ivCopy(w);
4754  // hom=isHomog;
4755  }
4756  }
4757 
4758  assume(u_id->rank>=id_RankFreeModule(u_id, currRing));
4759  res->data=(char *)t_rep_gb(currRing,
4760  u_id,u_id->rank);
4761  //res->data=(char *)t_rep_gb(currRing, u_id);
4762 
4764  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4765  return FALSE;
4766 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:94
ideal t_rep_gb(ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
Definition: tgb.cc:3558
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define assume(x)
Definition: mod2.h:394
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define rHasLocalOrMixedOrdering_currRing()
Definition: ring.h:758
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
static bool rIsSCA(const ring r)
Definition: nc.h:206
void * Data()
Definition: subexpr.cc:1137
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSort_Id()

static BOOLEAN jjSort_Id ( leftv  res,
leftv  v 
)
static

Definition at line 4871 of file iparith.cc.

4872 {
4873  res->data = (char *)idSort((ideal)v->Data());
4874  return FALSE;
4875 }
#define FALSE
Definition: auxiliary.h:94
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:169
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjSORTLIST()

BOOLEAN jjSORTLIST ( leftv  ,
leftv  arg 
)

Definition at line 9295 of file iparith.cc.

9296 {
9297  lists l=(lists)arg->Data();
9298  if (l->nr>0)
9299  {
9300  qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
9301  }
9302  return FALSE;
9303 }
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
static int jjCOMPARE_ALL(const void *aa, const void *bb)
Definition: iparith.cc:9254
int nr
Definition: lists.h:43
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137
int l
Definition: cfEzgcd.cc:94

◆ jjSQR_FREE()

static BOOLEAN jjSQR_FREE ( leftv  res,
leftv  u 
)
static

Definition at line 4876 of file iparith.cc.

4877 {
4879  intvec *v=NULL;
4880  ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, 0, currRing);
4881  if (f==NULL) return TRUE;
4882  ivTest(v);
4884  l->Init(2);
4885  l->m[0].rtyp=IDEAL_CMD;
4886  l->m[0].data=(void *)f;
4887  l->m[1].rtyp=INTVEC_CMD;
4888  l->m[1].data=(void *)v;
4889  res->data=(void *)l;
4890  return FALSE;
4891 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:1142
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
FILE * f
Definition: checklibs.c:9
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
int singclap_factorize_retry
Definition: iparith.cc:3194
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jjSQR_FREE2()

static BOOLEAN jjSQR_FREE2 ( leftv  res,
leftv  u,
leftv  dummy 
)
static

Definition at line 3195 of file iparith.cc.

3196 {
3197  intvec *v=NULL;
3198  int sw=(int)(long)dummy->Data();
3199  int fac_sw=sw;
3200  if (sw<0) fac_sw=1;
3202  ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, fac_sw, currRing);
3203  if (f==NULL)
3204  return TRUE;
3205  switch(sw)
3206  {
3207  case 0:
3208  case 2:
3209  {
3211  l->Init(2);
3212  l->m[0].rtyp=IDEAL_CMD;
3213  l->m[0].data=(void *)f;
3214  l->m[1].rtyp=INTVEC_CMD;
3215  l->m[1].data=(void *)v;
3216  res->data=(void *)l;
3217  res->rtyp=LIST_CMD;
3218  return FALSE;
3219  }
3220  case 1:
3221  res->data=(void *)f;
3222  return FALSE;
3223  case 3:
3224  {
3225  poly p=f->m[0];
3226  int i=IDELEMS(f);
3227  f->m[0]=NULL;
3228  while(i>1)
3229  {
3230  i--;
3231  p=pMult(p,f->m[i]);
3232  f->m[i]=NULL;
3233  }
3234  res->data=(void *)p;
3235  res->rtyp=POLY_CMD;
3236  }
3237  return FALSE;
3238  }
3239  WerrorS("invalid switch");
3240  return FALSE;
3241 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:1142
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
FILE * f
Definition: checklibs.c:9
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
int singclap_factorize_retry
Definition: iparith.cc:3194
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
#define pMult(p, q)
Definition: polys.h:190
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jjSTATUS2()

static BOOLEAN jjSTATUS2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3242 of file iparith.cc.

3243 {
3244  res->data = omStrDup(slStatus((si_link) u->Data(), (char *) v->Data()));
3245  return FALSE;
3246 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTATUS2L()

static BOOLEAN jjSTATUS2L ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3247 of file iparith.cc.

3248 {
3249  res->data = (void *)(long)slStatusSsiL((lists) u->Data(), (int)(long) v->Data());
3250  //return (res->data== (void*)(long)-2);
3251  return FALSE;
3252 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjSTATUS3()

static BOOLEAN jjSTATUS3 ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6429 of file iparith.cc.

6430 {
6431  int yes;
6432  jjSTATUS2(res, u, v);
6433  yes = (strcmp((char *) res->data, (char *) w->Data()) == 0);
6434  omFree((ADDRESS) res->data);
6435  res->data = (void *)(long)yes;
6436  return FALSE;
6437 }
#define FALSE
Definition: auxiliary.h:94
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:89
#define omFree(addr)
Definition: omAllocDecl.h:261
void * Data()
Definition: subexpr.cc:1137
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3242

◆ jjSTATUS_M()

static BOOLEAN jjSTATUS_M ( leftv  res,
leftv  v 
)
static

Definition at line 7654 of file iparith.cc.

7655 {
7656  if ((v->Typ() != LINK_CMD) ||
7657  (v->next->Typ() != STRING_CMD) ||
7658  (v->next->next->Typ() != STRING_CMD) ||
7659  (v->next->next->next->Typ() != INT_CMD))
7660  return TRUE;
7661  jjSTATUS3(res, v, v->next, v->next->next);
7662 #if defined(HAVE_USLEEP)
7663  if (((long) res->data) == 0L)
7664  {
7665  int i_s = (int)(long) v->next->next->next->Data();
7666  if (i_s > 0)
7667  {
7668  usleep((int)(long) v->next->next->next->Data());
7669  jjSTATUS3(res, v, v->next, v->next->next);
7670  }
7671  }
7672 #elif defined(HAVE_SLEEP)
7673  if (((int) res->data) == 0)
7674  {
7675  int i_s = (int) v->next->next->next->Data();
7676  if (i_s > 0)
7677  {
7678  si_sleep((is - 1)/1000000 + 1);
7679  jjSTATUS3(res, v, v->next, v->next->next);
7680  }
7681  }
7682 #endif
7683  return FALSE;
7684 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:89
leftv next
Definition: subexpr.h:87
Definition: tok.h:116
void * Data()
Definition: subexpr.cc:1137
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6429

◆ jjSTD()

static BOOLEAN jjSTD ( leftv  res,
leftv  v 
)
static

Definition at line 4845 of file iparith.cc.

4846 {
4847  ideal result;
4848  ideal v_id=(ideal)v->Data();
4849  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4850  tHomog hom=testHomog;
4851  if (w!=NULL)
4852  {
4853  if (!idTestHomModule(v_id,currRing->qideal,w))
4854  {
4855  WarnS("wrong weights");
4856  w=NULL;
4857  }
4858  else
4859  {
4860  hom=isHomog;
4861  w=ivCopy(w);
4862  }
4863  }
4864  result=kStd(v_id,currRing->qideal,hom,&w);
4865  idSkipZeroes(result);
4866  res->data = (char *)result;
4868  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4869  return FALSE;
4870 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2231
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTD_1()

static BOOLEAN jjSTD_1 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3291 of file iparith.cc.

3292 {
3293  ideal result;
3294  assumeStdFlag(u);
3295  ideal i1=(ideal)(u->Data());
3296  ideal i0;
3297  int r=v->Typ();
3298  if ((/*v->Typ()*/r==POLY_CMD) ||(r==VECTOR_CMD))
3299  {
3300  i0=idInit(1,i1->rank); // TODO: rank is wrong (if v is a vector!)
3301  i0->m[0]=(poly)v->Data();
3302  int ii0=idElem(i0); /* size of i0 */
3303  i1=idSimpleAdd(i1,i0); //
3304  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
3305  idDelete(&i0);
3306  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3307  tHomog hom=testHomog;
3308 
3309  if (w!=NULL)
3310  {
3311  if (!idTestHomModule(i1,currRing->qideal,w))
3312  {
3313  // no warnung: this is legal, if i in std(i,p)
3314  // is homogeneous, but p not
3315  w=NULL;
3316  }
3317  else
3318  {
3319  w=ivCopy(w);
3320  hom=isHomog;
3321  }
3322  }
3323  BITSET save1;
3324  SI_SAVE_OPT1(save1);
3326  /* ii0 appears to be the position of the first element of il that
3327  does not belong to the old SB ideal */
3328  result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0);
3329  SI_RESTORE_OPT1(save1);
3330  idDelete(&i1);
3331  idSkipZeroes(result);
3332  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3333  res->data = (char *)result;
3334  }
3335  else /*IDEAL/MODULE*/
3336  {
3337  i0=(ideal)v->CopyD();
3338  int ii0=idElem(i0); /* size of i0 */
3339  i1=idSimpleAdd(i1,i0); //
3340  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
3341  idDelete(&i0);
3342  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3343  tHomog hom=testHomog;
3344 
3345  if (w!=NULL)
3346  {
3347  if (!idTestHomModule(i1,currRing->qideal,w))
3348  {
3349  // no warnung: this is legal, if i in std(i,p)
3350  // is homogeneous, but p not
3351  w=NULL;
3352  }
3353  else
3354  {
3355  w=ivCopy(w);
3356  hom=isHomog;
3357  }
3358  }
3359  if (ii0*4 >= 3*IDELEMS(i1)) // MAGIC: add few poly to large SB: 3/4
3360  {
3361  BITSET save1;
3362  SI_SAVE_OPT1(save1);
3364  /* ii0 appears to be the position of the first element of il that
3365  does not belong to the old SB ideal */
3366  result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0);
3367  SI_RESTORE_OPT1(save1);
3368  }
3369  else
3370  {
3371  result=kStd(i1,currRing->qideal,hom,&w);
3372  }
3373  idDelete(&i1);
3374  idSkipZeroes(result);
3375  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3376  res->data = (char *)result;
3377  }
3379  return FALSE;
3380 }
unsigned si_opt_1
Definition: options.c:5
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
#define idSimpleAdd(A, B)
Definition: ideals.h:42
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2231
#define SI_SAVE_OPT1(A)
Definition: options.h:20
#define BITSET
Definition: structs.h:18
int Typ()
Definition: subexpr.cc:995
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
int idElem(const ideal F)
count non-zero elements
#define OPT_SB_1
Definition: options.h:90
polyrec * poly
Definition: hilb.h:10
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void * CopyD(int t)
Definition: subexpr.cc:707
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTD_HILB()

static BOOLEAN jjSTD_HILB ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3265 of file iparith.cc.

3266 {
3267  ideal result;
3268  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3269  tHomog hom=testHomog;
3270  ideal u_id=(ideal)(u->Data());
3271  if (w!=NULL)
3272  {
3273  if (!idTestHomModule(u_id,currRing->qideal,w))
3274  {
3275  WarnS("wrong weights:");w->show();PrintLn();
3276  w=NULL;
3277  }
3278  else
3279  {
3280  w=ivCopy(w);
3281  hom=isHomog;
3282  }
3283  }
3284  result=kStd(u_id,currRing->qideal,hom,&w,(intvec *)v->Data());
3285  idSkipZeroes(result);
3286  res->data = (char *)result;
3287  setFlag(res,FLAG_STD);
3288  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3289  return FALSE;
3290 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
void PrintLn()
Definition: reporter.cc:310
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2231
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTD_HILB_W()

static BOOLEAN jjSTD_HILB_W ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6438 of file iparith.cc.

6439 {
6440  intvec *vw=(intvec *)w->Data(); // weights of vars
6441  if (vw->length()!=currRing->N)
6442  {
6443  Werror("%d weights for %d variables",vw->length(),currRing->N);
6444  return TRUE;
6445  }
6446  ideal result;
6447  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
6448  tHomog hom=testHomog;
6449  ideal u_id=(ideal)(u->Data());
6450  if (ww!=NULL)
6451  {
6452  if (!idTestHomModule(u_id,currRing->qideal,ww))
6453  {
6454  WarnS("wrong weights");
6455  ww=NULL;
6456  }
6457  else
6458  {
6459  ww=ivCopy(ww);
6460  hom=isHomog;
6461  }
6462  }
6463  result=kStd(u_id,
6464  currRing->qideal,
6465  hom,
6466  &ww, // module weights
6467  (intvec *)v->Data(), // hilbert series
6468  0,0, // syzComp, newIdeal
6469  vw); // weights of vars
6470  idSkipZeroes(result);
6471  res->data = (char *)result;
6472  setFlag(res,FLAG_STD);
6473  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
6474  return FALSE;
6475 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:98
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2231
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTD_HILB_WP()

static BOOLEAN jjSTD_HILB_WP ( leftv  res,
leftv  INPUT 
)
static

Definition at line 7729 of file iparith.cc.

7730 { ideal result;
7731  leftv u = INPUT; /* an ideal, weighted homogeneous and standard */
7732  leftv v = u->next; /* one additional polynomial or ideal */
7733  leftv h = v->next; /* Hilbert vector */
7734  leftv w = h->next; /* weight vector */
7735  assumeStdFlag(u);
7736  ideal i1=(ideal)(u->Data());
7737  ideal i0;
7738  if (((u->Typ()!=IDEAL_CMD)&&(u->Typ()!=MODUL_CMD))
7739  || (h->Typ()!=INTVEC_CMD)
7740  || (w->Typ()!=INTVEC_CMD))
7741  {
7742  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7743  return TRUE;
7744  }
7745  intvec *vw=(intvec *)w->Data(); // weights of vars
7746  /* merging std_hilb_w and std_1 */
7747  if (vw->length()!=currRing->N)
7748  {
7749  Werror("%d weights for %d variables",vw->length(),currRing->N);
7750  return TRUE;
7751  }
7752  int r=v->Typ();
7753  BOOLEAN cleanup_i0=FALSE;
7754  if ((r==POLY_CMD) ||(r==VECTOR_CMD))
7755  {
7756  i0=idInit(1,i1->rank);
7757  i0->m[0]=(poly)v->Data();
7758  cleanup_i0=TRUE;
7759  }
7760  else if (r==IDEAL_CMD)/* IDEAL */
7761  {
7762  i0=(ideal)v->Data();
7763  }
7764  else
7765  {
7766  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7767  return TRUE;
7768  }
7769  int ii0=idElem(i0);
7770  i1 = idSimpleAdd(i1,i0);
7771  if (cleanup_i0)
7772  {
7773  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
7774  idDelete(&i0);
7775  }
7776  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
7777  tHomog hom=testHomog;
7778  /* u_id from jjSTD_W is now i1 as in jjSTD_1 */
7779  if (ww!=NULL)
7780  {
7781  if (!idTestHomModule(i1,currRing->qideal,ww))
7782  {
7783  WarnS("wrong weights");
7784  ww=NULL;
7785  }
7786  else
7787  {
7788  ww=ivCopy(ww);
7789  hom=isHomog;
7790  }
7791  }
7792  BITSET save1;
7793  SI_SAVE_OPT1(save1);
7795  result=kStd(i1,
7796  currRing->qideal,
7797  hom,
7798  &ww, // module weights
7799  (intvec *)h->Data(), // hilbert series
7800  0, // syzComp, whatever it is...
7801  IDELEMS(i1)-ii0, // new ideal
7802  vw); // weights of vars
7803  SI_RESTORE_OPT1(save1);
7804  idDelete(&i1);
7805  idSkipZeroes(result);
7806  res->data = (char *)result;
7807  if (!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
7808  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
7809  return FALSE;
7810 }
unsigned si_opt_1
Definition: options.c:5
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1835
#define idSimpleAdd(A, B)
Definition: ideals.h:42
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:98
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2231
#define SI_SAVE_OPT1(A)
Definition: options.h:20
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
#define BITSET
Definition: structs.h:18
int Typ()
Definition: subexpr.cc:995
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:87
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
int idElem(const ideal F)
count non-zero elements
#define OPT_SB_1
Definition: options.h:90
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
void Werror(const char *fmt,...)
Definition: reporter.cc:189
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjSTRING_PL()

static BOOLEAN jjSTRING_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7469 of file iparith.cc.

7470 {
7471  if (v == NULL)
7472  {
7473  res->data = omStrDup("");
7474  return FALSE;
7475  }
7476  int n = v->listLength();
7477  if (n == 1)
7478  {
7479  res->data = v->String();
7480  return FALSE;
7481  }
7482 
7483  char** slist = (char**) omAlloc(n*sizeof(char*));
7484  int i, j;
7485 
7486  for (i=0, j=0; i<n; i++, v = v ->next)
7487  {
7488  slist[i] = v->String();
7489  assume(slist[i] != NULL);
7490  j+=strlen(slist[i]);
7491  }
7492  char* s = (char*) omAlloc((j+1)*sizeof(char));
7493  *s='\0';
7494  for (i=0;i<n;i++)
7495  {
7496  strcat(s, slist[i]);
7497  omFree(slist[i]);
7498  }
7499  omFreeSize(slist, n*sizeof(char*));
7500  res->data = s;
7501  return FALSE;
7502 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:60
#define omAlloc(size)
Definition: omAllocDecl.h:210
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:751
void * data
Definition: subexpr.h:89
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:394
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjstrlen()

static BOOLEAN jjstrlen ( leftv  res,
leftv  v 
)
static

Definition at line 5194 of file iparith.cc.

5195 {
5196  res->data = (char *)strlen((char *)v->Data());
5197  return FALSE;
5198 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjSUBST_Id()

static BOOLEAN jjSUBST_Id ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6198 of file iparith.cc.

6199 {
6200  int ringvar;
6201  poly monomexpr;
6202  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6203  if (nok) return TRUE;
6204  ideal id=(ideal)u->Data();
6205  if (ringvar>0)
6206  {
6207  BOOLEAN overflow=FALSE;
6208  if (monomexpr!=NULL)
6209  {
6210  long deg_monexp=pTotaldegree(monomexpr);
6211  for(int i=IDELEMS(id)-1;i>=0;i--)
6212  {
6213  poly p=id->m[i];
6214  if ((p!=NULL) && (pTotaldegree(p)!=0) &&
6215  ((unsigned long)deg_monexp > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6216  {
6217  overflow=TRUE;
6218  break;
6219  }
6220  }
6221  }
6222  if (overflow)
6223  Warn("possible OVERFLOW in subst, max exponent is %ld",currRing->bitmask/2);
6224  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6225  {
6226  if (res->rtyp==MATRIX_CMD) id=(ideal)mp_Copy((matrix)id,currRing);
6227  else id=id_Copy(id,currRing);
6228  res->data = id_Subst(id, ringvar, monomexpr, currRing);
6229  }
6230  else
6231  res->data = idSubstPoly(id,ringvar,monomexpr);
6232  }
6233  else
6234  {
6235  res->data = idSubstPar(id,-ringvar,monomexpr);
6236  }
6237  return FALSE;
6238 }
ideal id_Subst(ideal id, int n, poly e, const ring r)
ideal idSubstPar(ideal id, int n, poly e)
Definition: maps_ip.cc:373
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN jjSUBST_Test(leftv v, leftv w, int &ringvar, poly &monomexpr)
Definition: iparith.cc:6144
static long pTotaldegree(poly p)
Definition: polys.h:264
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idSubstPoly(ideal id, int n, poly e)
Definition: maps_ip.cc:406
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85
#define Warn
Definition: emacs.cc:80

◆ jjSUBST_Id_I()

static BOOLEAN jjSUBST_Id_I ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6242 of file iparith.cc.

6243 {
6244  return jjSUBST_Id_X(res,u,v,w,INT_CMD);
6245 }
Definition: tok.h:95
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6250

◆ jjSUBST_Id_N()

static BOOLEAN jjSUBST_Id_N ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6246 of file iparith.cc.

6247 {
6248  return jjSUBST_Id_X(res,u,v,w,NUMBER_CMD);
6249 }
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6250

◆ jjSUBST_Id_X()

static BOOLEAN jjSUBST_Id_X ( leftv  res,
leftv  u,
leftv  v,
leftv  w,
int  input_type 
)
static

Definition at line 6250 of file iparith.cc.

6251 {
6252  sleftv tmp;
6253  memset(&tmp,0,sizeof(tmp));
6254  // do not check the result, conversion from int/number to poly works always
6255  iiConvert(input_type,POLY_CMD,iiTestConvert(input_type,POLY_CMD),w,&tmp);
6256  BOOLEAN b=jjSUBST_Id(res,u,v,&tmp);
6257  tmp.CleanUp();
6258  return b;
6259 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6198
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ jjSUBST_M()

static BOOLEAN jjSUBST_M ( leftv  res,
leftv  u 
)
static

Definition at line 7685 of file iparith.cc.

7686 {
7687  leftv v = u->next; // number of args > 0
7688  if (v==NULL) return TRUE;
7689  leftv w = v->next;
7690  if (w==NULL) return TRUE;
7691  leftv rest = w->next;;
7692 
7693  u->next = NULL;
7694  v->next = NULL;
7695  w->next = NULL;
7696  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
7697  if ((rest!=NULL) && (!b))
7698  {
7699  sleftv tmp_res;
7700  leftv tmp_next=res->next;
7701  res->next=rest;
7702  memset(&tmp_res,0,sizeof(tmp_res));
7703  b = iiExprArithM(&tmp_res,res,iiOp);
7704  memcpy(res,&tmp_res,sizeof(tmp_res));
7705  res->next=tmp_next;
7706  }
7707  u->next = v;
7708  v->next = w;
7709  // rest was w->next, but is already cleaned
7710  return b;
7711 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8430
#define TRUE
Definition: auxiliary.h:98
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8520
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int iiOp
Definition: iparith.cc:224
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213

◆ jjSUBST_P()

static BOOLEAN jjSUBST_P ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 6172 of file iparith.cc.

6173 {
6174  int ringvar;
6175  poly monomexpr;
6176  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6177  if (nok) return TRUE;
6178  poly p=(poly)u->Data();
6179  if (ringvar>0)
6180  {
6181  if ((monomexpr!=NULL) && (p!=NULL) && (pTotaldegree(p)!=0) &&
6182  ((unsigned long)pTotaldegree(monomexpr) > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6183  {
6184  Warn("possible OVERFLOW in subst, max exponent is %ld, substituting deg %d by deg %d",currRing->bitmask/2, pTotaldegree(monomexpr), pTotaldegree(p));
6185  //return TRUE;
6186  }
6187  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6188  res->data = pSubst((poly)u->CopyD(res->rtyp),ringvar,monomexpr);
6189  else
6190  res->data= pSubstPoly(p,ringvar,monomexpr);
6191  }
6192  else
6193  {
6194  res->data=pSubstPar(p,-ringvar,monomexpr);
6195  }
6196  return FALSE;
6197 }
#define pSubst(p, n, e)
Definition: polys.h:348
poly pSubstPoly(poly p, int var, poly image)
Definition: maps_ip.cc:390
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN jjSUBST_Test(leftv v, leftv w, int &ringvar, poly &monomexpr)
Definition: iparith.cc:6144
static long pTotaldegree(poly p)
Definition: polys.h:264
poly pSubstPar(poly p, int par, poly image)
Definition: maps_ip.cc:253
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85
void * CopyD(int t)
Definition: subexpr.cc:707
#define Warn
Definition: emacs.cc:80

◆ jjSUBST_Test()

static BOOLEAN jjSUBST_Test ( leftv  v,
leftv  w,
int &  ringvar,
poly monomexpr 
)
static

Definition at line 6144 of file iparith.cc.

6146 {
6147  monomexpr=(poly)w->Data();
6148  poly p=(poly)v->Data();
6149 #if 0
6150  if (pLength(monomexpr)>1)
6151  {
6152  Werror("`%s` substitutes a ringvar only by a term",
6154  return TRUE;
6155  }
6156 #endif
6157  if ((ringvar=pVar(p))==0)
6158  {
6159  if ((p!=NULL) && (currRing->cf->extRing!=NULL))
6160  {
6161  number n = pGetCoeff(p);
6162  ringvar= -n_IsParam(n, currRing);
6163  }
6164  if(ringvar==0)
6165  {
6166  WerrorS("ringvar/par expected");
6167  return TRUE;
6168  }
6169  }
6170  return FALSE;
6171 }
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
Definition: tok.h:182
static unsigned pLength(poly a)
Definition: p_polys.h:189
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
int n_IsParam(const number m, const ring r)
TODO: rewrite somehow...
Definition: ring.cc:5608
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjSYZYGY()

static BOOLEAN jjSYZYGY ( leftv  res,
leftv  v 
)
static

Definition at line 4893 of file iparith.cc.

4894 {
4895  intvec *w=NULL;
4896  res->data = (char *)idSyzygies((ideal)v->Data(),testHomog,&w);
4897  if (w!=NULL) delete w;
4899  return FALSE;
4900 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define TEST_OPT_RETURN_SB
Definition: options.h:107
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
Definition: ideals.cc:515

◆ jjTEST()

static BOOLEAN jjTEST ( leftv  ,
leftv  v 
)
static

Definition at line 7503 of file iparith.cc.

7504 {
7505  do
7506  {
7507  if (v->Typ()!=INT_CMD)
7508  return TRUE;
7509  test_cmd((int)(long)v->Data());
7510  v=v->next;
7511  }
7512  while (v!=NULL);
7513  return FALSE;
7514 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
leftv next
Definition: subexpr.h:87
void test_cmd(int i)
Definition: ipshell.cc:506
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_BI()

static BOOLEAN jjTIMES_BI ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 926 of file iparith.cc.

927 {
928  res->data = (char *)(n_Mult( (number)u->Data(), (number)v->Data(),coeffs_BIGINT));
929  if ((v->next!=NULL) || (u->next!=NULL))
930  return jjOP_REST(res,u,v);
931  return FALSE;
932 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:640
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_BIM()

static BOOLEAN jjTIMES_BIM ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1010 of file iparith.cc.

1011 {
1012  res->data = (char *)bimMult((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
1013  if (res->data==NULL)
1014  {
1015  WerrorS("bigintmat/cmatrix not compatible");
1016  return TRUE;
1017  }
1018  if ((v->next!=NULL) || (u->next!=NULL))
1019  return jjOP_REST(res,u,v);
1020  return FALSE;
1021 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:256
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_I()

static BOOLEAN jjTIMES_I ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 914 of file iparith.cc.

915 {
916  int a=(int)(long)u->Data();
917  int b=(int)(long)v->Data();
918  int64 c=(int64)a * (int64)b;
919  if ((c>INT_MAX)||(c<INT_MIN))
920  WarnS("int overflow(*), result may be wrong");
921  res->data = (char *)((long)((int)c));
922  if ((u->Next()!=NULL) || (v->Next()!=NULL))
923  return jjOP_REST(res,u,v);
924  return FALSE;
925 }
const poly a
Definition: syzextra.cc:212
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
long int64
Definition: auxiliary.h:66
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:89
leftv Next()
Definition: subexpr.h:137
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
const poly b
Definition: syzextra.cc:213

◆ jjTIMES_ID()

static BOOLEAN jjTIMES_ID ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 990 of file iparith.cc.

991 {
992  res->data = (char *)idMult((ideal)u->Data(),(ideal)v->Data());
993  id_Normalize((ideal)res->data,currRing);
994  if ((v->next!=NULL) || (u->next!=NULL))
995  return jjOP_REST(res,u,v);
996  return FALSE;
997 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
leftv next
Definition: subexpr.h:87
ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition: ideals.h:84
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_IV()

static BOOLEAN jjTIMES_IV ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 998 of file iparith.cc.

999 {
1000  res->data = (char *)ivMult((intvec*)(u->Data()), (intvec*)(v->Data()));
1001  if (res->data==NULL)
1002  {
1003  WerrorS("intmat size not compatible");
1004  return TRUE;
1005  }
1006  if ((v->next!=NULL) || (u->next!=NULL))
1007  return jjOP_REST(res,u,v);
1008  return FALSE;
1009 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
leftv next
Definition: subexpr.h:87
intvec * ivMult(intvec *a, intvec *b)
Definition: intvec.cc:332
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_MA()

static BOOLEAN jjTIMES_MA ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1078 of file iparith.cc.

1079 {
1080  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
1081  res->data = (char *)mp_Mult(A,B,currRing);
1082  if (res->data==NULL)
1083  {
1084  Werror("matrix size not compatible(%dx%d, %dx%d) in *",
1085  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
1086  return TRUE;
1087  }
1088  id_Normalize((ideal)res->data,currRing);
1089  if ((v->next!=NULL) || (u->next!=NULL))
1090  return jjOP_REST(res,u,v);
1091  return FALSE;
1092 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define A
Definition: sirandom.c:23
ip_smatrix * matrix
leftv next
Definition: subexpr.h:87
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition: matpol.cc:223
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
b *CanonicalForm B
Definition: facBivar.cc:51
void * Data()
Definition: subexpr.cc:1137
#define MATROWS(i)
Definition: matpol.h:27
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjTIMES_MA_BI1()

static BOOLEAN jjTIMES_MA_BI1 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1022 of file iparith.cc.

1023 {
1025  if (nMap==NULL) return TRUE;
1026  number n=nMap((number)v->Data(),coeffs_BIGINT,currRing->cf);
1027  poly p=pNSet(n);
1028  ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1029  res->data = (char *)I;
1030  return FALSE;
1031 }
#define pNSet(n)
Definition: polys.h:295
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
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:725
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix &#39;a&#39; by a poly &#39;p&#39;, destroy the args
Definition: matpol.cc:158
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjTIMES_MA_BI2()

static BOOLEAN jjTIMES_MA_BI2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1032 of file iparith.cc.

1033 {
1034  return jjTIMES_MA_BI1(res,v,u);
1035 }
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1022

◆ jjTIMES_MA_I1()

static BOOLEAN jjTIMES_MA_I1 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1068 of file iparith.cc.

1069 {
1070  res->data = (char *)mp_MultI((matrix)u->CopyD(MATRIX_CMD),(int)(long)v->Data(),currRing);
1071  id_Normalize((ideal)res->data,currRing);
1072  return FALSE;
1073 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
matrix mp_MultI(matrix a, int f, const ring R)
c = f*a
Definition: matpol.cc:145
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjTIMES_MA_I2()

static BOOLEAN jjTIMES_MA_I2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1074 of file iparith.cc.

1075 {
1076  return jjTIMES_MA_I1(res,v,u);
1077 }
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1068

◆ jjTIMES_MA_N1()

static BOOLEAN jjTIMES_MA_N1 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1056 of file iparith.cc.

1057 {
1058  number n=(number)v->CopyD(NUMBER_CMD);
1059  poly p=pNSet(n);
1060  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1061  id_Normalize((ideal)res->data,currRing);
1062  return FALSE;
1063 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pNSet(n)
Definition: polys.h:295
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix &#39;a&#39; by a poly &#39;p&#39;, destroy the args
Definition: matpol.cc:158
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjTIMES_MA_N2()

static BOOLEAN jjTIMES_MA_N2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1064 of file iparith.cc.

1065 {
1066  return jjTIMES_MA_N1(res,v,u);
1067 }
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1056

◆ jjTIMES_MA_P1()

static BOOLEAN jjTIMES_MA_P1 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1036 of file iparith.cc.

1037 {
1038  poly p=(poly)v->CopyD(POLY_CMD);
1039  int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
1040  ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1041  if (r>0) I->rank=r;
1043  res->data = (char *)I;
1044  return FALSE;
1045 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix &#39;a&#39; by a poly &#39;p&#39;, destroy the args
Definition: matpol.cc:158
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
long rank
Definition: matpol.h:20

◆ jjTIMES_MA_P2()

static BOOLEAN jjTIMES_MA_P2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 1046 of file iparith.cc.

1047 {
1048  poly p=(poly)u->CopyD(POLY_CMD);
1049  int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
1050  ideal I= (ideal)pMultMp(p,(matrix)v->CopyD(MATRIX_CMD),currRing);
1051  if (r>0) I->rank=r;
1053  res->data = (char *)I;
1054  return FALSE;
1055 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
matrix pMultMp(poly p, matrix a, const ring R)
Definition: matpol.cc:175
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
long rank
Definition: matpol.h:20

◆ jjTIMES_N()

static BOOLEAN jjTIMES_N ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 933 of file iparith.cc.

934 {
935  res->data = (char *)(nMult( (number)u->Data(), (number)v->Data()));
936  number n=(number)res->data;
937  nNormalize(n);
938  res->data=(char *)n;
939  if ((v->next!=NULL) || (u->next!=NULL))
940  return jjOP_REST(res,u,v);
941  return FALSE;
942 }
#define nNormalize(n)
Definition: numbers.h:30
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define nMult(n1, n2)
Definition: numbers.h:17
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjTIMES_P()

static BOOLEAN jjTIMES_P ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 943 of file iparith.cc.

944 {
945  poly a;
946  poly b;
947  if (v->next==NULL)
948  {
949  a=(poly)u->CopyD(POLY_CMD); // works also for VECTOR_CMD
950  if (u->next==NULL)
951  {
952  b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
953  if ((a!=NULL) && (b!=NULL)
954  && ((long)pTotaldegree(a)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)-(long)pTotaldegree(b)))
955  {
956  Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
957  pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
958  }
959  res->data = (char *)(pMult( a, b));
960  pNormalize((poly)res->data);
961  return FALSE;
962  }
963  // u->next exists: copy v
964  b=pCopy((poly)v->Data());
965  if ((a!=NULL) && (b!=NULL)
966  && (pTotaldegree(a)+pTotaldegree(b)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)))
967  {
968  Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
969  pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
970  }
971  res->data = (char *)(pMult( a, b));
972  pNormalize((poly)res->data);
973  return jjOP_REST(res,u,v);
974  }
975  // v->next exists: copy u
976  a=pCopy((poly)u->Data());
977  b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
978  if ((a!=NULL) && (b!=NULL)
979  && ((unsigned long)(pTotaldegree(a)+pTotaldegree(b))>=currRing->bitmask/2))
980  {
981  pDelete(&a);
982  pDelete(&b);
983  WerrorS("OVERFLOW");
984  return TRUE;
985  }
986  res->data = (char *)(pMult( a, b));
987  pNormalize((poly)res->data);
988  return jjOP_REST(res,u,v);
989 }
const poly a
Definition: syzextra.cc:212
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:513
#define FALSE
Definition: auxiliary.h:94
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static long pTotaldegree(poly p)
Definition: polys.h:264
pNormalize(P.p)
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
#define pMult(p, q)
Definition: polys.h:190
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:707
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define Warn
Definition: emacs.cc:80

◆ jjTRACE_IV()

static BOOLEAN jjTRACE_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4931 of file iparith.cc.

4932 {
4933  res->data = (char *)(long)ivTrace((intvec*)(v->Data()));
4934  return FALSE;
4935 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137
int ivTrace(intvec *o)
Definition: intvec.cc:322

◆ jjTRANSP_BIM()

static BOOLEAN jjTRANSP_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 4936 of file iparith.cc.

4937 {
4938  res->data = (char *)(((bigintmat*)(v->Data()))->transpose());
4939  return FALSE;
4940 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjTRANSP_IV()

static BOOLEAN jjTRANSP_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4941 of file iparith.cc.

4942 {
4943  res->data = (char *)ivTranp((intvec*)(v->Data()));
4944  return FALSE;
4945 }
#define FALSE
Definition: auxiliary.h:94
intvec * ivTranp(intvec *o)
Definition: intvec.cc:310
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjTWOSTD()

static BOOLEAN jjTWOSTD ( leftv  res,
leftv  a 
)
static

Definition at line 4973 of file iparith.cc.

4974 {
4975  if (rIsPluralRing(currRing)) res->data=(ideal)twostd((ideal)a->Data());
4976  else res->data=(ideal)a->CopyD();
4977  setFlag(res,FLAG_STD);
4978  setFlag(res,FLAG_TWOSTD);
4979  return FALSE;
4980 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define FLAG_TWOSTD
Definition: ipid.h:107
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707
ideal twostd(ideal I)
Compute two-sided GB:
Definition: nc.cc:21

◆ jjTYPEOF()

static BOOLEAN jjTYPEOF ( leftv  res,
leftv  v 
)
static

Definition at line 4983 of file iparith.cc.

4984 {
4985  int t=(int)(long)v->data;
4986  switch (t)
4987  {
4988  case CRING_CMD:
4989  case INT_CMD:
4990  case POLY_CMD:
4991  case VECTOR_CMD:
4992  case STRING_CMD:
4993  case INTVEC_CMD:
4994  case IDEAL_CMD:
4995  case MATRIX_CMD:
4996  case MODUL_CMD:
4997  case MAP_CMD:
4998  case PROC_CMD:
4999  case RING_CMD:
5000  //case QRING_CMD:
5001  case INTMAT_CMD:
5002  case BIGINTMAT_CMD:
5003  case NUMBER_CMD:
5004  #ifdef SINGULAR_4_2
5005  case CNUMBER_CMD:
5006  #endif
5007  case BIGINT_CMD:
5008  case LIST_CMD:
5009  case PACKAGE_CMD:
5010  case LINK_CMD:
5011  case RESOLUTION_CMD:
5012  res->data=omStrDup(Tok2Cmdname(t)); break;
5013  case DEF_CMD:
5014  case NONE: res->data=omStrDup("none"); break;
5015  default:
5016  {
5017  if (t>MAX_TOK)
5018  res->data=omStrDup(getBlackboxName(t));
5019  else
5020  res->data=omStrDup("?unknown type?");
5021  break;
5022  }
5023  }
5024  return FALSE;
5025 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
Definition: tok.h:213
void * data
Definition: subexpr.h:89
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8750
Definition: tok.h:56
Definition: tok.h:58
Definition: tok.h:116
Definition: tok.h:117
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition: blackbox.cc:185
#define NONE
Definition: tok.h:216
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjUMINUS_BI()

static BOOLEAN jjUMINUS_BI ( leftv  res,
leftv  u 
)
static

Definition at line 3513 of file iparith.cc.

3514 {
3515  number n=(number)u->CopyD(BIGINT_CMD);
3516  n=n_InpNeg(n,coeffs_BIGINT);
3517  res->data = (char *)n;
3518  return FALSE;
3519 }
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:89
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:561
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_BIM()

static BOOLEAN jjUMINUS_BIM ( leftv  res,
leftv  u 
)
static

Definition at line 3550 of file iparith.cc.

3551 {
3552  bigintmat *bim=(bigintmat *)u->CopyD(BIGINTMAT_CMD);
3553  (*bim)*=(-1);
3554  res->data = (char *)bim;
3555  return FALSE;
3556 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:89
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_I()

static BOOLEAN jjUMINUS_I ( leftv  res,
leftv  u 
)
static

Definition at line 3520 of file iparith.cc.

3521 {
3522  res->data = (char *)(-(long)u->Data());
3523  return FALSE;
3524 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137

◆ jjUMINUS_IV()

static BOOLEAN jjUMINUS_IV ( leftv  res,
leftv  u 
)
static

Definition at line 3543 of file iparith.cc.

3544 {
3545  intvec *iv=(intvec *)u->CopyD(INTVEC_CMD);
3546  (*iv)*=(-1);
3547  res->data = (char *)iv;
3548  return FALSE;
3549 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_MA()

static BOOLEAN jjUMINUS_MA ( leftv  res,
leftv  u 
)
static

Definition at line 3537 of file iparith.cc.

3538 {
3539  poly m1=pISet(-1);
3540  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),m1,currRing);
3541  return FALSE;
3542 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix &#39;a&#39; by a poly &#39;p&#39;, destroy the args
Definition: matpol.cc:158
polyrec * poly
Definition: hilb.h:10
#define pISet(i)
Definition: polys.h:294
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_N()

static BOOLEAN jjUMINUS_N ( leftv  res,
leftv  u 
)
static

Definition at line 3525 of file iparith.cc.

3526 {
3527  number n=(number)u->CopyD(NUMBER_CMD);
3528  n=nInpNeg(n);
3529  res->data = (char *)n;
3530  return FALSE;
3531 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
#define nInpNeg(n)
Definition: numbers.h:21
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_P()

static BOOLEAN jjUMINUS_P ( leftv  res,
leftv  u 
)
static

Definition at line 3532 of file iparith.cc.

3533 {
3534  res->data = (char *)pNeg((poly)u->CopyD(POLY_CMD));
3535  return FALSE;
3536 }
#define FALSE
Definition: auxiliary.h:94
#define pNeg(p)
Definition: polys.h:181
void * data
Definition: subexpr.h:89
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUNIQLIST()

BOOLEAN jjUNIQLIST ( leftv  ,
leftv  arg 
)

Definition at line 9304 of file iparith.cc.

9305 {
9306  lists l=(lists)arg->Data();
9307  if (l->nr>0)
9308  {
9309  qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
9310  int i, j, len;
9311  len=l->nr;
9312  i=0;
9313  while(i<len)
9314  {
9315  if(jjCOMPARE_ALL(&(l->m[i]),&(l->m[i+1]))==0)
9316  {
9317  l->m[i].CleanUp();
9318  for(j=i; j<len;j++) l->m[j]=l->m[j+1];
9319  memset(&(l->m[len]),0,sizeof(sleftv));
9320  l->m[len].rtyp=DEF_CMD;
9321  len--;
9322  }
9323  else
9324  i++;
9325  }
9326  //Print("new len:%d\n",len);
9327  }
9328  return FALSE;
9329 }
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
static int jjCOMPARE_ALL(const void *aa, const void *bb)
Definition: iparith.cc:9254
int j
Definition: myNF.cc:70
Definition: tok.h:58
int i
Definition: cfEzgcd.cc:123
int nr
Definition: lists.h:43
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
int l
Definition: cfEzgcd.cc:94

◆ jjUNIVARIATE()

static BOOLEAN jjUNIVARIATE ( leftv  res,
leftv  v 
)
static

Definition at line 5026 of file iparith.cc.

5027 {
5028  res->data=(char *)(long)pIsUnivariate((poly)v->Data());
5029  return FALSE;
5030 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
void * Data()
Definition: subexpr.cc:1137
#define pIsUnivariate(p)
Definition: polys.h:232
polyrec * poly
Definition: hilb.h:10

◆ jjVAR1()

static BOOLEAN jjVAR1 ( leftv  res,
leftv  v 
)
static

Definition at line 5031 of file iparith.cc.

5032 {
5033  int i=(int)(long)v->Data();
5034  if ((0<i) && (i<=currRing->N))
5035  {
5036  poly p=pOne();
5037  pSetExp(p,i,1);
5038  pSetm(p);
5039  res->data=(char *)p;
5040  }
5041  else
5042  {
5043  Werror("var number %d out of range 1..%d",i,currRing->N);
5044  return TRUE;
5045  }
5046  return FALSE;
5047 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:297
void * Data()
Definition: subexpr.cc:1137
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjVARSTR1()

static BOOLEAN jjVARSTR1 ( leftv  res,
leftv  v 
)
static

Definition at line 5048 of file iparith.cc.

5049 {
5050  if (currRing==NULL)
5051  {
5052  WerrorS("no ring active");
5053  return TRUE;
5054  }
5055  int i=(int)(long)v->Data();
5056  if ((0<i) && (i<=currRing->N))
5057  res->data=omStrDup(currRing->names[i-1]);
5058  else
5059  {
5060  Werror("var number %d out of range 1..%d",i,currRing->N);
5061  return TRUE;
5062  }
5063  return FALSE;
5064 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjVARSTR2()

static BOOLEAN jjVARSTR2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3381 of file iparith.cc.

3382 {
3383  idhdl h=(idhdl)u->data;
3384  int i=(int)(long)v->Data();
3385  if ((0<i) && (i<=IDRING(h)->N))
3386  res->data=omStrDup(IDRING(h)->names[i-1]);
3387  else
3388  {
3389  Werror("var number %d out of range 1..%d",i,IDRING(h)->N);
3390  return TRUE;
3391  }
3392  return FALSE;
3393 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
void * data
Definition: subexpr.h:89
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
idrec * idhdl
Definition: ring.h:18
int i
Definition: cfEzgcd.cc:123
#define IDRING(a)
Definition: ipid.h:124
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjVDIM()

static BOOLEAN jjVDIM ( leftv  res,
leftv  v 
)
static

Definition at line 5065 of file iparith.cc.

5066 {
5067  assumeStdFlag(v);
5068  res->data = (char *)(long)scMult0Int((ideal)v->Data(),currRing->qideal);
5069  return FALSE;
5070 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int scMult0Int(ideal S, ideal Q, const ring tailRing)
Definition: hdegree.cc:919
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * Data()
Definition: subexpr.cc:1137

◆ jjWAIT1ST1()

BOOLEAN jjWAIT1ST1 ( leftv  res,
leftv  u 
)

Definition at line 5071 of file iparith.cc.

5072 {
5073 // input: u: a list with links of type
5074 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5075 // returns: -1: the read state of all links is eof
5076 // i>0: (at least) u[i] is ready
5077  lists Lforks = (lists)u->Data();
5078  int i = slStatusSsiL(Lforks, -1);
5079  if(i == -2) /* error */
5080  {
5081  return TRUE;
5082  }
5083  res->data = (void*)(long)i;
5084  return FALSE;
5085 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137

◆ jjWAIT1ST2()

static BOOLEAN jjWAIT1ST2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3394 of file iparith.cc.

3395 {
3396 // input: u: a list with links of type
3397 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3398 // v: timeout for select in milliseconds
3399 // or 0 for polling
3400 // returns: ERROR (via Werror): timeout negative
3401 // -1: the read state of all links is eof
3402 // 0: timeout (or polling): none ready
3403 // i>0: (at least) L[i] is ready
3404  lists Lforks = (lists)u->Data();
3405  int t = (int)(long)v->Data();
3406  if(t < 0)
3407  {
3408  WerrorS("negative timeout"); return TRUE;
3409  }
3410  int i = slStatusSsiL(Lforks, t*1000);
3411  if(i == -2) /* error */
3412  {
3413  return TRUE;
3414  }
3415  res->data = (void*)(long)i;
3416  return FALSE;
3417 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137

◆ jjWAITALL1()

BOOLEAN jjWAITALL1 ( leftv  res,
leftv  u 
)

Definition at line 5086 of file iparith.cc.

5087 {
5088 // input: u: a list with links of type
5089 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5090 // returns: -1: the read state of all links is eof
5091 // 1: all links are ready
5092 // (caution: at least one is ready, but some maybe dead)
5093  lists Lforks = (lists)u->CopyD();
5094  int i;
5095  int j = -1;
5096  for(int nfinished = 0; nfinished < Lforks->nr+1; nfinished++)
5097  {
5098  i = slStatusSsiL(Lforks, -1);
5099  if(i == -2) /* error */
5100  {
5101  return TRUE;
5102  }
5103  if(i == -1)
5104  {
5105  break;
5106  }
5107  j = 1;
5108  Lforks->m[i-1].CleanUp();
5109  Lforks->m[i-1].rtyp=DEF_CMD;
5110  Lforks->m[i-1].data=NULL;
5111  }
5112  res->data = (void*)(long)j;
5113  Lforks->Clean();
5114  return FALSE;
5115 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:89
int j
Definition: myNF.cc:70
Definition: tok.h:58
int i
Definition: cfEzgcd.cc:123
int nr
Definition: lists.h:43
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void Clean(ring r=currRing)
Definition: lists.h:25
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjWAITALL2()

static BOOLEAN jjWAITALL2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3418 of file iparith.cc.

3419 {
3420 // input: u: a list with links of type
3421 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3422 // v: timeout for select in milliseconds
3423 // or 0 for polling
3424 // returns: ERROR (via Werror): timeout negative
3425 // -1: the read state of all links is eof
3426 // 0: timeout (or polling): none ready
3427 // 1: all links are ready
3428 // (caution: at least one is ready, but some maybe dead)
3429  lists Lforks = (lists)u->CopyD();
3430  int timeout = 1000*(int)(long)v->Data();
3431  if(timeout < 0)
3432  {
3433  WerrorS("negative timeout"); return TRUE;
3434  }
3435  int t = getRTimer()/TIMER_RESOLUTION; // in seconds
3436  int i;
3437  int ret = -1;
3438  for(unsigned nfinished = 0; nfinished < ((unsigned)Lforks->nr)+1; nfinished++)
3439  {
3440  i = slStatusSsiL(Lforks, timeout);
3441  if(i > 0) /* Lforks[i] is ready */
3442  {
3443  ret = 1;
3444  Lforks->m[i-1].CleanUp();
3445  Lforks->m[i-1].rtyp=DEF_CMD;
3446  Lforks->m[i-1].data=NULL;
3447  timeout = si_max(0,timeout - 1000*(getRTimer()/TIMER_RESOLUTION - t));
3448  }
3449  else /* terminate the for loop */
3450  {
3451  if(i == -2) /* error */
3452  {
3453  return TRUE;
3454  }
3455  if(i == 0) /* timeout */
3456  {
3457  ret = 0;
3458  }
3459  break;
3460  }
3461  }
3462  Lforks->Clean();
3463  res->data = (void*)(long)ret;
3464  return FALSE;
3465 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
int getRTimer()
Definition: timer.cc:172
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:89
#define TIMER_RESOLUTION
Definition: mod2.h:32
Definition: tok.h:58
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
int i
Definition: cfEzgcd.cc:123
int nr
Definition: lists.h:43
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjWEDGE()

static BOOLEAN jjWEDGE ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 3466 of file iparith.cc.

3467 {
3468  res->data = (char *)mp_Wedge((matrix)u->Data(),(int)(long)v->Data(),currRing);
3469  return FALSE;
3470 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
matrix mp_Wedge(matrix a, int ar, const ring R)
Definition: matpol.cc:1663
void * Data()
Definition: subexpr.cc:1137

◆ jjWRONG()

static BOOLEAN jjWRONG ( leftv  ,
leftv   
)
static

Definition at line 3473 of file iparith.cc.

3474 {
3475  return TRUE;
3476 }
#define TRUE
Definition: auxiliary.h:98

◆ pHeadProc()

poly pHeadProc ( poly  p)

Definition at line 234 of file iparith.cc.

235 {
236  return pHead(p);
237 }
return P p
Definition: myNF.cc:203
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67

◆ rCompose()

ring rCompose ( const lists  L,
const BOOLEAN  check_comp = TRUE 
)

Definition at line 2725 of file ipshell.cc.

2726 {
2727  if ((L->nr!=3)
2728 #ifdef HAVE_PLURAL
2729  &&(L->nr!=5)
2730 #endif
2731  )
2732  return NULL;
2733  int is_gf_char=0;
2734  // 0: char/ cf - ring
2735  // 1: list (var)
2736  // 2: list (ord)
2737  // 3: qideal
2738  // possibly:
2739  // 4: C
2740  // 5: D
2741 
2742  ring R = (ring) omAlloc0Bin(sip_sring_bin);
2743 
2744  // ------------------------------------------------------------------
2745  // 0: char:
2746  if (L->m[0].Typ()==CRING_CMD)
2747  {
2748  R->cf=(coeffs)L->m[0].Data();
2749  R->cf->ref++;
2750  }
2751  else
2752  if (L->m[0].Typ()==INT_CMD)
2753  {
2754  int ch = (int)(long)L->m[0].Data();
2755  assume( ch >= 0 );
2756 
2757  if (ch == 0) // Q?
2758  R->cf = nInitChar(n_Q, NULL);
2759  else
2760  {
2761  int l = IsPrime(ch); // Zp?
2762  if( l != ch )
2763  {
2764  Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
2765  ch = l;
2766  }
2767  R->cf = nInitChar(n_Zp, (void*)(long)ch);
2768  }
2769  }
2770  else if (L->m[0].Typ()==LIST_CMD) // something complicated...
2771  {
2772  lists LL=(lists)L->m[0].Data();
2773 
2774 #ifdef HAVE_RINGS
2775  if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
2776  {
2777  rComposeRing(LL, R); // Ring!?
2778  }
2779  else
2780 #endif
2781  if (LL->nr < 3)
2782  rComposeC(LL,R); // R, long_R, long_C
2783  else
2784  {
2785  if (LL->m[0].Typ()==INT_CMD)
2786  {
2787  int ch = (int)(long)LL->m[0].Data();
2788  while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
2789  if (fftable[is_gf_char]==0) is_gf_char=-1;
2790 
2791  if(is_gf_char!= -1)
2792  {
2793  GFInfo param;
2794 
2795  param.GFChar = ch;
2796  param.GFDegree = 1;
2797  param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
2798 
2799  // nfInitChar should be able to handle the case when ch is in fftables!
2800  R->cf = nInitChar(n_GF, (void*)&param);
2801  }
2802  }
2803 
2804  if( R->cf == NULL )
2805  {
2806  ring extRing = rCompose((lists)L->m[0].Data(),FALSE);
2807 
2808  if (extRing==NULL)
2809  {
2810  WerrorS("could not create the specified coefficient field");
2811  goto rCompose_err;
2812  }
2813 
2814  if( extRing->qideal != NULL ) // Algebraic extension
2815  {
2816  AlgExtInfo extParam;
2817 
2818  extParam.r = extRing;
2819 
2820  R->cf = nInitChar(n_algExt, (void*)&extParam);
2821  }
2822  else // Transcendental extension
2823  {
2824  TransExtInfo extParam;
2825  extParam.r = extRing;
2826  assume( extRing->qideal == NULL );
2827 
2828  R->cf = nInitChar(n_transExt, &extParam);
2829  }
2830  }
2831  }
2832  }
2833  else
2834  {
2835  WerrorS("coefficient field must be described by `int` or `list`");
2836  goto rCompose_err;
2837  }
2838 
2839  if( R->cf == NULL )
2840  {
2841  WerrorS("could not create coefficient field described by the input!");
2842  goto rCompose_err;
2843  }
2844 
2845  // ------------------------- VARS ---------------------------
2846  if (rComposeVar(L,R)) goto rCompose_err;
2847  // ------------------------ ORDER ------------------------------
2848  if (rComposeOrder(L,check_comp,R)) goto rCompose_err;
2849 
2850  // ------------------------ ??????? --------------------
2851 
2852  rRenameVars(R);
2853  rComplete(R);
2854 
2855  // ------------------------ Q-IDEAL ------------------------
2856 
2857  if (L->m[3].Typ()==IDEAL_CMD)
2858  {
2859  ideal q=(ideal)L->m[3].Data();
2860  if (q->m[0]!=NULL)
2861  {
2862  if (R->cf != currRing->cf) //->cf->ch!=currRing->cf->ch)
2863  {
2864  #if 0
2865  WerrorS("coefficient fields must be equal if q-ideal !=0");
2866  goto rCompose_err;
2867  #else
2868  ring orig_ring=currRing;
2869  rChangeCurrRing(R);
2870  int *perm=NULL;
2871  int *par_perm=NULL;
2872  int par_perm_size=0;
2873  nMapFunc nMap;
2874 
2875  if ((nMap=nSetMap(orig_ring->cf))==NULL)
2876  {
2877  if (rEqual(orig_ring,currRing))
2878  {
2879  nMap=n_SetMap(currRing->cf, currRing->cf);
2880  }
2881  else
2882  // Allow imap/fetch to be make an exception only for:
2883  if ( (rField_is_Q_a(orig_ring) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2886  ||
2887  (rField_is_Zp_a(orig_ring) && // Zp(a..) -> Zp(a..) || Zp
2888  (rField_is_Zp(currRing, rInternalChar(orig_ring)) ||
2889  rField_is_Zp_a(currRing, rInternalChar(orig_ring)))) )
2890  {
2891  par_perm_size=rPar(orig_ring);
2892 
2893 // if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
2894 // naSetChar(rInternalChar(orig_ring),orig_ring);
2895 // else ntSetChar(rInternalChar(orig_ring),orig_ring);
2896 
2897  nSetChar(currRing->cf);
2898  }
2899  else
2900  {
2901  WerrorS("coefficient fields must be equal if q-ideal !=0");
2902  goto rCompose_err;
2903  }
2904  }
2905  perm=(int *)omAlloc0((orig_ring->N+1)*sizeof(int));
2906  if (par_perm_size!=0)
2907  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2908  int i;
2909  #if 0
2910  // use imap:
2911  maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2912  currRing->names,currRing->N,currRing->parameter, currRing->P,
2913  perm,par_perm, currRing->ch);
2914  #else
2915  // use fetch
2916  if ((rPar(orig_ring)>0) && (rPar(currRing)==0))
2917  {
2918  for(i=si_min(rPar(orig_ring),rVar(currRing))-1;i>=0;i--) par_perm[i]=i+1;
2919  }
2920  else if (par_perm_size!=0)
2921  for(i=si_min(rPar(orig_ring),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2922  for(i=si_min(orig_ring->N,rVar(currRing));i>0;i--) perm[i]=i;
2923  #endif
2924  ideal dest_id=idInit(IDELEMS(q),1);
2925  for(i=IDELEMS(q)-1; i>=0; i--)
2926  {
2927  dest_id->m[i]=p_PermPoly(q->m[i],perm,orig_ring, currRing,nMap,
2928  par_perm,par_perm_size);
2929  // PrintS("map:");pWrite(dest_id->m[i]);PrintLn();
2930  pTest(dest_id->m[i]);
2931  }
2932  R->qideal=dest_id;
2933  if (perm!=NULL)
2934  omFreeSize((ADDRESS)perm,(orig_ring->N+1)*sizeof(int));
2935  if (par_perm!=NULL)
2936  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2937  rChangeCurrRing(orig_ring);
2938  #endif
2939  }
2940  else
2941  R->qideal=idrCopyR(q,currRing,R);
2942  }
2943  }
2944  else
2945  {
2946  WerrorS("q-ideal must be given as `ideal`");
2947  goto rCompose_err;
2948  }
2949 
2950 
2951  // ---------------------------------------------------------------
2952  #ifdef HAVE_PLURAL
2953  if (L->nr==5)
2954  {
2955  if (nc_CallPlural((matrix)L->m[4].Data(),
2956  (matrix)L->m[5].Data(),
2957  NULL,NULL,
2958  R,
2959  true, // !!!
2960  true, false,
2961  currRing, FALSE)) goto rCompose_err;
2962  // takes care about non-comm. quotient! i.e. calls "nc_SetupQuotient" due to last true
2963  }
2964  #endif
2965  return R;
2966 
2967 rCompose_err:
2968  if (R->N>0)
2969  {
2970  int i;
2971  if (R->names!=NULL)
2972  {
2973  i=R->N-1;
2974  while (i>=0) { omfree(R->names[i]); i--; }
2975  omFree(R->names);
2976  }
2977  }
2978  omfree(R->order);
2979  omfree(R->block0);
2980  omfree(R->block1);
2981  omfree(R->wvhdl);
2982  omFree(R);
2983  return NULL;
2984 }
sleftv * m
Definition: lists.h:45
Definition: tok.h:95
ring r
Definition: algext.h:40
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:521
static BOOLEAN rComposeVar(const lists L, ring R)
Definition: ipshell.cc:2430
Definition: lists.h:22
ring rCompose(const lists L, const BOOLEAN check_comp)
Definition: ipshell.cc:2725
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
#define pTest(p)
Definition: polys.h:398
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition: coeffs.h:440
rational (GMP) numbers
Definition: coeffs.h:31
const char * GFPar_name
Definition: coeffs.h:96
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
{p < 2^31}
Definition: coeffs.h:30
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:531
void * ADDRESS
Definition: auxiliary.h:115
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:995
void rComposeC(lists L, ring R)
Definition: ipshell.cc:2225
Creation data needed for finite fields.
Definition: coeffs.h:92
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:56
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition: p_polys.cc:3977
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
Definition: ipshell.cc:2475
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3356
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:394
The main handler for Singular numbers which are suitable for Singular polynomials.
int GFDegree
Definition: coeffs.h:95
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define omfree(addr)
Definition: omAllocDecl.h:237
const ring R
Definition: DebugPrint.cc:36
ip_smatrix * matrix
omBin sip_sring_bin
Definition: ring.cc:54
const unsigned short fftable[]
Definition: ffields.cc:31
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
int IsPrime(int p)
Definition: prime.cc:61
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well
Definition: ring.cc:1627
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:725
static void rRenameVars(ring R)
Definition: ipshell.cc:2389
void rChangeCurrRing(ring r)
Definition: polys.cc:12
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
int GFChar
Definition: coeffs.h:94
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
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:2746
int nr
Definition: lists.h:43
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:169
void rComposeRing(lists L, ring R)
Definition: ipshell.cc:2296
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
{p^n < 2^16}
Definition: coeffs.h:33
struct for passing initialization parameters to naInitChar
Definition: algext.h:40
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
void * Data()
Definition: subexpr.cc:1137
#define nSetMap(R)
Definition: numbers.h:43
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
static int rInternalChar(const ring r)
Definition: ring.h:680
Definition: tok.h:117
int perm[100]
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:341
#define Warn
Definition: emacs.cc:80

◆ Tok2Cmdname()

const char* Tok2Cmdname ( int  tok)

Definition at line 8750 of file iparith.cc.

8751 {
8752  if (tok <= 0)
8753  {
8754  return sArithBase.sCmds[0].name;
8755  }
8756  if (tok==ANY_TYPE) return "any_type";
8757  if (tok==COMMAND) return "command";
8758  if (tok==NONE) return "nothing";
8759  //if (tok==IFBREAK) return "if_break";
8760  //if (tok==VECTOR_FROM_POLYS) return "vector_from_polys";
8761  //if (tok==ORDER_VECTOR) return "ordering";
8762  //if (tok==REF_VAR) return "ref";
8763  //if (tok==OBJECT) return "object";
8764  //if (tok==PRINT_EXPR) return "print_expr";
8765  if (tok==IDHDL) return "identifier";
8766  if (tok>MAX_TOK) return getBlackboxName(tok);
8767  unsigned i;
8768  for(i=0; i<sArithBase.nCmdUsed; i++)
8769  //while (sArithBase.sCmds[i].tokval!=0)
8770  {
8771  if ((sArithBase.sCmds[i].tokval == tok)&&
8772  (sArithBase.sCmds[i].alias==0))
8773  {
8774  return sArithBase.sCmds[i].name;
8775  }
8776  }
8777  // try gain for alias/old names:
8778  for(i=0; i<sArithBase.nCmdUsed; i++)
8779  {
8780  if (sArithBase.sCmds[i].tokval == tok)
8781  {
8782  return sArithBase.sCmds[i].name;
8783  }
8784  }
8785  return sArithBase.sCmds[0].name;
8786 }
#define ANY_TYPE
Definition: tok.h:30
Definition: tok.h:213
#define IDHDL
Definition: tok.h:31
int i
Definition: cfEzgcd.cc:123
unsigned nCmdUsed
number of commands used
Definition: iparith.cc:193
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:203
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition: blackbox.cc:185
#define NONE
Definition: tok.h:216
#define COMMAND
Definition: tok.h:29

◆ WerrorS_dummy()

static void WerrorS_dummy ( const char *  )
static

Definition at line 5177 of file iparith.cc.

5178 {
5180 }
static int WerrorS_dummy_cnt
Definition: iparith.cc:5176

Variable Documentation

◆ cmdtok

int cmdtok

Definition at line 174 of file grammar.cc.

◆ expected_parms

BOOLEAN expected_parms

Definition at line 173 of file grammar.cc.

◆ iiOp

int iiOp

Definition at line 224 of file iparith.cc.

◆ sArithBase

SArithBase sArithBase
static

Base entry for arithmetic.

Definition at line 203 of file iparith.cc.

◆ singclap_factorize_retry

int singclap_factorize_retry

Definition at line 3194 of file iparith.cc.

◆ WerrorS_dummy_cnt

int WerrorS_dummy_cnt =0
static

Definition at line 5176 of file iparith.cc.