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 jjSYZ_2 (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 jjSetRing (leftv, leftv u)
 
static BOOLEAN jjPROC1 (leftv res, leftv u)
 
static BOOLEAN jjBAREISS (leftv res, leftv v)
 
static BOOLEAN jjBAREISS_BIM (leftv res, leftv v)
 
static BOOLEAN jjBI2N (leftv res, leftv u)
 
static BOOLEAN jjBI2IM (leftv res, leftv u)
 
static BOOLEAN jjBI2P (leftv res, leftv u)
 
static BOOLEAN jjCALL1MANY (leftv res, leftv u)
 
static BOOLEAN jjCHAR (leftv res, leftv v)
 
static BOOLEAN 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)
 
static BOOLEAN jjLIFT_4 (leftv res, leftv U)
 
static BOOLEAN jjLIFTSTD_4 (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 7946 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 7948 of file iparith.cc.

◆ jjWRONG2

#define jjWRONG2   (proc2)jjWRONG

Definition at line 3483 of file iparith.cc.

◆ jjWRONG3

#define jjWRONG3   (proc3)jjWRONG

Definition at line 3484 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 7947 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 8900 of file iparith.cc.

8901 {
8902  cmdnames *pCmdL = (cmdnames*)a;
8903  cmdnames *pCmdR = (cmdnames*)b;
8904 
8905  if(a==NULL || b==NULL) return 0;
8906 
8907  /* empty entries goes to the end of the list for later reuse */
8908  if(pCmdL->name==NULL) return 1;
8909  if(pCmdR->name==NULL) return -1;
8910 
8911  /* $INVALID$ must come first */
8912  if(strcmp(pCmdL->name, "$INVALID$")==0) return -1;
8913  if(strcmp(pCmdR->name, "$INVALID$")==0) return 1;
8914 
8915  /* tokval=-1 are reserved names at the end */
8916  if (pCmdL->tokval==-1)
8917  {
8918  if (pCmdR->tokval==-1)
8919  return strcmp(pCmdL->name, pCmdR->name);
8920  /* pCmdL->tokval==-1, pCmdL goes at the end */
8921  return 1;
8922  }
8923  /* pCmdR->tokval==-1, pCmdR goes at the end */
8924  if(pCmdR->tokval==-1) return -1;
8925 
8926  return strcmp(pCmdL->name, pCmdR->name);
8927 }
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 9126 of file iparith.cc.

9127 {
9128  #ifdef HAVE_PLURAL
9129  if (rIsPluralRing(currRing))
9130  {
9131  if ((p & PLURAL_MASK)==0 /*NO_PLURAL*/)
9132  {
9133  WerrorS("not implemented for non-commutative rings");
9134  return TRUE;
9135  }
9136  else if ((p & PLURAL_MASK)==2 /*, COMM_PLURAL */)
9137  {
9138  Warn("assume commutative subalgebra for cmd `%s`",Tok2Cmdname(op));
9139  return FALSE;
9140  }
9141  /* else, ALLOW_PLURAL */
9142  }
9143  #endif
9144 #ifdef HAVE_RINGS
9145  if (rField_is_Ring(currRing))
9146  {
9147  if ((p & RING_MASK)==0 /*NO_RING*/)
9148  {
9149  WerrorS("not implemented for rings with rings as coeffients");
9150  return TRUE;
9151  }
9152  /* else ALLOW_RING */
9153  else if (((p & ZERODIVISOR_MASK)==NO_ZERODIVISOR)
9154  &&(!rField_is_Domain(currRing)))
9155  {
9156  WerrorS("domain required as coeffients");
9157  return TRUE;
9158  }
9159  /* else ALLOW_ZERODIVISOR */
9160  else if(((p & WARN_RING)==WARN_RING)&&(myynest==0))
9161  {
9162  WarnS("considering the image in Q[...]");
9163  }
9164  }
9165 #endif
9166  return FALSE;
9167 }
#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:8851
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 9067 of file iparith.cc.

9074 {
9075  //printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
9076  // nTokval, nToktype, nPos);
9077  if(nPos>=0)
9078  {
9079  // no checks: we rely on a correct generated code in iparith.inc
9080  assume((unsigned)nPos < sArithBase.nCmdAllocated);
9081  assume(szName!=NULL);
9082  sArithBase.sCmds[nPos].name = omStrDup(szName);
9083  sArithBase.sCmds[nPos].alias = nAlias;
9084  sArithBase.sCmds[nPos].tokval = nTokval;
9085  sArithBase.sCmds[nPos].toktype = nToktype;
9086  sArithBase.nCmdUsed++;
9087  //if(nTokval>0) sArithBase.nLastIdentifier++;
9088  }
9089  else
9090  {
9091  if(szName==NULL) return -1;
9092  int nIndex = iiArithFindCmd(szName);
9093  if(nIndex>=0)
9094  {
9095  Print("'%s' already exists at %d\n", szName, nIndex);
9096  return -1;
9097  }
9098 
9100  {
9101  /* needs to create new slots */
9102  unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
9103  sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
9104  if(sArithBase.sCmds==NULL) return -1;
9106  }
9107  /* still free slots available */
9108  sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
9109  sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
9110  sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
9111  sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
9112  sArithBase.nCmdUsed++;
9113 
9114  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9115  (&_gentable_sort_cmds));
9118  {
9119  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9120  }
9121  //Print("L=%d\n", sArithBase.nLastIdentifier);
9122  }
9123  return 0;
9124 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8900
#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:8972
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 8972 of file iparith.cc.

8973 {
8974  int an=0;
8975  int i = 0,v = 0;
8976  int en=sArithBase.nLastIdentifier;
8977 
8978  loop
8979  //for(an=0; an<sArithBase.nCmdUsed; )
8980  {
8981  if(an>=en-1)
8982  {
8983  if (strcmp(szName, sArithBase.sCmds[an].name) == 0)
8984  {
8985  //Print("RET-an=%d %s\n", an, sArithBase.sCmds[an].name);
8986  return an;
8987  }
8988  else if (strcmp(szName, sArithBase.sCmds[en].name) == 0)
8989  {
8990  //Print("RET-en=%d %s\n", en, sArithBase.sCmds[en].name);
8991  return en;
8992  }
8993  else
8994  {
8995  //Print("RET- 1\n");
8996  return -1;
8997  }
8998  }
8999  i=(an+en)/2;
9000  if (*szName < *(sArithBase.sCmds[i].name))
9001  {
9002  en=i-1;
9003  }
9004  else if (*szName > *(sArithBase.sCmds[i].name))
9005  {
9006  an=i+1;
9007  }
9008  else
9009  {
9010  v=strcmp(szName,sArithBase.sCmds[i].name);
9011  if(v<0)
9012  {
9013  en=i-1;
9014  }
9015  else if(v>0)
9016  {
9017  an=i+1;
9018  }
9019  else /*v==0*/
9020  {
9021  //Print("RET-i=%d %s\n", i, sArithBase.sCmds[i].name);
9022  return i;
9023  }
9024  }
9025  }
9026  //if(i>=0 && i<sArithBase.nCmdUsed)
9027  // return i;
9028  //PrintS("RET-2\n");
9029  return -2;
9030 }
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 9032 of file iparith.cc.

9033 {
9034  if(nPos<0) return NULL;
9035  if(nPos<(int)sArithBase.nCmdUsed)
9036  return sArithBase.sCmds[nPos].name;
9037  return NULL;
9038 }
#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 9040 of file iparith.cc.

9041 {
9042  int nIndex;
9043  if(szName==NULL) return -1;
9044 
9045  nIndex = iiArithFindCmd(szName);
9046  if(nIndex<0 || nIndex>=(int)sArithBase.nCmdUsed)
9047  {
9048  Print("'%s' not found (%d)\n", szName, nIndex);
9049  return -1;
9050  }
9051  omFree(sArithBase.sCmds[nIndex].name);
9052  sArithBase.sCmds[nIndex].name=NULL;
9053  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9054  (&_gentable_sort_cmds));
9055  sArithBase.nCmdUsed--;
9056 
9057  /* fix last-identifier */
9060  {
9061  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9062  }
9063  //Print("L=%d\n", sArithBase.nLastIdentifier);
9064  return 0;
9065 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8900
#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:8972
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:188

◆ iiExprArith1()

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

Definition at line 8319 of file iparith.cc.

8320 {
8321  memset(res,0,sizeof(sleftv));
8322 
8323  if (!errorreported)
8324  {
8325 #ifdef SIQ
8326  if (siq>0)
8327  {
8328  //Print("siq:%d\n",siq);
8330  memcpy(&d->arg1,a,sizeof(sleftv));
8331  a->Init();
8332  d->op=op;
8333  d->argc=1;
8334  res->data=(char *)d;
8335  res->rtyp=COMMAND;
8336  return FALSE;
8337  }
8338 #endif
8339  int at=a->Typ();
8340  // handling bb-objects ----------------------------------------------------
8341  if(op>MAX_TOK) // explicit type conversion to bb
8342  {
8343  blackbox *bb=getBlackboxStuff(op);
8344  if (bb!=NULL)
8345  {
8346  res->rtyp=op;
8347  res->data=bb->blackbox_Init(bb);
8348  if(!bb->blackbox_Assign(res,a)) return FALSE;
8349  if (errorreported) return TRUE;
8350  }
8351  else return TRUE;
8352  }
8353  else if (at>MAX_TOK) // argument is of bb-type
8354  {
8355  blackbox *bb=getBlackboxStuff(at);
8356  if (bb!=NULL)
8357  {
8358  if(!bb->blackbox_Op1(op,res,a)) return FALSE;
8359  if (errorreported) return TRUE;
8360  // else: no op defined
8361  }
8362  else return TRUE;
8363  }
8364 
8365  iiOp=op;
8366  int i=iiTabIndex(dArithTab1,JJTAB1LEN,op);
8367  return iiExprArith1Tab(res,a,op, dArith1+i,at,dConvertTypes);
8368  }
8369  a->CleanUp();
8370  return TRUE;
8371 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1186
#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:107
int Typ()
Definition: subexpr.cc:995
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8828
void * data
Definition: subexpr.h:88
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:91
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:8189
#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 8189 of file iparith.cc.

8190 {
8191  memset(res,0,sizeof(sleftv));
8192  BOOLEAN call_failed=FALSE;
8193 
8194  if (!errorreported)
8195  {
8196  BOOLEAN failed=FALSE;
8197  iiOp=op;
8198  int i = 0;
8199  while (dA1[i].cmd==op)
8200  {
8201  if (at==dA1[i].arg)
8202  {
8203  if (currRing!=NULL)
8204  {
8205  if (check_valid(dA1[i].valid_for,op)) break;
8206  }
8207  else
8208  {
8209  if (RingDependend(dA1[i].res))
8210  {
8211  WerrorS("no ring active");
8212  break;
8213  }
8214  }
8215  if (traceit&TRACE_CALL)
8216  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
8217  res->rtyp=dA1[i].res;
8218  if ((call_failed=dA1[i].p(res,a)))
8219  {
8220  break;// leave loop, goto error handling
8221  }
8222  if (a->Next()!=NULL)
8223  {
8225  failed=iiExprArith1(res->next,a->next,op);
8226  }
8227  a->CleanUp();
8228  return failed;
8229  }
8230  i++;
8231  }
8232  // implicite type conversion --------------------------------------------
8233  if (dA1[i].cmd!=op)
8234  {
8236  i=0;
8237  //Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
8238  while (dA1[i].cmd==op)
8239  {
8240  int ai;
8241  //Print("test %s\n",Tok2Cmdname(dA1[i].arg));
8242  if ((dA1[i].valid_for & NO_CONVERSION)==0)
8243  {
8244  if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
8245  {
8246  if (currRing!=NULL)
8247  {
8248  if (check_valid(dA1[i].valid_for,op)) break;
8249  }
8250  else
8251  {
8252  if (RingDependend(dA1[i].res))
8253  {
8254  WerrorS("no ring active");
8255  break;
8256  }
8257  }
8258  if (traceit&TRACE_CALL)
8259  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
8260  res->rtyp=dA1[i].res;
8261  failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
8262  || (call_failed=dA1[i].p(res,an)));
8263  // everything done, clean up temp. variables
8264  if (failed)
8265  {
8266  // leave loop, goto error handling
8267  break;
8268  }
8269  else
8270  {
8271  if (an->Next() != NULL)
8272  {
8273  res->next = (leftv)omAllocBin(sleftv_bin);
8274  failed=iiExprArith1(res->next,an->next,op);
8275  }
8276  // everything ok, clean up and return
8277  an->CleanUp();
8279  return failed;
8280  }
8281  }
8282  }
8283  i++;
8284  }
8285  an->CleanUp();
8287  }
8288  // error handling
8289  if (!errorreported)
8290  {
8291  if ((at==0) && (a->Fullname()!=sNoName_fe))
8292  {
8293  Werror("`%s` is not defined",a->Fullname());
8294  }
8295  else
8296  {
8297  i=0;
8298  const char *s = iiTwoOps(op);
8299  Werror("%s(`%s`) failed"
8300  ,s,Tok2Cmdname(at));
8301  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8302  {
8303  while (dA1[i].cmd==op)
8304  {
8305  if ((dA1[i].res!=0)
8306  && (dA1[i].p!=jjWRONG))
8307  Werror("expected %s(`%s`)"
8308  ,s,Tok2Cmdname(dA1[i].arg));
8309  i++;
8310  }
8311  }
8312  }
8313  }
8314  res->rtyp = UNKNOWN;
8315  }
8316  a->CleanUp();
8317  return TRUE;
8318 }
#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:82
#define Print
Definition: emacs.cc:83
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8319
#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:125
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:9126
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
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:3485
leftv Next()
Definition: subexpr.h:136
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:86
#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:91
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 8130 of file iparith.cc.

8131 {
8132  memset(res,0,sizeof(sleftv));
8133 
8134  if (!errorreported)
8135  {
8136 #ifdef SIQ
8137  if (siq>0)
8138  {
8139  //Print("siq:%d\n",siq);
8141  memcpy(&d->arg1,a,sizeof(sleftv));
8142  a->Init();
8143  memcpy(&d->arg2,b,sizeof(sleftv));
8144  b->Init();
8145  d->argc=2;
8146  d->op=op;
8147  res->data=(char *)d;
8148  res->rtyp=COMMAND;
8149  return FALSE;
8150  }
8151 #endif
8152  int at=a->Typ();
8153  int bt=b->Typ();
8154  // handling bb-objects ----------------------------------------------------
8155  if (at>MAX_TOK)
8156  {
8157  blackbox *bb=getBlackboxStuff(at);
8158  if (bb!=NULL)
8159  {
8160  if (!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8161  if (errorreported) return TRUE;
8162  // else: no op defined
8163  }
8164  else return TRUE;
8165  }
8166  else if ((bt>MAX_TOK)&&(op!='('))
8167  {
8168  blackbox *bb=getBlackboxStuff(bt);
8169  if (bb!=NULL)
8170  {
8171  if(!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8172  if (errorreported) return TRUE;
8173  // else: no op defined
8174  }
8175  else return TRUE;
8176  }
8177  int i=iiTabIndex(dArithTab2,JJTAB2LEN,op);
8178  return iiExprArith2TabIntern(res,a,op,b,proccall,dArith2+i,at,bt,dConvertTypes);
8179  }
8180  a->CleanUp();
8181  b->CleanUp();
8182  return TRUE;
8183 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1186
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:57
const struct sValCmd2 dArith2[]
Definition: table.h:291
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:107
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:7957
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8828
void * data
Definition: subexpr.h:88
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:91
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 8117 of file iparith.cc.

8121 {
8122  leftv b=a->next;
8123  a->next=NULL;
8124  int bt=b->Typ();
8125  BOOLEAN bo=iiExprArith2TabIntern(res,a,op,b,TRUE,dA2,at,bt,dConvertTypes);
8126  a->next=b;
8127  a->CleanUp(); // to clean up the chain, content already done in iiExprArith2TabIntern
8128  return bo;
8129 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:7957
leftv next
Definition: subexpr.h:86
#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 7957 of file iparith.cc.

7962 {
7963  memset(res,0,sizeof(sleftv));
7964  BOOLEAN call_failed=FALSE;
7965 
7966  if (!errorreported)
7967  {
7968  int i=0;
7969  iiOp=op;
7970  while (dA2[i].cmd==op)
7971  {
7972  if ((at==dA2[i].arg1)
7973  && (bt==dA2[i].arg2))
7974  {
7975  res->rtyp=dA2[i].res;
7976  if (currRing!=NULL)
7977  {
7978  if (check_valid(dA2[i].valid_for,op)) break;
7979  }
7980  else
7981  {
7982  if (RingDependend(dA2[i].res))
7983  {
7984  WerrorS("no ring active");
7985  break;
7986  }
7987  }
7988  if (traceit&TRACE_CALL)
7989  Print("call %s(%s,%s)\n",iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt));
7990  if ((call_failed=dA2[i].p(res,a,b)))
7991  {
7992  break;// leave loop, goto error handling
7993  }
7994  a->CleanUp();
7995  b->CleanUp();
7996  //Print("op: %d,result typ:%d\n",op,res->rtyp);
7997  return FALSE;
7998  }
7999  i++;
8000  }
8001  // implicite type conversion ----------------------------------------------
8002  if (dA2[i].cmd!=op)
8003  {
8004  int ai,bi;
8007  BOOLEAN failed=FALSE;
8008  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
8009  //Print("op: %c, type: %s %s\n",op,Tok2Cmdname(at),Tok2Cmdname(bt));
8010  while (dA2[i].cmd==op)
8011  {
8012  //Print("test %s %s\n",Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8013  if ((dA2[i].valid_for & NO_CONVERSION)==0)
8014  {
8015  if ((ai=iiTestConvert(at,dA2[i].arg1,dConvertTypes))!=0)
8016  {
8017  if ((bi=iiTestConvert(bt,dA2[i].arg2,dConvertTypes))!=0)
8018  {
8019  res->rtyp=dA2[i].res;
8020  if (currRing!=NULL)
8021  {
8022  if (check_valid(dA2[i].valid_for,op)) break;
8023  }
8024  else
8025  {
8026  if (RingDependend(dA2[i].res))
8027  {
8028  WerrorS("no ring active");
8029  break;
8030  }
8031  }
8032  if (traceit&TRACE_CALL)
8033  Print("call %s(%s,%s)\n",iiTwoOps(op),
8034  Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8035  failed= ((iiConvert(at,dA2[i].arg1,ai,a,an))
8036  || (iiConvert(bt,dA2[i].arg2,bi,b,bn))
8037  || (call_failed=dA2[i].p(res,an,bn)));
8038  // everything done, clean up temp. variables
8039  if (failed)
8040  {
8041  // leave loop, goto error handling
8042  break;
8043  }
8044  else
8045  {
8046  // everything ok, clean up and return
8047  an->CleanUp();
8048  bn->CleanUp();
8051  return FALSE;
8052  }
8053  }
8054  }
8055  }
8056  i++;
8057  }
8058  an->CleanUp();
8059  bn->CleanUp();
8062  }
8063  // error handling ---------------------------------------------------
8064  const char *s=NULL;
8065  if (!errorreported)
8066  {
8067  if ((at==0) && (a->Fullname()!=sNoName_fe))
8068  {
8069  s=a->Fullname();
8070  }
8071  else if ((bt==0) && (b->Fullname()!=sNoName_fe))
8072  {
8073  s=b->Fullname();
8074  }
8075  if (s!=NULL)
8076  Werror("`%s` is not defined",s);
8077  else
8078  {
8079  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
8080  s = iiTwoOps(op);
8081  if (proccall)
8082  {
8083  Werror("%s(`%s`,`%s`) failed"
8084  ,s,Tok2Cmdname(at),Tok2Cmdname(bt));
8085  }
8086  else
8087  {
8088  Werror("`%s` %s `%s` failed"
8089  ,Tok2Cmdname(at),s,Tok2Cmdname(bt));
8090  }
8091  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8092  {
8093  while (dA2[i].cmd==op)
8094  {
8095  if(((at==dA2[i].arg1)||(bt==dA2[i].arg2))
8096  && (dA2[i].res!=0)
8097  && (dA2[i].p!=jjWRONG2))
8098  {
8099  if (proccall)
8100  Werror("expected %s(`%s`,`%s`)"
8101  ,s,Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8102  else
8103  Werror("expected `%s` %s `%s`"
8104  ,Tok2Cmdname(dA2[i].arg1),s,Tok2Cmdname(dA2[i].arg2));
8105  }
8106  i++;
8107  }
8108  }
8109  }
8110  }
8111  a->CleanUp();
8112  b->CleanUp();
8113  res->rtyp = UNKNOWN;
8114  }
8115  return TRUE;
8116 }
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:82
#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:125
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:9126
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
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:3483
int rtyp
Definition: subexpr.h:91
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 8531 of file iparith.cc.

8532 {
8533  memset(res,0,sizeof(sleftv));
8534 
8535  if (!errorreported)
8536  {
8537 #ifdef SIQ
8538  if (siq>0)
8539  {
8540  //Print("siq:%d\n",siq);
8542  memcpy(&d->arg1,a,sizeof(sleftv));
8543  a->Init();
8544  memcpy(&d->arg2,b,sizeof(sleftv));
8545  b->Init();
8546  memcpy(&d->arg3,c,sizeof(sleftv));
8547  c->Init();
8548  d->op=op;
8549  d->argc=3;
8550  res->data=(char *)d;
8551  res->rtyp=COMMAND;
8552  return FALSE;
8553  }
8554 #endif
8555  int at=a->Typ();
8556  // handling bb-objects ----------------------------------------------
8557  if (at>MAX_TOK)
8558  {
8559  blackbox *bb=getBlackboxStuff(at);
8560  if (bb!=NULL)
8561  {
8562  if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
8563  if (errorreported) return TRUE;
8564  // else: no op defined
8565  }
8566  else return TRUE;
8567  if (errorreported) return TRUE;
8568  }
8569  int bt=b->Typ();
8570  int ct=c->Typ();
8571 
8572  iiOp=op;
8573  int i=0;
8574  while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
8575  return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
8576  }
8577  a->CleanUp();
8578  b->CleanUp();
8579  c->CleanUp();
8580  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8581  return TRUE;
8582 }
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:8377
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1186
#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:107
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:88
const struct sValCmd3 dArith3[]
Definition: table.h:716
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:91
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 8583 of file iparith.cc.

8587 {
8588  leftv b=a->next;
8589  a->next=NULL;
8590  int bt=b->Typ();
8591  leftv c=b->next;
8592  b->next=NULL;
8593  int ct=c->Typ();
8594  BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
8595  b->next=c;
8596  a->next=b;
8597  a->CleanUp(); // to cleanup the chain, content already done
8598  return bo;
8599 }
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:8377
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
int Typ()
Definition: subexpr.cc:995
leftv next
Definition: subexpr.h:86
#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 8377 of file iparith.cc.

8380 {
8381  memset(res,0,sizeof(sleftv));
8382  BOOLEAN call_failed=FALSE;
8383 
8384  assume(dA3[0].cmd==op);
8385 
8386  if (!errorreported)
8387  {
8388  int i=0;
8389  iiOp=op;
8390  while (dA3[i].cmd==op)
8391  {
8392  if ((at==dA3[i].arg1)
8393  && (bt==dA3[i].arg2)
8394  && (ct==dA3[i].arg3))
8395  {
8396  res->rtyp=dA3[i].res;
8397  if (currRing!=NULL)
8398  {
8399  if (check_valid(dA3[i].valid_for,op)) break;
8400  }
8401  if (traceit&TRACE_CALL)
8402  Print("call %s(%s,%s,%s)\n",
8403  iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8404  if ((call_failed=dA3[i].p(res,a,b,c)))
8405  {
8406  break;// leave loop, goto error handling
8407  }
8408  a->CleanUp();
8409  b->CleanUp();
8410  c->CleanUp();
8411  return FALSE;
8412  }
8413  i++;
8414  }
8415  // implicite type conversion ----------------------------------------------
8416  if (dA3[i].cmd!=op)
8417  {
8418  int ai,bi,ci;
8422  BOOLEAN failed=FALSE;
8423  i=0;
8424  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8425  while (dA3[i].cmd==op)
8426  {
8427  if ((dA3[i].valid_for & NO_CONVERSION)==0)
8428  {
8429  if ((ai=iiTestConvert(at,dA3[i].arg1,dConvertTypes))!=0)
8430  {
8431  if ((bi=iiTestConvert(bt,dA3[i].arg2,dConvertTypes))!=0)
8432  {
8433  if ((ci=iiTestConvert(ct,dA3[i].arg3,dConvertTypes))!=0)
8434  {
8435  res->rtyp=dA3[i].res;
8436  if (currRing!=NULL)
8437  {
8438  if (check_valid(dA3[i].valid_for,op)) break;
8439  }
8440  if (traceit&TRACE_CALL)
8441  Print("call %s(%s,%s,%s)\n",
8442  iiTwoOps(op),Tok2Cmdname(dA3[i].arg1),
8443  Tok2Cmdname(dA3[i].arg2),Tok2Cmdname(dA3[i].arg3));
8444  failed= ((iiConvert(at,dA3[i].arg1,ai,a,an,dConvertTypes))
8445  || (iiConvert(bt,dA3[i].arg2,bi,b,bn,dConvertTypes))
8446  || (iiConvert(ct,dA3[i].arg3,ci,c,cn,dConvertTypes))
8447  || (call_failed=dA3[i].p(res,an,bn,cn)));
8448  // everything done, clean up temp. variables
8449  if (failed)
8450  {
8451  // leave loop, goto error handling
8452  break;
8453  }
8454  else
8455  {
8456  // everything ok, clean up and return
8457  an->CleanUp();
8458  bn->CleanUp();
8459  cn->CleanUp();
8463  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8464  return FALSE;
8465  }
8466  }
8467  }
8468  }
8469  }
8470  i++;
8471  }
8472  an->CleanUp();
8473  bn->CleanUp();
8474  cn->CleanUp();
8478  }
8479  // error handling ---------------------------------------------------
8480  if (!errorreported)
8481  {
8482  const char *s=NULL;
8483  if ((at==0) && (a->Fullname()!=sNoName_fe))
8484  {
8485  s=a->Fullname();
8486  }
8487  else if ((bt==0) && (b->Fullname()!=sNoName_fe))
8488  {
8489  s=b->Fullname();
8490  }
8491  else if ((ct==0) && (c->Fullname()!=sNoName_fe))
8492  {
8493  s=c->Fullname();
8494  }
8495  if (s!=NULL)
8496  Werror("`%s` is not defined",s);
8497  else
8498  {
8499  i=0;
8500  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8501  const char *s = iiTwoOps(op);
8502  Werror("%s(`%s`,`%s`,`%s`) failed"
8503  ,s,Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8504  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8505  {
8506  while (dA3[i].cmd==op)
8507  {
8508  if(((at==dA3[i].arg1)
8509  ||(bt==dA3[i].arg2)
8510  ||(ct==dA3[i].arg3))
8511  && (dA3[i].res!=0))
8512  {
8513  Werror("expected %s(`%s`,`%s`,`%s`)"
8514  ,s,Tok2Cmdname(dA3[i].arg1)
8515  ,Tok2Cmdname(dA3[i].arg2)
8516  ,Tok2Cmdname(dA3[i].arg3));
8517  }
8518  i++;
8519  }
8520  }
8521  }
8522  }
8523  res->rtyp = UNKNOWN;
8524  }
8525  a->CleanUp();
8526  b->CleanUp();
8527  c->CleanUp();
8528  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8529  return TRUE;
8530 }
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:82
#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:125
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:9126
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
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:91
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 8621 of file iparith.cc.

8622 {
8623  memset(res,0,sizeof(sleftv));
8624 
8625  if (!errorreported)
8626  {
8627 #ifdef SIQ
8628  if (siq>0)
8629  {
8630  //Print("siq:%d\n",siq);
8632  d->op=op;
8633  res->data=(char *)d;
8634  if (a!=NULL)
8635  {
8636  d->argc=a->listLength();
8637  // else : d->argc=0;
8638  memcpy(&d->arg1,a,sizeof(sleftv));
8639  switch(d->argc)
8640  {
8641  case 3:
8642  memcpy(&d->arg3,a->next->next,sizeof(sleftv));
8643  a->next->next->Init();
8644  /* no break */
8645  case 2:
8646  memcpy(&d->arg2,a->next,sizeof(sleftv));
8647  a->next->Init();
8648  a->next->next=d->arg2.next;
8649  d->arg2.next=NULL;
8650  /* no break */
8651  case 1:
8652  a->Init();
8653  a->next=d->arg1.next;
8654  d->arg1.next=NULL;
8655  }
8656  if (d->argc>3) a->next=NULL;
8657  a->name=NULL;
8658  a->rtyp=0;
8659  a->data=NULL;
8660  a->e=NULL;
8661  a->attribute=NULL;
8662  a->CleanUp();
8663  }
8664  res->rtyp=COMMAND;
8665  return FALSE;
8666  }
8667 #endif
8668  if ((a!=NULL) && (a->Typ()>MAX_TOK))
8669  {
8670  blackbox *bb=getBlackboxStuff(a->Typ());
8671  if (bb!=NULL)
8672  {
8673  if(!bb->blackbox_OpM(op,res,a)) return FALSE;
8674  if (errorreported) return TRUE;
8675  // else: no op defined
8676  }
8677  else return TRUE;
8678  }
8679  int args=0;
8680  if (a!=NULL) args=a->listLength();
8681 
8682  iiOp=op;
8683  int i=0;
8684  while ((dArithM[i].cmd!=op)&&(dArithM[i].cmd!=0)) i++;
8685  while (dArithM[i].cmd==op)
8686  {
8687  if ((args==dArithM[i].number_of_args)
8688  || (dArithM[i].number_of_args==-1)
8689  || ((dArithM[i].number_of_args==-2)&&(args>0)))
8690  {
8691  res->rtyp=dArithM[i].res;
8692  if (currRing!=NULL)
8693  {
8694  if (check_valid(dArithM[i].valid_for,op)) break;
8695  }
8696  if (traceit&TRACE_CALL)
8697  Print("call %s(... (%d args))\n", iiTwoOps(op),args);
8698  if (dArithM[i].p(res,a))
8699  {
8700  break;// leave loop, goto error handling
8701  }
8702  if (a!=NULL) a->CleanUp();
8703  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8704  return FALSE;
8705  }
8706  i++;
8707  }
8708  // error handling
8709  if (!errorreported)
8710  {
8711  if ((args>0) && (a->rtyp==0) && (a->Name()!=sNoName_fe))
8712  {
8713  Werror("`%s` is not defined",a->Fullname());
8714  }
8715  else
8716  {
8717  const char *s = iiTwoOps(op);
8718  Werror("%s(...) failed",s);
8719  }
8720  }
8721  res->rtyp = UNKNOWN;
8722  }
8723  if (a!=NULL) a->CleanUp();
8724  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8725  return TRUE;
8726 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
ip_command * command
Definition: ipid.h:24
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:105
#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:107
#define UNKNOWN
Definition: tok.h:217
const struct sValCmdM dArithM[]
Definition: table.h:826
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:995
const char * Name()
Definition: subexpr.h:120
const char * Fullname()
Definition: subexpr.h:125
void * data
Definition: subexpr.h:88
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:9126
const char * iiTwoOps(int t)
Definition: gentable.cc:253
const char * name
Definition: subexpr.h:87
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:86
#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:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
attr attribute
Definition: subexpr.h:89
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 8937 of file iparith.cc.

8938 {
8939  //printf("iiInitArithmetic()\n");
8940  memset(&sArithBase, 0, sizeof(sArithBase));
8941  iiInitCmdName();
8942  /* fix last-identifier */
8943 #if 0
8944  /* we expect that gentable allready did every thing */
8947  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
8948  }
8949 #endif
8950  //Print("L=%d\n", sArithBase.nLastIdentifier);
8951 
8952  //iiArithAddCmd(szName, nAlias, nTokval, nToktype);
8953  //iiArithAddCmd("mygcd", 1, GCD_CMD, CMD_2);
8954 
8955  //iiArithAddCmd("Top", 0,-1,0);
8956 
8957 
8958  //for(i=0; i<sArithBase.nCmdUsed; i++) {
8959  // printf("CMD[%03d] %s, %d, %d, %d\n", i,
8960  // sArithBase.sCmds[i].name,
8961  // sArithBase.sCmds[i].alias,
8962  // sArithBase.sCmds[i].tokval,
8963  // sArithBase.sCmds[i].toktype);
8964  //}
8965  //iiArithRemoveCmd("Top");
8966  //iiArithAddCmd("mygcd", 2, GCD_CMD, CMD_2);
8967  //iiArithRemoveCmd("mygcd");
8968  //iiArithAddCmd("kkk", 1, 1234, CMD_1);
8969  return 0;
8970 }
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 8828 of file iparith.cc.

8829 {
8830  // user defined types are not in the pre-computed table:
8831  if (op>MAX_TOK) return 0;
8832 
8833  int a=0;
8834  int e=len;
8835  int p=len/2;
8836  do
8837  {
8838  if (op==dArithTab[p].cmd) return dArithTab[p].start;
8839  if (op<dArithTab[p].cmd) e=p-1;
8840  else a = p+1;
8841  p=a+(e-a)/2;
8842  }
8843  while ( a <= e);
8844 
8845  // catch missing a cmd:
8846  // may be missing as a op for blackbox, if the first operand is "undef" instead of bb
8847  // Print("op %d (%c) unknown",op,op);
8848  return 0;
8849 }
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 8729 of file iparith.cc.

8730 {
8731  int i;
8732  int an=1;
8733  int en=sArithBase.nLastIdentifier;
8734 
8735  loop
8736  //for(an=0; an<sArithBase.nCmdUsed; )
8737  {
8738  if(an>=en-1)
8739  {
8740  if (strcmp(n, sArithBase.sCmds[an].name) == 0)
8741  {
8742  i=an;
8743  break;
8744  }
8745  else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
8746  {
8747  i=en;
8748  break;
8749  }
8750  else
8751  {
8752  // -- blackbox extensions:
8753  // return 0;
8754  return blackboxIsCmd(n,tok);
8755  }
8756  }
8757  i=(an+en)/2;
8758  if (*n < *(sArithBase.sCmds[i].name))
8759  {
8760  en=i-1;
8761  }
8762  else if (*n > *(sArithBase.sCmds[i].name))
8763  {
8764  an=i+1;
8765  }
8766  else
8767  {
8768  int v=strcmp(n,sArithBase.sCmds[i].name);
8769  if(v<0)
8770  {
8771  en=i-1;
8772  }
8773  else if(v>0)
8774  {
8775  an=i+1;
8776  }
8777  else /*v==0*/
8778  {
8779  break;
8780  }
8781  }
8782  }
8784  tok=sArithBase.sCmds[i].tokval;
8785  if(sArithBase.sCmds[i].alias==2)
8786  {
8787  Warn("outdated identifier `%s` used - please change your code",
8788  sArithBase.sCmds[i].name);
8789  sArithBase.sCmds[i].alias=1;
8790  }
8791  #if 0
8792  if (currRingHdl==NULL)
8793  {
8794  #ifdef SIQ
8795  if (siq<=0)
8796  {
8797  #endif
8798  if ((tok>=BEGIN_RING) && (tok<=END_RING))
8799  {
8800  WerrorS("no ring active");
8801  return 0;
8802  }
8803  #ifdef SIQ
8804  }
8805  #endif
8806  }
8807  #endif
8808  if (!expected_parms)
8809  {
8810  switch (tok)
8811  {
8812  case IDEAL_CMD:
8813  case INT_CMD:
8814  case INTVEC_CMD:
8815  case MAP_CMD:
8816  case MATRIX_CMD:
8817  case MODUL_CMD:
8818  case POLY_CMD:
8819  case PROC_CMD:
8820  case RING_CMD:
8821  case STRING_CMD:
8822  cmdtok = tok;
8823  break;
8824  }
8825  }
8826  return sArithBase.sCmds[i].toktype;
8827 }
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:88
#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:88
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:4561
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:88
void * Data()
Definition: subexpr.cc:1137

◆ jjBAREISS()

static BOOLEAN jjBAREISS ( leftv  res,
leftv  v 
)
static

Definition at line 3595 of file iparith.cc.

3596 {
3597  //matrix m=(matrix)v->Data();
3598  //lists l=mpBareiss(m,FALSE);
3599  intvec *iv;
3600  ideal m;
3601  sm_CallBareiss((ideal)v->Data(),0,0,m,&iv, currRing);
3603  l->Init(2);
3604  l->m[0].rtyp=MODUL_CMD;
3605  l->m[1].rtyp=INTVEC_CMD;
3606  l->m[0].data=(void *)m;
3607  l->m[1].data=(void *)iv;
3608  res->data = (char *)l;
3609  return FALSE;
3610 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:400
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 5620 of file iparith.cc.

5621 {
5622  intvec *iv;
5623  ideal m;
5625  int k=(int)(long)w->Data();
5626  if (k>=0)
5627  {
5628  sm_CallBareiss((ideal)u->Data(),(int)(long)v->Data(),(int)(long)w->Data(),m,&iv, currRing);
5629  l->Init(2);
5630  l->m[0].rtyp=MODUL_CMD;
5631  l->m[1].rtyp=INTVEC_CMD;
5632  l->m[0].data=(void *)m;
5633  l->m[1].data=(void *)iv;
5634  }
5635  else
5636  {
5637  m=sm_CallSolv((ideal)u->Data(), currRing);
5638  l->Init(1);
5639  l->m[0].rtyp=IDEAL_CMD;
5640  l->m[0].data=(void *)m;
5641  }
5642  res->data = (char *)l;
5643  return FALSE;
5644 }
#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:88
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:2369
int rtyp
Definition: subexpr.h:91
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:400
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 3618 of file iparith.cc.

3619 {
3621  b->hnf();
3622  res->data=(char*)b;
3623  return FALSE;
3624 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
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 3640 of file iparith.cc.

3641 {
3642  bigintmat *b=(bigintmat*)u->Data();
3643  res->data=(void *)bim2iv(b);
3644  return FALSE;
3645 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
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 3625 of file iparith.cc.

3626 {
3627  BOOLEAN bo=FALSE;
3628  number n=(number)u->CopyD();
3630  if (nMap!=NULL)
3631  res->data=nMap(n,coeffs_BIGINT,currRing->cf);
3632  else
3633  {
3634  Werror("cannot convert bigint to cring %s", nCoeffName(currRing->cf));
3635  bo=TRUE;
3636  }
3637  n_Delete(&n,coeffs_BIGINT);
3638  return bo;
3639 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:88
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 3646 of file iparith.cc.

3647 {
3648  sleftv tmp;
3649  BOOLEAN bo=jjBI2N(&tmp,u);
3650  if (!bo)
3651  {
3652  number n=(number) tmp.data;
3653  if (nIsZero(n)) { res->data=NULL;nDelete(&n); }
3654  else
3655  {
3656  res->data=(void *)pNSet(n);
3657  }
3658  }
3659  return bo;
3660 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:3625
void * data
Definition: subexpr.h:88
#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 5393 of file iparith.cc.

5394 {
5395  bigintmat *bim = (bigintmat *)u->Data();
5396  int r = (int)(long)v->Data();
5397  int c = (int)(long)w->Data();
5398  if ((r<1)||(r>bim->rows())||(c<1)||(c>bim->cols()))
5399  {
5400  Werror("wrong range[%d,%d] in bigintmat %s(%d x %d)",
5401  r,c,u->Fullname(),bim->rows(),bim->cols());
5402  return TRUE;
5403  }
5404  res->data=u->data; u->data=NULL;
5405  res->rtyp=u->rtyp; u->rtyp=0;
5406  res->name=u->name; u->name=NULL;
5407  Subexpr e=jjMakeSub(v);
5408  e->next=jjMakeSub(w);
5409  if (u->e==NULL)
5410  res->e=e;
5411  else
5412  {
5413  Subexpr h=u->e;
5414  while (h->next!=NULL) h=h->next;
5415  h->next=e;
5416  res->e=u->e;
5417  u->e=NULL;
5418  }
5419  return FALSE;
5420 }
Subexpr e
Definition: subexpr.h:105
#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:125
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:87
int cols() const
Definition: bigintmat.h:145
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7939
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 5366 of file iparith.cc.

5367 {
5368  intvec *iv = (intvec *)u->Data();
5369  int r = (int)(long)v->Data();
5370  int c = (int)(long)w->Data();
5371  if ((r<1)||(r>iv->rows())||(c<1)||(c>iv->cols()))
5372  {
5373  Werror("wrong range[%d,%d] in intmat %s(%d x %d)",
5374  r,c,u->Fullname(),iv->rows(),iv->cols());
5375  return TRUE;
5376  }
5377  res->data=u->data; u->data=NULL;
5378  res->rtyp=u->rtyp; u->rtyp=0;
5379  res->name=u->name; u->name=NULL;
5380  Subexpr e=jjMakeSub(v);
5381  e->next=jjMakeSub(w);
5382  if (u->e==NULL) res->e=e;
5383  else
5384  {
5385  Subexpr h=u->e;
5386  while (h->next!=NULL) h=h->next;
5387  h->next=e;
5388  res->e=u->e;
5389  u->e=NULL;
5390  }
5391  return FALSE;
5392 }
Subexpr e
Definition: subexpr.h:105
#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:125
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
int cols() const
Definition: intvec.h:87
int rtyp
Definition: subexpr.h:91
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7939
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 5421 of file iparith.cc.

5422 {
5423  matrix m= (matrix)u->Data();
5424  int r = (int)(long)v->Data();
5425  int c = (int)(long)w->Data();
5426  //Print("gen. elem %d, %d\n",r,c);
5427  if ((r<1)||(r>MATROWS(m))||(c<1)||(c>MATCOLS(m)))
5428  {
5429  Werror("wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->Fullname(),
5430  MATROWS(m),MATCOLS(m));
5431  return TRUE;
5432  }
5433  res->data=u->data; u->data=NULL;
5434  res->rtyp=u->rtyp; u->rtyp=0;
5435  res->name=u->name; u->name=NULL;
5436  Subexpr e=jjMakeSub(v);
5437  e->next=jjMakeSub(w);
5438  if (u->e==NULL)
5439  res->e=e;
5440  else
5441  {
5442  Subexpr h=u->e;
5443  while (h->next!=NULL) h=h->next;
5444  h->next=e;
5445  res->e=u->e;
5446  u->e=NULL;
5447  }
5448  return FALSE;
5449 }
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Fullname()
Definition: subexpr.h:125
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:87
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:91
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7939
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 5450 of file iparith.cc.

5451 {
5452  sleftv t;
5453  sleftv ut;
5454  leftv p=NULL;
5455  intvec *iv=(intvec *)w->Data();
5456  int l;
5457  BOOLEAN nok;
5458 
5459  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5460  {
5461  WerrorS("cannot build expression lists from unnamed objects");
5462  return TRUE;
5463  }
5464  memcpy(&ut,u,sizeof(ut));
5465  memset(&t,0,sizeof(t));
5466  t.rtyp=INT_CMD;
5467  for (l=0;l< iv->length(); l++)
5468  {
5469  t.data=(char *)(long)((*iv)[l]);
5470  if (p==NULL)
5471  {
5472  p=res;
5473  }
5474  else
5475  {
5477  p=p->next;
5478  }
5479  memcpy(u,&ut,sizeof(ut));
5480  if (u->Typ() == MATRIX_CMD)
5481  nok=jjBRACK_Ma(p,u,v,&t);
5482  else if (u->Typ() == BIGINTMAT_CMD)
5483  nok=jjBRACK_Bim(p,u,v,&t);
5484  else /* INTMAT_CMD */
5485  nok=jjBRACK_Im(p,u,v,&t);
5486  if (nok)
5487  {
5488  while (res->next!=NULL)
5489  {
5490  p=res->next->next;
5491  omFreeBin((ADDRESS)res->next, sleftv_bin);
5492  // res->e aufraeumen !!!!
5493  res->next=p;
5494  }
5495  return TRUE;
5496  }
5497  }
5498  return FALSE;
5499 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:105
#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:5393
#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:5366
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#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:91
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:5421
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 5500 of file iparith.cc.

5501 {
5502  sleftv t;
5503  sleftv ut;
5504  leftv p=NULL;
5505  intvec *iv=(intvec *)v->Data();
5506  int l;
5507  BOOLEAN nok;
5508 
5509  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5510  {
5511  WerrorS("cannot build expression lists from unnamed objects");
5512  return TRUE;
5513  }
5514  memcpy(&ut,u,sizeof(ut));
5515  memset(&t,0,sizeof(t));
5516  t.rtyp=INT_CMD;
5517  for (l=0;l< iv->length(); l++)
5518  {
5519  t.data=(char *)(long)((*iv)[l]);
5520  if (p==NULL)
5521  {
5522  p=res;
5523  }
5524  else
5525  {
5527  p=p->next;
5528  }
5529  memcpy(u,&ut,sizeof(ut));
5530  if (u->Typ() == MATRIX_CMD)
5531  nok=jjBRACK_Ma(p,u,&t,w);
5532  else if (u->Typ() == BIGINTMAT_CMD)
5533  nok=jjBRACK_Bim(p,u,&t,w);
5534  else /* INTMAT_CMD */
5535  nok=jjBRACK_Im(p,u,&t,w);
5536  if (nok)
5537  {
5538  while (res->next!=NULL)
5539  {
5540  p=res->next->next;
5541  omFreeBin((ADDRESS)res->next, sleftv_bin);
5542  // res->e aufraeumen !!
5543  res->next=p;
5544  }
5545  return TRUE;
5546  }
5547  }
5548  return FALSE;
5549 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:105
#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:5393
#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:5366
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#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:91
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:5421
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 5550 of file iparith.cc.

5551 {
5552  sleftv t1,t2,ut;
5553  leftv p=NULL;
5554  intvec *vv=(intvec *)v->Data();
5555  intvec *wv=(intvec *)w->Data();
5556  int vl;
5557  int wl;
5558  BOOLEAN nok;
5559 
5560  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5561  {
5562  WerrorS("cannot build expression lists from unnamed objects");
5563  return TRUE;
5564  }
5565  memcpy(&ut,u,sizeof(ut));
5566  memset(&t1,0,sizeof(sleftv));
5567  memset(&t2,0,sizeof(sleftv));
5568  t1.rtyp=INT_CMD;
5569  t2.rtyp=INT_CMD;
5570  for (vl=0;vl< vv->length(); vl++)
5571  {
5572  t1.data=(char *)(long)((*vv)[vl]);
5573  for (wl=0;wl< wv->length(); wl++)
5574  {
5575  t2.data=(char *)(long)((*wv)[wl]);
5576  if (p==NULL)
5577  {
5578  p=res;
5579  }
5580  else
5581  {
5583  p=p->next;
5584  }
5585  memcpy(u,&ut,sizeof(ut));
5586  if (u->Typ() == MATRIX_CMD)
5587  nok=jjBRACK_Ma(p,u,&t1,&t2);
5588  else if (u->Typ() == BIGINTMAT_CMD)
5589  nok=jjBRACK_Bim(p,u,&t1,&t2);
5590  else /* INTMAT_CMD */
5591  nok=jjBRACK_Im(p,u,&t1,&t2);
5592  if (nok)
5593  {
5594  res->CleanUp();
5595  return TRUE;
5596  }
5597  }
5598  }
5599  return FALSE;
5600 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:105
#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:5393
#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:5366
int Typ()
Definition: subexpr.cc:995
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#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:91
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:5421
int BOOLEAN
Definition: auxiliary.h:85

◆ jjBRACK_S()

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

Definition at line 5350 of file iparith.cc.

5351 {
5352  char *s= (char *)u->Data();
5353  int r = (int)(long)v->Data();
5354  int c = (int)(long)w->Data();
5355  int l = strlen(s);
5356 
5357  if ( (r<1) || (r>l) || (c<0) )
5358  {
5359  Werror("wrong range[%d,%d] in string %s",r,c,u->Fullname());
5360  return TRUE;
5361  }
5362  res->data = (char *)omAlloc((long)(c+1));
5363  sprintf((char *)res->data,"%-*.*s",c,c,s+r-1);
5364  return FALSE;
5365 }
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:125
void * data
Definition: subexpr.h:88
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:2254
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
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 6522 of file iparith.cc.

6523 {
6524 #ifdef HAVE_SDB
6525  sdb_show_bp();
6526 #endif
6527  return FALSE;
6528 }
#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 6529 of file iparith.cc.

6530 {
6531 #ifdef HAVE_SDB
6532  if(v->Typ()==PROC_CMD)
6533  {
6534  int lineno=0;
6535  if((v->next!=NULL) && (v->next->Typ()==INT_CMD))
6536  {
6537  lineno=(int)(long)v->next->Data();
6538  }
6539  return sdb_set_breakpoint(v->Name(),lineno);
6540  }
6541  return TRUE;
6542 #else
6543  return FALSE;
6544 #endif
6545 }
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:120
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
Definition: sdb.cc:65
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137

◆ jjCALL1ARG()

static BOOLEAN jjCALL1ARG ( leftv  res,
leftv  v 
)
static

Definition at line 6546 of file iparith.cc.

6547 {
6548  return iiExprArith1(res,v,iiOp);
6549 }
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8319
int iiOp
Definition: iparith.cc:224

◆ jjCALL1MANY()

static BOOLEAN jjCALL1MANY ( leftv  res,
leftv  u 
)
static

Definition at line 3661 of file iparith.cc.

3662 {
3663  return iiExprArithM(res,u,iiOp);
3664 }
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8621
int iiOp
Definition: iparith.cc:224

◆ jjCALL2ARG()

static BOOLEAN jjCALL2ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6550 of file iparith.cc.

6551 {
6552  leftv v=u->next;
6553  u->next=NULL;
6554  BOOLEAN b=iiExprArith2(res,u,iiOp,v, (iiOp > 255));
6555  u->next=v;
6556  return b;
6557 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
leftv next
Definition: subexpr.h:86
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:8130

◆ jjCALL3ARG()

static BOOLEAN jjCALL3ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6558 of file iparith.cc.

6559 {
6560  leftv v = u->next;
6561  leftv w = v->next;
6562  u->next = NULL;
6563  v->next = NULL;
6564  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
6565  u->next = v;
6566  v->next = w;
6567  return b;
6568 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8531
leftv next
Definition: subexpr.h:86
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 3665 of file iparith.cc.

3666 {
3667  res->data = (char *)(long)rChar((ring)v->Data());
3668  return FALSE;
3669 }
#define FALSE
Definition: auxiliary.h:94
int rChar(ring r)
Definition: ring.cc:688
void * data
Definition: subexpr.h:88
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:88
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 9169 of file iparith.cc.

9170 {
9171  coeffs cf;
9172  lists c=(lists)u->CopyD(); // list of ideal or bigint/int
9173  int rl=c->nr+1;
9174  int return_type=c->m[0].Typ();
9175  if ((return_type!=IDEAL_CMD)
9176  && (return_type!=MODUL_CMD)
9177  && (return_type!=MATRIX_CMD)
9178  && (return_type!=POLY_CMD))
9179  {
9180  if((return_type==BIGINT_CMD)
9181  ||(return_type==INT_CMD))
9182  return_type=BIGINT_CMD;
9183  else if (return_type==LIST_CMD)
9184  {
9185  // create a tmp list of the correct size
9186  lists res_l=(lists)omAllocBin(slists_bin);
9187  res_l->Init(rl /*c->nr+1*/);
9188  BOOLEAN bo=FALSE;
9189  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,CHINREM_CMD);
9190  for (unsigned i=0;i<=(unsigned)c->nr;i++)
9191  {
9192  sleftv tmp;
9193  tmp.Copy(v);
9194  bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],CHINREM_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
9195  if (bo) { Werror("chinrem failed for list entry %d",i+1); break;}
9196  }
9197  c->Clean();
9198  res->data=res_l;
9199  res->rtyp=LIST_CMD;
9200  return bo;
9201  }
9202  else
9203  {
9204  c->Clean();
9205  WerrorS("poly/ideal/module/matrix/list expected");
9206  return TRUE;
9207  }
9208  }
9209  if (return_type==BIGINT_CMD)
9210  cf=coeffs_BIGINT;
9211  else
9212  {
9213  cf=currRing->cf;
9214  if (nCoeff_is_Extension(cf) && (cf->extRing!=NULL))
9215  cf=cf->extRing->cf;
9216  }
9217  lists pl=NULL;
9218  intvec *p=NULL;
9219  if (v->Typ()==LIST_CMD) pl=(lists)v->Data();
9220  else p=(intvec*)v->Data();
9221  ideal result;
9222  ideal *x=(ideal *)omAlloc(rl*sizeof(ideal));
9223  number *xx=NULL;
9224  nMapFunc nMap=n_SetMap(coeffs_BIGINT,cf);
9225  int i;
9226  if (return_type!=BIGINT_CMD)
9227  {
9228  for(i=rl-1;i>=0;i--)
9229  {
9230  if (c->m[i].Typ()!=return_type)
9231  {
9232  Werror("%s expected at pos %d",Tok2Cmdname(return_type),i+1);
9233  omFree(x); // delete c
9234  return TRUE;
9235  }
9236  if (return_type==POLY_CMD)
9237  {
9238  x[i]=idInit(1,1);
9239  x[i]->m[0]=(poly)c->m[i].CopyD();
9240  }
9241  else
9242  {
9243  x[i]=(ideal)c->m[i].CopyD();
9244  }
9245  //c->m[i].Init();
9246  }
9247  }
9248  else
9249  {
9250  if (nMap==NULL)
9251  {
9252  Werror("not implemented: map bigint -> %s", nCoeffName(cf));
9253  return TRUE;
9254  }
9255  xx=(number *)omAlloc(rl*sizeof(number));
9256  for(i=rl-1;i>=0;i--)
9257  {
9258  if (c->m[i].Typ()==INT_CMD)
9259  {
9260  xx[i]=n_Init(((int)(long)c->m[i].Data()),cf);
9261  }
9262  else if (c->m[i].Typ()==BIGINT_CMD)
9263  {
9264  xx[i]=nMap((number)c->m[i].Data(),coeffs_BIGINT,cf);
9265  }
9266  else
9267  {
9268  Werror("bigint expected at pos %d",i+1);
9269  omFree(x); // delete c
9270  omFree(xx); // delete c
9271  return TRUE;
9272  }
9273  }
9274  }
9275  number *q=(number *)omAlloc(rl*sizeof(number));
9276  if (p!=NULL)
9277  {
9278  for(i=rl-1;i>=0;i--)
9279  {
9280  q[i]=n_Init((*p)[i], cf);
9281  }
9282  }
9283  else
9284  {
9285  for(i=rl-1;i>=0;i--)
9286  {
9287  if (pl->m[i].Typ()==INT_CMD)
9288  {
9289  q[i]=n_Init((int)(long)pl->m[i].Data(),cf);
9290  }
9291  else if (pl->m[i].Typ()==BIGINT_CMD)
9292  {
9293  q[i]=nMap((number)(pl->m[i].Data()),coeffs_BIGINT,cf);
9294  }
9295  else
9296  {
9297  Werror("bigint expected at pos %d",i+1);
9298  for(i++;i<rl;i++)
9299  {
9300  n_Delete(&(q[i]),cf);
9301  }
9302  omFree(x); // delete c
9303  omFree(q); // delete pl
9304  if (xx!=NULL) omFree(xx); // delete c
9305  return TRUE;
9306  }
9307  }
9308  }
9309  if (return_type==BIGINT_CMD)
9310  {
9311  CFArray i_v(rl);
9312  number n=n_ChineseRemainderSym(xx,q,rl,TRUE,i_v,coeffs_BIGINT);
9313  res->data=(char *)n;
9314  }
9315  else
9316  {
9317  result=id_ChineseRemainder(x,q,rl,currRing); // deletes also x
9318  c->Clean();
9319  if ((return_type==POLY_CMD) &&(result!=NULL))
9320  {
9321  res->data=(char *)result->m[0];
9322  result->m[0]=NULL;
9323  idDelete(&result);
9324  }
9325  else
9326  res->data=(char *)result;
9327  }
9328  for(i=rl-1;i>=0;i--)
9329  {
9330  n_Delete(&(q[i]),cf);
9331  }
9332  omFree(q);
9333  res->rtyp=return_type;
9334  return result==NULL;
9335 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:1186
#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:291
#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:7957
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8828
void * data
Definition: subexpr.h:88
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:8851
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:91
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:410
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
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 6570 of file iparith.cc.

6571 {
6572  const short t[]={5,VECTOR_CMD,POLY_CMD,MATRIX_CMD,MATRIX_CMD,IDHDL};
6573  if (iiCheckTypes(v,t))
6574  return TRUE;
6575  idhdl c=(idhdl)v->next->next->data;
6576  if (v->next->next->next->rtyp!=IDHDL) return TRUE;
6577  idhdl m=(idhdl)v->next->next->next->data;
6578  idDelete((ideal *)&(c->data.uideal));
6579  idDelete((ideal *)&(m->data.uideal));
6580  mp_Coef2((poly)v->Data(),(poly)v->next->Data(),
6581  (matrix *)&(c->data.umatrix),(matrix *)&(m->data.umatrix),currRing);
6582  return FALSE;
6583 }
#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:88
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:86
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:512
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:6466
int rtyp
Definition: subexpr.h:91
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:2283
void * data
Definition: subexpr.h:88
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 5645 of file iparith.cc.

5646 {
5647  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5648  {
5649  WerrorS("3rd argument must be a name of a matrix");
5650  return TRUE;
5651  }
5652  ideal i=(ideal)u->Data();
5653  int rank=(int)i->rank;
5654  BOOLEAN r=jjCOEFFS_Id(res,u,v);
5655  if (r) return TRUE;
5656  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5657  return FALSE;
5658 }
#define pVar(m)
Definition: polys.h:364
Subexpr e
Definition: subexpr.h:105
#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:88
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:373
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
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 5659 of file iparith.cc.

5660 {
5661  res->data=(void*)idCoeffOfKBase((ideal)(u->Data()),
5662  (ideal)(v->Data()),(poly)(w->Data()));
5663  return FALSE;
5664 }
#define FALSE
Definition: auxiliary.h:94
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2283
void * data
Definition: subexpr.h:88
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 5665 of file iparith.cc.

5666 {
5667  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5668  {
5669  WerrorS("3rd argument must be a name of a matrix");
5670  return TRUE;
5671  }
5672  // CopyD for POLY_CMD and VECTOR_CMD are identical:
5673  poly p=(poly)u->CopyD(POLY_CMD);
5674  ideal i=idInit(1,1);
5675  i->m[0]=p;
5676  sleftv t;
5677  memset(&t,0,sizeof(t));
5678  t.data=(char *)i;
5679  t.rtyp=IDEAL_CMD;
5680  int rank=1;
5681  if (u->Typ()==VECTOR_CMD)
5682  {
5683  i->rank=rank=pMaxComp(p);
5684  t.rtyp=MODUL_CMD;
5685  }
5686  BOOLEAN r=jjCOEFFS_Id(res,&t,v);
5687  t.CleanUp();
5688  if (r) return TRUE;
5689  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5690  return FALSE;
5691 }
#define pVar(m)
Definition: polys.h:364
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Subexpr e
Definition: subexpr.h:105
#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:88
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:373
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
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:323
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:88
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:82
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiTryLoadLib(leftv v, const char *id)
Definition: iplib.cc:782
#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:88
#define IDPACKAGE(a)
Definition: ipid.h:136
Definition: tok.h:58
const char * name
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:106
int rtyp
Definition: subexpr.h:91
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:88
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 3670 of file iparith.cc.

3671 {
3672  res->data = (char *)(long)MATCOLS((matrix)(v->Data()));
3673  return FALSE;
3674 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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 3675 of file iparith.cc.

3676 {
3677  res->data = (char *)(long)((bigintmat*)(v->Data()))->cols();
3678  return FALSE;
3679 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjCOLS_IV()

static BOOLEAN jjCOLS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 3680 of file iparith.cc.

3681 {
3682  res->data = (char *)(long)((intvec*)(v->Data()))->cols();
3683  return FALSE;
3684 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 9355 of file iparith.cc.

9356 {
9357  leftv a=(leftv)aa;
9358  int at=a->Typ();
9359  leftv b=(leftv)bb;
9360  int bt=b->Typ();;
9361  if (at < bt) return -1;
9362  if (at > bt) return 1;
9363  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,'<');
9364  sleftv tmp;
9365  memset(&tmp,0,sizeof(sleftv));
9366  iiOp='<';
9367  BOOLEAN bo=iiExprArith2TabIntern(&tmp,a,'<',b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
9368  if (bo)
9369  {
9370  Werror(" no `<` for %s",Tok2Cmdname(at));
9371  unsigned long ad=(unsigned long)a->Data();
9372  unsigned long bd=(unsigned long)b->Data();
9373  if (ad<bd) return -1;
9374  else if (ad==bd) return 0;
9375  else return 1;
9376  }
9377  else if (tmp.data==NULL) /* not < */
9378  {
9379  iiOp=EQUAL_EQUAL;
9380  tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,EQUAL_EQUAL);
9381  bo=iiExprArith2TabIntern(&tmp,a,EQUAL_EQUAL,b,FALSE,dArith2+tab_pos,at,bt,dConvertTypes);
9382  if (bo)
9383  {
9384  Werror(" no `==` for %s",Tok2Cmdname(at));
9385  unsigned long ad=(unsigned long)a->Data();
9386  unsigned long bd=(unsigned long)b->Data();
9387  if (ad<bd) return -1;
9388  else if (ad==bd) return 0;
9389  else return 1;
9390  }
9391  else if (tmp.data==NULL) /* not <,== */ return 1;
9392  else return 0;
9393  }
9394  else return -1;
9395 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
const poly a
Definition: syzextra.cc:212
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1186
#define FALSE
Definition: auxiliary.h:94
const struct sValCmd2 dArith2[]
Definition: table.h:291
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:7957
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8828
void * data
Definition: subexpr.h:88
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
#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:88
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:88
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:88
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:88
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:574
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:88
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:4760
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:88
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 3685 of file iparith.cc.

3686 {
3687  // CopyD for POLY_CMD and VECTOR_CMD are identical:
3688  poly p=(poly)v->CopyD(POLY_CMD);
3689  if (p!=NULL) p_Cleardenom(p, currRing);
3690  res->data = (char *)p;
3691  return FALSE;
3692 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
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:2755
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:1966
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_BI()

static BOOLEAN jjCOUNT_BI ( leftv  res,
leftv  v 
)
static

Definition at line 3693 of file iparith.cc.

3694 {
3695  res->data = (char *)(long)n_Size((number)v->Data(),coeffs_BIGINT);
3696  return FALSE;
3697 }
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:88
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 3715 of file iparith.cc.

3716 {
3717  res->data = (char *)(long)((intvec*)(v->Data()))->length();
3718  return FALSE;
3719 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjCOUNT_L()

static BOOLEAN jjCOUNT_L ( leftv  res,
leftv  v 
)
static

Definition at line 3703 of file iparith.cc.

3704 {
3705  lists l=(lists)v->Data();
3706  res->data = (char *)(long)(lSize(l)+1);
3707  return FALSE;
3708 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 3709 of file iparith.cc.

3710 {
3711  matrix m=(matrix)v->Data();
3712  res->data = (char *)(long)(MATROWS(m)*MATCOLS(m));
3713  return FALSE;
3714 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 3698 of file iparith.cc.

3699 {
3700  res->data = (char *)(long)nSize((number)v->Data());
3701  return FALSE;
3702 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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 5319 of file iparith.cc.

5320 {
5321  res->data=(char *)(long)sySize((syStrategy)v->Data());
5322  return FALSE;
5323 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 3720 of file iparith.cc.

3721 {
3722  ring r=(ring)v->Data();
3723  int elems=-1;
3724  if (rField_is_Zp(r)) elems=r->cf->ch;
3725  else if (rField_is_GF(r)) elems=r->cf->m_nfCharQ;
3726  else if (rField_is_Zp_a(r) && (r->cf->type==n_algExt))
3727  {
3728  extern int ipower ( int b, int n ); /* factory/cf_util */
3729  elems=ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));
3730  }
3731  res->data = (char *)(long)elems;
3732  return FALSE;
3733 }
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:88
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 3772 of file iparith.cc.

3773 {
3774  if ((v->rtyp==IDHDL)
3775  && ((myynest==IDLEV((idhdl)v->data))||(0==IDLEV((idhdl)v->data))))
3776  {
3777  res->data=(void *)(long)(IDLEV((idhdl)v->data)+1);
3778  }
3779  else if (v->rtyp!=0) res->data=(void *)(-1);
3780  return FALSE;
3781 }
#define FALSE
Definition: auxiliary.h:94
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
int myynest
Definition: febase.cc:46
#define IDLEV(a)
Definition: ipid.h:118
int rtyp
Definition: subexpr.h:91

◆ jjDEG()

static BOOLEAN jjDEG ( leftv  res,
leftv  v 
)
static

Definition at line 3734 of file iparith.cc.

3735 {
3736  int dummy;
3737  poly p=(poly)v->Data();
3738  if (p!=NULL) res->data = (char *)currRing->pLDeg(p,&dummy,currRing);
3739  else res->data=(char *)-1;
3740  return FALSE;
3741 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
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:88
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:691
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 3742 of file iparith.cc.

3743 {
3744  ideal I=(ideal)u->Data();
3745  int d=-1;
3746  int dummy;
3747  int i;
3748  for(i=IDELEMS(I)-1;i>=0;i--)
3749  if (I->m[i]!=NULL) d=si_max(d,(int)currRing->pLDeg(I->m[i],&dummy,currRing));
3750  res->data = (char *)(long)d;
3751  return FALSE;
3752 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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:691
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 3753 of file iparith.cc.

3754 {
3755  SPrintStart();
3756 #ifdef HAVE_RINGS
3758  {
3759  PrintS("// NOTE: computation of degree is being performed for\n");
3760  PrintS("// generic fibre, that is, over Q\n");
3761  }
3762 #endif
3763  assumeStdFlag(v);
3764  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
3765  scDegree((ideal)v->Data(),module_w,currRing->qideal);
3766  char *s=SPrintEnd();
3767  int l=strlen(s)-1;
3768  s[l]='\0';
3769  res->data=(void*)s;
3770  return FALSE;
3771 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:137
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 3785 of file iparith.cc.

3786 {
3787  number n = reinterpret_cast<number>(v->Data());
3788  res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing->cf));
3789  return FALSE;
3790 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 3801 of file iparith.cc.

3802 {
3803  matrix m=(matrix)v->Data();
3804  poly p;
3805  if (sm_CheckDet((ideal)m,m->cols(),TRUE, currRing))
3806  {
3808  p=sm_CallDet(I, currRing);
3809  idDelete(&I);
3810  }
3811  else
3812  p=singclap_det(m,currRing);
3813  res ->data = (char *)p;
3814  return FALSE;
3815 }
#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:355
#define TRUE
Definition: auxiliary.h:98
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1568
void * data
Definition: subexpr.h:88
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:304
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:71
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 3816 of file iparith.cc.

3817 {
3818  bigintmat * m=(bigintmat*)v->Data();
3819  int i,j;
3820  i=m->rows();j=m->cols();
3821  if(i==j)
3822  res->data = (char *)(long)singclap_det_bi(m,coeffs_BIGINT);
3823  else
3824  {
3825  Werror("det of %d x %d bigintmat",i,j);
3826  return TRUE;
3827  }
3828  return FALSE;
3829 }
#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:88
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 3852 of file iparith.cc.

3853 {
3854  intvec * m=(intvec*)v->Data();
3855  int i,j;
3856  i=m->rows();j=m->cols();
3857  if(i==j)
3858  res->data = (char *)(long)singclap_det_i(m,currRing);
3859  else
3860  {
3861  Werror("det of %d x %d intmat",i,j);
3862  return TRUE;
3863  }
3864  return FALSE;
3865 }
#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:88
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 3866 of file iparith.cc.

3867 {
3868  ideal I=(ideal)v->Data();
3869  poly p;
3870  if (IDELEMS(I)<1) return TRUE;
3871  if (sm_CheckDet(I,IDELEMS(I),FALSE, currRing))
3872  {
3874  p=singclap_det(m,currRing);
3875  idDelete((ideal *)&m);
3876  }
3877  else
3878  p=sm_CallDet(I, currRing);
3879  res->data = (char *)p;
3880  return FALSE;
3881 }
#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:355
#define TRUE
Definition: auxiliary.h:98
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1568
void * data
Definition: subexpr.h:88
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:304
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 4285 of file iparith.cc.

4286 {
4287  if (!nCoeff_is_transExt(currRing->cf))
4288  {
4289  WerrorS("differentiation not defined in the coefficient ring");
4290  return TRUE;
4291  }
4292  number n = (number) u->Data();
4293  number k = (number) v->Data();
4294  res->data = ntDiff(n,k,currRing->cf);
4295  return FALSE;
4296 }
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:88
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:1953
#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:88
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:1966
void * data
Definition: subexpr.h:88
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:88
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 3882 of file iparith.cc.

3883 {
3884  assumeStdFlag(v);
3886  {
3887  Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
3888  }
3889 #ifdef HAVE_RINGS
3890  if (rField_is_Ring(currRing))
3891  {
3892  ideal vid = (ideal)v->Data();
3893  int i = idPosConstant(vid);
3894  if ((i != -1) && (n_IsUnit(pGetCoeff(vid->m[i]),currRing->cf)))
3895  { /* ideal v contains unit; dim = -1 */
3896  res->data = (char *)-1L;
3897  return FALSE;
3898  }
3899  ideal vv = id_Head(vid,currRing);
3900  idSkipZeroes(vv);
3901  int j = idPosConstant(vv);
3902  long d;
3903  if(j == -1)
3904  {
3905  d = (long)scDimInt(vv, currRing->qideal);
3907  d++;
3908  }
3909  else
3910  {
3911  if(n_IsUnit(pGetCoeff(vv->m[j]),currRing->cf))
3912  d = -1;
3913  else
3914  d = (long)scDimInt(vv, currRing->qideal);
3915  }
3916  //Anne's Idea for std(4,2x) = 0 bug
3917  long dcurr = d;
3918  for(unsigned ii=0;ii<(unsigned)IDELEMS(vv);ii++)
3919  {
3920  if(vv->m[ii] != NULL && !n_IsUnit(pGetCoeff(vv->m[ii]),currRing->cf))
3921  {
3922  ideal vc = idCopy(vv);
3923  poly c = pInit();
3924  pSetCoeff0(c,nCopy(pGetCoeff(vv->m[ii])));
3925  idInsertPoly(vc,c);
3926  idSkipZeroes(vc);
3927  for(unsigned jj = 0;jj<(unsigned)IDELEMS(vc)-1;jj++)
3928  {
3929  if((vc->m[jj]!=NULL)
3930  && (n_DivBy(pGetCoeff(vc->m[jj]),pGetCoeff(c),currRing->cf)))
3931  {
3932  pDelete(&vc->m[jj]);
3933  }
3934  }
3935  idSkipZeroes(vc);
3936  j = idPosConstant(vc);
3937  if (j != -1) pDelete(&vc->m[j]);
3938  dcurr = (long)scDimInt(vc, currRing->qideal);
3939  // the following assumes the ground rings to be either zero- or one-dimensional
3940  if((j==-1) && rField_is_Ring_Z(currRing))
3941  {
3942  // should also be activated for other euclidean domains as groundfield
3943  dcurr++;
3944  }
3945  idDelete(&vc);
3946  }
3947  if(dcurr > d)
3948  d = dcurr;
3949  }
3950  res->data = (char *)d;
3951  idDelete(&vv);
3952  return FALSE;
3953  }
3954 #endif
3955  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
3956  return FALSE;
3957 }
#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:120
void * data
Definition: subexpr.h:88
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:753
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:120
void * data
Definition: subexpr.h:88
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:753
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 5324 of file iparith.cc.

5325 {
5326  res->data = (char *)(long)syDim((syStrategy)v->Data());
5327  return FALSE;
5328 }
#define FALSE
Definition: auxiliary.h:94
int syDim(syStrategy syzstr)
Definition: syz1.cc:1857
void * data
Definition: subexpr.h:88
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:88
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:88
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:44
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:88
#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:88
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:88
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:44
#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:91
void * Data()
Definition: subexpr.cc:1137
omBin slists_bin
Definition: lists.cc:23
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
Definition: ideals.cc:938
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 6585 of file iparith.cc.

6586 { // may have 3 or 4 arguments
6587  leftv v1=v;
6588  leftv v2=v1->next;
6589  leftv v3=v2->next;
6590  leftv v4=v3->next;
6591  assumeStdFlag(v2);
6592 
6593  int i1=iiTestConvert(v1->Typ(),MODUL_CMD);
6594  int i2=iiTestConvert(v2->Typ(),MODUL_CMD);
6595 
6596  if((i1==0)||(i2==0)
6597  ||(v3->Typ()!=INT_CMD)||((v4!=NULL)&&(v4->Typ()!=INTVEC_CMD)))
6598  {
6599  WarnS("<module>,<module>,<int>[,<intvec>] expected!");
6600  return TRUE;
6601  }
6602 
6603  sleftv w1,w2;
6604  iiConvert(v1->Typ(),MODUL_CMD,i1,v1,&w1);
6605  iiConvert(v2->Typ(),MODUL_CMD,i2,v2,&w2);
6606  ideal P=(ideal)w1.Data();
6607  ideal Q=(ideal)w2.Data();
6608 
6609  int n=(int)(long)v3->Data();
6610  short *w=NULL;
6611  if(v4!=NULL)
6612  {
6613  w = iv2array((intvec *)v4->Data(),currRing);
6614  short * w0 = w + 1;
6615  int i = currRing->N;
6616  while( (i > 0) && ((*w0) > 0) )
6617  {
6618  w0++;
6619  i--;
6620  }
6621  if(i>0)
6622  WarnS("not all weights are positive!");
6623  }
6624 
6625  matrix T;
6626  ideal R;
6627  idLiftW(P,Q,n,T,R,w);
6628 
6629  w1.CleanUp();
6630  w2.CleanUp();
6631  if(w!=NULL)
6632  omFreeSize( (ADDRESS)w, (rVar(currRing)+1)*sizeof(short) );
6633 
6635  L->Init(2);
6636  L->m[1].rtyp=v1->Typ();
6637  if(v1->Typ()==POLY_CMD||v1->Typ()==VECTOR_CMD)
6638  {
6639  if(v1->Typ()==POLY_CMD)
6640  p_Shift(&R->m[0],-1,currRing);
6641  L->m[1].data=(void *)R->m[0];
6642  R->m[0]=NULL;
6643  idDelete(&R);
6644  }
6645  else if(v1->Typ()==IDEAL_CMD||v1->Typ()==MATRIX_CMD)
6646  L->m[1].data=(void *)id_Module2Matrix(R,currRing);
6647  else
6648  {
6649  L->m[1].rtyp=MODUL_CMD;
6650  L->m[1].data=(void *)R;
6651  }
6652  L->m[0].rtyp=MATRIX_CMD;
6653  L->m[0].data=(char *)T;
6654 
6655  res->data=L;
6656  res->rtyp=LIST_CMD;
6657 
6658  return FALSE;
6659 }
#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:82
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:1134
#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:88
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:86
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition: p_polys.cc:4561
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:91
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:88
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:88
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjDUMMY()

static BOOLEAN jjDUMMY ( leftv  res,
leftv  u 
)
static

Definition at line 3494 of file iparith.cc.

3495 {
3496  res->data = (char *)u->CopyD();
3497  return FALSE;
3498 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjDUMP()

static BOOLEAN jjDUMP ( leftv  ,
leftv  v 
)
static

Definition at line 3958 of file iparith.cc.

3959 {
3960  si_link l = (si_link)v->Data();
3961  if (slDump(l))
3962  {
3963  const char *s;
3964  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
3965  else s=sNoName_fe;
3966  Werror("cannot dump to `%s`",s);
3967  return TRUE;
3968  }
3969  else
3970  return FALSE;
3971 }
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 3972 of file iparith.cc.

3973 {
3974  res->data = (char *)pOne();
3975  int co=(int)(long)v->Data();
3976  if (co>0)
3977  {
3978  pSetComp((poly)res->data,co);
3979  pSetm((poly)res->data);
3980  }
3981  else WerrorS("argument of gen must be positive");
3982  return (co<=0);
3983 }
#define pSetm(p)
Definition: polys.h:253
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:88
#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:88
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1402
leftv next
Definition: subexpr.h:86
#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 5692 of file iparith.cc.

5693 {
5694  res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data(),
5695  (intvec *)w->Data());
5696  //setFlag(res,FLAG_STD);
5697  return FALSE;
5698 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1402
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:88
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1402
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 5002 of file iparith.cc.

5003 {
5004  ring r = (ring)a->Data();
5005  if (rIsPluralRing(r))
5006  {
5007  ring s = rEnvelope(r);
5008  res->data = s;
5009  }
5010  else res->data = rCopy(r);
5011  return FALSE;
5012 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
ring rEnvelope(ring R)
Definition: ring.cc:5519
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:1614
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:88
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:88
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:88
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:593

◆ 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:88
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:88
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:88
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:88
leftv next
Definition: subexpr.h:86
#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:8130

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

3985 {
3986  char * d = (char *)v->Data();
3987  char * s = (char *)omAlloc(strlen(d) + 13);
3988  strcpy( s, (char *)d);
3989  strcat( s, "\n;RETURN();\n");
3990  newBuffer(s,BT_execute);
3991  return yyparse();
3992 }
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:88
#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:88
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:91
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:88
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:91
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:88
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:91
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 4033 of file iparith.cc.

4034 {
4035  intvec *v=NULL;
4037  ideal f=singclap_factorize((poly)(u->CopyD()), &v, 0,currRing);
4038  if (f==NULL) return TRUE;
4039  ivTest(v);
4041  l->Init(2);
4042  l->m[0].rtyp=IDEAL_CMD;
4043  l->m[0].data=(void *)f;
4044  l->m[1].rtyp=INTVEC_CMD;
4045  l->m[1].data=(void *)v;
4046  res->data=(void *)l;
4047  return FALSE;
4048 }
#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:88
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:91
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:88
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:91
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 3993 of file iparith.cc.

3994 {
3996  if (currRing->cf->convSingNFactoryN!=NULL) /* conversion to factory*/
3997  {
3998  ideal_list p,h;
3999  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL);
4000  if (h==NULL)
4001  {
4002  L->Init(1);
4003  L->m[0].data=(char *)idInit(1);
4004  L->m[0].rtyp=IDEAL_CMD;
4005  }
4006  else
4007  {
4008  p=h;
4009  int l=0;
4010  while (p!=NULL) { p=p->next;l++; }
4011  L->Init(l);
4012  l=0;
4013  while(h!=NULL)
4014  {
4015  L->m[l].data=(char *)h->d;
4016  L->m[l].rtyp=IDEAL_CMD;
4017  p=h->next;
4018  omFreeSize(h,sizeof(*h));
4019  h=p;
4020  l++;
4021  }
4022  }
4023  }
4024  else
4025  {
4026  WarnS("no factorization implemented");
4027  L->Init(1);
4028  iiExprArith1(&(L->m[0]),v,STD_CMD);
4029  }
4030  res->data=(void *)L;
4031  return FALSE;
4032 }
#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:8319
#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:88
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:91
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:88
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:91
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 7627 of file iparith.cc.

7628 {
7629  /* compute two factors of h(x,y) modulo x^(d+1) in K[[x]][y],
7630  see a detailed documentation in /kernel/linear_algebra/linearAlgebra.h
7631 
7632  valid argument lists:
7633  - (poly h, int d),
7634  - (poly h, int d, poly f0, poly g0), optional: factors of h(0,y),
7635  - (poly h, int d, int xIndex, int yIndex), optional: indices of vars x & y
7636  in list of ring vars,
7637  - (poly h, int d, poly f0, poly g0, int xIndex, int yIndec),
7638  optional: all 4 optional args
7639  (The defaults are xIndex = 1, yIndex = 2, f0 and g0 polynomials as found
7640  by singclap_factorize and h(0, y)
7641  has exactly two distinct monic factors [possibly with exponent > 1].)
7642  result:
7643  - list with the two factors f and g such that
7644  h(x,y) = f(x,y)*g(x,y) mod x^(d+1) */
7645 
7646  poly h = NULL;
7647  int d = 1;
7648  poly f0 = NULL;
7649  poly g0 = NULL;
7650  int xIndex = 1; /* default index if none provided */
7651  int yIndex = 2; /* default index if none provided */
7652 
7653  leftv u = v; int factorsGiven = 0;
7654  if ((u == NULL) || (u->Typ() != POLY_CMD))
7655  {
7656  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7657  return TRUE;
7658  }
7659  else h = (poly)u->Data();
7660  u = u->next;
7661  if ((u == NULL) || (u->Typ() != INT_CMD))
7662  {
7663  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7664  return TRUE;
7665  }
7666  else d = (int)(long)u->Data();
7667  u = u->next;
7668  if ((u != NULL) && (u->Typ() == POLY_CMD))
7669  {
7670  if ((u->next == NULL) || (u->next->Typ() != POLY_CMD))
7671  {
7672  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7673  return TRUE;
7674  }
7675  else
7676  {
7677  f0 = (poly)u->Data();
7678  g0 = (poly)u->next->Data();
7679  factorsGiven = 1;
7680  u = u->next->next;
7681  }
7682  }
7683  if ((u != NULL) && (u->Typ() == INT_CMD))
7684  {
7685  if ((u->next == NULL) || (u->next->Typ() != INT_CMD))
7686  {
7687  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7688  return TRUE;
7689  }
7690  else
7691  {
7692  xIndex = (int)(long)u->Data();
7693  yIndex = (int)(long)u->next->Data();
7694  u = u->next->next;
7695  }
7696  }
7697  if (u != NULL)
7698  {
7699  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7700  return TRUE;
7701  }
7702 
7703  /* checks for provided arguments */
7704  if (pIsConstant(h) || (factorsGiven && (pIsConstant(f0) || pIsConstant(g0))))
7705  {
7706  WerrorS("expected non-constant polynomial argument(s)");
7707  return TRUE;
7708  }
7709  int n = rVar(currRing);
7710  if ((xIndex < 1) || (n < xIndex))
7711  {
7712  Werror("index for variable x (%d) out of range [1..%d]", xIndex, n);
7713  return TRUE;
7714  }
7715  if ((yIndex < 1) || (n < yIndex))
7716  {
7717  Werror("index for variable y (%d) out of range [1..%d]", yIndex, n);
7718  return TRUE;
7719  }
7720  if (xIndex == yIndex)
7721  {
7722  WerrorS("expected distinct indices for variables x and y");
7723  return TRUE;
7724  }
7725 
7726  /* computation of f0 and g0 if missing */
7727  if (factorsGiven == 0)
7728  {
7729  poly h0 = pSubst(pCopy(h), xIndex, NULL);
7730  intvec* v = NULL;
7731  ideal i = singclap_factorize(h0, &v, 0,currRing);
7732 
7733  ivTest(v);
7734 
7735  if (i == NULL) return TRUE;
7736 
7737  idTest(i);
7738 
7739  if ((v->rows() != 3) || ((*v)[0] =! 1) || (!nIsOne(pGetCoeff(i->m[0]))))
7740  {
7741  WerrorS("expected h(0,y) to have exactly two distinct monic factors");
7742  return TRUE;
7743  }
7744  f0 = pPower(pCopy(i->m[1]), (*v)[1]);
7745  g0 = pPower(pCopy(i->m[2]), (*v)[2]);
7746  idDelete(&i);
7747  }
7748 
7749  poly f; poly g;
7750  henselFactors(xIndex, yIndex, h, f0, g0, d, f, g);
7752  L->Init(2);
7753  L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f;
7754  L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g;
7755  res->rtyp = LIST_CMD;
7756  res->data = (char*)L;
7757  return FALSE;
7758 }
#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:82
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:88
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:86
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:91
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:88
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:88
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:2510
void * Data()
Definition: subexpr.cc:1137

◆ jjFAREY_LI()

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

Definition at line 9336 of file iparith.cc.

9337 {
9338  lists c=(lists)u->CopyD();
9339  lists res_l=(lists)omAllocBin(slists_bin);
9340  res_l->Init(c->nr+1);
9341  BOOLEAN bo=FALSE;
9342  int tab_pos=iiTabIndex(dArithTab2,JJTAB2LEN,FAREY_CMD);
9343  for (unsigned i=0;i<=(unsigned)c->nr;i++)
9344  {
9345  sleftv tmp;
9346  tmp.Copy(v);
9347  bo=iiExprArith2TabIntern(&res_l->m[i],&c->m[i],FAREY_CMD,&tmp,TRUE,dArith2+tab_pos,c->m[i].rtyp,tmp.rtyp,dConvertTypes);
9348  if (bo) { Werror("farey failed for list entry %d",i+1); break;}
9349  }
9350  c->Clean();
9351  res->data=res_l;
9352  return bo;
9353 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: lists.h:22
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1186
#define FALSE
Definition: auxiliary.h:94
const struct sValCmd2 dArith2[]
Definition: table.h:291
#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:7957
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8828
void * data
Definition: subexpr.h:88
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:91
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:82
#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:120
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:125
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:88
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:8851
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:87
#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:91
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 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 6778 of file iparith.cc.

6779 {
6780  ring r=(ring)u->Data();
6781  leftv v=u->next;
6782  leftv perm_var_l=v->next;
6783  leftv perm_par_l=v->next->next;
6784  if ((perm_var_l->Typ()!=INTVEC_CMD)
6785  ||((perm_par_l!=NULL)&&(perm_par_l->Typ()!=INTVEC_CMD))
6786  ||(u->Typ()!=RING_CMD))
6787  {
6788  WerrorS("fetch(<ring>,<name>[,<intvec>[,<intvec>])");
6789  return TRUE;
6790  }
6791  intvec *perm_var_v=(intvec*)perm_var_l->Data();
6792  intvec *perm_par_v=NULL;
6793  if (perm_par_l!=NULL)
6794  perm_par_v=(intvec*)perm_par_l->Data();
6795  idhdl w;
6796  nMapFunc nMap;
6797 
6798  if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
6799  {
6800  int *perm=NULL;
6801  int *par_perm=NULL;
6802  int par_perm_size=0;
6803  BOOLEAN bo;
6804  if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
6805  {
6806  // Allow imap/fetch to be make an exception only for:
6807  if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
6810  ||
6811  (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp
6812  (rField_is_Zp(currRing, r->cf->ch) ||
6813  rField_is_Zp_a(currRing, r->cf->ch))) )
6814  {
6815  par_perm_size=rPar(r);
6816  }
6817  else
6818  {
6819  goto err_fetch;
6820  }
6821  }
6822  else
6823  par_perm_size=rPar(r);
6824  perm=(int *)omAlloc0((rVar(r)+1)*sizeof(int));
6825  if (par_perm_size!=0)
6826  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
6827  int i;
6828  if (perm_par_l==NULL)
6829  {
6830  if (par_perm_size!=0)
6831  for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
6832  }
6833  else
6834  {
6835  if (par_perm_size==0) WarnS("source ring has no parameters");
6836  else
6837  {
6838  for(i=rPar(r)-1;i>=0;i--)
6839  {
6840  if (i<perm_par_v->length()) par_perm[i]=(*perm_par_v)[i];
6841  if ((par_perm[i]<-rPar(currRing))
6842  || (par_perm[i]>rVar(currRing)))
6843  {
6844  Warn("invalid entry for par %d: %d\n",i,par_perm[i]);
6845  par_perm[i]=0;
6846  }
6847  }
6848  }
6849  }
6850  for(i=rVar(r)-1;i>=0;i--)
6851  {
6852  if (i<perm_var_v->length()) perm[i+1]=(*perm_var_v)[i];
6853  if ((perm[i]<-rPar(currRing))
6854  || (perm[i]>rVar(currRing)))
6855  {
6856  Warn("invalid entry for var %d: %d\n",i,perm[i]);
6857  perm[i]=0;
6858  }
6859  }
6860  if (BVERBOSE(V_IMAP))
6861  {
6862  for(i=1;i<=si_min(rVar(r),rVar(currRing));i++)
6863  {
6864  if (perm[i]>0)
6865  Print("// var nr %d: %s -> var %s\n",i,r->names[i-1],currRing->names[perm[i]-1]);
6866  else if (perm[i]<0)
6867  Print("// var nr %d: %s -> par %s\n",i,r->names[i-1],rParameter(currRing)[-perm[i]-1]);
6868  }
6869  for(i=1;i<=si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
6870  {
6871  if (par_perm[i-1]<0)
6872  Print("// par nr %d: %s -> par %s\n",
6873  i,rParameter(r)[i-1],rParameter(currRing)[-par_perm[i-1]-1]);
6874  else if (par_perm[i-1]>0)
6875  Print("// par nr %d: %s -> var %s\n",
6876  i,rParameter(r)[i-1],currRing->names[par_perm[i-1]-1]);
6877  }
6878  }
6879  if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
6880  sleftv tmpW;
6881  memset(&tmpW,0,sizeof(sleftv));
6882  tmpW.rtyp=IDTYP(w);
6883  tmpW.data=IDDATA(w);
6884  if ((bo=maApplyFetch(IMAP_CMD,NULL,res,&tmpW, r,
6885  perm,par_perm,par_perm_size,nMap)))
6886  {
6887  Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
6888  }
6889  if (perm!=NULL)
6890  omFreeSize((ADDRESS)perm,(rVar(r)+1)*sizeof(int));
6891  if (par_perm!=NULL)
6892  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
6893  return bo;
6894  }
6895  else
6896  {
6897  Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
6898  }
6899  return TRUE;
6900 err_fetch:
6901  char *s1=nCoeffString(r->cf);
6902  char *s2=nCoeffString(currRing->cf);
6903  Werror("no identity map from %s (%s -> %s)",u->Fullname(),s1,s2);
6904  omFree(s2);omFree(s1);
6905  return TRUE;
6906 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:120
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:125
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:88
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:8851
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:87
#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:86
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:91
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 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:88
#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 5699 of file iparith.cc.

5700 {
5701  /*4
5702  * look for the substring what in the string where
5703  * starting at position n
5704  * return the position of the first char of what in where
5705  * or 0
5706  */
5707  int n=(int)(long)w->Data();
5708  char *where=(char *)u->Data();
5709  char *what=(char *)v->Data();
5710  char *found;
5711  if ((1>n)||(n>(int)strlen(where)))
5712  {
5713  Werror("start position %d out of range",n);
5714  return TRUE;
5715  }
5716  found = strchr(where+n-1,*what);
5717  if (*(what+1)!='\0')
5718  {
5719  while((found !=NULL) && (strncmp(found+1,what+1,strlen(what+1))!=0))
5720  {
5721  found=strchr(found+1,*what);
5722  }
5723  }
5724  if (found != NULL)
5725  {
5726  res->data=(char *)((found-where)+1);
5727  }
5728  return FALSE;
5729 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
bool found
Definition: facFactorize.cc:56
void * data
Definition: subexpr.h:88
#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:88
#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 5730 of file iparith.cc.

5731 {
5732  if ((int)(long)w->Data()==0)
5733  res->data=(char *)walkProc(u,v);
5734  else
5735  res->data=(char *)fractalWalkProc(u,v);
5736  setFlag( res, FLAG_STD );
5737  return FALSE;
5738 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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:88
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:88
const ring r
Definition: syzextra.cc:208
#define ABS(x)
Definition: auxiliary.h:111
int rtyp
Definition: subexpr.h:91
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:88
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:88
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:88
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:88
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:88
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 4049 of file iparith.cc.

4050 {
4051  si_link l = (si_link)v->Data();
4052  if (slGetDump(l))
4053  {
4054  const char *s;
4055  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
4056  else s=sNoName_fe;
4057  Werror("cannot get dump from `%s`",s);
4058  return TRUE;
4059  }
4060  else
4061  return FALSE;
4062 }
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:88
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:88
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:88
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 4063 of file iparith.cc.

4064 {
4065  assumeStdFlag(v);
4066  ideal I=(ideal)v->Data();
4067  res->data=(void *)iiHighCorner(I,0);
4068  return FALSE;
4069 }
#define FALSE
Definition: auxiliary.h:94
poly iiHighCorner(ideal I, int ak)
Definition: ipshell.cc:1511
void * data
Definition: subexpr.h:88
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 4070 of file iparith.cc.

4071 {
4072  assumeStdFlag(v);
4073  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4074  BOOLEAN delete_w=FALSE;
4075  ideal I=(ideal)v->Data();
4076  int i;
4077  poly p=NULL,po=NULL;
4078  int rk=id_RankFreeModule(I,currRing);
4079  if (w==NULL)
4080  {
4081  w = new intvec(rk);
4082  delete_w=TRUE;
4083  }
4084  for(i=rk;i>0;i--)
4085  {
4086  p=iiHighCorner(I,i);
4087  if (p==NULL)
4088  {
4089  WerrorS("module must be zero-dimensional");
4090  if (delete_w) delete w;
4091  return TRUE;
4092  }
4093  if (po==NULL)
4094  {
4095  po=p;
4096  }
4097  else
4098  {
4099  // now po!=NULL, p!=NULL
4100  int d=(currRing->pFDeg(po,currRing)-(*w)[pGetComp(po)-1] - currRing->pFDeg(p,currRing)+(*w)[i-1]);
4101  if (d==0)
4102  d=pLmCmp(po,p);
4103  if (d > 0)
4104  {
4105  pDelete(&p);
4106  }
4107  else // (d < 0)
4108  {
4109  pDelete(&po); po=p;
4110  }
4111  }
4112  }
4113  if (delete_w) delete w;
4114  res->data=(void *)po;
4115  return FALSE;
4116 }
#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:88
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:137
#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 4117 of file iparith.cc.

4118 {
4119 #ifdef HAVE_RINGS
4121  {
4122  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4123  PrintS("// performed for generic fibre, that is, over Q\n");
4124  }
4125 #endif
4126  assumeStdFlag(v);
4127  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4128  //scHilbertPoly((ideal)v->Data(),currRing->qideal);
4129  hLookSeries((ideal)v->Data(),module_w,currRing->qideal);
4130  return FALSE;
4131 }
#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:137
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:1388

◆ 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:88
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:137
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1317
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:1309

◆ jjHILBERT3()

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

Definition at line 5739 of file iparith.cc.

5740 {
5741  intvec *wdegree=(intvec*)w->Data();
5742  if (wdegree->length()!=currRing->N)
5743  {
5744  Werror("weight vector must have size %d, not %d",
5745  currRing->N,wdegree->length());
5746  return TRUE;
5747  }
5748 #ifdef HAVE_RINGS
5750  {
5751  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
5752  PrintS("// performed for generic fibre, that is, over Q\n");
5753  }
5754 #endif
5755  assumeStdFlag(u);
5756  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
5757  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal,wdegree);
5758  switch((int)(long)v->Data())
5759  {
5760  case 1:
5761  res->data=(void *)iv;
5762  return FALSE;
5763  case 2:
5764  res->data=(void *)hSecondSeries(iv);
5765  delete iv;
5766  return FALSE;
5767  }
5768  delete iv;
5770  return TRUE;
5771 }
#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:88
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:137
int length() const
Definition: intvec.h:86
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1317
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:1309
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjHILBERT_IV()

static BOOLEAN jjHILBERT_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4132 of file iparith.cc.

4133 {
4134 #ifdef HAVE_RINGS
4136  {
4137  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4138  PrintS("// performed for generic fibre, that is, over Q\n");
4139  }
4140 #endif
4141  res->data=(void *)hSecondSeries((intvec *)v->Data());
4142  return FALSE;
4143 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:1317
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 4144 of file iparith.cc.

4145 {
4146  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4147  ideal v_id=(ideal)v->Data();
4148  if (w==NULL)
4149  {
4150  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
4151  if (res->data!=NULL)
4152  {
4153  if (v->rtyp==IDHDL)
4154  {
4155  char *s_isHomog=omStrDup("isHomog");
4156  if (v->e==NULL)
4157  atSet((idhdl)(v->data),s_isHomog,w,INTVEC_CMD);
4158  else
4159  atSet((idhdl)(v->LData()),s_isHomog,w,INTVEC_CMD);
4160  }
4161  else if (w!=NULL) delete w;
4162  } // if res->data==NULL then w==NULL
4163  }
4164  else
4165  {
4166  res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w);
4167  if((res->data==NULL) && (v->rtyp==IDHDL))
4168  {
4169  if (v->e==NULL)
4170  atKill((idhdl)(v->data),"isHomog");
4171  else
4172  atKill((idhdl)(v->LData()),"isHomog");
4173  }
4174  }
4175  return FALSE;
4176 }
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1884
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
#define atKill(H, A)
Definition: attrib.h:44
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
leftv LData()
Definition: subexpr.cc:1406
#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:88
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
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:3543
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2218
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3555
#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

◆ 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:88
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 5772 of file iparith.cc.

5773 {
5774  PrintS("TODO\n");
5775  int i=pVar((poly)v->Data());
5776  if (i==0)
5777  {
5778  WerrorS("ringvar expected");
5779  return TRUE;
5780  }
5781  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5782  int d=pWTotaldegree(p);
5783  pLmDelete(p);
5784  if (d==1)
5785  res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
5786  else
5787  WerrorS("variable must have weight 1");
5788  return (d!=1);
5789 }
#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:88
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:3200
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:88
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 5790 of file iparith.cc.

5791 {
5792  PrintS("TODO\n");
5793  int i=pVar((poly)v->Data());
5794  if (i==0)
5795  {
5796  WerrorS("ringvar expected");
5797  return TRUE;
5798  }
5799  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5800  int d=pWTotaldegree(p);
5801  pLmDelete(p);
5802  if (d==1)
5803  res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
5804  else
5805  WerrorS("variable must have weight 1");
5806  return (d!=1);
5807 }
#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:3200
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:88
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 4183 of file iparith.cc.

4184 {
4185  matrix mat=(matrix)v->CopyD(MATRIX_CMD);
4186  IDELEMS((ideal)mat)=MATCOLS(mat)*MATROWS(mat);
4187  if (IDELEMS((ideal)mat)==0)
4188  {
4189  idDelete((ideal *)&mat);
4190  mat=(matrix)idInit(1,1);
4191  }
4192  else
4193  {
4194  MATROWS(mat)=1;
4195  mat->rank=1;
4196  idTest((ideal)mat);
4197  }
4198  res->data=(char *)mat;
4199  return FALSE;
4200 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4201 of file iparith.cc.

4202 {
4203  map m=(map)v->CopyD(MAP_CMD);
4204  omFree((ADDRESS)m->preimage);
4205  m->preimage=NULL;
4206  ideal I=(ideal)m;
4207  I->rank=1;
4208  res->data=(char *)I;
4209  return FALSE;
4210 }
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:88
#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 6685 of file iparith.cc.

6686 {
6687  int s=1;
6688  leftv h=v;
6689  if (h!=NULL) s=exprlist_length(h);
6690  ideal id=idInit(s,1);
6691  int rank=1;
6692  int i=0;
6693  poly p;
6694  while (h!=NULL)
6695  {
6696  switch(h->Typ())
6697  {
6698  case POLY_CMD:
6699  {
6700  p=(poly)h->CopyD(POLY_CMD);
6701  break;
6702  }
6703  case INT_CMD:
6704  {
6705  number n=nInit((int)(long)h->Data());
6706  if (!nIsZero(n))
6707  {
6708  p=pNSet(n);
6709  }
6710  else
6711  {
6712  p=NULL;
6713  nDelete(&n);
6714  }
6715  break;
6716  }
6717  case BIGINT_CMD:
6718  {
6719  number b=(number)h->Data();
6721  if (nMap==NULL) return TRUE;
6722  number n=nMap(b,coeffs_BIGINT,currRing->cf);
6723  if (!nIsZero(n))
6724  {
6725  p=pNSet(n);
6726  }
6727  else
6728  {
6729  p=NULL;
6730  nDelete(&n);
6731  }
6732  break;
6733  }
6734  case NUMBER_CMD:
6735  {
6736  number n=(number)h->CopyD(NUMBER_CMD);
6737  if (!nIsZero(n))
6738  {
6739  p=pNSet(n);
6740  }
6741  else
6742  {
6743  p=NULL;
6744  nDelete(&n);
6745  }
6746  break;
6747  }
6748  case VECTOR_CMD:
6749  {
6750  p=(poly)h->CopyD(VECTOR_CMD);
6751  if (iiOp!=MODUL_CMD)
6752  {
6753  idDelete(&id);
6754  pDelete(&p);
6755  return TRUE;
6756  }
6757  rank=si_max(rank,(int)pMaxComp(p));
6758  break;
6759  }
6760  default:
6761  {
6762  idDelete(&id);
6763  return TRUE;
6764  }
6765  }
6766  if ((iiOp==MODUL_CMD)&&(p!=NULL)&&(pGetComp(p)==0))
6767  {
6768  pSetCompP(p,1);
6769  }
6770  id->m[i]=p;
6771  i++;
6772  h=h->next;
6773  }
6774  id->rank=rank;
6775  res->data=(char *)id;
6776  return FALSE;
6777 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
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:86
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 4211 of file iparith.cc.

4212 {
4213  if (currRing!=NULL)
4214  {
4215  ring q=(ring)v->Data();
4216  if (rSamePolyRep(currRing, q))
4217  {
4218  if (q->qideal==NULL)
4219  res->data=(char *)idInit(1,1);
4220  else
4221  res->data=(char *)idCopy(q->qideal);
4222  return FALSE;
4223  }
4224  }
4225  WerrorS("can only get ideal from identical qring");
4226  return TRUE;
4227 }
#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:88
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:1677
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 5246 of file iparith.cc.

5247 {
5248  res->data = (char *)(long)idElem((ideal)v->Data());
5249  return FALSE;
5250 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5251 of file iparith.cc.

5252 {
5253  res->data = (char *)id_FreeModule((int)(long)v->Data(), currRing);
5254  return FALSE;
5255 }
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:88
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 5271 of file iparith.cc.

5272 {
5273  res->data = (char *)id_Head((ideal)v->Data(),currRing);
5274  setFlag(res,FLAG_STD);
5275  return FALSE;
5276 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4177 of file iparith.cc.

4178 {
4179  res->data = (char *)idMaxIdeal((int)(long)v->Data());
4180  setFlag(res,FLAG_STD);
4181  return FALSE;
4182 }
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition: ideals.h:33
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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 5277 of file iparith.cc.

5278 {
5279  res->data = (char *)idMinBase((ideal)v->Data());
5280  return FALSE;
5281 }
#define FALSE
Definition: auxiliary.h:94
ideal idMinBase(ideal h1)
Definition: ideals.cc:48
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjidTransp()

static BOOLEAN jjidTransp ( leftv  res,
leftv  v 
)
static

Definition at line 5329 of file iparith.cc.

5330 {
5331  res->data = (char *)id_Transp((ideal)v->Data(),currRing);
5332  return FALSE;
5333 }
ideal id_Transp(ideal a, const ring rRing)
transpose a module
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5256 of file iparith.cc.

5257 {
5258  res->data = (char *)id_Vec2Ideal((poly)v->Data(), currRing);
5259  return FALSE;
5260 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4228 of file iparith.cc.

4229 {
4230  intvec *iv = (intvec *)v->CopyD(INTMAT_CMD);
4231  iv->makeVector();
4232  res->data = iv;
4233  return FALSE;
4234 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4235 of file iparith.cc.

4236 {
4237  res->data = (char *)n_ImPart((number)v->Data(),currRing->cf);
4238  return FALSE;
4239 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4240 of file iparith.cc.

4241 {
4242  assumeStdFlag(v);
4243  res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal);
4244  return FALSE;
4245 }
intvec * scIndIntvec(ideal S, ideal Q)
Definition: hdegree.cc:212
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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:82
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
sleftv * leftv
Definition: structs.h:60
void * data
Definition: subexpr.h:88
const char * name
Definition: subexpr.h:87
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7939
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:8130

◆ 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:82
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:105
BITSET flag
Definition: subexpr.h:90
#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:88
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
const char * name
Definition: subexpr.h:87
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
#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:91
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:7939
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:88
#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:88
#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:88
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:88
#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:88
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 4246 of file iparith.cc.

4247 {
4248  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
4249 #ifdef HAVE_RINGS
4251  WarnS("interred: this command is experimental over the integers");
4252 #endif
4253  if (TEST_OPT_PROT) { PrintLn(); mflush(); }
4254  res->data = result;
4255  return FALSE;
4256 }
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:88
#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:88
ideal idSect(ideal h1, ideal h2)
Definition: ideals.cc:204
#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 6907 of file iparith.cc.

6908 {
6909  leftv h=v;
6910  int l=v->listLength();
6911  resolvente r=(resolvente)omAlloc0(l*sizeof(ideal));
6912  BOOLEAN *copied=(BOOLEAN *)omAlloc0(l*sizeof(BOOLEAN));
6913  int t=0;
6914  // try to convert to IDEAL_CMD
6915  while (h!=NULL)
6916  {
6917  if (iiTestConvert(h->Typ(),IDEAL_CMD)!=0)
6918  {
6919  t=IDEAL_CMD;
6920  }
6921  else break;
6922  h=h->next;
6923  }
6924  // if failure, try MODUL_CMD
6925  if (t==0)
6926  {
6927  h=v;
6928  while (h!=NULL)
6929  {
6930  if (iiTestConvert(h->Typ(),MODUL_CMD)!=0)
6931  {
6932  t=MODUL_CMD;
6933  }
6934  else break;
6935  h=h->next;
6936  }
6937  }
6938  // check for success in converting
6939  if (t==0)
6940  {
6941  WerrorS("cannot convert to ideal or module");
6942  return TRUE;
6943  }
6944  // call idMultSect
6945  h=v;
6946  int i=0;
6947  sleftv tmp;
6948  while (h!=NULL)
6949  {
6950  if (h->Typ()==t)
6951  {
6952  r[i]=(ideal)h->Data(); /*no copy*/
6953  h=h->next;
6954  }
6955  else if(iiConvert(h->Typ(),t,iiTestConvert(h->Typ(),t),h,&tmp))
6956  {
6957  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
6958  omFreeSize((ADDRESS)r,l*sizeof(ideal));
6959  Werror("cannot convert arg. %d to %s",i+1,Tok2Cmdname(t));
6960  return TRUE;
6961  }
6962  else
6963  {
6964  r[i]=(ideal)tmp.Data(); /*now it's a copy*/
6965  copied[i]=TRUE;
6966  h=tmp.next;
6967  }
6968  i++;
6969  }
6970  res->rtyp=t;
6971  res->data=(char *)idMultSect(r,i);
6972  while(i>0)
6973  {
6974  i--;
6975  if (copied[i]) idDelete(&(r[i]));
6976  }
6977  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
6978  omFreeSize((ADDRESS)r,l*sizeof(ideal));
6979  return FALSE;
6980 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:344
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:88
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
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 5808 of file iparith.cc.

5809 {
5810  intvec* im= new intvec((int)(long)v->Data(),(int)(long)w->Data(), 0);
5811  intvec* arg = (intvec*) u->Data();
5812  int i, n = si_min(im->cols()*im->rows(), arg->cols()*arg->rows());
5813 
5814  for (i=0; i<n; i++)
5815  {
5816  (*im)[i] = (*arg)[i];
5817  }
5818 
5819  res->data = (char *)im;
5820  return FALSE;
5821 }
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:88
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 7143 of file iparith.cc.

7144 {
7145  int i=0;
7146  leftv h=v;
7147  if (h!=NULL) i=exprlist_length(h);
7148  intvec *iv=new intvec(i);
7149  i=0;
7150  while (h!=NULL)
7151  {
7152  if(h->Typ()==INT_CMD)
7153  {
7154  (*iv)[i]=(int)(long)h->Data();
7155  }
7156  else if (h->Typ()==INTVEC_CMD)
7157  {
7158  intvec *ivv=(intvec*)h->Data();
7159  for(int j=0;j<ivv->length();j++,i++)
7160  {
7161  (*iv)[i]=(*ivv)[j];
7162  }
7163  i--;
7164  }
7165  else
7166  {
7167  delete iv;
7168  return TRUE;
7169  }
7170  i++;
7171  h=h->next;
7172  }
7173  res->data=(char *)iv;
7174  return FALSE;
7175 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
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 4268 of file iparith.cc.

4269 {
4270  res->data = (char *)0;
4271  return FALSE;
4272 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88

◆ jjIS_RINGVAR_P()

static BOOLEAN jjIS_RINGVAR_P ( leftv  res,
leftv  v 
)
static

Definition at line 4257 of file iparith.cc.

4258 {
4259  res->data = (char *)(long)pVar((poly)v->Data());
4260  return FALSE;
4261 }
#define pVar(m)
Definition: polys.h:364
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4262 of file iparith.cc.

4263 {
4264  res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing->names,
4265  currRing->N)+1);
4266  return FALSE;
4267 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4304 of file iparith.cc.

4305 {
4306  ideal id = (ideal)a->Data();
4307  id = id_Transp(id,currRing);
4308  int W = IDELEMS(id);
4309 
4310  ideal result = idInit(W * currRing->N, id->rank);
4311  poly *p = result->m;
4312 
4313  for( int v = 1; v <= currRing->N; v++ )
4314  {
4315  poly* q = id->m;
4316  for( int i = 0; i < W; i++, p++, q++ )
4317  *p = pDiff( *q, v );
4318  }
4319  idDelete(&id);
4320 
4321  res->data = (char *)result;
4322  return FALSE;
4323 }
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:88
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 4273 of file iparith.cc.

4274 {
4275  ideal i=idInit(currRing->N,1);
4276  int k;
4277  poly p=(poly)(v->Data());
4278  for (k=currRing->N;k>0;k--)
4279  {
4280  i->m[k-1]=pDiff(p,k);
4281  }
4282  res->data = (char *)i;
4283  return FALSE;
4284 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:88
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:82
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:82
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 7176 of file iparith.cc.

7177 {
7178  const short t1[]={4,POLY_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7179  const short t2[]={4,VECTOR_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7180  const short t3[]={4,IDEAL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7181  const short t4[]={4,MODUL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7182  leftv u1=u;
7183  leftv u2=u1->next;
7184  leftv u3=u2->next;
7185  leftv u4=u3->next;
7186  if (iiCheckTypes(u,t1)||iiCheckTypes(u,t2))
7187  {
7188  if(!pIsUnit((poly)u2->Data()))
7189  {
7190  WerrorS("2nd argument must be a unit");
7191  return TRUE;
7192  }
7193  res->rtyp=u1->Typ();
7194  res->data=(char*)pSeries((int)(long)u3->Data(),pCopy((poly)u1->Data()),
7195  pCopy((poly)u2->Data()),(intvec*)u4->Data());
7196  return FALSE;
7197  }
7198  else
7199  if (iiCheckTypes(u,t3)||iiCheckTypes(u,t4))
7200  {
7201  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7202  {
7203  WerrorS("2nd argument must be a diagonal matrix of units");
7204  return TRUE;
7205  }
7206  res->rtyp=u1->Typ();
7207  res->data=(char*)idSeries(
7208  (int)(long)u3->Data(),
7209  idCopy((ideal)u1->Data()),
7210  mp_Copy((matrix)u2->Data(), currRing),
7211  (intvec*)u4->Data()
7212  );
7213  return FALSE;
7214  }
7215  else
7216  {
7217  Werror("%s(`poly`,`poly`,`int`,`intvec`) exppected",
7218  Tok2Cmdname(iiOp));
7219  return TRUE;
7220  }
7221 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
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:8851
ideal idSeries(int n, ideal M, matrix U, intvec *w)
Definition: ideals.cc:1936
Definition: intvec.h:14
ideal idCopy(ideal A)
Definition: ideals.h:60
leftv next
Definition: subexpr.h:86
#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:6466
int rtyp
Definition: subexpr.h:91
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:725
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:71
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:88
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 5839 of file iparith.cc.

5840 {
5841  res->data = (char *)id_JetW((ideal)u->Data(),(int)(long)v->Data(),
5842  (intvec *)w->Data(),currRing);
5843  return FALSE;
5844 }
#define FALSE
Definition: auxiliary.h:94
ideal id_JetW(ideal i, int d, intvec *iv, const ring R)
void * data
Definition: subexpr.h:88
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 5845 of file iparith.cc.

5846 {
5847  if (!mp_IsDiagUnit((matrix)v->Data(), currRing))
5848  {
5849  WerrorS("2nd argument must be a diagonal matrix of units");
5850  return TRUE;
5851  }
5852  res->data = (char *)idSeries((int)(long)w->Data(),(ideal)u->CopyD(),
5853  (matrix)v->CopyD());
5854  return FALSE;
5855 }
#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:88
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:1936
ip_smatrix * matrix
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:725
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:88
#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 5822 of file iparith.cc.

5823 {
5824  short *iw=iv2array((intvec *)w->Data(),currRing);
5825  res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
5826  omFreeSize( (ADDRESS)iw, (rVar(currRing)+1)*sizeof(short) );
5827  return FALSE;
5828 }
#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:88
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 5829 of file iparith.cc.

5830 {
5831  if (!pIsUnit((poly)v->Data()))
5832  {
5833  WerrorS("2nd argument must be a unit");
5834  return TRUE;
5835  }
5836  res->data = (char *)p_Series((int)(long)w->Data(),(poly)u->CopyD(),(poly)v->CopyD(),NULL,currRing);
5837  return FALSE;
5838 }
#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:88
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:4353
#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 4326 of file iparith.cc.

4327 {
4328  assumeStdFlag(v);
4329  res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal);
4330  return FALSE;
4331 }
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:88
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
#define FALSE
Definition: auxiliary.h:94
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1474
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#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:6065
#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:87
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:86
#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:82
#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:87
#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:86
#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 7259 of file iparith.cc.

7260 {
7261  if ((yyInRingConstruction)
7262  && ((strcmp(u->Name(),"real")==0) || (strcmp(u->Name(),"complex")==0)))
7263  {
7264  memcpy(res,u,sizeof(sleftv));
7265  memset(u,0,sizeof(sleftv));
7266  return FALSE;
7267  }
7268  leftv v=u->next;
7269  BOOLEAN b;
7270  if(v==NULL) // p()
7271  b=iiExprArith1(res,u,iiOp);
7272  else if ((v->next==NULL) // p(1)
7273  || (u->Typ()!=UNKNOWN)) // p(1,2), p proc or map
7274  {
7275  u->next=NULL;
7276  b=iiExprArith2(res,u,iiOp,v);
7277  u->next=v;
7278  }
7279  else // p(1,2), p undefined
7280  {
7281  if (v->Typ()!=INT_CMD)
7282  {
7283  Werror("`int` expected while building `%s(`",u->name);
7284  return TRUE;
7285  }
7286  int l=u->listLength();
7287  char * nn = (char *)omAlloc(strlen(u->name) + 12*l);
7288  sprintf(nn,"%s(%d",u->name,(int)(long)v->Data());
7289  char *s=nn;
7290  do
7291  {
7292  while (*s!='\0') s++;
7293  v=v->next;
7294  if (v->Typ()!=INT_CMD)
7295  {
7296  Werror("`int` expected while building `%s`",nn);
7297  omFree((ADDRESS)nn);
7298  return TRUE;
7299  }
7300  sprintf(s,",%d",(int)(long)v->Data());
7301  } while (v->next!=NULL);
7302  while (*s!='\0') s++;
7303  nn=strcat(nn,")");
7304  char *n=omStrDup(nn);
7305  omFree((ADDRESS)nn);
7306  syMake(res,n);
7307  b=FALSE;
7308  }
7309  return b;
7310 }
BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8319
#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:120
const char * name
Definition: subexpr.h:87
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:86
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:8130
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:82
#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:86
#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:3018
#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:82
Definition: tok.h:95
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition: ipshell.cc:3018
void * data
Definition: subexpr.h:88
#define IDELEMS(i)
Definition: simpleideals.h:24
int rtyp
Definition: subexpr.h:91
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 4332 of file iparith.cc.

4333 {
4334  res->data=(char *)syConvList((lists)v->Data());
4335  if (res->data != NULL)
4336  return FALSE;
4337  else
4338  return TRUE;
4339 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
syStrategy syConvList(lists li)
Definition: ipshell.cc:3182
void * data
Definition: subexpr.h:88
#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:88
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 4340 of file iparith.cc.

4341 {
4342  poly p=(poly)v->Data();
4343  if (p==NULL)
4344  {
4345  res->data=(char *)nInit(0);
4346  }
4347  else
4348  {
4349  res->data=(char *)nCopy(pGetCoeff(p));
4350  }
4351  return FALSE;
4352 }
#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:88
#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 4353 of file iparith.cc.

4354 {
4355  poly p=(poly)v->Data();
4356  int s=currRing->N;
4357  if (v->Typ()==VECTOR_CMD) s++;
4358  intvec *iv=new intvec(s);
4359  if (p!=NULL)
4360  {
4361  for(int i = currRing->N;i;i--)
4362  {
4363  (*iv)[i-1]=pGetExp(p,i);
4364  }
4365  if (s!=currRing->N)
4366  (*iv)[currRing->N]=pGetComp(p);
4367  }
4368  res->data=(char *)iv;
4369  return FALSE;
4370 }
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:88
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 4371 of file iparith.cc.

4372 {
4373  poly p=(poly)v->Data();
4374  if (p == NULL)
4375  {
4376  res->data = (char*) NULL;
4377  }
4378  else
4379  {
4380  poly lm = pLmInit(p);
4381  pSetCoeff(lm, nInit(1));
4382  res->data = (char*) lm;
4383  }
4384  return FALSE;
4385 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
#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:88
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, GbVariant alg)
Definition: ideals.cc:938

◆ jjLIFT3()

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

Definition at line 6364 of file iparith.cc.

6365 {
6366  if (w->rtyp!=IDHDL) return TRUE;
6367  int ul= IDELEMS((ideal)u->Data());
6368  int vl= IDELEMS((ideal)v->Data());
6369  ideal m
6370  = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
6371  FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))));
6372  if (m==NULL) return TRUE;
6373  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
6374  return FALSE;
6375 }
#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:88
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:91
void * Data()
Definition: subexpr.cc:1137
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
Definition: ideals.cc:938
#define IDMATRIX(a)
Definition: ipid.h:131

◆ jjLIFT_4()

static BOOLEAN jjLIFT_4 ( leftv  res,
leftv  U 
)
static

Definition at line 7311 of file iparith.cc.

7312 {
7313  const short t1[]={4,IDEAL_CMD,IDEAL_CMD,MATRIX_CMD,STRING_CMD};
7314  const short t2[]={4,MODUL_CMD,MODUL_CMD,MATRIX_CMD,STRING_CMD};
7315  leftv u=U;
7316  leftv v=u->next;
7317  leftv w=v->next;
7318  leftv u4=w->next;
7319  if (w->rtyp!=IDHDL) return TRUE;
7320  if (iiCheckTypes(U,t1)||iiCheckTypes(U,t2))
7321  {
7322  // see jjLIFT3
7323  ideal I=(ideal)u->Data();
7324  int ul= IDELEMS(I /*(ideal)u->Data()*/);
7325  int vl= IDELEMS((ideal)v->Data());
7326  GbVariant alg=syGetAlgorithm((char*)u4->Data(),currRing,I);
7327  ideal m
7328  = idLift(I,(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
7329  FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))),alg);
7330  if (m==NULL) return TRUE;
7331  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
7332  return FALSE;
7333  }
7334  else
7335  {
7336  Werror("%s(`ideal`,`ideal`,`matrix`,`string`)\n"
7337  "or (`module`,`module`,`matrix`,`string`)expected",
7338  Tok2Cmdname(iiOp));
7339  return TRUE;
7340  }
7341 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define FALSE
Definition: auxiliary.h:94
GbVariant
Definition: ideals.h:121
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:8851
int m
Definition: cfEzgcd.cc:119
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:86
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
Definition: ideals.cc:2655
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:6466
#define hasFlag(A, F)
Definition: ipid.h:109
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
Definition: ideals.cc:938
int iiOp
Definition: iparith.cc:224
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#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:105
BITSET flag
Definition: subexpr.h:90
#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:88
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz, GbVariant alg)
Definition: ideals.cc:750
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
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 6376 of file iparith.cc.

6377 {
6378  if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
6379  if ((w->rtyp!=IDHDL)||(w->e!=NULL)) return TRUE;
6380  idhdl hv=(idhdl)v->data;
6381  idhdl hw=(idhdl)w->data;
6382  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
6383  res->data = (char *)idLiftStd((ideal)u->Data(),
6384  &(hv->data.umatrix),testHomog,
6385  &(hw->data.uideal));
6386  setFlag(res,FLAG_STD); v->flag=0; w->flag=0;
6387  return FALSE;
6388 }
Subexpr e
Definition: subexpr.h:105
BITSET flag
Definition: subexpr.h:90
#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:88
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz, GbVariant alg)
Definition: ideals.cc:750
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
utypes data
Definition: idrec.h:40

◆ jjLIFTSTD_4()

static BOOLEAN jjLIFTSTD_4 ( leftv  res,
leftv  U 
)
static

Definition at line 7342 of file iparith.cc.

7343 {
7344  const short t1[]={4,IDEAL_CMD,IDEAL_CMD,MATRIX_CMD,STRING_CMD};
7345  const short t2[]={4,MODUL_CMD,MODUL_CMD,MATRIX_CMD,STRING_CMD};
7346  leftv u=U;
7347  leftv v=u->next;
7348  leftv w=v->next;
7349  leftv u4=w->next;
7350  if (v->rtyp!=IDHDL) return TRUE;
7351  if (w->rtyp!=IDHDL) return TRUE;
7352  if (iiCheckTypes(U,t1)||iiCheckTypes(U,t2))
7353  {
7354  // see jjLIFTSTD3
7355  ideal I=(ideal)u->Data();
7356  idhdl hv=(idhdl)v->data;
7357  idhdl hw=(idhdl)w->data;
7358  GbVariant alg=syGetAlgorithm((char*)u4->Data(),currRing,I);
7359  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
7360  res->data = (char *)idLiftStd((ideal)u->Data(),
7361  &(hv->data.umatrix),testHomog,
7362  &(hw->data.uideal),alg);
7363  setFlag(res,FLAG_STD); v->flag=0; w->flag=0;
7364  return FALSE;
7365  }
7366  else
7367  {
7368  Werror("%s(`ideal`,`ideal`,`matrix`,`string`)\n"
7369  "or (`module`,`module`,`matrix`,`string`)expected",
7370  Tok2Cmdname(iiOp));
7371  return TRUE;
7372  }
7373 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
BITSET flag
Definition: subexpr.h:90
#define FALSE
Definition: auxiliary.h:94
GbVariant
Definition: ideals.h:121
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:8851
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz, GbVariant alg)
Definition: ideals.cc:750
leftv next
Definition: subexpr.h:86
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
Definition: ideals.cc:2655
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:6466
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
int iiOp
Definition: iparith.cc:224
void Werror(const char *fmt,...)
Definition: reporter.cc:189
utypes data
Definition: idrec.h:40

◆ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv  res,
leftv  v 
)

Definition at line 7374 of file iparith.cc.

7375 {
7376  int sl=0;
7377  if (v!=NULL) sl = v->listLength();
7378  lists L;
7379  if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
7380  {
7381  int add_row_shift = 0;
7382  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
7383  if (weights!=NULL) add_row_shift=weights->min_in();
7384  L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
7385  }
7386  else
7387  {
7389  leftv h=NULL;
7390  int i;
7391  int rt;
7392 
7393  L->Init(sl);
7394  for (i=0;i<sl;i++)
7395  {
7396  if (h!=NULL)
7397  { /* e.g. not in the first step:
7398  * h is the pointer to the old sleftv,
7399  * v is the pointer to the next sleftv
7400  * (in this moment) */
7401  h->next=v;
7402  }
7403  h=v;
7404  v=v->next;
7405  h->next=NULL;
7406  rt=h->Typ();
7407  if (rt==0)
7408  {
7409  L->Clean();
7410  Werror("`%s` is undefined",h->Fullname());
7411  return TRUE;
7412  }
7413  if (rt==RING_CMD)
7414  {
7415  L->m[i].rtyp=rt; L->m[i].data=h->Data();
7416  ((ring)L->m[i].data)->ref++;
7417  }
7418  else
7419  L->m[i].Copy(h);
7420  }
7421  }
7422  res->data=(char *)L;
7423  return FALSE;
7424 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3109
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:125
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
void Copy(leftv e)
Definition: subexpr.cc:688
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
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:137
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:91
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 4390 of file iparith.cc.

4391 {
4392  ring r=rCompose((lists)v->Data());
4393  if (r==NULL) return TRUE;
4394  res->data=(char *)r;
4395  return FALSE;
4396 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
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:2731
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD()

BOOLEAN jjLOAD ( const char *  s,
BOOLEAN  autoexport 
)

load lib/module given in v

Definition at line 5157 of file iparith.cc.

5158 {
5159  char libnamebuf[1024];
5160  lib_types LT = type_of_LIB(s, libnamebuf);
5161 
5162 #ifdef HAVE_DYNAMIC_LOADING
5163  extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
5164 #endif /* HAVE_DYNAMIC_LOADING */
5165  switch(LT)
5166  {
5167  default:
5168  case LT_NONE:
5169  Werror("%s: unknown type", s);
5170  break;
5171  case LT_NOTFOUND:
5172  Werror("cannot open %s", s);
5173  break;
5174 
5175  case LT_SINGULAR:
5176  {
5177  char *plib = iiConvName(s);
5178  idhdl pl = IDROOT->get(plib,0);
5179  if (pl==NULL)
5180  {
5181  pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
5182  IDPACKAGE(pl)->language = LANG_SINGULAR;
5183  IDPACKAGE(pl)->libname=plib;
5184  }
5185  else if (IDTYP(pl)!=PACKAGE_CMD)
5186  {
5187  Werror("can not create package `%s`",plib);
5188  omFree(plib);
5189  return TRUE;
5190  }
5191  else
5192  omFree(plib);
5193  package savepack=currPack;
5194  currPack=IDPACKAGE(pl);
5195  IDPACKAGE(pl)->loaded=TRUE;
5196  char libnamebuf[1024];
5197  FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
5198  BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
5199  currPack=savepack;
5200  IDPACKAGE(pl)->loaded=(!bo);
5201  return bo;
5202  }
5203  case LT_BUILTIN:
5204  SModulFunc_t iiGetBuiltinModInit(const char*);
5205  return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
5206  case LT_MACH_O:
5207  case LT_ELF:
5208  case LT_HPUX:
5209 #ifdef HAVE_DYNAMIC_LOADING
5210  return load_modules(s, libnamebuf, autoexport);
5211 #else /* HAVE_DYNAMIC_LOADING */
5212  WerrorS("Dynamic modules are not supported by this version of Singular");
5213  break;
5214 #endif /* HAVE_DYNAMIC_LOADING */
5215  }
5216  return TRUE;
5217 }
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:1206
#define NULL
Definition: omList.c:10
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition: iplib.cc:769
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:933
char * iiConvName(const char *libname)
Definition: iplib.cc:1340
int BOOLEAN
Definition: auxiliary.h:85
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition: iplib.cc:1108
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjLOAD1()

static BOOLEAN jjLOAD1 ( leftv  ,
leftv  v 
)
static

Definition at line 4386 of file iparith.cc.

4387 {
4388  return jjLOAD((char*)v->Data(),FALSE);
4389 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5157
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:5157
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:5157
BOOLEAN jjLOAD_TRY(const char *s)
Definition: iparith.cc:5223
void * Data()
Definition: subexpr.cc:1137

◆ jjLOAD_TRY()

BOOLEAN jjLOAD_TRY ( const char *  s)

Definition at line 5223 of file iparith.cc.

5224 {
5225  void (*WerrorS_save)(const char *s) = WerrorS_callback;
5228  BOOLEAN bo=jjLOAD(s,TRUE);
5229  if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5230  Print("loading of >%s< failed\n",s);
5231  WerrorS_callback=WerrorS_save;
5232  errorreported=0;
5233  return FALSE;
5234 }
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:5218
#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:5157
static void WerrorS_dummy(const char *)
Definition: iparith.cc:5219
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:88
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 4406 of file iparith.cc.

4407 {
4408  /* computes the LU-decomposition of a matrix M;
4409  i.e., M = P * L * U, where
4410  - P is a row permutation matrix,
4411  - L is in lower triangular form,
4412  - U is in upper row echelon form
4413  Then, we also have P * M = L * U.
4414  A list [P, L, U] is returned. */
4415  matrix mat = (const matrix)v->Data();
4416  if (!idIsConstant((ideal)mat))
4417  {
4418  WerrorS("matrix must be constant");
4419  return TRUE;
4420  }
4421  matrix pMat;
4422  matrix lMat;
4423  matrix uMat;
4424 
4425  luDecomp(mat, pMat, lMat, uMat);
4426 
4428  ll->Init(3);
4429  ll->m[0].rtyp=MATRIX_CMD; ll->m[0].data=(void *)pMat;
4430  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)lMat;
4431  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)uMat;
4432  res->data=(char*)ll;
4433 
4434  return FALSE;
4435 }
#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:88
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:91
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 6981 of file iparith.cc.

6982 {
6983  /* computation of the inverse of a quadratic matrix A
6984  using the L-U-decomposition of A;
6985  There are two valid parametrisations:
6986  1) exactly one argument which is just the matrix A,
6987  2) exactly three arguments P, L, U which already
6988  realise the L-U-decomposition of A, that is,
6989  P * A = L * U, and P, L, and U satisfy the
6990  properties decribed in method 'jjLU_DECOMP';
6991  see there;
6992  If A is invertible, the list [1, A^(-1)] is returned,
6993  otherwise the list [0] is returned. Thus, the user may
6994  inspect the first entry of the returned list to see
6995  whether A is invertible. */
6996  matrix iMat; int invertible;
6997  const short t1[]={1,MATRIX_CMD};
6998  const short t2[]={3,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
6999  if (iiCheckTypes(v,t1))
7000  {
7001  matrix aMat = (matrix)v->Data();
7002  int rr = aMat->rows();
7003  int cc = aMat->cols();
7004  if (rr != cc)
7005  {
7006  Werror("given matrix (%d x %d) is not quadratic, hence not invertible", rr, cc);
7007  return TRUE;
7008  }
7009  if (!idIsConstant((ideal)aMat))
7010  {
7011  WerrorS("matrix must be constant");
7012  return TRUE;
7013  }
7014  invertible = luInverse(aMat, iMat);
7015  }
7016  else if (iiCheckTypes(v,t2))
7017  {
7018  matrix pMat = (matrix)v->Data();
7019  matrix lMat = (matrix)v->next->Data();
7020  matrix uMat = (matrix)v->next->next->Data();
7021  int rr = uMat->rows();
7022  int cc = uMat->cols();
7023  if (rr != cc)
7024  {
7025  Werror("third matrix (%d x %d) is not quadratic, hence not invertible",
7026  rr, cc);
7027  return TRUE;
7028  }
7029  if (!idIsConstant((ideal)pMat)
7030  || (!idIsConstant((ideal)lMat))
7031  || (!idIsConstant((ideal)uMat))
7032  )
7033  {
7034  WerrorS("matricesx must be constant");
7035  return TRUE;
7036  }
7037  invertible = luInverseFromLUDecomp(pMat, lMat, uMat, iMat);
7038  }
7039  else
7040  {
7041  Werror("expected either one or three matrices");
7042  return TRUE;
7043  }
7044 
7045  /* build the return structure; a list with either one or two entries */
7047  if (invertible)
7048  {
7049  ll->Init(2);
7050  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7051  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)iMat;
7052  }
7053  else
7054  {
7055  ll->Init(1);
7056  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7057  }
7058 
7059  res->data=(char*)ll;
7060  return FALSE;
7061 }
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:88
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:86
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:6466
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:91
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 7062 of file iparith.cc.

7063 {
7064  /* for solving a linear equation system A * x = b, via the
7065  given LU-decomposition of the matrix A;
7066  There is one valid parametrisation:
7067  1) exactly four arguments P, L, U, b;
7068  P, L, and U realise the L-U-decomposition of A, that is,
7069  P * A = L * U, and P, L, and U satisfy the
7070  properties decribed in method 'jjLU_DECOMP';
7071  see there;
7072  b is the right-hand side vector of the equation system;
7073  The method will return a list of either 1 entry or three entries:
7074  1) [0] if there is no solution to the system;
7075  2) [1, x, H] if there is at least one solution;
7076  x is any solution of the given linear system,
7077  H is the matrix with column vectors spanning the homogeneous
7078  solution space.
7079  The method produces an error if matrix and vector sizes do not fit. */
7080  const short t[]={4,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
7081  if (!iiCheckTypes(v,t))
7082  {
7083  WerrorS("expected exactly three matrices and one vector as input");
7084  return TRUE;
7085  }
7086  matrix pMat = (matrix)v->Data();
7087  matrix lMat = (matrix)v->next->Data();
7088  matrix uMat = (matrix)v->next->next->Data();
7089  matrix bVec = (matrix)v->next->next->next->Data();
7090  matrix xVec; int solvable; matrix homogSolSpace;
7091  if (pMat->rows() != pMat->cols())
7092  {
7093  Werror("first matrix (%d x %d) is not quadratic",
7094  pMat->rows(), pMat->cols());
7095  return TRUE;
7096  }
7097  if (lMat->rows() != lMat->cols())
7098  {
7099  Werror("second matrix (%d x %d) is not quadratic",
7100  lMat->rows(), lMat->cols());
7101  return TRUE;
7102  }
7103  if (lMat->rows() != uMat->rows())
7104  {
7105  Werror("second matrix (%d x %d) and third matrix (%d x %d) do not fit",
7106  lMat->rows(), lMat->cols(), uMat->rows(), uMat->cols());
7107  return TRUE;
7108  }
7109  if (uMat->rows() != bVec->rows())
7110  {
7111  Werror("third matrix (%d x %d) and vector (%d x 1) do not fit",
7112  uMat->rows(), uMat->cols(), bVec->rows());
7113  return TRUE;
7114  }
7115  if (!idIsConstant((ideal)pMat)
7116  ||(!idIsConstant((ideal)lMat))
7117  ||(!idIsConstant((ideal)uMat))
7118  )
7119  {
7120  WerrorS("matrices must be constant");
7121  return TRUE;
7122  }
7123  solvable = luSolveViaLUDecomp(pMat, lMat, uMat, bVec, xVec, homogSolSpace);
7124 
7125  /* build the return structure; a list with either one or three entries */
7127  if (solvable)
7128  {
7129  ll->Init(3);
7130  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7131  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
7132  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
7133  }
7134  else
7135  {
7136  ll->Init(1);
7137  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7138  }
7139 
7140  res->data=(char*)ll;
7141  return FALSE;
7142 }
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:88
ip_smatrix * matrix
leftv next
Definition: subexpr.h:86
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:6466
int rtyp
Definition: subexpr.h:91
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 7939 of file iparith.cc.

7940 {
7941  assume( e->Typ()==INT_CMD );
7942  Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
7943  r->start =(int)(long)e->Data();
7944  return r;
7945 }
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:82
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
const char * Name()
Definition: subexpr.h:120
const char * name
Definition: subexpr.h:87
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 6302 of file iparith.cc.

6303 {
6304  int mi=(int)(long)v->Data();
6305  int ni=(int)(long)w->Data();
6306  if ((mi<1)||(ni<1))
6307  {
6308  Werror("converting ideal to matrix: dimensions must be positive(%dx%d)",mi,ni);
6309  return TRUE;
6310  }
6311  matrix m=mpNew(mi,ni);
6312  ideal I=(ideal)u->CopyD(IDEAL_CMD);
6313  int i=si_min(IDELEMS(I),mi*ni);
6314  //for(i=i-1;i>=0;i--)
6315  //{
6316  // m->m[i]=I->m[i];
6317  // I->m[i]=NULL;
6318  //}
6319  memcpy(m->m,I->m,i*sizeof(poly));
6320  memset(I->m,0,i*sizeof(poly));
6321  id_Delete(&I,currRing);
6322  res->data = (char *)m;
6323  return FALSE;
6324 }
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:88
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:44
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 6338 of file iparith.cc.

6339 {
6340  int mi=(int)(long)v->Data();
6341  int ni=(int)(long)w->Data();
6342  if ((mi<1)||(ni<1))
6343  {
6344  Werror("converting matrix to matrix: dimensions must be positive(%dx%d)",mi,ni);
6345  return TRUE;
6346  }
6347  matrix m=mpNew(mi,ni);
6348  matrix I=(matrix)u->CopyD(MATRIX_CMD);
6349  int r=si_min(MATROWS(I),mi);
6350  int c=si_min(MATCOLS(I),ni);
6351  int i,j;
6352  for(i=r;i>0;i--)
6353  {
6354  for(j=c;j>0;j--)
6355  {
6356  MATELEM(m,i,j)=MATELEM(I,i,j);
6357  MATELEM(I,i,j)=NULL;
6358  }
6359  }
6360  id_Delete((ideal *)&I,currRing);
6361  res->data = (char *)m;
6362  return FALSE;
6363 }
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:88
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:44
#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 6325 of file iparith.cc.

6326 {
6327  int mi=(int)(long)v->Data();
6328  int ni=(int)(long)w->Data();
6329  if ((mi<1)||(ni<1))
6330  {
6331  Werror("converting module to matrix: dimensions must be positive(%dx%d)",mi,ni);
6332  return TRUE;
6333  }
6334  res->data = (char *)id_Module2formatedMatrix((ideal)u->CopyD(MODUL_CMD),
6335  mi,ni,currRing);
6336  return FALSE;
6337 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
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 4436 of file iparith.cc.

4437 {
4438  // clean out "_":
4440  memset(&sLastPrinted,0,sizeof(sleftv));
4441  // collect all info:
4442  omUpdateInfo();
4443  switch(((int)(long)v->Data()))
4444  {
4445  case 0:
4446  res->data=(char *)n_Init(om_Info.UsedBytes,coeffs_BIGINT);
4447  break;
4448  case 1:
4449  res->data = (char *)n_Init(om_Info.CurrentBytesSystem,coeffs_BIGINT);
4450  break;
4451  case 2:
4452  res->data = (char *)n_Init(om_Info.MaxBytesSystem,coeffs_BIGINT);
4453  break;
4454  default:
4455  omPrintStats(stdout);
4456  omPrintInfo(stdout);
4457  omPrintBinStats(stdout);
4458  res->data = (char *)0;
4459  res->rtyp = NONE;
4460  }
4461  return FALSE;
4462  res->data = (char *)0;
4463  return FALSE;
4464 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
omInfo_t om_Info
Definition: omStats.c:13
void omUpdateInfo()
Definition: omStats.c:24
int rtyp
Definition: subexpr.h:91
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 5856 of file iparith.cc.

5857 {
5858  /* Here's the use pattern for the minor command:
5859  minor ( matrix_expression m, int_expression minorSize,
5860  optional ideal_expression IasSB, optional int_expression k,
5861  optional string_expression algorithm,
5862  optional int_expression cachedMinors,
5863  optional int_expression cachedMonomials )
5864  This method here assumes that there are at least two arguments.
5865  - If IasSB is present, it must be a std basis. All minors will be
5866  reduced w.r.t. IasSB.
5867  - If k is absent, all non-zero minors will be computed.
5868  If k is present and k > 0, the first k non-zero minors will be
5869  computed.
5870  If k is present and k < 0, the first |k| minors (some of which
5871  may be zero) will be computed.
5872  If k is present and k = 0, an error is reported.
5873  - If algorithm is absent, all the following arguments must be absent too.
5874  In this case, a heuristic picks the best-suited algorithm (among
5875  Bareiss, Laplace, and Laplace with caching).
5876  If algorithm is present, it must be one of "Bareiss", "bareiss",
5877  "Laplace", "laplace", "Cache", "cache". In the cases "Cache" and
5878  "cache" two more arguments may be given, determining how many entries
5879  the cache may have at most, and how many cached monomials there are at
5880  most. (Cached monomials are counted over all cached polynomials.)
5881  If these two additional arguments are not provided, 200 and 100000
5882  will be used as defaults.
5883  */
5884  matrix m;
5885  leftv u=v->next;
5886  v->next=NULL;
5887  int v_typ=v->Typ();
5888  if (v_typ==MATRIX_CMD)
5889  {
5890  m = (const matrix)v->Data();
5891  }
5892  else
5893  {
5894  if (v_typ==0)
5895  {
5896  Werror("`%s` is undefined",v->Fullname());
5897  return TRUE;
5898  }
5899  // try to convert to MATRIX:
5900  int ii=iiTestConvert(v_typ,MATRIX_CMD);
5901  BOOLEAN bo;
5902  sleftv tmp;
5903  if (ii>0) bo=iiConvert(v_typ,MATRIX_CMD,ii,v,&tmp);
5904  else bo=TRUE;
5905  if (bo)
5906  {
5907  Werror("cannot convert %s to matrix",Tok2Cmdname(v_typ));
5908  return TRUE;
5909  }
5910  m=(matrix)tmp.data;
5911  }
5912  const int mk = (const int)(long)u->Data();
5913  bool noIdeal = true; bool noK = true; bool noAlgorithm = true;
5914  bool noCacheMinors = true; bool noCacheMonomials = true;
5915  ideal IasSB; int k; char* algorithm; int cacheMinors; int cacheMonomials;
5916 
5917  /* here come the different cases of correct argument sets */
5918  if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD))
5919  {
5920  IasSB = (ideal)u->next->Data();
5921  noIdeal = false;
5922  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
5923  {
5924  k = (int)(long)u->next->next->Data();
5925  noK = false;
5926  assume(k != 0);
5927  if ((u->next->next->next != NULL) &&
5928  (u->next->next->next->Typ() == STRING_CMD))
5929  {
5930  algorithm = (char*)u->next->next->next->Data();
5931  noAlgorithm = false;
5932  if ((u->next->next->next->next != NULL) &&
5933  (u->next->next->next->next->Typ() == INT_CMD))
5934  {
5935  cacheMinors = (int)(long)u->next->next->next->next->Data();
5936  noCacheMinors = false;
5937  if ((u->next->next->next->next->next != NULL) &&
5938  (u->next->next->next->next->next->Typ() == INT_CMD))
5939  {
5940  cacheMonomials =
5941  (int)(long)u->next->next->next->next->next->Data();
5942  noCacheMonomials = false;
5943  }
5944  }
5945  }
5946  }
5947  }
5948  else if ((u->next != NULL) && (u->next->Typ() == INT_CMD))
5949  {
5950  k = (int)(long)u->next->Data();
5951  noK = false;
5952  assume(k != 0);
5953  if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD))
5954  {
5955  algorithm = (char*)u->next->next->Data();
5956  noAlgorithm = false;
5957  if ((u->next->next->next != NULL) &&
5958  (u->next->next->next->Typ() == INT_CMD))
5959  {
5960  cacheMinors = (int)(long)u->next->next->next->Data();
5961  noCacheMinors = false;
5962  if ((u->next->next->next->next != NULL) &&
5963  (u->next->next->next->next->Typ() == INT_CMD))
5964  {
5965  cacheMonomials = (int)(long)u->next->next->next->next->Data();
5966  noCacheMonomials = false;
5967  }
5968  }
5969  }
5970  }
5971  else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD))
5972  {
5973  algorithm = (char*)u->next->Data();
5974  noAlgorithm = false;
5975  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
5976  {
5977  cacheMinors = (int)(long)u->next->next->Data();
5978  noCacheMinors = false;
5979  if ((u->next->next->next != NULL) &&
5980  (u->next->next->next->Typ() == INT_CMD))
5981  {
5982  cacheMonomials = (int)(long)u->next->next->next->Data();
5983  noCacheMonomials = false;
5984  }
5985  }
5986  }
5987 
5988  /* upper case conversion for the algorithm if present */
5989  if (!noAlgorithm)
5990  {
5991  if (strcmp(algorithm, "bareiss") == 0)
5992  algorithm = (char*)"Bareiss";
5993  if (strcmp(algorithm, "laplace") == 0)
5994  algorithm = (char*)"Laplace";
5995  if (strcmp(algorithm, "cache") == 0)
5996  algorithm = (char*)"Cache";
5997  }
5998 
5999  v->next=u;
6000  /* here come some tests */
6001  if (!noIdeal)
6002  {
6003  assumeStdFlag(u->next);
6004  }
6005  if ((!noK) && (k == 0))
6006  {
6007  WerrorS("Provided number of minors to be computed is zero.");
6008  return TRUE;
6009  }
6010  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") != 0)
6011  && (strcmp(algorithm, "Laplace") != 0)
6012  && (strcmp(algorithm, "Cache") != 0))
6013  {
6014  WerrorS("Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
6015  return TRUE;
6016  }
6017  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
6018  && (!rField_is_Domain(currRing)))
6019  {
6020  Werror("Bareiss algorithm not defined over coefficient rings %s",
6021  "with zero divisors.");
6022  return TRUE;
6023  }
6024  res->rtyp=IDEAL_CMD;
6025  if ((mk < 1) || (mk > m->rows()) || (mk > m->cols()))
6026  {
6027  ideal I=idInit(1,1);
6028  if (mk<1) I->m[0]=p_One(currRing);
6029  //Werror("invalid size of minors: %d (matrix is (%d x %d))", mk,
6030  // m->rows(), m->cols());
6031  res->data=(void*)I;
6032  return FALSE;
6033  }
6034  if ((!noAlgorithm) && (strcmp(algorithm, "Cache") == 0)
6035  && (noCacheMinors || noCacheMonomials))
6036  {
6037  cacheMinors = 200;
6038  cacheMonomials = 100000;
6039  }
6040 
6041  /* here come the actual procedure calls */
6042  if (noAlgorithm)
6043  res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k),
6044  (noIdeal ? 0 : IasSB), false);
6045  else if (strcmp(algorithm, "Cache") == 0)
6046  res->data = getMinorIdealCache(m, mk, (noK ? 0 : k),
6047  (noIdeal ? 0 : IasSB), 3, cacheMinors,
6048  cacheMonomials, false);
6049  else
6050  res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm,
6051  (noIdeal ? 0 : IasSB), false);
6052  if (v_typ!=MATRIX_CMD) idDelete((ideal *)&m);
6053  return FALSE;
6054 }
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:82
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:125
void * data
Definition: subexpr.h:88
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:8851
poly p_One(const ring r)
Definition: p_polys.cc:1314
#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:86
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:91
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 4490 of file iparith.cc.

4491 {
4492  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4493 
4494  syStrategy tmp=(syStrategy)v->Data();
4495  tmp = syMinimize(tmp); // enrich itself!
4496 
4497  res->data=(char *)tmp;
4498 
4499  if (weights!=NULL)
4500  atSet(res, omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
4501 
4502  return FALSE;
4503 }
#define FALSE
Definition: auxiliary.h:94
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#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:88
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:88
#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:88
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:88
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:88
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:203
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:88
#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:88
#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:88
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:88
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 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1884
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w)
Definition: ideals.cc:2038
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#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:88
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:91
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 5294 of file iparith.cc.

5295 {
5296  res->data = (char *)mp_Trace((matrix)v->Data(),currRing);
5297  return FALSE;
5298 }
#define FALSE
Definition: auxiliary.h:94
poly mp_Trace(matrix a, const ring R)
Definition: matpol.cc:285
void * data
Definition: subexpr.h:88
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 5299 of file iparith.cc.

5300 {
5301  res->data = (char *)mp_Transp((matrix)v->Data(),currRing);
5302  return FALSE;
5303 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
matrix mp_Transp(matrix a, const ring R)
Definition: matpol.cc:264
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 4469 of file iparith.cc.

4470 {
4471  int t=v->Typ();
4472  ideal r,m;
4473  r=kMin_std((ideal)v->Data(),currRing->qideal,testHomog,NULL,m);
4475  l->Init(2);
4476  l->m[0].rtyp=t;
4477  l->m[0].data=(char *)r;
4478  setFlag(&(l->m[0]),FLAG_STD);
4479  l->m[1].rtyp=t;
4480  l->m[1].data=(char *)m;
4481  res->data=(char *)l;
4482  return FALSE;
4483 }
#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:88
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 4484 of file iparith.cc.

4485 {
4486  assumeStdFlag(v);
4487  res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal);
4488  return FALSE;
4489 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4504 of file iparith.cc.

4505 {
4506  number n,i; i=(number)v->Data();
4508  if (nMap!=NULL)
4509  n=nMap(i,currRing->cf,coeffs_BIGINT);
4510  else goto err;
4511  res->data=(void *)n;
4512  return FALSE;
4513 err:
4514  WerrorS("cannot convert to bigint"); return TRUE;
4515 }
#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:88
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 4516 of file iparith.cc.

4517 {
4518  if ((v->rtyp==IDHDL)||(v->rtyp==ALIAS_CMD))
4519  res->data=omStrDup(v->name);
4520  else if (v->name==NULL)
4521  res->data=omStrDup("");
4522  else
4523  {
4524  res->data = (char *)v->name;
4525  v->name=NULL;
4526  }
4527  return FALSE;
4528 }
#define FALSE
Definition: auxiliary.h:94
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
const char * name
Definition: subexpr.h:87
Definition: tok.h:34
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ jjNAMES()

static BOOLEAN jjNAMES ( leftv  res,
leftv  v 
)
static

Definition at line 4529 of file iparith.cc.

4530 {
4531  res->data=ipNameList(((ring)v->Data())->idroot);
4532  return FALSE;
4533 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
lists ipNameList(idhdl root)
Definition: ipid.cc:533
void * Data()
Definition: subexpr.cc:1137

◆ jjNAMES0()

static BOOLEAN jjNAMES0 ( leftv  res,
leftv   
)
static

Definition at line 7425 of file iparith.cc.

7426 {
7427  res->data=(void *)ipNameList(IDROOT);
7428  return FALSE;
7429 }
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:88
lists ipNameList(idhdl root)
Definition: ipid.cc:533

◆ jjNAMES_I()

static BOOLEAN jjNAMES_I ( leftv  res,
leftv  v 
)
static

Definition at line 4534 of file iparith.cc.

4535 {
4536  res->data=ipNameListLev((IDROOT),(int)(long)v->Data());
4537  return FALSE;
4538 }
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:88
lists ipNameListLev(idhdl root, int lev)
Definition: ipid.cc:556
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 6055 of file iparith.cc.

6056 {
6057  // u: the name of the new type
6058  // v: the parent type
6059  // w: the elements
6060  newstruct_desc d=newstructChildFromString((const char *)v->Data(),
6061  (const char *)w->Data());
6062  if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
6063  return (d==NULL);
6064 }
#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 5334 of file iparith.cc.

5335 {
5336  number n=(number)u->CopyD(); // n_Int may call n_Normalize
5337  res->data=(char *)(long)iin_Int(n,currRing->cf);
5338  n_Delete(&n,currRing->cf);
5339  return FALSE;
5340 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5341 of file iparith.cc.

5342 {
5343  number n=(number)u->Data();
5344  res->data=(char *)(long)iin_Int(n,coeffs_BIGINT );
5345  return FALSE;
5346 }
#define FALSE
Definition: auxiliary.h:94
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:88
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 4539 of file iparith.cc.

4540 {
4541  res->data=(char*)(long)((long)v->Data()==0 ? 1 : 0);
4542  return FALSE;
4543 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjNULL()

static BOOLEAN jjNULL ( leftv  ,
leftv   
)
static

Definition at line 3499 of file iparith.cc.

3500 {
3501  return FALSE;
3502 }
#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 3794 of file iparith.cc.

3795 {
3796  number n = reinterpret_cast<number>(v->Data());
3797  res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing->cf));
3798  return FALSE;
3799 }
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:88
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 4544 of file iparith.cc.

4545 {
4546  res->data = (char *)(long)(((ring)(v->Data()))->N);
4547  return FALSE;
4548 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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:88
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:88
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:88
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:136
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#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:8130

◆ jjOpenClose()

static BOOLEAN jjOpenClose ( leftv  ,
leftv  v 
)
static

Definition at line 4549 of file iparith.cc.

4550 {
4551  si_link l=(si_link)v->Data();
4552  if (iiOp==OPEN_CMD) return slOpen(l, SI_LINK_OPEN,v);
4553  else { slPrepClose(l); return slClose(l);}
4554 }
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:3373
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:3346
Subexpr e
Definition: subexpr.h:105
#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:120
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:3412
const char * Fullname()
Definition: subexpr.h:125
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:88
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:91
#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:71
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 4987 of file iparith.cc.

4988 {
4989  ring r = (ring)a->Data();
4990  //if (rIsPluralRing(r))
4991  if (r->OrdSgn==1)
4992  {
4993  res->data = rOpposite(r);
4994  }
4995  else
4996  {
4997  WarnS("opposite only for global orderings");
4998  res->data = rCopy(r);
4999  }
5000  return FALSE;
5001 }
#define FALSE
Definition: auxiliary.h:94
ring rOpposite(ring src)
Definition: ring.cc:5189
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
ring rCopy(ring r)
Definition: ring.cc:1614
void * Data()
Definition: subexpr.cc:1137

◆ jjOPTION_PL()

static BOOLEAN jjOPTION_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7430 of file iparith.cc.

7431 {
7432  if(v==NULL)
7433  {
7434  res->data=(char *)showOption();
7435  return FALSE;
7436  }
7437  res->rtyp=NONE;
7438  return setOption(res,v);
7439 }
#define FALSE
Definition: auxiliary.h:94
char * showOption()
Definition: misc_ip.cc:717
void * data
Definition: subexpr.h:88
BOOLEAN setOption(leftv res, leftv v)
Definition: misc_ip.cc:575
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
#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:88
void * Data()
Definition: subexpr.cc:1137

◆ jjORD()

static BOOLEAN jjORD ( leftv  res,
leftv  v 
)
static

Definition at line 4555 of file iparith.cc.

4556 {
4557  poly p=(poly)v->Data();
4558  res->data=(char *)( p==NULL ? -1 : currRing->pFDeg(p,currRing) );
4559  return FALSE;
4560 }
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
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 4601 of file iparith.cc.

4602 {
4603  poly p=(poly)v->Data();
4604  if (p==NULL) { res->data=(char *)n_Init(0,coeffs_BIGINT); return FALSE; }
4605  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4606  {
4607  WerrorS("poly must be constant");
4608  return TRUE;
4609  }
4610  number i=pGetCoeff(p);
4611  number n;
4613  if (nMap!=NULL)
4614  n=nMap(i,currRing->cf,coeffs_BIGINT);
4615  else goto err;
4616  res->data=(void *)n;
4617  return FALSE;
4618 err:
4619  WerrorS("cannot convert to bigint"); return TRUE;
4620 }
#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:88
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 4621 of file iparith.cc.

4622 {
4623  poly p=(poly)v->Data();
4624  if (p==NULL) { /*res->data=(char *)0;*/ return FALSE; }
4625  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4626  {
4627  WerrorS("poly must be constant");
4628  return TRUE;
4629  }
4630  res->data = (char *)(long)iin_Int(pGetCoeff(p),currRing->cf);
4631  return FALSE;
4632 }
#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:88
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 4669 of file iparith.cc.

4670 {
4671  number n;
4672  poly p;
4673  if (((p=(poly)v->Data())!=NULL)
4674  && (pIsConstant(p)))
4675  {
4676  n=nCopy(pGetCoeff(p));
4677  }
4678  else
4679  {
4680  n=nInit(0);
4681  }
4682  res->data = (char *)n;
4683  return FALSE;
4684 }
#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:88
#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 4561 of file iparith.cc.

4562 {
4563  int i=(int)(long)v->Data();
4564  int p=0;
4565  p=rPar(currRing);
4566  if ((0<i) && (i<=p))
4567  {
4568  res->data=(char *)n_Param(i,currRing);
4569  }
4570  else
4571  {
4572  Werror("par number %d out of range 1..%d",i,p);
4573  return TRUE;
4574  }
4575  return FALSE;
4576 }
#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:88
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 4577 of file iparith.cc.

4578 {
4579  number nn=(number)v->Data();
4580  res->data = (char *)(long)n_ParDeg(nn, currRing->cf);
4581  return FALSE;
4582 }
#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:88
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 4583 of file iparith.cc.

4584 {
4585  if (currRing==NULL)
4586  {
4587  WerrorS("no ring active");
4588  return TRUE;
4589  }
4590  int i=(int)(long)v->Data();
4591  int p=0;
4592  if ((0<i) && (rParameter(currRing)!=NULL) && (i<=(p=rPar(currRing))))
4593  res->data=omStrDup(rParameter(currRing)[i-1]);
4594  else
4595  {
4596  Werror("par number %d out of range 1..%d",i,p);
4597  return TRUE;
4598  }
4599  return FALSE;
4600 }
#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:88
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:88
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 4397 of file iparith.cc.

4398 {
4399  /* call method jjPFAC2 with second argument = 0 (meaning that no
4400  valid bound for the prime factors has been given) */
4401  sleftv tmp;
4402  memset(&tmp, 0, sizeof(tmp));
4403  tmp.rtyp = INT_CMD;
4404  return jjPFAC2(res, v, &tmp);
4405 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3123
int rtyp
Definition: subexpr.h:91

◆ 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:88
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 5266 of file iparith.cc.

5267 {
5268  res->data = (char *)pHead((poly)v->Data());
5269  return FALSE;
5270 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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 5241 of file iparith.cc.

5242 {
5243  res->data = (char *)(long)pLength((poly)v->Data());
5244  return FALSE;
5245 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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:2693
ring rCopy(ring r)
Definition: ring.cc:1614
#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:88
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:2693
ring rCopy(ring r)
Definition: ring.cc:1614
#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:88
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:2693
ring rCopy(ring r)
Definition: ring.cc:1614
#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:88
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:2693
ring rCopy(ring r)
Definition: ring.cc:1614
#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:88
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:88
#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:88
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:88
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:88
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:88
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:186
#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:120
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
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:186
void * Data()
Definition: subexpr.cc:1137
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:203
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:88
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:88
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:88
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:82
loop
Definition: myNF.cc:98
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8319
#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:88
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:86
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
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:8130
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjPLUSPLUS()

static BOOLEAN jjPLUSPLUS ( leftv  ,
leftv  u 
)
static

Definition at line 3513 of file iparith.cc.

3514 {
3515  if (IDTYP((idhdl)u->data)==INT_CMD)
3516  {
3517  int i=IDINT((idhdl)u->data);
3518  if (iiOp==PLUSPLUS) i++;
3519  else i--;
3520  IDDATA((idhdl)u->data)=(char *)(long)i;
3521  return FALSE;
3522  }
3523  return TRUE;
3524 }
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:88
#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 5289 of file iparith.cc.

5290 {
5291  res->data = (char *)pMaxComp((poly)v->Data());
5292  return FALSE;
5293 }
#define pMaxComp(p)
Definition: polys.h:281
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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:88
#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:88
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:88
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:88
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 6065 of file iparith.cc.

6066 {
6067  // handles preimage(r,phi,i) and kernel(r,phi)
6068  idhdl h;
6069  ring rr;
6070  map mapping;
6071  BOOLEAN kernel_cmd= (iiOp==KERNEL_CMD);
6072 
6073  if ((v->name==NULL) || (!kernel_cmd && (w->name==NULL)))
6074  {
6075  WerrorS("2nd/3rd arguments must have names");
6076  return TRUE;
6077  }
6078  rr=(ring)u->Data();
6079  const char *ring_name=u->Name();
6080  if ((h=rr->idroot->get(v->name,myynest))!=NULL)
6081  {
6082  if (h->typ==MAP_CMD)
6083  {
6084  mapping=IDMAP(h);
6085  idhdl preim_ring=IDROOT->get(mapping->preimage,myynest);
6086  if ((preim_ring==NULL)
6087  || (IDRING(preim_ring)!=currRing))
6088  {
6089  Werror("preimage ring `%s` is not the basering",mapping->preimage);
6090  return TRUE;
6091  }
6092  }
6093  else if (h->typ==IDEAL_CMD)
6094  {
6095  mapping=IDMAP(h);
6096  }
6097  else
6098  {
6099  Werror("`%s` is no map nor ideal",IDID(h));
6100  return TRUE;
6101  }
6102  }
6103  else
6104  {
6105  Werror("`%s` is not defined in `%s`",v->name,ring_name);
6106  return TRUE;
6107  }
6108  ideal image;
6109  if (kernel_cmd) image=idInit(1,1);
6110  else
6111  {
6112  if ((h=rr->idroot->get(w->name,myynest))!=NULL)
6113  {
6114  if (h->typ==IDEAL_CMD)
6115  {
6116  image=IDIDEAL(h);
6117  }
6118  else
6119  {
6120  Werror("`%s` is no ideal",IDID(h));
6121  return TRUE;
6122  }
6123  }
6124  else
6125  {
6126  Werror("`%s` is not defined in `%s`",w->name,ring_name);
6127  return TRUE;
6128  }
6129  }
6130  if (((currRing->qideal!=NULL) && (rHasLocalOrMixedOrdering(currRing)))
6131  || ((rr->qideal!=NULL) && (rHasLocalOrMixedOrdering(rr))))
6132  {
6133  WarnS("preimage in local qring may be wrong: use Ring::preimageLoc instead");
6134  }
6135  res->data=(char *)maGetPreimage(rr,mapping,image,currRing);
6136  if (kernel_cmd) idDelete(&image);
6137  return (res->data==NULL/* is of type ideal, should not be NULL*/);
6138 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:752
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:120
Definition: idrec.h:34
idhdl get(const char *s, int lev)
Definition: ipid.cc:90
void * data
Definition: subexpr.h:88
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:87
#define IDMAP(a)
Definition: ipid.h:132
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 4633 of file iparith.cc.

4634 {
4635  map mapping=(map)v->Data();
4636  syMake(res,omStrDup(mapping->preimage));
4637  return FALSE;
4638 }
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 4639 of file iparith.cc.

4640 {
4641  int i = IsPrime((int)(long)(v->Data()));
4642  res->data = (char *)(long)(i > 1 ? i : 2);
4643  return FALSE;
4644 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:82
Subexpr e
Definition: subexpr.h:105
#define FALSE
Definition: auxiliary.h:94
sleftv iiRETURNEXPR
Definition: iplib.cc:473
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:98
void Init()
Definition: subexpr.h:107
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
short ref
Definition: idrec.h:46
idrec * idhdl
Definition: ring.h:18
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv sl)
Definition: iplib.cc:503
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:106
package currPack
Definition: ipid.cc:63
int rtyp
Definition: subexpr.h:91
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 3591 of file iparith.cc.

3592 {
3593  return jjPROC(res,u,NULL);
3594 }
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 5601 of file iparith.cc.

5602 {
5604  memcpy(v->next,w,sizeof(sleftv));
5605  memset(w,0,sizeof(sleftv));
5606  return jjPROC(res,u,v);
5607 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:86

◆ jjPRUNE()

static BOOLEAN jjPRUNE ( leftv  res,
leftv  v 
)
static

Definition at line 4645 of file iparith.cc.

4646 {
4647  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4648  ideal v_id=(ideal)v->Data();
4649  if (w!=NULL)
4650  {
4651  if (!idTestHomModule(v_id,currRing->qideal,w))
4652  {
4653  WarnS("wrong weights");
4654  w=NULL;
4655  // and continue at the non-homog case below
4656  }
4657  else
4658  {
4659  w=ivCopy(w);
4660  intvec **ww=&w;
4661  res->data = (char *)idMinEmbedding(v_id,FALSE,ww);
4662  atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD);
4663  return FALSE;
4664  }
4665  }
4666  res->data = (char *)idMinEmbedding(v_id);
4667  return FALSE;
4668 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1884
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:2349
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#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 7817 of file iparith.cc.

7818 {
7819  if ((INPUT->Typ() != MATRIX_CMD) ||
7820  (INPUT->next->Typ() != NUMBER_CMD) ||
7821  (INPUT->next->next->Typ() != NUMBER_CMD) ||
7822  (INPUT->next->next->next->Typ() != NUMBER_CMD))
7823  {
7824  WerrorS("expected (matrix, number, number, number) as arguments");
7825  return TRUE;
7826  }
7827  leftv u = INPUT; leftv v = u->next; leftv w = v->next; leftv x = w->next;
7828  res->data = (char *)qrDoubleShift((matrix)(u->Data()),
7829  (number)(v->Data()),
7830  (number)(w->Data()),
7831  (number)(x->Data()));
7832  return FALSE;
7833 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:88
leftv next
Definition: subexpr.h:86
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:1308
void * data
Definition: subexpr.h:88
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:88
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 6139 of file iparith.cc.

6140 {
6141  int di, k;
6142  int i=(int)(long)u->Data();
6143  int r=(int)(long)v->Data();
6144  int c=(int)(long)w->Data();
6145  if ((r<=0) || (c<=0)) return TRUE;
6146  intvec *iv = new intvec(r, c, 0);
6147  if (iv->rows()==0)
6148  {
6149  delete iv;
6150  return TRUE;
6151  }
6152  if (i!=0)
6153  {
6154  if (i<0) i = -i;
6155  di = 2 * i + 1;
6156  for (k=0; k<iv->length(); k++)
6157  {
6158  (*iv)[k] = ((siRand() % di) - i);
6159  }
6160  }
6161  res->data = (char *)iv;
6162  return FALSE;
6163 }
#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:88
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 4700 of file iparith.cc.

4701 {
4702  matrix m =(matrix)v->Data();
4703  int rank = luRank(m, 0);
4704  res->data =(char *)(long)rank;
4705  return FALSE;
4706 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:88
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 5261 of file iparith.cc.

5262 {
5263  res->data = rCharStr((ring)v->Data());
5264  return FALSE;
5265 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:622

◆ jjREAD()

static BOOLEAN jjREAD ( leftv  res,
leftv  v 
)
static

Definition at line 4707 of file iparith.cc.

4708 {
4709  return jjREAD2(res,v,NULL);
4710 }
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:82
#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 6401 of file iparith.cc.

6402 {
6403  assumeStdFlag(v);
6404  if (!idIsZeroDim((ideal)v->Data()))
6405  {
6406  Werror("`%s` must be 0-dimensional",v->Name());
6407  return TRUE;
6408  }
6409  res->data = (char *)redNF((ideal)v->CopyD(),(ideal)u->CopyD(),
6410  (matrix)w->CopyD());
6411  return FALSE;
6412 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:120
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:177
void * data
Definition: subexpr.h:88
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 6389 of file iparith.cc.

6390 {
6391  assumeStdFlag(v);
6392  if (!idIsZeroDim((ideal)v->Data()))
6393  {
6394  Werror("`%s` must be 0-dimensional",v->Name());
6395  return TRUE;
6396  }
6397  res->data = (char *)redNF((ideal)v->CopyD(),(poly)u->CopyD(),
6398  (poly)w->CopyD());
6399  return FALSE;
6400 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:120
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:177
void * data
Definition: subexpr.h:88
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 6420 of file iparith.cc.

6421 {
6422  assumeStdFlag(v);
6423  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(),
6424  0,(int)(long)w->Data());
6425  return FALSE;
6426 }
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:88
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 6413 of file iparith.cc.

6414 {
6415  assumeStdFlag(v);
6416  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(),
6417  0,(int)(long)w->Data());
6418  return FALSE;
6419 }
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:88
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 7440 of file iparith.cc.

7441 {
7442  leftv u1=u;
7443  leftv u2=u1->next;
7444  leftv u3=u2->next;
7445  leftv u4=u3->next;
7446  if((u3->Typ()==INT_CMD)&&(u4->Typ()==INTVEC_CMD))
7447  {
7448  int save_d=Kstd1_deg;
7449  Kstd1_deg=(int)(long)u3->Data();
7450  kModW=(intvec *)u4->Data();
7451  BITSET save2;
7452  SI_SAVE_OPT2(save2);
7454  u2->next=NULL;
7455  BOOLEAN r=jjCALL2ARG(res,u);
7456  kModW=NULL;
7457  Kstd1_deg=save_d;
7458  SI_RESTORE_OPT2(save2);
7459  u->next->next=u3;
7460  return r;
7461  }
7462  else
7463  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7464  (u4->Typ()==INT_CMD))
7465  {
7466  assumeStdFlag(u3);
7467  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7468  {
7469  WerrorS("2nd argument must be a diagonal matrix of units");
7470  return TRUE;
7471  }
7472  res->rtyp=IDEAL_CMD;
7473  res->data=(char*)redNF(
7474  idCopy((ideal)u3->Data()),
7475  idCopy((ideal)u1->Data()),
7476  mp_Copy((matrix)u2->Data(), currRing),
7477  (int)(long)u4->Data()
7478  );
7479  return FALSE;
7480  }
7481  else
7482  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7483  (u4->Typ()==INT_CMD))
7484  {
7485  assumeStdFlag(u3);
7486  if(!pIsUnit((poly)u2->Data()))
7487  {
7488  WerrorS("2nd argument must be a unit");
7489  return TRUE;
7490  }
7491  res->rtyp=POLY_CMD;
7492  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7493  pCopy((poly)u2->Data()),(int)(long)u4->Data());
7494  return FALSE;
7495  }
7496  else
7497  {
7498  Werror("%s(`poly`,`ideal`,`int`,`intvec`) expected",Tok2Cmdname(iiOp));
7499  Werror("%s(`ideal`,`matrix`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
7500  Werror("%s(`poly`,`poly`,`ideal`,`int`) expected",Tok2Cmdname(iiOp));
7501  return TRUE;
7502  }
7503 }
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition: iparith.cc:6550
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
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:8851
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:86
#define SI_RESTORE_OPT2(A)
Definition: options.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:725
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:71
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 7504 of file iparith.cc.

7505 {
7506  leftv u1=u;
7507  leftv u2=u1->next;
7508  leftv u3=u2->next;
7509  leftv u4=u3->next;
7510  leftv u5=u4->next;
7511  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7512  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7513  {
7514  assumeStdFlag(u3);
7515  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7516  {
7517  WerrorS("2nd argument must be a diagonal matrix of units");
7518  return TRUE;
7519  }
7520  res->rtyp=IDEAL_CMD;
7521  res->data=(char*)redNF(
7522  idCopy((ideal)u3->Data()),
7523  idCopy((ideal)u1->Data()),
7524  mp_Copy((matrix)u2->Data(),currRing),
7525  (int)(long)u4->Data(),
7526  (intvec*)u5->Data()
7527  );
7528  return FALSE;
7529  }
7530  else
7531  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7532  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7533  {
7534  assumeStdFlag(u3);
7535  if(!pIsUnit((poly)u2->Data()))
7536  {
7537  WerrorS("2nd argument must be a unit");
7538  return TRUE;
7539  }
7540  res->rtyp=POLY_CMD;
7541  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7542  pCopy((poly)u2->Data()),
7543  (int)(long)u4->Data(),(intvec*)u5->Data());
7544  return FALSE;
7545  }
7546  else
7547  {
7548  Werror("%s(`ideal`,`ideal`,`matrix`,`int`,`intvec`) exppected",
7549  Tok2Cmdname(iiOp));
7550  return TRUE;
7551  }
7552 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:88
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:8851
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:86
int rtyp
Definition: subexpr.h:91
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:725
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:71
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:88
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:88
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 4711 of file iparith.cc.

4712 {
4713  res->data = (char *)(long)iiRegularity((lists)v->Data());
4714  return FALSE;
4715 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
int iiRegularity(lists L)
Definition: ipshell.cc:956
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjREPART()

static BOOLEAN jjREPART ( leftv  res,
leftv  v 
)
static

Definition at line 4716 of file iparith.cc.

4717 {
4718  res->data = (char *)n_RePart((number)v->Data(),currRing->cf);
4719  return FALSE;
4720 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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
Definition: tok.h:108
void PrintLn()
Definition: reporter.cc:310
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:91
#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:1884
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:88
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
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
Definition: tok.h:130
#define NULL
Definition: omList.c:10
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 6428 of file iparith.cc.

6429 {
6430  int maxl=(int)v->Data();
6431  ideal u_id=(ideal)u->Data();
6432  int l=0;
6433  resolvente r;
6434  intvec **weights=NULL;
6435  int wmaxl=maxl;
6436  maxl--;
6437  if ((maxl==-1) && (iiOp!=MRES_CMD))
6438  maxl = currRing->N-1;
6439  if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
6440  {
6441  intvec * iv=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
6442  if (iv!=NULL)
6443  {
6444  l=1;
6445  if (!idTestHomModule(u_id,currRing->qideal,iv))
6446  {
6447  WarnS("wrong weights");
6448  iv=NULL;
6449  }
6450  else
6451  {
6452  weights = (intvec**)omAlloc0Bin(char_ptr_bin);
6453  weights[0] = ivCopy(iv);
6454  }
6455  }
6456  r=syResolvente(u_id,maxl,&l, &weights, iiOp==MRES_CMD);
6457  }
6458  else
6459  r=sySchreyerResolvente((ideal)u->Data(),maxl+1,&l);
6460  if (r==NULL) return TRUE;
6461  int t3=u->Typ();
6462  iiMakeResolv(r,l,wmaxl,w->name,t3,weights);
6463  return FALSE;
6464 }
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:1884
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:87
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:137
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 7553 of file iparith.cc.

7554 {
7555  unsigned i=1;
7556  unsigned nCount = (sArithBase.nCmdUsed-1)/3;
7557  if((3*nCount)<sArithBase.nCmdUsed) nCount++;
7558  //Print("CMDS: %d/%d\n", sArithBase.nCmdUsed,
7559  // sArithBase.nCmdAllocated);
7560  for(i=0; i<nCount; i++)
7561  {
7562  Print("%-20s",sArithBase.sCmds[i+1].name);
7563  if(i+1+nCount<sArithBase.nCmdUsed)
7564  Print("%-20s",sArithBase.sCmds[i+1+nCount].name);
7565  if(i+1+2*nCount<sArithBase.nCmdUsed)
7566  Print("%-20s",sArithBase.sCmds[i+1+2*nCount].name);
7567  //if ((i%3)==1) PrintLn();
7568  PrintLn();
7569  }
7570  PrintLn();
7572  return FALSE;
7573 }
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 4685 of file iparith.cc.

4686 {
4687  char *s= (char *)v->Data();
4688  for(unsigned i=0; i<sArithBase.nCmdUsed; i++)
4689  {
4690  //Print("test %d, >>%s<<, tab:>>%s<<\n",i,s,sArithBase.sCmds[i].name);
4691  if (strcmp(s, sArithBase.sCmds[i].name) == 0)
4692  {
4693  res->data = (char *)1;
4694  return FALSE;
4695  }
4696  }
4697  //res->data = (char *)0;
4698  return FALSE;
4699 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 6466 of file iparith.cc.

6467 {
6468  res->data=(void *)rInit(u,v,w);
6469  return (res->data==NULL);
6470 }
void * data
Definition: subexpr.h:88
ring rInit(leftv pn, leftv rv, leftv ord)
Definition: ipshell.cc:5524
#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:82
sleftv * leftv
Definition: structs.h:60
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8621
#define omAlloc(size)
Definition: omAllocDecl.h:210
leftv next
Definition: subexpr.h:86
#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 5608 of file iparith.cc.

5609 {
5610  u->next=(leftv)omAlloc(sizeof(sleftv));
5611  memcpy(u->next,v,sizeof(sleftv));
5612  memset(v,0,sizeof(sleftv));
5613  u->next->next=(leftv)omAlloc(sizeof(sleftv));
5614  memcpy(u->next->next,w,sizeof(sleftv));
5615  memset(w,0,sizeof(sleftv));
5616  BOOLEAN bo=iiExprArithM(res,u,'[');
5617  u->next=NULL;
5618  return bo;
5619 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
sleftv * leftv
Definition: structs.h:60
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8621
#define omAlloc(size)
Definition: omAllocDecl.h:210
leftv next
Definition: subexpr.h:86
#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 4735 of file iparith.cc.

4736 {
4737  ring r=(ring)v->Data();
4738  if (r!=NULL)
4739  res->data = (char *)rDecompose_list_cf((ring)v->Data());
4740  return (r==NULL)||(res->data==NULL);
4741 }
void * data
Definition: subexpr.h:88
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 7917 of file iparith.cc.

7918 {
7919  //Print("construct ring\n");
7920  if (a->Typ()!=CRING_CMD)
7921  {
7922  WerrorS("expected `cring` [ `id` ... ]");
7923  return TRUE;
7924  }
7925  assume(a->next!=NULL);
7926  leftv names=a->next;
7927  int N=names->listLength();
7928  char **n=(char**)omAlloc0(N*sizeof(char*));
7929  for(int i=0; i<N;i++,names=names->next)
7930  {
7931  n[i]=(char *)names->Name();
7932  }
7933  coeffs cf=(coeffs)a->CopyD();
7934  res->data=rDefault(cf,N,n, ringorder_dp);
7935  omFreeSize(n,N*sizeof(char*));
7936  return FALSE;
7937 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:88
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:86
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 4721 of file iparith.cc.

4722 {
4723  ring r=(ring)v->Data();
4724  if (r!=NULL)
4725  res->data = (char *)rDecompose((ring)v->Data());
4726  return (r==NULL)||(res->data==NULL);
4727 }
void * data
Definition: subexpr.h:88
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 4728 of file iparith.cc.

4729 {
4730  coeffs r=(coeffs)v->Data();
4731  if (r!=NULL)
4732  return rDecompose_CF(res,r);
4733  return TRUE;
4734 }
#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 5304 of file iparith.cc.

5305 {
5306  res->data = rOrdStr((ring)v->Data());
5307  return FALSE;
5308 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137
char * rOrdStr(ring r)
Definition: ring.cc:522

◆ jjROWS()

static BOOLEAN jjROWS ( leftv  res,
leftv  v 
)
static

Definition at line 4742 of file iparith.cc.

4743 {
4744  ideal i = (ideal)v->Data();
4745  res->data = (char *)i->rank;
4746  return FALSE;
4747 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4748 of file iparith.cc.

4749 {
4750  res->data = (char *)(long)((bigintmat*)(v->Data()))->rows();
4751  return FALSE;
4752 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjROWS_IV()

static BOOLEAN jjROWS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4753 of file iparith.cc.

4754 {
4755  res->data = (char *)(long)((intvec*)(v->Data()))->rows();
4756  return FALSE;
4757 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjRPAR()

static BOOLEAN jjRPAR ( leftv  res,
leftv  v 
)
static

Definition at line 4758 of file iparith.cc.

4759 {
4760  res->data = (char *)(long)rPar(((ring)v->Data()));
4761  return FALSE;
4762 }
#define FALSE
Definition: auxiliary.h:94
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:590
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjrParStr()

static BOOLEAN jjrParStr ( leftv  res,
leftv  v 
)
static

Definition at line 5314 of file iparith.cc.

5315 {
5316  res->data = rParStr((ring)v->Data());
5317  return FALSE;
5318 }
#define FALSE
Definition: auxiliary.h:94
char * rParStr(ring r)
Definition: ring.cc:624
void * data
Definition: subexpr.h:88
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:88
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1306
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 5309 of file iparith.cc.

5310 {
5311  res->data = rVarStr((ring)v->Data());
5312  return FALSE;
5313 }
char * rVarStr(ring r)
Definition: ring.cc:598
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjSBA()

static BOOLEAN jjSBA ( leftv  res,
leftv  v 
)
static

Definition at line 4807 of file iparith.cc.

4808 {
4809  ideal result;
4810  ideal v_id=(ideal)v->Data();
4811  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4812  tHomog hom=testHomog;
4813  if (w!=NULL)
4814  {
4815  if (!idTestHomModule(v_id,currRing->qideal,w))
4816  {
4817  WarnS("wrong weights");
4818  w=NULL;
4819  }
4820  else
4821  {
4822  hom=isHomog;
4823  w=ivCopy(w);
4824  }
4825  }
4826  result=kSba(v_id,currRing->qideal,hom,&w,1,0);
4827  idSkipZeroes(result);
4828  res->data = (char *)result;
4830  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4831  return FALSE;
4832 }
#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:1884
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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 4833 of file iparith.cc.

4834 {
4835  ideal result;
4836  ideal v_id=(ideal)v->Data();
4837  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4838  tHomog hom=testHomog;
4839  if (w!=NULL)
4840  {
4841  if (!idTestHomModule(v_id,currRing->qideal,w))
4842  {
4843  WarnS("wrong weights");
4844  w=NULL;
4845  }
4846  else
4847  {
4848  hom=isHomog;
4849  w=ivCopy(w);
4850  }
4851  }
4852  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0);
4853  idSkipZeroes(result);
4854  res->data = (char *)result;
4856  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4857  return FALSE;
4858 }
#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:1884
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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 4859 of file iparith.cc.

4860 {
4861  ideal result;
4862  ideal v_id=(ideal)v->Data();
4863  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4864  tHomog hom=testHomog;
4865  if (w!=NULL)
4866  {
4867  if (!idTestHomModule(v_id,currRing->qideal,w))
4868  {
4869  WarnS("wrong weights");
4870  w=NULL;
4871  }
4872  else
4873  {
4874  hom=isHomog;
4875  w=ivCopy(w);
4876  }
4877  }
4878  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());
4879  idSkipZeroes(result);
4880  res->data = (char *)result;
4882  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4883  return FALSE;
4884 }
#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:1884
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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

◆ jjSetRing()

static BOOLEAN jjSetRing ( leftv  ,
leftv  u 
)
static

Definition at line 3570 of file iparith.cc.

3571 {
3572  if (u->rtyp==IDHDL) rSetHdl((idhdl)u->data);
3573  else
3574  {
3575  ring r=(ring)u->Data();
3576  idhdl h=rFindHdl(r,NULL);
3577  if (h==NULL)
3578  {
3579  char name_buffer[100];
3580  static int ending=1000000;
3581  ending++;
3582  sprintf(name_buffer, "PYTHON_RING_VAR%d",ending);
3583  h=enterid(omStrDup(name_buffer),0,RING_CMD,&IDROOT);
3584  IDRING(h)=r;
3585  r->ref++;
3586  }
3587  rSetHdl(h);
3588  }
3589  return FALSE;
3590 }
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:258
const ring r
Definition: syzextra.cc:208
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1594
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:124
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
void rSetHdl(idhdl h)
Definition: ipshell.cc:5038
static Poly * h
Definition: janet.cc:978
#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:88
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:88
#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 4763 of file iparith.cc.

4764 {
4765 #ifdef HAVE_PLURAL
4766  const bool bIsSCA = rIsSCA(currRing);
4767 #else
4768  const bool bIsSCA = false;
4769 #endif
4770 
4771  if ((currRing->qideal!=NULL) && !bIsSCA)
4772  {
4773  WerrorS("qring not supported by slimgb at the moment");
4774  return TRUE;
4775  }
4777  {
4778  WerrorS("ordering must be global for slimgb");
4779  return TRUE;
4780  }
4781  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
4782  // tHomog hom=testHomog;
4783  ideal u_id=(ideal)u->Data();
4784  if (w!=NULL)
4785  {
4786  if (!idTestHomModule(u_id,currRing->qideal,w))
4787  {
4788  WarnS("wrong weights");
4789  w=NULL;
4790  }
4791  else
4792  {
4793  w=ivCopy(w);
4794  // hom=isHomog;
4795  }
4796  }
4797 
4798  assume(u_id->rank>=id_RankFreeModule(u_id, currRing));
4799  res->data=(char *)t_rep_gb(currRing,
4800  u_id,u_id->rank);
4801  //res->data=(char *)t_rep_gb(currRing, u_id);
4802 
4804  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4805  return FALSE;
4806 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:752
#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:1884
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:88
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
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
Definition: tgb.cc:3558
#define setFlag(A, F)
Definition: ipid.h:110
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#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 4911 of file iparith.cc.

4912 {
4913  res->data = (char *)idSort((ideal)v->Data());
4914  return FALSE;
4915 }
#define FALSE
Definition: auxiliary.h:94
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:185
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjSORTLIST()

BOOLEAN jjSORTLIST ( leftv  ,
leftv  arg 
)

Definition at line 9396 of file iparith.cc.

9397 {
9398  lists l=(lists)arg->Data();
9399  if (l->nr>0)
9400  {
9401  qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
9402  }
9403  return FALSE;
9404 }
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
static int jjCOMPARE_ALL(const void *aa, const void *bb)
Definition: iparith.cc:9355
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 4916 of file iparith.cc.

4917 {
4919  intvec *v=NULL;
4920  ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, 0, currRing);
4921  if (f==NULL) return TRUE;
4922  ivTest(v);
4924  l->Init(2);
4925  l->m[0].rtyp=IDEAL_CMD;
4926  l->m[0].data=(void *)f;
4927  l->m[1].rtyp=INTVEC_CMD;
4928  l->m[1].data=(void *)v;
4929  res->data=(void *)l;
4930  return FALSE;
4931 }
#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:88
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:91
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:88
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:91
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:88
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:88
void * Data()
Definition: subexpr.cc:1137

◆ jjSTATUS3()

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

Definition at line 6471 of file iparith.cc.

6472 {
6473  int yes;
6474  jjSTATUS2(res, u, v);
6475  yes = (strcmp((char *) res->data, (char *) w->Data()) == 0);
6476  omFree((ADDRESS) res->data);
6477  res->data = (void *)(long)yes;
6478  return FALSE;
6479 }
#define FALSE
Definition: auxiliary.h:94
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:88
#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 7759 of file iparith.cc.

7760 {
7761  if ((v->Typ() != LINK_CMD) ||
7762  (v->next->Typ() != STRING_CMD) ||
7763  (v->next->next->Typ() != STRING_CMD) ||
7764  (v->next->next->next->Typ() != INT_CMD))
7765  return TRUE;
7766  jjSTATUS3(res, v, v->next, v->next->next);
7767 #if defined(HAVE_USLEEP)
7768  if (((long) res->data) == 0L)
7769  {
7770  int i_s = (int)(long) v->next->next->next->Data();
7771  if (i_s > 0)
7772  {
7773  usleep((int)(long) v->next->next->next->Data());
7774  jjSTATUS3(res, v, v->next, v->next->next);
7775  }
7776  }
7777 #elif defined(HAVE_SLEEP)
7778  if (((int) res->data) == 0)
7779  {
7780  int i_s = (int) v->next->next->next->Data();
7781  if (i_s > 0)
7782  {
7783  si_sleep((is - 1)/1000000 + 1);
7784  jjSTATUS3(res, v, v->next, v->next->next);
7785  }
7786  }
7787 #endif
7788  return FALSE;
7789 }
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:88
leftv next
Definition: subexpr.h:86
Definition: tok.h:116
void * Data()
Definition: subexpr.cc:1137
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6471

◆ jjSTD()

static BOOLEAN jjSTD ( leftv  res,
leftv  v 
)
static

Definition at line 4885 of file iparith.cc.

4886 {
4887  ideal result;
4888  ideal v_id=(ideal)v->Data();
4889  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4890  tHomog hom=testHomog;
4891  if (w!=NULL)
4892  {
4893  if (!idTestHomModule(v_id,currRing->qideal,w))
4894  {
4895  WarnS("wrong weights");
4896  w=NULL;
4897  }
4898  else
4899  {
4900  hom=isHomog;
4901  w=ivCopy(w);
4902  }
4903  }
4904  result=kStd(v_id,currRing->qideal,hom,&w);
4905  idSkipZeroes(result);
4906  res->data = (char *)result;
4908  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4909  return FALSE;
4910 }
#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:1884
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:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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
#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:1884
#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:88
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
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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 PrintLn()
Definition: reporter.cc:310
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1884
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:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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 6480 of file iparith.cc.

6481 {
6482  intvec *vw=(intvec *)w->Data(); // weights of vars
6483  if (vw->length()!=currRing->N)
6484  {
6485  Werror("%d weights for %d variables",vw->length(),currRing->N);
6486  return TRUE;
6487  }
6488  ideal result;
6489  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
6490  tHomog hom=testHomog;
6491  ideal u_id=(ideal)(u->Data());
6492  if (ww!=NULL)
6493  {
6494  if (!idTestHomModule(u_id,currRing->qideal,ww))
6495  {
6496  WarnS("wrong weights");
6497  ww=NULL;
6498  }
6499  else
6500  {
6501  ww=ivCopy(ww);
6502  hom=isHomog;
6503  }
6504  }
6505  result=kStd(u_id,
6506  currRing->qideal,
6507  hom,
6508  &ww, // module weights
6509  (intvec *)v->Data(), // hilbert series
6510  0,0, // syzComp, newIdeal
6511  vw); // weights of vars
6512  idSkipZeroes(result);
6513  res->data = (char *)result;
6514  setFlag(res,FLAG_STD);
6515  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
6516  return FALSE;
6517 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1884
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:88
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 atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:137
#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 7834 of file iparith.cc.

7835 { ideal result;
7836  leftv u = INPUT; /* an ideal, weighted homogeneous and standard */
7837  leftv v = u->next; /* one additional polynomial or ideal */
7838  leftv h = v->next; /* Hilbert vector */
7839  leftv w = h->next; /* weight vector */
7840  assumeStdFlag(u);
7841  ideal i1=(ideal)(u->Data());
7842  ideal i0;
7843  if (((u->Typ()!=IDEAL_CMD)&&(u->Typ()!=MODUL_CMD))
7844  || (h->Typ()!=INTVEC_CMD)
7845  || (w->Typ()!=INTVEC_CMD))
7846  {
7847  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7848  return TRUE;
7849  }
7850  intvec *vw=(intvec *)w->Data(); // weights of vars
7851  /* merging std_hilb_w and std_1 */
7852  if (vw->length()!=currRing->N)
7853  {
7854  Werror("%d weights for %d variables",vw->length(),currRing->N);
7855  return TRUE;
7856  }
7857  int r=v->Typ();
7858  BOOLEAN cleanup_i0=FALSE;
7859  if ((r==POLY_CMD) ||(r==VECTOR_CMD))
7860  {
7861  i0=idInit(1,i1->rank);
7862  i0->m[0]=(poly)v->Data();
7863  cleanup_i0=TRUE;
7864  }
7865  else if (r==IDEAL_CMD)/* IDEAL */
7866  {
7867  i0=(ideal)v->Data();
7868  }
7869  else
7870  {
7871  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7872  return TRUE;
7873  }
7874  int ii0=idElem(i0);
7875  i1 = idSimpleAdd(i1,i0);
7876  if (cleanup_i0)
7877  {
7878  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
7879  idDelete(&i0);
7880  }
7881  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
7882  tHomog hom=testHomog;
7883  /* u_id from jjSTD_W is now i1 as in jjSTD_1 */
7884  if (ww!=NULL)
7885  {
7886  if (!idTestHomModule(i1,currRing->qideal,ww))
7887  {
7888  WarnS("wrong weights");
7889  ww=NULL;
7890  }
7891  else
7892  {
7893  ww=ivCopy(ww);
7894  hom=isHomog;
7895  }
7896  }
7897  BITSET save1;
7898  SI_SAVE_OPT1(save1);
7900  result=kStd(i1,
7901  currRing->qideal,
7902  hom,
7903  &ww, // module weights
7904  (intvec *)h->Data(), // hilbert series
7905  0, // syzComp, whatever it is...
7906  IDELEMS(i1)-ii0, // new ideal
7907  vw); // weights of vars
7908  SI_RESTORE_OPT1(save1);
7909  idDelete(&i1);
7910  idSkipZeroes(result);
7911  res->data = (char *)result;
7912  if (!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
7913  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
7914  return FALSE;
7915 }
unsigned si_opt_1
Definition: options.c:5
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#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:1884
#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:88
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
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:158
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:86
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:137
#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 7574 of file iparith.cc.

7575 {
7576  if (v == NULL)
7577  {
7578  res->data = omStrDup("");
7579  return FALSE;
7580  }
7581  int n = v->listLength();
7582  if (n == 1)
7583  {
7584  res->data = v->String();
7585  return FALSE;
7586  }
7587 
7588  char** slist = (char**) omAlloc(n*sizeof(char*));
7589  int i, j;
7590 
7591  for (i=0, j=0; i<n; i++, v = v ->next)
7592  {
7593  slist[i] = v->String();
7594  assume(slist[i] != NULL);
7595  j+=strlen(slist[i]);
7596  }
7597  char* s = (char*) omAlloc((j+1)*sizeof(char));
7598  *s='\0';
7599  for (i=0;i<n;i++)
7600  {
7601  strcat(s, slist[i]);
7602  omFree(slist[i]);
7603  }
7604  omFreeSize(slist, n*sizeof(char*));
7605  res->data = s;
7606  return FALSE;
7607 }
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:88
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:86
#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 5236 of file iparith.cc.

5237 {
5238  res->data = (char *)strlen((char *)v->Data());
5239  return FALSE;
5240 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjSUBST_Id()

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

Definition at line 6240 of file iparith.cc.

6241 {
6242  int ringvar;
6243  poly monomexpr;
6244  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6245  if (nok) return TRUE;
6246  ideal id=(ideal)u->Data();
6247  if (ringvar>0)
6248  {
6249  BOOLEAN overflow=FALSE;
6250  if (monomexpr!=NULL)
6251  {
6252  long deg_monexp=pTotaldegree(monomexpr);
6253  for(int i=IDELEMS(id)-1;i>=0;i--)
6254  {
6255  poly p=id->m[i];
6256  if ((p!=NULL) && (pTotaldegree(p)!=0) &&
6257  ((unsigned long)deg_monexp > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6258  {
6259  overflow=TRUE;
6260  break;
6261  }
6262  }
6263  }
6264  if (overflow)
6265  Warn("possible OVERFLOW in subst, max exponent is %ld",currRing->bitmask/2);
6266  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6267  {
6268  if (res->rtyp==MATRIX_CMD) id=(ideal)mp_Copy((matrix)id,currRing);
6269  else id=id_Copy(id,currRing);
6270  res->data = id_Subst(id, ringvar, monomexpr, currRing);
6271  }
6272  else
6273  res->data = idSubstPoly(id,ringvar,monomexpr);
6274  }
6275  else
6276  {
6277  res->data = idSubstPar(id,-ringvar,monomexpr);
6278  }
6279  return FALSE;
6280 }
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:88
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:6186
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:91
#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:71
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 6284 of file iparith.cc.

6285 {
6286  return jjSUBST_Id_X(res,u,v,w,INT_CMD);
6287 }
Definition: tok.h:95
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6292

◆ jjSUBST_Id_N()

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

Definition at line 6288 of file iparith.cc.

6289 {
6290  return jjSUBST_Id_X(res,u,v,w,NUMBER_CMD);
6291 }
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6292

◆ jjSUBST_Id_X()

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

Definition at line 6292 of file iparith.cc.

6293 {
6294  sleftv tmp;
6295  memset(&tmp,0,sizeof(tmp));
6296  // do not check the result, conversion from int/number to poly works always
6297  iiConvert(input_type,POLY_CMD,iiTestConvert(input_type,POLY_CMD),w,&tmp);
6298  BOOLEAN b=jjSUBST_Id(res,u,v,&tmp);
6299  tmp.CleanUp();
6300  return b;
6301 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
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:6240
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 7790 of file iparith.cc.

7791 {
7792  leftv v = u->next; // number of args > 0
7793  if (v==NULL) return TRUE;
7794  leftv w = v->next;
7795  if (w==NULL) return TRUE;
7796  leftv rest = w->next;;
7797 
7798  u->next = NULL;
7799  v->next = NULL;
7800  w->next = NULL;
7801  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
7802  if ((rest!=NULL) && (!b))
7803  {
7804  sleftv tmp_res;
7805  leftv tmp_next=res->next;
7806  res->next=rest;
7807  memset(&tmp_res,0,sizeof(tmp_res));
7808  b = iiExprArithM(&tmp_res,res,iiOp);
7809  memcpy(res,&tmp_res,sizeof(tmp_res));
7810  res->next=tmp_next;
7811  }
7812  u->next = v;
7813  v->next = w;
7814  // rest was w->next, but is already cleaned
7815  return b;
7816 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8531
#define TRUE
Definition: auxiliary.h:98
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8621
leftv next
Definition: subexpr.h:86
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 6214 of file iparith.cc.

6215 {
6216  int ringvar;
6217  poly monomexpr;
6218  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6219  if (nok) return TRUE;
6220  poly p=(poly)u->Data();
6221  if (ringvar>0)
6222  {
6223  if ((monomexpr!=NULL) && (p!=NULL) && (pTotaldegree(p)!=0) &&
6224  ((unsigned long)pTotaldegree(monomexpr) > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6225  {
6226  Warn("possible OVERFLOW in subst, max exponent is %ld, substituting deg %d by deg %d",currRing->bitmask/2, pTotaldegree(monomexpr), pTotaldegree(p));
6227  //return TRUE;
6228  }
6229  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6230  res->data = pSubst((poly)u->CopyD(res->rtyp),ringvar,monomexpr);
6231  else
6232  res->data= pSubstPoly(p,ringvar,monomexpr);
6233  }
6234  else
6235  {
6236  res->data=pSubstPar(p,-ringvar,monomexpr);
6237  }
6238  return FALSE;
6239 }
#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:88
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:6186
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:91
#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 6186 of file iparith.cc.

6188 {
6189  monomexpr=(poly)w->Data();
6190  poly p=(poly)v->Data();
6191 #if 0
6192  if (pLength(monomexpr)>1)
6193  {
6194  Werror("`%s` substitutes a ringvar only by a term",
6196  return TRUE;
6197  }
6198 #endif
6199  if ((ringvar=pVar(p))==0)
6200  {
6201  if ((p!=NULL) && (currRing->cf->extRing!=NULL))
6202  {
6203  number n = pGetCoeff(p);
6204  ringvar= -n_IsParam(n, currRing);
6205  }
6206  if(ringvar==0)
6207  {
6208  WerrorS("ringvar/par expected");
6209  return TRUE;
6210  }
6211  }
6212  return FALSE;
6213 }
#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:8851
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:5644
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ jjSYZ_2()

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

Definition at line 3381 of file iparith.cc.

3382 {
3383  // see jjSYZYGY
3384  intvec *w=NULL;
3385  ideal I=(ideal)u->Data();
3386  GbVariant alg=syGetAlgorithm((char*)v->Data(),currRing,I);
3387  res->data = (char *)idSyzygies(I,testHomog,&w,TRUE,FALSE,NULL,alg);
3388  if (w!=NULL) delete w;
3390  return FALSE;
3391 
3392 }
#define FALSE
Definition: auxiliary.h:94
GbVariant
Definition: ideals.h:121
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
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 setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition: ideals.cc:562
#define TEST_OPT_RETURN_SB
Definition: options.h:107
#define NULL
Definition: omList.c:10
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
Definition: ideals.cc:2655
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1137

◆ jjSYZYGY()

static BOOLEAN jjSYZYGY ( leftv  res,
leftv  v 
)
static

Definition at line 4933 of file iparith.cc.

4934 {
4935  intvec *w=NULL;
4936  res->data = (char *)idSyzygies((ideal)v->Data(),testHomog,&w);
4937  if (w!=NULL) delete w;
4939  return FALSE;
4940 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition: ideals.cc:562
#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

◆ jjTEST()

static BOOLEAN jjTEST ( leftv  ,
leftv  v 
)
static

Definition at line 7608 of file iparith.cc.

7609 {
7610  do
7611  {
7612  if (v->Typ()!=INT_CMD)
7613  return TRUE;
7614  test_cmd((int)(long)v->Data());
7615  v=v->next;
7616  }
7617  while (v!=NULL);
7618  return FALSE;
7619 }
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:86
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:88
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:86
#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:88
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:256
leftv next
Definition: subexpr.h:86
#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:88
leftv Next()
Definition: subexpr.h:136
#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:88
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:86
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
static ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition: ideals.h:84

◆ 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:88
Definition: intvec.h:14
leftv next
Definition: subexpr.h:86
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:88
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:86
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition: matpol.cc:220
#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:88
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:155
#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:88
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:142
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:88
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:155
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:88
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:155
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:88
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:172
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:88
#define nMult(n1, n2)
Definition: numbers.h:17
leftv next
Definition: subexpr.h:86
#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:88
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:86
#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 4971 of file iparith.cc.

4972 {
4973  res->data = (char *)(long)ivTrace((intvec*)(v->Data()));
4974  return FALSE;
4975 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 4976 of file iparith.cc.

4977 {
4978  res->data = (char *)(((bigintmat*)(v->Data()))->transpose());
4979  return FALSE;
4980 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjTRANSP_IV()

static BOOLEAN jjTRANSP_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4981 of file iparith.cc.

4982 {
4983  res->data = (char *)ivTranp((intvec*)(v->Data()));
4984  return FALSE;
4985 }
#define FALSE
Definition: auxiliary.h:94
intvec * ivTranp(intvec *o)
Definition: intvec.cc:310
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1137

◆ jjTWOSTD()

static BOOLEAN jjTWOSTD ( leftv  res,
leftv  a 
)
static

Definition at line 5013 of file iparith.cc.

5014 {
5015  if (rIsPluralRing(currRing)) res->data=(ideal)twostd((ideal)a->Data());
5016  else res->data=(ideal)a->CopyD();
5017  setFlag(res,FLAG_STD);
5018  setFlag(res,FLAG_TWOSTD);
5019  return FALSE;
5020 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5023 of file iparith.cc.

5024 {
5025  int t=(int)(long)v->data;
5026  switch (t)
5027  {
5028  case CRING_CMD:
5029  case INT_CMD:
5030  case POLY_CMD:
5031  case VECTOR_CMD:
5032  case STRING_CMD:
5033  case INTVEC_CMD:
5034  case IDEAL_CMD:
5035  case MATRIX_CMD:
5036  case MODUL_CMD:
5037  case MAP_CMD:
5038  case PROC_CMD:
5039  case RING_CMD:
5040  //case QRING_CMD:
5041  case INTMAT_CMD:
5042  case BIGINTMAT_CMD:
5043  case NUMBER_CMD:
5044  #ifdef SINGULAR_4_2
5045  case CNUMBER_CMD:
5046  #endif
5047  case BIGINT_CMD:
5048  case LIST_CMD:
5049  case PACKAGE_CMD:
5050  case LINK_CMD:
5051  case RESOLUTION_CMD:
5052  res->data=omStrDup(Tok2Cmdname(t)); break;
5053  case DEF_CMD:
5054  case NONE: res->data=omStrDup("none"); break;
5055  default:
5056  {
5057  if (t>MAX_TOK)
5058  res->data=omStrDup(getBlackboxName(t));
5059  else
5060  res->data=omStrDup("?unknown type?");
5061  break;
5062  }
5063  }
5064  return FALSE;
5065 }
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
Definition: tok.h:213
void * data
Definition: subexpr.h:88
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8851
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 3525 of file iparith.cc.

3526 {
3527  number n=(number)u->CopyD(BIGINT_CMD);
3528  n=n_InpNeg(n,coeffs_BIGINT);
3529  res->data = (char *)n;
3530  return FALSE;
3531 }
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:88
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 3562 of file iparith.cc.

3563 {
3564  bigintmat *bim=(bigintmat *)u->CopyD(BIGINTMAT_CMD);
3565  (*bim)*=(-1);
3566  res->data = (char *)bim;
3567  return FALSE;
3568 }
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUMINUS_I()

static BOOLEAN jjUMINUS_I ( leftv  res,
leftv  u 
)
static

Definition at line 3532 of file iparith.cc.

3533 {
3534  res->data = (char *)(-(long)u->Data());
3535  return FALSE;
3536 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
void * Data()
Definition: subexpr.cc:1137

◆ jjUMINUS_IV()

static BOOLEAN jjUMINUS_IV ( leftv  res,
leftv  u 
)
static

Definition at line 3555 of file iparith.cc.

3556 {
3557  intvec *iv=(intvec *)u->CopyD(INTVEC_CMD);
3558  (*iv)*=(-1);
3559  res->data = (char *)iv;
3560  return FALSE;
3561 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 3549 of file iparith.cc.

3550 {
3551  poly m1=pISet(-1);
3552  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),m1,currRing);
3553  return FALSE;
3554 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:155
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 3537 of file iparith.cc.

3538 {
3539  number n=(number)u->CopyD(NUMBER_CMD);
3540  n=nInpNeg(n);
3541  res->data = (char *)n;
3542  return FALSE;
3543 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#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 3544 of file iparith.cc.

3545 {
3546  res->data = (char *)pNeg((poly)u->CopyD(POLY_CMD));
3547  return FALSE;
3548 }
#define FALSE
Definition: auxiliary.h:94
#define pNeg(p)
Definition: polys.h:181
void * data
Definition: subexpr.h:88
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jjUNIQLIST()

BOOLEAN jjUNIQLIST ( leftv  ,
leftv  arg 
)

Definition at line 9405 of file iparith.cc.

9406 {
9407  lists l=(lists)arg->Data();
9408  if (l->nr>0)
9409  {
9410  qsort(l->m,l->nr+1,sizeof(sleftv),jjCOMPARE_ALL);
9411  int i, j, len;
9412  len=l->nr;
9413  i=0;
9414  while(i<len)
9415  {
9416  if(jjCOMPARE_ALL(&(l->m[i]),&(l->m[i+1]))==0)
9417  {
9418  l->m[i].CleanUp();
9419  for(j=i; j<len;j++) l->m[j]=l->m[j+1];
9420  memset(&(l->m[len]),0,sizeof(sleftv));
9421  l->m[len].rtyp=DEF_CMD;
9422  len--;
9423  }
9424  else
9425  i++;
9426  }
9427  //Print("new len:%d\n",len);
9428  }
9429  return FALSE;
9430 }
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
static int jjCOMPARE_ALL(const void *aa, const void *bb)
Definition: iparith.cc:9355
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:91
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 5066 of file iparith.cc.

5067 {
5068  res->data=(char *)(long)pIsUnivariate((poly)v->Data());
5069  return FALSE;
5070 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5071 of file iparith.cc.

5072 {
5073  int i=(int)(long)v->Data();
5074  if ((0<i) && (i<=currRing->N))
5075  {
5076  poly p=pOne();
5077  pSetExp(p,i,1);
5078  pSetm(p);
5079  res->data=(char *)p;
5080  }
5081  else
5082  {
5083  Werror("var number %d out of range 1..%d",i,currRing->N);
5084  return TRUE;
5085  }
5086  return FALSE;
5087 }
#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:88
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 5088 of file iparith.cc.

5089 {
5090  if (currRing==NULL)
5091  {
5092  WerrorS("no ring active");
5093  return TRUE;
5094  }
5095  int i=(int)(long)v->Data();
5096  if ((0<i) && (i<=currRing->N))
5097  res->data=omStrDup(currRing->names[i-1]);
5098  else
5099  {
5100  Werror("var number %d out of range 1..%d",i,currRing->N);
5101  return TRUE;
5102  }
5103  return FALSE;
5104 }
#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:88
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 3393 of file iparith.cc.

3394 {
3395  idhdl h=(idhdl)u->data;
3396  int i=(int)(long)v->Data();
3397  if ((0<i) && (i<=IDRING(h)->N))
3398  res->data=omStrDup(IDRING(h)->names[i-1]);
3399  else
3400  {
3401  Werror("var number %d out of range 1..%d",i,IDRING(h)->N);
3402  return TRUE;
3403  }
3404  return FALSE;
3405 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: idrec.h:34
void * data
Definition: subexpr.h:88
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 5105 of file iparith.cc.

5106 {
5107  assumeStdFlag(v);
5108  res->data = (char *)(long)scMult0Int((ideal)v->Data(),currRing->qideal);
5109  return FALSE;
5110 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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 5111 of file iparith.cc.

5112 {
5113 // input: u: a list with links of type
5114 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5115 // returns: -1: the read state of all links is eof
5116 // i>0: (at least) u[i] is ready
5117  lists Lforks = (lists)u->Data();
5118  int i = slStatusSsiL(Lforks, -1);
5119  if(i == -2) /* error */
5120  {
5121  return TRUE;
5122  }
5123  res->data = (void*)(long)i;
5124  return FALSE;
5125 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
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 3406 of file iparith.cc.

3407 {
3408 // input: u: a list with links of type
3409 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3410 // v: timeout for select in milliseconds
3411 // or 0 for polling
3412 // returns: ERROR (via Werror): timeout negative
3413 // -1: the read state of all links is eof
3414 // 0: timeout (or polling): none ready
3415 // i>0: (at least) L[i] is ready
3416  lists Lforks = (lists)u->Data();
3417  int t = (int)(long)v->Data();
3418  if(t < 0)
3419  {
3420  WerrorS("negative timeout"); return TRUE;
3421  }
3422  int i = slStatusSsiL(Lforks, t*1000);
3423  if(i == -2) /* error */
3424  {
3425  return TRUE;
3426  }
3427  res->data = (void*)(long)i;
3428  return FALSE;
3429 }
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:88
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 5126 of file iparith.cc.

5127 {
5128 // input: u: a list with links of type
5129 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5130 // returns: -1: the read state of all links is eof
5131 // 1: all links are ready
5132 // (caution: at least one is ready, but some maybe dead)
5133  lists Lforks = (lists)u->CopyD();
5134  int i;
5135  int j = -1;
5136  for(int nfinished = 0; nfinished < Lforks->nr+1; nfinished++)
5137  {
5138  i = slStatusSsiL(Lforks, -1);
5139  if(i == -2) /* error */
5140  {
5141  return TRUE;
5142  }
5143  if(i == -1)
5144  {
5145  break;
5146  }
5147  j = 1;
5148  Lforks->m[i-1].CleanUp();
5149  Lforks->m[i-1].rtyp=DEF_CMD;
5150  Lforks->m[i-1].data=NULL;
5151  }
5152  res->data = (void*)(long)j;
5153  Lforks->Clean();
5154  return FALSE;
5155 }
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:88
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:91
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 3430 of file iparith.cc.

3431 {
3432 // input: u: a list with links of type
3433 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3434 // v: timeout for select in milliseconds
3435 // or 0 for polling
3436 // returns: ERROR (via Werror): timeout negative
3437 // -1: the read state of all links is eof
3438 // 0: timeout (or polling): none ready
3439 // 1: all links are ready
3440 // (caution: at least one is ready, but some maybe dead)
3441  lists Lforks = (lists)u->CopyD();
3442  int timeout = 1000*(int)(long)v->Data();
3443  if(timeout < 0)
3444  {
3445  WerrorS("negative timeout"); return TRUE;
3446  }
3447  int t = getRTimer()/TIMER_RESOLUTION; // in seconds
3448  int i;
3449  int ret = -1;
3450  for(unsigned nfinished = 0; nfinished < ((unsigned)Lforks->nr)+1; nfinished++)
3451  {
3452  i = slStatusSsiL(Lforks, timeout);
3453  if(i > 0) /* Lforks[i] is ready */
3454  {
3455  ret = 1;
3456  Lforks->m[i-1].CleanUp();
3457  Lforks->m[i-1].rtyp=DEF_CMD;
3458  Lforks->m[i-1].data=NULL;
3459  timeout = si_max(0,timeout - 1000*(getRTimer()/TIMER_RESOLUTION - t));
3460  }
3461  else /* terminate the for loop */
3462  {
3463  if(i == -2) /* error */
3464  {
3465  return TRUE;
3466  }
3467  if(i == 0) /* timeout */
3468  {
3469  ret = 0;
3470  }
3471  break;
3472  }
3473  }
3474  Lforks->Clean();
3475  res->data = (void*)(long)ret;
3476  return FALSE;
3477 }
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:88
#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:91
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 3478 of file iparith.cc.

3479 {
3480  res->data = (char *)mp_Wedge((matrix)u->Data(),(int)(long)v->Data(),currRing);
3481  return FALSE;
3482 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:1660
void * Data()
Definition: subexpr.cc:1137

◆ jjWRONG()

static BOOLEAN jjWRONG ( leftv  ,
leftv   
)
static

Definition at line 3485 of file iparith.cc.

3486 {
3487  return TRUE;
3488 }
#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 2731 of file ipshell.cc.

2732 {
2733  if ((L->nr!=3)
2734 #ifdef HAVE_PLURAL
2735  &&(L->nr!=5)
2736 #endif
2737  )
2738  return NULL;
2739  int is_gf_char=0;
2740  // 0: char/ cf - ring
2741  // 1: list (var)
2742  // 2: list (ord)
2743  // 3: qideal
2744  // possibly:
2745  // 4: C
2746  // 5: D
2747 
2748  ring R = (ring) omAlloc0Bin(sip_sring_bin);
2749 
2750  // ------------------------------------------------------------------
2751  // 0: char:
2752  if (L->m[0].Typ()==CRING_CMD)
2753  {
2754  R->cf=(coeffs)L->m[0].Data();
2755  R->cf->ref++;
2756  }
2757  else if (L->m[0].Typ()==INT_CMD)
2758  {
2759  int ch = (int)(long)L->m[0].Data();
2760  assume( ch >= 0 );
2761 
2762  if (ch == 0) // Q?
2763  R->cf = nInitChar(n_Q, NULL);
2764  else
2765  {
2766  int l = IsPrime(ch); // Zp?
2767  if( l != ch )
2768  {
2769  Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
2770  ch = l;
2771  }
2772  R->cf = nInitChar(n_Zp, (void*)(long)ch);
2773  }
2774  }
2775  else if (L->m[0].Typ()==LIST_CMD) // something complicated...
2776  {
2777  lists LL=(lists)L->m[0].Data();
2778 
2779 #ifdef HAVE_RINGS
2780  if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
2781  {
2782  rComposeRing(LL, R); // Ring!?
2783  }
2784  else
2785 #endif
2786  if (LL->nr < 3)
2787  rComposeC(LL,R); // R, long_R, long_C
2788  else
2789  {
2790  if (LL->m[0].Typ()==INT_CMD)
2791  {
2792  int ch = (int)(long)LL->m[0].Data();
2793  while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
2794  if (fftable[is_gf_char]==0) is_gf_char=-1;
2795 
2796  if(is_gf_char!= -1)
2797  {
2798  GFInfo param;
2799 
2800  param.GFChar = ch;
2801  param.GFDegree = 1;
2802  param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
2803 
2804  // nfInitChar should be able to handle the case when ch is in fftables!
2805  R->cf = nInitChar(n_GF, (void*)&param);
2806  }
2807  }
2808 
2809  if( R->cf == NULL )
2810  {
2811  ring extRing = rCompose((lists)L->m[0].Data(),FALSE);
2812 
2813  if (extRing==NULL)
2814  {
2815  WerrorS("could not create the specified coefficient field");
2816  goto rCompose_err;
2817  }
2818 
2819  if( extRing->qideal != NULL ) // Algebraic extension
2820  {
2821  AlgExtInfo extParam;
2822 
2823  extParam.r = extRing;
2824 
2825  R->cf = nInitChar(n_algExt, (void*)&extParam);
2826  }
2827  else // Transcendental extension
2828  {
2829  TransExtInfo extParam;
2830  extParam.r = extRing;
2831  assume( extRing->qideal == NULL );
2832 
2833  R->cf = nInitChar(n_transExt, &extParam);
2834  }
2835  }
2836  }
2837  }
2838  else
2839  {
2840  WerrorS("coefficient field must be described by `int` or `list`");
2841  goto rCompose_err;
2842  }
2843 
2844  if( R->cf == NULL )
2845  {
2846  WerrorS("could not create coefficient field described by the input!");
2847  goto rCompose_err;
2848  }
2849 
2850  // ------------------------- VARS ---------------------------
2851  if (rComposeVar(L,R)) goto rCompose_err;
2852  // ------------------------ ORDER ------------------------------
2853  if (rComposeOrder(L,check_comp,R)) goto rCompose_err;
2854 
2855  // ------------------------ ??????? --------------------
2856 
2857  rRenameVars(R);
2858  rComplete(R);
2859 
2860  // ------------------------ Q-IDEAL ------------------------
2861 
2862  if (L->m[3].Typ()==IDEAL_CMD)
2863  {
2864  ideal q=(ideal)L->m[3].Data();
2865  if (q->m[0]!=NULL)
2866  {
2867  if (R->cf != currRing->cf) //->cf->ch!=currRing->cf->ch)
2868  {
2869  #if 0
2870  WerrorS("coefficient fields must be equal if q-ideal !=0");
2871  goto rCompose_err;
2872  #else
2873  ring orig_ring=currRing;
2874  rChangeCurrRing(R);
2875  int *perm=NULL;
2876  int *par_perm=NULL;
2877  int par_perm_size=0;
2878  nMapFunc nMap;
2879 
2880  if ((nMap=nSetMap(orig_ring->cf))==NULL)
2881  {
2882  if (rEqual(orig_ring,currRing))
2883  {
2884  nMap=n_SetMap(currRing->cf, currRing->cf);
2885  }
2886  else
2887  // Allow imap/fetch to be make an exception only for:
2888  if ( (rField_is_Q_a(orig_ring) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2891  ||
2892  (rField_is_Zp_a(orig_ring) && // Zp(a..) -> Zp(a..) || Zp
2893  (rField_is_Zp(currRing, rInternalChar(orig_ring)) ||
2894  rField_is_Zp_a(currRing, rInternalChar(orig_ring)))) )
2895  {
2896  par_perm_size=rPar(orig_ring);
2897 
2898 // if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
2899 // naSetChar(rInternalChar(orig_ring),orig_ring);
2900 // else ntSetChar(rInternalChar(orig_ring),orig_ring);
2901 
2902  nSetChar(currRing->cf);
2903  }
2904  else
2905  {
2906  WerrorS("coefficient fields must be equal if q-ideal !=0");
2907  goto rCompose_err;
2908  }
2909  }
2910  perm=(int *)omAlloc0((orig_ring->N+1)*sizeof(int));
2911  if (par_perm_size!=0)
2912  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2913  int i;
2914  #if 0
2915  // use imap:
2916  maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2917  currRing->names,currRing->N,currRing->parameter, currRing->P,
2918  perm,par_perm, currRing->ch);
2919  #else
2920  // use fetch
2921  if ((rPar(orig_ring)>0) && (rPar(currRing)==0))
2922  {
2923  for(i=si_min(rPar(orig_ring),rVar(currRing))-1;i>=0;i--) par_perm[i]=i+1;
2924  }
2925  else if (par_perm_size!=0)
2926  for(i=si_min(rPar(orig_ring),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2927  for(i=si_min(orig_ring->N,rVar(currRing));i>0;i--) perm[i]=i;
2928  #endif
2929  ideal dest_id=idInit(IDELEMS(q),1);
2930  for(i=IDELEMS(q)-1; i>=0; i--)
2931  {
2932  dest_id->m[i]=p_PermPoly(q->m[i],perm,orig_ring, currRing,nMap,
2933  par_perm,par_perm_size);
2934  // PrintS("map:");pWrite(dest_id->m[i]);PrintLn();
2935  pTest(dest_id->m[i]);
2936  }
2937  R->qideal=dest_id;
2938  if (perm!=NULL)
2939  omFreeSize((ADDRESS)perm,(orig_ring->N+1)*sizeof(int));
2940  if (par_perm!=NULL)
2941  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2942  rChangeCurrRing(orig_ring);
2943  #endif
2944  }
2945  else
2946  R->qideal=idrCopyR(q,currRing,R);
2947  }
2948  }
2949  else
2950  {
2951  WerrorS("q-ideal must be given as `ideal`");
2952  goto rCompose_err;
2953  }
2954 
2955 
2956  // ---------------------------------------------------------------
2957  #ifdef HAVE_PLURAL
2958  if (L->nr==5)
2959  {
2960  if (nc_CallPlural((matrix)L->m[4].Data(),
2961  (matrix)L->m[5].Data(),
2962  NULL,NULL,
2963  R,
2964  true, // !!!
2965  true, false,
2966  currRing, FALSE)) goto rCompose_err;
2967  // takes care about non-comm. quotient! i.e. calls "nc_SetupQuotient" due to last true
2968  }
2969  #endif
2970  return R;
2971 
2972 rCompose_err:
2973  if (R->N>0)
2974  {
2975  int i;
2976  if (R->names!=NULL)
2977  {
2978  i=R->N-1;
2979  while (i>=0) { omfree(R->names[i]); i--; }
2980  omFree(R->names);
2981  }
2982  }
2983  omfree(R->order);
2984  omfree(R->block0);
2985  omfree(R->block1);
2986  omfree(R->wvhdl);
2987  omFree(R);
2988  return NULL;
2989 }
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:2431
Definition: lists.h:22
ring rCompose(const lists L, const BOOLEAN check_comp)
Definition: ipshell.cc:2731
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:2226
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:3985
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
Definition: ipshell.cc:2476
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:3365
#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:93
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:1629
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:2390
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:2693
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:2297
#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
#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 8851 of file iparith.cc.

8852 {
8853  if (tok <= 0)
8854  {
8855  return sArithBase.sCmds[0].name;
8856  }
8857  if (tok==ANY_TYPE) return "any_type";
8858  if (tok==COMMAND) return "command";
8859  if (tok==NONE) return "nothing";
8860  //if (tok==IFBREAK) return "if_break";
8861  //if (tok==VECTOR_FROM_POLYS) return "vector_from_polys";
8862  //if (tok==ORDER_VECTOR) return "ordering";
8863  //if (tok==REF_VAR) return "ref";
8864  //if (tok==OBJECT) return "object";
8865  //if (tok==PRINT_EXPR) return "print_expr";
8866  if (tok==IDHDL) return "identifier";
8867  if (tok>MAX_TOK) return getBlackboxName(tok);
8868  unsigned i;
8869  for(i=0; i<sArithBase.nCmdUsed; i++)
8870  //while (sArithBase.sCmds[i].tokval!=0)
8871  {
8872  if ((sArithBase.sCmds[i].tokval == tok)&&
8873  (sArithBase.sCmds[i].alias==0))
8874  {
8875  return sArithBase.sCmds[i].name;
8876  }
8877  }
8878  // try gain for alias/old names:
8879  for(i=0; i<sArithBase.nCmdUsed; i++)
8880  {
8881  if (sArithBase.sCmds[i].tokval == tok)
8882  {
8883  return sArithBase.sCmds[i].name;
8884  }
8885  }
8886  return sArithBase.sCmds[0].name;
8887 }
#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 5219 of file iparith.cc.

5220 {
5222 }
static int WerrorS_dummy_cnt
Definition: iparith.cc:5218

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