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/prCopy.h>
#include <polys/matpol.h>
#include <polys/monomials/maps.h>
#include <polys/coeffrings.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 WARN_RING   16
 
#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_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 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 jjFETCH (leftv res, leftv u, leftv v)
 
static BOOLEAN jjFIND2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjFWALK (leftv res, leftv u, leftv v)
 
static BOOLEAN jjGCD_I (leftv res, leftv u, leftv v)
 
static BOOLEAN jjGCD_BI (leftv res, leftv u, leftv v)
 
static BOOLEAN jjGCD_N (leftv res, leftv u, leftv v)
 
static BOOLEAN jjGCD_P (leftv res, leftv u, leftv v)
 
static BOOLEAN jjHILBERT2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjHOMOG_P (leftv res, leftv u, leftv v)
 
static BOOLEAN jjHOMOG_ID (leftv res, leftv u, leftv v)
 
static BOOLEAN jjHOMOG1_W (leftv res, leftv v, leftv u)
 
static BOOLEAN jjINDEPSET2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjINTERSECT (leftv res, leftv u, leftv v)
 
static BOOLEAN jjINTERPOLATION (leftv res, leftv l, leftv v)
 
static BOOLEAN jjJanetBasis2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjJanetBasis (leftv res, leftv v)
 
static BOOLEAN jjJET_P (leftv res, leftv u, leftv v)
 
static BOOLEAN jjJET_ID (leftv res, leftv u, leftv v)
 
static BOOLEAN jjKBASE2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjPREIMAGE (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjKERNEL (leftv res, leftv u, leftv v)
 
static BOOLEAN jjKoszul (leftv res, leftv u, leftv v)
 
static BOOLEAN jjKoszul_Id (leftv res, leftv u, leftv v)
 
static BOOLEAN jjLIFT (leftv res, leftv u, leftv v)
 
static BOOLEAN jjLIFTSTD (leftv res, leftv u, leftv v)
 
static BOOLEAN jjLOAD2 (leftv, leftv, leftv v)
 
static BOOLEAN jjLOAD_E (leftv, leftv v, leftv u)
 
static BOOLEAN jjMODULO (leftv res, leftv u, leftv v)
 
static BOOLEAN jjMOD_BI (leftv res, leftv u, leftv v)
 
static BOOLEAN jjMOD_N (leftv res, leftv u, leftv v)
 
static BOOLEAN jjMONITOR2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjMONITOR1 (leftv res, leftv v)
 
static BOOLEAN jjMONOM (leftv res, leftv v)
 
static BOOLEAN jjNEWSTRUCT2 (leftv, leftv u, leftv v)
 
static BOOLEAN jjPARSTR2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjPlural_num_poly (leftv res, leftv a, leftv b)
 
static BOOLEAN jjPlural_num_mat (leftv res, leftv a, leftv b)
 
static BOOLEAN jjPlural_mat_poly (leftv res, leftv a, leftv b)
 
static BOOLEAN jjPlural_mat_mat (leftv res, leftv a, leftv b)
 
static BOOLEAN jjBRACKET (leftv res, leftv a, leftv b)
 
static BOOLEAN jjOPPOSE (leftv res, leftv a, leftv b)
 
static BOOLEAN jjQUOT (leftv res, leftv u, leftv v)
 
static BOOLEAN jjRANDOM (leftv res, leftv u, leftv v)
 
static BOOLEAN jjRANK2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjREAD2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjREDUCE_P (leftv res, leftv u, leftv v)
 
static BOOLEAN jjREDUCE_ID (leftv res, leftv u, leftv v)
 
static BOOLEAN jjRES (leftv res, leftv u, leftv v)
 
static BOOLEAN jjPFAC2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjRSUM (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSIMPL_ID (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSQR_FREE2 (leftv res, leftv u, leftv dummy)
 
static BOOLEAN jjSTATUS2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSTATUS2L (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSIMPL_P (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSTD_HILB (leftv res, leftv u, leftv v)
 
static BOOLEAN jjSTD_1 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjVARSTR2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjWAIT1ST2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjWAITALL2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjWEDGE (leftv res, leftv u, leftv v)
 
static BOOLEAN jjWRONG (leftv, leftv)
 
static BOOLEAN jjDUMMY (leftv res, leftv u)
 
static BOOLEAN jjNULL (leftv, leftv)
 
static BOOLEAN jjPLUSPLUS (leftv, leftv u)
 
static BOOLEAN jjUMINUS_BI (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_I (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_N (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_P (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_MA (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_IV (leftv res, leftv u)
 
static BOOLEAN jjUMINUS_BIM (leftv res, leftv u)
 
static BOOLEAN jjPROC1 (leftv res, leftv u)
 
static BOOLEAN jjBAREISS (leftv res, leftv v)
 
static BOOLEAN jjBAREISS_BIM (leftv res, leftv v)
 
static BOOLEAN jjBI2N (leftv res, leftv u)
 
static BOOLEAN jjBI2IM (leftv res, leftv u)
 
static BOOLEAN jjBI2P (leftv res, leftv u)
 
static BOOLEAN jjCALL1MANY (leftv res, leftv u)
 
static BOOLEAN jjCHAR (leftv res, leftv v)
 
static BOOLEAN jjCOLS (leftv res, leftv v)
 
static BOOLEAN jjCOLS_BIM (leftv res, leftv v)
 
static BOOLEAN jjCOLS_IV (leftv res, leftv v)
 
static BOOLEAN jjCONTENT (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_BI (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_N (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_L (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_M (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_IV (leftv res, leftv v)
 
static BOOLEAN jjCOUNT_RG (leftv res, leftv v)
 
static BOOLEAN jjDEG (leftv res, leftv v)
 
static BOOLEAN jjDEG_M (leftv res, leftv u)
 
static BOOLEAN jjDEGREE (leftv res, leftv v)
 
static BOOLEAN jjDEFINED (leftv res, leftv v)
 
static BOOLEAN jjDENOMINATOR (leftv res, leftv v)
 Return the denominator of the input number NOTE: the input number is normalized as a side effect. More...
 
static BOOLEAN jjNUMERATOR (leftv res, leftv v)
 Return the numerator of the input number NOTE: the input number is normalized as a side effect. More...
 
static BOOLEAN jjDET (leftv res, leftv v)
 
static BOOLEAN jjDET_BI (leftv res, leftv v)
 
static BOOLEAN jjDET_N2 (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 jjsyMinBase (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 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 currRingIsOverIntegralDomain ()
 
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 jjRANDOM_CF (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSUBST_Test (leftv v, leftv w, int &ringvar, poly &monomexpr)
 
static BOOLEAN jjSUBST_P (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSUBST_Id (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSUBST_Id_X (leftv res, leftv u, leftv v, leftv w, int input_type)
 
static BOOLEAN jjSUBST_Id_I (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSUBST_Id_N (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjMATRIX_Id (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjMATRIX_Mo (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjMATRIX_Ma (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjLIFT3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjLIFTSTD3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjREDUCE3_CP (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjREDUCE3_CID (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjREDUCE3_P (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjREDUCE3_ID (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjRES3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjRING3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSTATUS3 (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjSTD_HILB_W (leftv res, leftv u, leftv v, leftv w)
 
static BOOLEAN jjBREAK0 (leftv, leftv)
 
static BOOLEAN jjBREAK1 (leftv, leftv v)
 
static BOOLEAN jjCALL1ARG (leftv res, leftv v)
 
static BOOLEAN jjCALL2ARG (leftv res, leftv u)
 
static BOOLEAN jjCALL3ARG (leftv res, leftv u)
 
static BOOLEAN jjCOEF_M (leftv, leftv v)
 
static BOOLEAN jjDIVISION4 (leftv res, leftv v)
 
static BOOLEAN jjIDEAL_PL (leftv res, leftv v)
 
static BOOLEAN jjFETCH_M (leftv res, leftv u)
 
static BOOLEAN jjINTERSECT_PL (leftv res, leftv v)
 
static BOOLEAN jjLU_INVERSE (leftv res, leftv v)
 
static BOOLEAN jjLU_SOLVE (leftv res, leftv v)
 
static BOOLEAN jjINTVEC_PL (leftv res, leftv v)
 
static BOOLEAN jjJET4 (leftv res, leftv u)
 
static BOOLEAN jjKLAMMER_PL (leftv res, leftv u)
 
BOOLEAN jjLIST_PL (leftv res, leftv v)
 
static BOOLEAN jjNAMES0 (leftv res, leftv)
 
static BOOLEAN jjOPTION_PL (leftv res, leftv v)
 
static BOOLEAN jjREDUCE4 (leftv res, leftv u)
 
static BOOLEAN jjREDUCE5 (leftv res, leftv u)
 
static BOOLEAN jjRESERVED0 (leftv, leftv)
 
static BOOLEAN jjSTRING_PL (leftv res, leftv v)
 
static BOOLEAN jjTEST (leftv, leftv v)
 
static BOOLEAN jjFactModD_M (leftv res, leftv v)
 
static BOOLEAN jjSTATUS_M (leftv res, leftv v)
 
static BOOLEAN jjSUBST_M (leftv res, leftv u)
 
static BOOLEAN jjQRDS (leftv res, leftv INPUT)
 
static BOOLEAN jjSTD_HILB_WP (leftv res, leftv INPUT)
 
static BOOLEAN jjRING_PL (leftv res, leftv a)
 
static BOOLEAN iiExprArith2TabIntern (leftv res, leftv a, int op, leftv b, BOOLEAN proccall, const struct sValCmd2 *dA2, int at, int bt, const struct sConvertTypes *dConvertTypes)
 
BOOLEAN iiExprArith2Tab (leftv res, leftv a, int op, const struct sValCmd2 *dA2, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a and a->next return TRUE on failure More...
 
BOOLEAN iiExprArith2 (leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
 
BOOLEAN iiExprArith1Tab (leftv res, leftv a, int op, const struct sValCmd1 *dA1, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to an argument a return TRUE on failure More...
 
BOOLEAN iiExprArith1 (leftv res, leftv a, int op)
 
static BOOLEAN iiExprArith3TabIntern (leftv res, int op, leftv a, leftv b, leftv c, const struct sValCmd3 *dA3, int at, int bt, int ct, const struct sConvertTypes *dConvertTypes)
 
BOOLEAN iiExprArith3 (leftv res, int op, leftv a, leftv b, leftv c)
 
BOOLEAN iiExprArith3Tab (leftv res, leftv a, int op, const struct sValCmd3 *dA3, int at, const struct sConvertTypes *dConvertTypes)
 apply an operation 'op' to arguments a, a->next and a->next->next return TRUE on failure More...
 
static BOOLEAN jjANY2LIST (leftv res, leftv v, int cnt)
 
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)
 

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

Data Fields
short cmd
short start

§ _scmdnames

struct _scmdnames

Definition at line 47 of file gentable.cc.

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

§ sValCmd1

struct sValCmd1

Definition at line 66 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 57 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 74 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 84 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 189 of file iparith.cc.

Data Fields
int nCmdAllocated number of commands-slots allocated
int nCmdUsed number of commands used
int 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 118 of file iparith.cc.

§ ALLOW_RING

#define ALLOW_RING   4

Definition at line 121 of file iparith.cc.

§ ALLOW_ZERODIVISOR

#define ALLOW_ZERODIVISOR   0

Definition at line 124 of file iparith.cc.

§ COMM_PLURAL

#define COMM_PLURAL   2

Definition at line 120 of file iparith.cc.

§ D

#define D (   A)    (A)

Definition at line 8052 of file iparith.cc.

§ ii_div_by_0

#define ii_div_by_0   "div. by 0"

Definition at line 225 of file iparith.cc.

§ IPARITH

#define IPARITH

Definition at line 8054 of file iparith.cc.

§ jjWRONG2

#define jjWRONG2   (proc2)jjWRONG

Definition at line 3658 of file iparith.cc.

§ jjWRONG3

#define jjWRONG3   (proc3)jjWRONG

Definition at line 3659 of file iparith.cc.

§ NO_PLURAL

#define NO_PLURAL   0

Definition at line 119 of file iparith.cc.

§ NO_RING

#define NO_RING   0

Definition at line 122 of file iparith.cc.

§ NO_ZERODIVISOR

#define NO_ZERODIVISOR   8

Definition at line 123 of file iparith.cc.

§ NULL_VAL

#define NULL_VAL   NULL

Definition at line 8053 of file iparith.cc.

§ PLURAL_MASK

#define PLURAL_MASK   3

Definition at line 106 of file iparith.cc.

§ RING_MASK

#define RING_MASK   4

Definition at line 112 of file iparith.cc.

§ SIMPL_EQU

#define SIMPL_EQU   4

Definition at line 3346 of file iparith.cc.

§ SIMPL_LMDIV

#define SIMPL_LMDIV   32

Definition at line 3343 of file iparith.cc.

§ SIMPL_LMEQ

#define SIMPL_LMEQ   16

Definition at line 3344 of file iparith.cc.

§ SIMPL_MULT

#define SIMPL_MULT   8

Definition at line 3345 of file iparith.cc.

§ SIMPL_NORM

#define SIMPL_NORM   1

Definition at line 3348 of file iparith.cc.

§ SIMPL_NULL

#define SIMPL_NULL   2

Definition at line 3347 of file iparith.cc.

§ WARN_RING

#define WARN_RING   16

Definition at line 127 of file iparith.cc.

§ ZERODIVISOR_MASK

#define ZERODIVISOR_MASK   8

Definition at line 113 of file iparith.cc.

Typedef Documentation

§ jjValCmdTab

typedef sValCmdTab jjValCmdTab[]

Definition at line 138 of file iparith.cc.

§ proc2

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

Definition at line 158 of file iparith.cc.

§ proc3

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

Definition at line 169 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 9004 of file iparith.cc.

9005 {
9006  cmdnames *pCmdL = (cmdnames*)a;
9007  cmdnames *pCmdR = (cmdnames*)b;
9008 
9009  if(a==NULL || b==NULL) return 0;
9010 
9011  /* empty entries goes to the end of the list for later reuse */
9012  if(pCmdL->name==NULL) return 1;
9013  if(pCmdR->name==NULL) return -1;
9014 
9015  /* $INVALID$ must come first */
9016  if(strcmp(pCmdL->name, "$INVALID$")==0) return -1;
9017  if(strcmp(pCmdR->name, "$INVALID$")==0) return 1;
9018 
9019  /* tokval=-1 are reserved names at the end */
9020  if (pCmdL->tokval==-1)
9021  {
9022  if (pCmdR->tokval==-1)
9023  return strcmp(pCmdL->name, pCmdR->name);
9024  /* pCmdL->tokval==-1, pCmdL goes at the end */
9025  return 1;
9026  }
9027  /* pCmdR->tokval==-1, pCmdR goes at the end */
9028  if(pCmdR->tokval==-1) return -1;
9029 
9030  return strcmp(pCmdL->name, pCmdR->name);
9031 }
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 9230 of file iparith.cc.

9231 {
9232  #ifdef HAVE_PLURAL
9233  if (rIsPluralRing(currRing))
9234  {
9235  if ((p & PLURAL_MASK)==0 /*NO_PLURAL*/)
9236  {
9237  WerrorS("not implemented for non-commutative rings");
9238  return TRUE;
9239  }
9240  else if ((p & PLURAL_MASK)==2 /*, COMM_PLURAL */)
9241  {
9242  Warn("assume commutative subalgebra for cmd `%s`",Tok2Cmdname(op));
9243  return FALSE;
9244  }
9245  /* else, ALLOW_PLURAL */
9246  }
9247  #endif
9248  if (rField_is_Ring(currRing))
9249  {
9250  if ((p & RING_MASK)==0 /*NO_RING*/)
9251  {
9252  WerrorS("not implemented for rings with rings as coeffients");
9253  return TRUE;
9254  }
9255  /* else ALLOW_RING */
9256  else if (((p & ZERODIVISOR_MASK)==NO_ZERODIVISOR)
9257  &&(!rField_is_Domain(currRing)))
9258  {
9259  WerrorS("domain required as coeffients");
9260  return TRUE;
9261  }
9262  /* else ALLOW_ZERODIVISOR */
9263  else if(((p & WARN_RING)==WARN_RING)&&(myynest==0))
9264  {
9265  WarnS("considering the image in Q[...]");
9266  }
9267  }
9268  return FALSE;
9269 }
#define WARN_RING
Definition: iparith.cc:127
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
#define PLURAL_MASK
Definition: iparith.cc:106
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:8952
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define ZERODIVISOR_MASK
Definition: iparith.cc:113
#define NO_ZERODIVISOR
Definition: iparith.cc:123
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define RING_MASK
Definition: iparith.cc:112
#define Warn
Definition: emacs.cc:80

§ currRingIsOverIntegralDomain()

static BOOLEAN currRingIsOverIntegralDomain ( )
static

Definition at line 6049 of file iparith.cc.

6050 {
6051  /* true for fields and Z, false otherwise */
6052  if (rField_is_Ring_PtoM(currRing)) return FALSE;
6053  if (rField_is_Ring_2toM(currRing)) return FALSE;
6054  if (rField_is_Ring_ModN(currRing)) return FALSE;
6055  return TRUE;
6056 }
static BOOLEAN rField_is_Ring_PtoM(const ring r)
Definition: ring.h:471
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN rField_is_Ring_ModN(const ring r)
Definition: ring.h:468
#define TRUE
Definition: auxiliary.h:101
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rField_is_Ring_2toM(const ring r)
Definition: ring.h:465

§ iiArithAddCmd()

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

Definition at line 9171 of file iparith.cc.

9178 {
9179  //printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
9180  // nTokval, nToktype, nPos);
9181  if(nPos>=0)
9182  {
9183  // no checks: we rely on a correct generated code in iparith.inc
9185  assume(szName!=NULL);
9186  sArithBase.sCmds[nPos].name = omStrDup(szName);
9187  sArithBase.sCmds[nPos].alias = nAlias;
9188  sArithBase.sCmds[nPos].tokval = nTokval;
9189  sArithBase.sCmds[nPos].toktype = nToktype;
9190  sArithBase.nCmdUsed++;
9191  //if(nTokval>0) sArithBase.nLastIdentifier++;
9192  }
9193  else
9194  {
9195  if(szName==NULL) return -1;
9196  int nIndex = iiArithFindCmd(szName);
9197  if(nIndex>=0)
9198  {
9199  Print("'%s' already exists at %d\n", szName, nIndex);
9200  return -1;
9201  }
9202 
9204  {
9205  /* needs to create new slots */
9206  unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
9207  sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
9208  if(sArithBase.sCmds==NULL) return -1;
9210  }
9211  /* still free slots available */
9212  sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
9213  sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
9214  sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
9215  sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
9216  sArithBase.nCmdUsed++;
9217 
9218  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9219  (&_gentable_sort_cmds));
9222  {
9223  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9224  }
9225  //Print("L=%d\n", sArithBase.nLastIdentifier);
9226  }
9227  return 0;
9228 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:9004
#define Print
Definition: emacs.cc:83
int nCmdAllocated
number of commands-slots allocated
Definition: iparith.cc:197
#define assume(x)
Definition: mod2.h:403
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:198
int nCmdUsed
number of commands used
Definition: iparith.cc:196
#define NULL
Definition: omList.c:10
#define nSize(n)
Definition: numbers.h:39
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:9076
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191
#define omRealloc(addr, size)
Definition: omAllocDecl.h:225
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ iiArithFindCmd()

int iiArithFindCmd ( const char *  szName)

Definition at line 9076 of file iparith.cc.

9077 {
9078  int an=0;
9079  int i = 0,v = 0;
9080  int en=sArithBase.nLastIdentifier;
9081 
9082  loop
9083  //for(an=0; an<sArithBase.nCmdUsed; )
9084  {
9085  if(an>=en-1)
9086  {
9087  if (strcmp(szName, sArithBase.sCmds[an].name) == 0)
9088  {
9089  //Print("RET-an=%d %s\n", an, sArithBase.sCmds[an].name);
9090  return an;
9091  }
9092  else if (strcmp(szName, sArithBase.sCmds[en].name) == 0)
9093  {
9094  //Print("RET-en=%d %s\n", en, sArithBase.sCmds[en].name);
9095  return en;
9096  }
9097  else
9098  {
9099  //Print("RET- 1\n");
9100  return -1;
9101  }
9102  }
9103  i=(an+en)/2;
9104  if (*szName < *(sArithBase.sCmds[i].name))
9105  {
9106  en=i-1;
9107  }
9108  else if (*szName > *(sArithBase.sCmds[i].name))
9109  {
9110  an=i+1;
9111  }
9112  else
9113  {
9114  v=strcmp(szName,sArithBase.sCmds[i].name);
9115  if(v<0)
9116  {
9117  en=i-1;
9118  }
9119  else if(v>0)
9120  {
9121  an=i+1;
9122  }
9123  else /*v==0*/
9124  {
9125  //Print("RET-i=%d %s\n", i, sArithBase.sCmds[i].name);
9126  return i;
9127  }
9128  }
9129  }
9130  //if(i>=0 && i<sArithBase.nCmdUsed)
9131  // return i;
9132  //PrintS("RET-2\n");
9133  return -2;
9134 }
loop
Definition: myNF.cc:98
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:198
int i
Definition: cfEzgcd.cc:123
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ iiArithGetCmd()

char* iiArithGetCmd ( int  nPos)

Definition at line 9136 of file iparith.cc.

9137 {
9138  if(nPos<0) return NULL;
9139  if(nPos<sArithBase.nCmdUsed)
9140  return sArithBase.sCmds[nPos].name;
9141  return NULL;
9142 }
int nCmdUsed
number of commands used
Definition: iparith.cc:196
#define NULL
Definition: omList.c:10
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ iiArithRemoveCmd() [1/2]

int iiArithRemoveCmd ( char *  szName)

§ iiArithRemoveCmd() [2/2]

int iiArithRemoveCmd ( const char *  szName)

Definition at line 9144 of file iparith.cc.

9145 {
9146  int nIndex;
9147  if(szName==NULL) return -1;
9148 
9149  nIndex = iiArithFindCmd(szName);
9150  if(nIndex<0 || nIndex>=sArithBase.nCmdUsed)
9151  {
9152  Print("'%s' not found (%d)\n", szName, nIndex);
9153  return -1;
9154  }
9155  omFree(sArithBase.sCmds[nIndex].name);
9156  sArithBase.sCmds[nIndex].name=NULL;
9157  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9158  (&_gentable_sort_cmds));
9159  sArithBase.nCmdUsed--;
9160 
9161  /* fix last-identifier */
9164  {
9165  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9166  }
9167  //Print("L=%d\n", sArithBase.nLastIdentifier);
9168  return 0;
9169 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:9004
#define Print
Definition: emacs.cc:83
#define omFree(addr)
Definition: omAllocDecl.h:261
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:198
int nCmdUsed
number of commands used
Definition: iparith.cc:196
#define NULL
Definition: omList.c:10
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:9076
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ iiExprArith1()

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

Definition at line 8422 of file iparith.cc.

8423 {
8424  memset(res,0,sizeof(sleftv));
8425 
8426  if (!errorreported)
8427  {
8428 #ifdef SIQ
8429  if (siq>0)
8430  {
8431  //Print("siq:%d\n",siq);
8433  memcpy(&d->arg1,a,sizeof(sleftv));
8434  //a->Init();
8435  d->op=op;
8436  d->argc=1;
8437  res->data=(char *)d;
8438  res->rtyp=COMMAND;
8439  return FALSE;
8440  }
8441 #endif
8442  int at=a->Typ();
8443  // handling bb-objects ----------------------------------------------------
8444  if(op>MAX_TOK) // explicit type conversion to bb
8445  {
8446  blackbox *bb=getBlackboxStuff(op);
8447  if (bb!=NULL)
8448  {
8449  res->rtyp=op;
8450  res->data=bb->blackbox_Init(bb);
8451  if(!bb->blackbox_Assign(res,a)) return FALSE;
8452  if (errorreported) return TRUE;
8453  }
8454  else return TRUE;
8455  }
8456  else if (at>MAX_TOK) // argument is of bb-type
8457  {
8458  blackbox *bb=getBlackboxStuff(at);
8459  if (bb!=NULL)
8460  {
8461  if(!bb->blackbox_Op1(op,res,a)) return FALSE;
8462  if (errorreported) return TRUE;
8463  // else: no op defined
8464  }
8465  else return TRUE;
8466  }
8467 
8468  iiOp=op;
8469  int i=iiTabIndex(dArithTab1,JJTAB1LEN,op);
8470  return iiExprArith1Tab(res,a,op, dArith1+i,at,dConvertTypes);
8471  }
8472  a->CleanUp();
8473  return TRUE;
8474 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1184
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:58
#define TRUE
Definition: auxiliary.h:101
struct sValCmd1 dArith1[]
Definition: table.h:19
int Typ()
Definition: subexpr.cc:979
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8929
void * data
Definition: subexpr.h:90
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int iiOp
Definition: iparith.cc:227
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:8294
#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 8294 of file iparith.cc.

8295 {
8296  memset(res,0,sizeof(sleftv));
8297  BOOLEAN call_failed=FALSE;
8298 
8299  if (!errorreported)
8300  {
8301  BOOLEAN failed=FALSE;
8302  iiOp=op;
8303  int i = 0;
8304  while (dA1[i].cmd==op)
8305  {
8306  if (at==dA1[i].arg)
8307  {
8308  if (currRing!=NULL)
8309  {
8310  if (check_valid(dA1[i].valid_for,op)) break;
8311  }
8312  else
8313  {
8314  if (RingDependend(dA1[i].res))
8315  {
8316  WerrorS("no ring active");
8317  break;
8318  }
8319  }
8320  if (traceit&TRACE_CALL)
8321  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
8322  res->rtyp=dA1[i].res;
8323  if ((call_failed=dA1[i].p(res,a)))
8324  {
8325  break;// leave loop, goto error handling
8326  }
8327  if (a->Next()!=NULL)
8328  {
8330  failed=iiExprArith1(res->next,a->next,op);
8331  }
8332  a->CleanUp();
8333  return failed;
8334  }
8335  i++;
8336  }
8337  // implicite type conversion --------------------------------------------
8338  if (dA1[i].cmd!=op)
8339  {
8341  i=0;
8342  //Print("fuer %c , typ: %s\n",op,Tok2Cmdname(at));
8343  while (dA1[i].cmd==op)
8344  {
8345  int ai;
8346  //Print("test %s\n",Tok2Cmdname(dA1[i].arg));
8347  if ((ai=iiTestConvert(at,dA1[i].arg,dConvertTypes))!=0)
8348  {
8349  if (currRing!=NULL)
8350  {
8351  if (check_valid(dA1[i].valid_for,op)) break;
8352  }
8353  else
8354  {
8355  if (RingDependend(dA1[i].res))
8356  {
8357  WerrorS("no ring active");
8358  break;
8359  }
8360  }
8361  if (traceit&TRACE_CALL)
8362  Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(dA1[i].arg));
8363  res->rtyp=dA1[i].res;
8364  failed= ((iiConvert(at,dA1[i].arg,ai,a,an,dConvertTypes))
8365  || (call_failed=dA1[i].p(res,an)));
8366  // everything done, clean up temp. variables
8367  if (failed)
8368  {
8369  // leave loop, goto error handling
8370  break;
8371  }
8372  else
8373  {
8374  if (an->Next() != NULL)
8375  {
8376  res->next = (leftv)omAllocBin(sleftv_bin);
8377  failed=iiExprArith1(res->next,an->next,op);
8378  }
8379  // everything ok, clean up and return
8380  an->CleanUp();
8382  a->CleanUp();
8383  return failed;
8384  }
8385  }
8386  i++;
8387  }
8388  an->CleanUp();
8390  }
8391  // error handling
8392  if (!errorreported)
8393  {
8394  if ((at==0) && (a->Fullname()!=sNoName))
8395  {
8396  Werror("`%s` is not defined",a->Fullname());
8397  }
8398  else
8399  {
8400  i=0;
8401  const char *s = iiTwoOps(op);
8402  Werror("%s(`%s`) failed"
8403  ,s,Tok2Cmdname(at));
8404  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8405  {
8406  while (dA1[i].cmd==op)
8407  {
8408  if ((dA1[i].res!=0)
8409  && (dA1[i].p!=jjWRONG))
8410  Werror("expected %s(`%s`)"
8411  ,s,Tok2Cmdname(dA1[i].arg));
8412  i++;
8413  }
8414  }
8415  }
8416  }
8417  res->rtyp = UNKNOWN;
8418  }
8419  a->CleanUp();
8420  return TRUE;
8421 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8422
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
return P p
Definition: myNF.cc:203
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:118
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:70
const char * Fullname()
Definition: subexpr.h:127
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:9230
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8952
int RingDependend(int t)
Definition: gentable.cc:23
const char * iiTwoOps(int t)
Definition: gentable.cc:252
static BOOLEAN jjWRONG(leftv, leftv)
Definition: iparith.cc:3660
leftv Next()
Definition: subexpr.h:138
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:88
#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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
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 8235 of file iparith.cc.

8236 {
8237  memset(res,0,sizeof(sleftv));
8238 
8239  if (!errorreported)
8240  {
8241 #ifdef SIQ
8242  if (siq>0)
8243  {
8244  //Print("siq:%d\n",siq);
8246  memcpy(&d->arg1,a,sizeof(sleftv));
8247  //a->Init();
8248  memcpy(&d->arg2,b,sizeof(sleftv));
8249  //b->Init();
8250  d->argc=2;
8251  d->op=op;
8252  res->data=(char *)d;
8253  res->rtyp=COMMAND;
8254  return FALSE;
8255  }
8256 #endif
8257  int at=a->Typ();
8258  int bt=b->Typ();
8259  // handling bb-objects ----------------------------------------------------
8260  if (at>MAX_TOK)
8261  {
8262  blackbox *bb=getBlackboxStuff(at);
8263  if (bb!=NULL)
8264  {
8265  if (!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8266  if (errorreported) return TRUE;
8267  // else: no op defined
8268  }
8269  else return TRUE;
8270  }
8271  else if ((bt>MAX_TOK)&&(op!='('))
8272  {
8273  blackbox *bb=getBlackboxStuff(bt);
8274  if (bb!=NULL)
8275  {
8276  if(!bb->blackbox_Op2(op,res,a,b)) return FALSE;
8277  if (errorreported) return TRUE;
8278  // else: no op defined
8279  }
8280  else return TRUE;
8281  }
8282  int i=iiTabIndex(dArithTab2,JJTAB2LEN,op);
8283  return iiExprArith2TabIntern(res,a,op,b,proccall,dArith2+i,at,bt,dConvertTypes);
8284  }
8285  a->CleanUp();
8286  b->CleanUp();
8287  return TRUE;
8288 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1184
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:58
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
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:8063
static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)
Definition: iparith.cc:8929
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
struct sValCmd2 dArith2[]
Definition: table.h:292
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#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 8222 of file iparith.cc.

8226 {
8227  leftv b=a->next;
8228  a->next=NULL;
8229  int bt=b->Typ();
8230  BOOLEAN bo=iiExprArith2TabIntern(res,a,op,b,TRUE,dA2,at,bt,dConvertTypes);
8231  a->next=b;
8232  a->CleanUp();
8233  return bo;
8234 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
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:8063
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int BOOLEAN
Definition: auxiliary.h:88
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 8063 of file iparith.cc.

8068 {
8069  memset(res,0,sizeof(sleftv));
8070  BOOLEAN call_failed=FALSE;
8071 
8072  if (!errorreported)
8073  {
8074  int i=0;
8075  iiOp=op;
8076  while (dA2[i].cmd==op)
8077  {
8078  if ((at==dA2[i].arg1)
8079  && (bt==dA2[i].arg2))
8080  {
8081  res->rtyp=dA2[i].res;
8082  if (currRing!=NULL)
8083  {
8084  if (check_valid(dA2[i].valid_for,op)) break;
8085  }
8086  else
8087  {
8088  if (RingDependend(dA2[i].res))
8089  {
8090  WerrorS("no ring active");
8091  break;
8092  }
8093  }
8094  if (traceit&TRACE_CALL)
8095  Print("call %s(%s,%s)\n",iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt));
8096  if ((call_failed=dA2[i].p(res,a,b)))
8097  {
8098  break;// leave loop, goto error handling
8099  }
8100  a->CleanUp();
8101  b->CleanUp();
8102  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8103  return FALSE;
8104  }
8105  i++;
8106  }
8107  // implicite type conversion ----------------------------------------------
8108  if (dA2[i].cmd!=op)
8109  {
8110  int ai,bi;
8113  BOOLEAN failed=FALSE;
8114  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
8115  //Print("op: %c, type: %s %s\n",op,Tok2Cmdname(at),Tok2Cmdname(bt));
8116  while (dA2[i].cmd==op)
8117  {
8118  //Print("test %s %s\n",Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8119  if ((ai=iiTestConvert(at,dA2[i].arg1,dConvertTypes))!=0)
8120  {
8121  if ((bi=iiTestConvert(bt,dA2[i].arg2,dConvertTypes))!=0)
8122  {
8123  res->rtyp=dA2[i].res;
8124  if (currRing!=NULL)
8125  {
8126  if (check_valid(dA2[i].valid_for,op)) break;
8127  }
8128  else
8129  {
8130  if (RingDependend(dA2[i].res))
8131  {
8132  WerrorS("no ring active");
8133  break;
8134  }
8135  }
8136  if (traceit&TRACE_CALL)
8137  Print("call %s(%s,%s)\n",iiTwoOps(op),
8138  Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8139  failed= ((iiConvert(at,dA2[i].arg1,ai,a,an))
8140  || (iiConvert(bt,dA2[i].arg2,bi,b,bn))
8141  || (call_failed=dA2[i].p(res,an,bn)));
8142  // everything done, clean up temp. variables
8143  if (failed)
8144  {
8145  // leave loop, goto error handling
8146  break;
8147  }
8148  else
8149  {
8150  // everything ok, clean up and return
8151  an->CleanUp();
8152  bn->CleanUp();
8155  a->CleanUp();
8156  b->CleanUp();
8157  return FALSE;
8158  }
8159  }
8160  }
8161  i++;
8162  }
8163  an->CleanUp();
8164  bn->CleanUp();
8167  }
8168  // error handling ---------------------------------------------------
8169  const char *s=NULL;
8170  if (!errorreported)
8171  {
8172  if ((at==0) && (a->Fullname()!=sNoName))
8173  {
8174  s=a->Fullname();
8175  }
8176  else if ((bt==0) && (b->Fullname()!=sNoName))
8177  {
8178  s=b->Fullname();
8179  }
8180  if (s!=NULL)
8181  Werror("`%s` is not defined",s);
8182  else
8183  {
8184  i=0; /*iiTabIndex(dArithTab2,JJTAB2LEN,op);*/
8185  s = iiTwoOps(op);
8186  if (proccall)
8187  {
8188  Werror("%s(`%s`,`%s`) failed"
8189  ,s,Tok2Cmdname(at),Tok2Cmdname(bt));
8190  }
8191  else
8192  {
8193  Werror("`%s` %s `%s` failed"
8194  ,Tok2Cmdname(at),s,Tok2Cmdname(bt));
8195  }
8196  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8197  {
8198  while (dA2[i].cmd==op)
8199  {
8200  if(((at==dA2[i].arg1)||(bt==dA2[i].arg2))
8201  && (dA2[i].res!=0)
8202  && (dA2[i].p!=jjWRONG2))
8203  {
8204  if (proccall)
8205  Werror("expected %s(`%s`,`%s`)"
8206  ,s,Tok2Cmdname(dA2[i].arg1),Tok2Cmdname(dA2[i].arg2));
8207  else
8208  Werror("expected `%s` %s `%s`"
8209  ,Tok2Cmdname(dA2[i].arg1),s,Tok2Cmdname(dA2[i].arg2));
8210  }
8211  i++;
8212  }
8213  }
8214  }
8215  }
8216  res->rtyp = UNKNOWN;
8217  }
8218  a->CleanUp();
8219  b->CleanUp();
8220  return TRUE;
8221 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
short res
Definition: gentable.cc:61
return P p
Definition: myNF.cc:203
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:118
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:127
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:9230
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8952
int RingDependend(int t)
Definition: gentable.cc:23
const char * iiTwoOps(int t)
Definition: gentable.cc:252
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:3658
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
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 8634 of file iparith.cc.

8635 {
8636  memset(res,0,sizeof(sleftv));
8637 
8638  if (!errorreported)
8639  {
8640 #ifdef SIQ
8641  if (siq>0)
8642  {
8643  //Print("siq:%d\n",siq);
8645  memcpy(&d->arg1,a,sizeof(sleftv));
8646  //a->Init();
8647  memcpy(&d->arg2,b,sizeof(sleftv));
8648  //b->Init();
8649  memcpy(&d->arg3,c,sizeof(sleftv));
8650  //c->Init();
8651  d->op=op;
8652  d->argc=3;
8653  res->data=(char *)d;
8654  res->rtyp=COMMAND;
8655  return FALSE;
8656  }
8657 #endif
8658  int at=a->Typ();
8659  // handling bb-objects ----------------------------------------------
8660  if (at>MAX_TOK)
8661  {
8662  blackbox *bb=getBlackboxStuff(at);
8663  if (bb!=NULL)
8664  {
8665  if(!bb->blackbox_Op3(op,res,a,b,c)) return FALSE;
8666  if (errorreported) return TRUE;
8667  // else: no op defined
8668  }
8669  else return TRUE;
8670  if (errorreported) return TRUE;
8671  }
8672  int bt=b->Typ();
8673  int ct=c->Typ();
8674 
8675  iiOp=op;
8676  int i=0;
8677  while ((dArith3[i].cmd!=op)&&(dArith3[i].cmd!=0)) i++;
8678  return iiExprArith3TabIntern(res,op,a,b,c,dArith3+i,at,bt,ct,dConvertTypes);
8679  }
8680  a->CleanUp();
8681  b->CleanUp();
8682  c->CleanUp();
8683  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8684  return TRUE;
8685 }
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:8480
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
ip_command * command
Definition: ipid.h:24
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1184
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:58
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
struct sValCmd3 dArith3[]
Definition: table.h:712
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int iiOp
Definition: iparith.cc:227
#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 8686 of file iparith.cc.

8690 {
8691  leftv b=a->next;
8692  a->next=NULL;
8693  int bt=b->Typ();
8694  leftv c=b->next;
8695  b->next=NULL;
8696  int ct=c->Typ();
8697  BOOLEAN bo=iiExprArith3TabIntern(res,op,a,b,c,dA3,at,bt,ct,dConvertTypes);
8698  b->next=c;
8699  a->next=b;
8700  a->CleanUp();
8701  return bo;
8702 }
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:8480
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
int Typ()
Definition: subexpr.cc:979
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int BOOLEAN
Definition: auxiliary.h:88
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 8480 of file iparith.cc.

8483 {
8484  memset(res,0,sizeof(sleftv));
8485  BOOLEAN call_failed=FALSE;
8486 
8487  assume(dA3[0].cmd==op);
8488 
8489  if (!errorreported)
8490  {
8491  int i=0;
8492  iiOp=op;
8493  while (dA3[i].cmd==op)
8494  {
8495  if ((at==dA3[i].arg1)
8496  && (bt==dA3[i].arg2)
8497  && (ct==dA3[i].arg3))
8498  {
8499  res->rtyp=dA3[i].res;
8500  if (currRing!=NULL)
8501  {
8502  if (check_valid(dA3[i].valid_for,op)) break;
8503  }
8504  if (traceit&TRACE_CALL)
8505  Print("call %s(%s,%s,%s)\n",
8506  iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8507  if ((call_failed=dA3[i].p(res,a,b,c)))
8508  {
8509  break;// leave loop, goto error handling
8510  }
8511  a->CleanUp();
8512  b->CleanUp();
8513  c->CleanUp();
8514  return FALSE;
8515  }
8516  i++;
8517  }
8518  // implicite type conversion ----------------------------------------------
8519  if (dA3[i].cmd!=op)
8520  {
8521  int ai,bi,ci;
8525  BOOLEAN failed=FALSE;
8526  i=0;
8527  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8528  while (dA3[i].cmd==op)
8529  {
8530  if ((ai=iiTestConvert(at,dA3[i].arg1,dConvertTypes))!=0)
8531  {
8532  if ((bi=iiTestConvert(bt,dA3[i].arg2,dConvertTypes))!=0)
8533  {
8534  if ((ci=iiTestConvert(ct,dA3[i].arg3,dConvertTypes))!=0)
8535  {
8536  res->rtyp=dA3[i].res;
8537  if (currRing!=NULL)
8538  {
8539  if (check_valid(dA3[i].valid_for,op)) break;
8540  }
8541  if (traceit&TRACE_CALL)
8542  Print("call %s(%s,%s,%s)\n",
8543  iiTwoOps(op),Tok2Cmdname(dA3[i].arg1),
8544  Tok2Cmdname(dA3[i].arg2),Tok2Cmdname(dA3[i].arg3));
8545  failed= ((iiConvert(at,dA3[i].arg1,ai,a,an,dConvertTypes))
8546  || (iiConvert(bt,dA3[i].arg2,bi,b,bn,dConvertTypes))
8547  || (iiConvert(ct,dA3[i].arg3,ci,c,cn,dConvertTypes))
8548  || (call_failed=dA3[i].p(res,an,bn,cn)));
8549  // everything done, clean up temp. variables
8550  if (failed)
8551  {
8552  // leave loop, goto error handling
8553  break;
8554  }
8555  else
8556  {
8557  // everything ok, clean up and return
8558  an->CleanUp();
8559  bn->CleanUp();
8560  cn->CleanUp();
8564  a->CleanUp();
8565  b->CleanUp();
8566  c->CleanUp();
8567  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8568  return FALSE;
8569  }
8570  }
8571  }
8572  }
8573  i++;
8574  }
8575  an->CleanUp();
8576  bn->CleanUp();
8577  cn->CleanUp();
8581  }
8582  // error handling ---------------------------------------------------
8583  if (!errorreported)
8584  {
8585  const char *s=NULL;
8586  if ((at==0) && (a->Fullname()!=sNoName))
8587  {
8588  s=a->Fullname();
8589  }
8590  else if ((bt==0) && (b->Fullname()!=sNoName))
8591  {
8592  s=b->Fullname();
8593  }
8594  else if ((ct==0) && (c->Fullname()!=sNoName))
8595  {
8596  s=c->Fullname();
8597  }
8598  if (s!=NULL)
8599  Werror("`%s` is not defined",s);
8600  else
8601  {
8602  i=0;
8603  //while ((dA3[i].cmd!=op)&&(dA3[i].cmd!=0)) i++;
8604  const char *s = iiTwoOps(op);
8605  Werror("%s(`%s`,`%s`,`%s`) failed"
8606  ,s,Tok2Cmdname(at),Tok2Cmdname(bt),Tok2Cmdname(ct));
8607  if ((!call_failed) && BVERBOSE(V_SHOW_USE))
8608  {
8609  while (dA3[i].cmd==op)
8610  {
8611  if(((at==dA3[i].arg1)
8612  ||(bt==dA3[i].arg2)
8613  ||(ct==dA3[i].arg3))
8614  && (dA3[i].res!=0))
8615  {
8616  Werror("expected %s(`%s`,`%s`,`%s`)"
8617  ,s,Tok2Cmdname(dA3[i].arg1)
8618  ,Tok2Cmdname(dA3[i].arg2)
8619  ,Tok2Cmdname(dA3[i].arg3));
8620  }
8621  i++;
8622  }
8623  }
8624  }
8625  }
8626  res->rtyp = UNKNOWN;
8627  }
8628  a->CleanUp();
8629  b->CleanUp();
8630  c->CleanUp();
8631  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8632  return TRUE;
8633 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
return P p
Definition: myNF.cc:203
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
#define UNKNOWN
Definition: tok.h:217
void * ADDRESS
Definition: auxiliary.h:118
sleftv * leftv
Definition: structs.h:60
int traceit
Definition: febase.cc:47
const char * Fullname()
Definition: subexpr.h:127
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:9230
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8952
const char * iiTwoOps(int t)
Definition: gentable.cc:252
#define assume(x)
Definition: mod2.h:403
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:78
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ iiExprArithM()

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

Definition at line 8722 of file iparith.cc.

8723 {
8724  memset(res,0,sizeof(sleftv));
8725 
8726  if (!errorreported)
8727  {
8728 #ifdef SIQ
8729  if (siq>0)
8730  {
8731  //Print("siq:%d\n",siq);
8733  d->op=op;
8734  res->data=(char *)d;
8735  if (a!=NULL)
8736  {
8737  d->argc=a->listLength();
8738  // else : d->argc=0;
8739  memcpy(&d->arg1,a,sizeof(sleftv));
8740  switch(d->argc)
8741  {
8742  case 3:
8743  memcpy(&d->arg3,a->next->next,sizeof(sleftv));
8744  a->next->next->Init();
8745  /* no break */
8746  case 2:
8747  memcpy(&d->arg2,a->next,sizeof(sleftv));
8748  a->next->Init();
8749  a->next->next=d->arg2.next;
8750  d->arg2.next=NULL;
8751  /* no break */
8752  case 1:
8753  a->Init();
8754  a->next=d->arg1.next;
8755  d->arg1.next=NULL;
8756  }
8757  if (d->argc>3) a->next=NULL;
8758  a->name=NULL;
8759  a->rtyp=0;
8760  a->data=NULL;
8761  a->e=NULL;
8762  a->attribute=NULL;
8763  a->CleanUp();
8764  }
8765  res->rtyp=COMMAND;
8766  return FALSE;
8767  }
8768 #endif
8769  if ((a!=NULL) && (a->Typ()>MAX_TOK))
8770  {
8771  blackbox *bb=getBlackboxStuff(a->Typ());
8772  if (bb!=NULL)
8773  {
8774  if(!bb->blackbox_OpM(op,res,a)) return FALSE;
8775  if (errorreported) return TRUE;
8776  // else: no op defined
8777  }
8778  else return TRUE;
8779  }
8780  int args=0;
8781  if (a!=NULL) args=a->listLength();
8782 
8783  iiOp=op;
8784  int i=0;
8785  while ((dArithM[i].cmd!=op)&&(dArithM[i].cmd!=0)) i++;
8786  while (dArithM[i].cmd==op)
8787  {
8788  if ((args==dArithM[i].number_of_args)
8789  || (dArithM[i].number_of_args==-1)
8790  || ((dArithM[i].number_of_args==-2)&&(args>0)))
8791  {
8792  res->rtyp=dArithM[i].res;
8793  if (currRing!=NULL)
8794  {
8795  if (check_valid(dArithM[i].valid_for,op)) break;
8796  }
8797  if (traceit&TRACE_CALL)
8798  Print("call %s(... (%d args))\n", iiTwoOps(op),args);
8799  if (dArithM[i].p(res,a))
8800  {
8801  break;// leave loop, goto error handling
8802  }
8803  if (a!=NULL) a->CleanUp();
8804  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8805  return FALSE;
8806  }
8807  i++;
8808  }
8809  // error handling
8810  if (!errorreported)
8811  {
8812  if ((args>0) && (a->rtyp==0) && (a->Name()!=sNoName))
8813  {
8814  Werror("`%s` is not defined",a->Fullname());
8815  }
8816  else
8817  {
8818  const char *s = iiTwoOps(op);
8819  Werror("%s(...) failed",s);
8820  }
8821  }
8822  res->rtyp = UNKNOWN;
8823  }
8824  if (a!=NULL) a->CleanUp();
8825  //Print("op: %d,result typ:%d\n",op,res->rtyp);
8826  return TRUE;
8827 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
ip_command * command
Definition: ipid.h:24
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
Definition: tok.h:213
BOOLEAN siq
Definition: subexpr.cc:58
const char sNoName[]
Definition: subexpr.cc:56
int listLength()
Definition: subexpr.cc:61
#define TRUE
Definition: auxiliary.h:101
void Init()
Definition: subexpr.h:109
#define UNKNOWN
Definition: tok.h:217
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
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:9230
const char * iiTwoOps(int t)
Definition: gentable.cc:252
const char * name
Definition: subexpr.h:89
int i
Definition: cfEzgcd.cc:123
#define TRACE_CALL
Definition: reporter.h:43
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:88
struct sValCmdM dArithM[]
Definition: table.h:821
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
short res
Definition: gentable.cc:88
#define NULL
Definition: omList.c:10
omBin sip_command_bin
Definition: ipid.cc:49
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
attr attribute
Definition: subexpr.h:91
int iiOp
Definition: iparith.cc:227
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 9041 of file iparith.cc.

9042 {
9043  //printf("iiInitArithmetic()\n");
9044  memset(&sArithBase, 0, sizeof(sArithBase));
9045  iiInitCmdName();
9046  /* fix last-identifier */
9047 #if 0
9048  /* we expect that gentable allready did every thing */
9051  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9052  }
9053 #endif
9054  //Print("L=%d\n", sArithBase.nLastIdentifier);
9055 
9056  //iiArithAddCmd(szName, nAlias, nTokval, nToktype);
9057  //iiArithAddCmd("mygcd", 1, GCD_CMD, CMD_2);
9058 
9059  //iiArithAddCmd("Top", 0,-1,0);
9060 
9061 
9062  //for(i=0; i<sArithBase.nCmdUsed; i++) {
9063  // printf("CMD[%03d] %s, %d, %d, %d\n", i,
9064  // sArithBase.sCmds[i].name,
9065  // sArithBase.sCmds[i].alias,
9066  // sArithBase.sCmds[i].tokval,
9067  // sArithBase.sCmds[i].toktype);
9068  //}
9069  //iiArithRemoveCmd("Top");
9070  //iiArithAddCmd("mygcd", 2, GCD_CMD, CMD_2);
9071  //iiArithRemoveCmd("mygcd");
9072  //iiArithAddCmd("kkk", 1, 1234, CMD_1);
9073  return 0;
9074 }
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:198
int nCmdUsed
number of commands used
Definition: iparith.cc:196
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ iin_Int()

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

Definition at line 230 of file iparith.cc.

231 {
232  long l=n_Int(n,cf);
233  int i=(int)l;
234  if ((long)i==l) return l;
235  return 0;
236 }
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 8929 of file iparith.cc.

8930 {
8931  // user defined types are not in the pre-computed table:
8932  if (op>MAX_TOK) return 0;
8933 
8934  int a=0;
8935  int e=len;
8936  int p=len/2;
8937  do
8938  {
8939  if (op==dArithTab[p].cmd) return dArithTab[p].start;
8940  if (op<dArithTab[p].cmd) e=p-1;
8941  else a = p+1;
8942  p=a+(e-a)/2;
8943  }
8944  while ( a <= e);
8945 
8946  // catch missing a cmd:
8947  // may be missing as a op for blackbox, if the first operand is "undef" instead of bb
8948  // Print("op %d (%c) unknown",op,op);
8949  return 0;
8950 }
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 242 of file iparith.cc.

243 {
244  for (int i=0;i<sArithBase.nCmdUsed;i++)
245  {
246  if (sArithBase.sCmds[i].tokval==op)
247  return sArithBase.sCmds[i].toktype;
248  }
249  return 0;
250 }
int nCmdUsed
number of commands used
Definition: iparith.cc:196
int i
Definition: cfEzgcd.cc:123
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ IsCmd()

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

Definition at line 8830 of file iparith.cc.

8831 {
8832  int i;
8833  int an=1;
8834  int en=sArithBase.nLastIdentifier;
8835 
8836  loop
8837  //for(an=0; an<sArithBase.nCmdUsed; )
8838  {
8839  if(an>=en-1)
8840  {
8841  if (strcmp(n, sArithBase.sCmds[an].name) == 0)
8842  {
8843  i=an;
8844  break;
8845  }
8846  else if ((an!=en) && (strcmp(n, sArithBase.sCmds[en].name) == 0))
8847  {
8848  i=en;
8849  break;
8850  }
8851  else
8852  {
8853  // -- blackbox extensions:
8854  // return 0;
8855  return blackboxIsCmd(n,tok);
8856  }
8857  }
8858  i=(an+en)/2;
8859  if (*n < *(sArithBase.sCmds[i].name))
8860  {
8861  en=i-1;
8862  }
8863  else if (*n > *(sArithBase.sCmds[i].name))
8864  {
8865  an=i+1;
8866  }
8867  else
8868  {
8869  int v=strcmp(n,sArithBase.sCmds[i].name);
8870  if(v<0)
8871  {
8872  en=i-1;
8873  }
8874  else if(v>0)
8875  {
8876  an=i+1;
8877  }
8878  else /*v==0*/
8879  {
8880  break;
8881  }
8882  }
8883  }
8885  tok=sArithBase.sCmds[i].tokval;
8886  if(sArithBase.sCmds[i].alias==2)
8887  {
8888  Warn("outdated identifier `%s` used - please change your code",
8889  sArithBase.sCmds[i].name);
8890  sArithBase.sCmds[i].alias=1;
8891  }
8892  #if 0
8893  if (currRingHdl==NULL)
8894  {
8895  #ifdef SIQ
8896  if (siq<=0)
8897  {
8898  #endif
8899  if ((tok>=BEGIN_RING) && (tok<=END_RING))
8900  {
8901  WerrorS("no ring active");
8902  return 0;
8903  }
8904  #ifdef SIQ
8905  }
8906  #endif
8907  }
8908  #endif
8909  if (!expected_parms)
8910  {
8911  switch (tok)
8912  {
8913  case IDEAL_CMD:
8914  case INT_CMD:
8915  case INTVEC_CMD:
8916  case MAP_CMD:
8917  case MATRIX_CMD:
8918  case MODUL_CMD:
8919  case POLY_CMD:
8920  case PROC_CMD:
8921  case RING_CMD:
8922  case STRING_CMD:
8923  cmdtok = tok;
8924  break;
8925  }
8926  }
8927  return sArithBase.sCmds[i].toktype;
8928 }
Definition: tok.h:94
loop
Definition: myNF.cc:98
BOOLEAN siq
Definition: subexpr.cc:58
int cmdtok
Definition: grammar.cc:174
void WerrorS(const char *s)
Definition: feFopen.cc:24
BOOLEAN expected_parms
Definition: grammar.cc:173
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:198
idhdl currRingHdl
Definition: ipid.cc:65
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#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:189
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191
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 1753 of file iparith.cc.

1754 {
1755  ideal M=(ideal)u->CopyD();
1756  int s=(int)(long)v->Data();
1757  for(int i=IDELEMS(M)-1; i>=0;i--)
1758  {
1759  if (s+p_MinComp(M->m[i],currRing)<=0)
1760  { id_Delete(&M,currRing);return TRUE;}
1761  }
1762  id_Shift(M,s,currRing);
1763  res->data=M;
1764  return FALSE;
1765 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
#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:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjALIGN_V()

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

Definition at line 1743 of file iparith.cc.

1744 {
1745  poly p=(poly)u->CopyD();
1746  int s=(int)(long)v->Data();
1747  if (s+p_MinComp(p,currRing)<=0)
1748  { p_Delete(&p,currRing);return TRUE;}
1749  p_Shift(&p,s,currRing);
1750  res->data=p;
1751  return FALSE;
1752 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:4515
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjAND_I()

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

Definition at line 1362 of file iparith.cc.

1363 {
1364  res->data = (char *)((long)u->Data() && (long)v->Data());
1365  return FALSE;
1366 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjANY2LIST()

static BOOLEAN jjANY2LIST ( leftv  res,
leftv  v,
int  cnt 
)
static

Definition at line 8707 of file iparith.cc.

8708 {
8709  // cnt = 0: all
8710  // cnt = 1: only first one
8711  leftv next;
8712  BOOLEAN failed = TRUE;
8713  if(v==NULL) return failed;
8714  res->rtyp = LIST_CMD;
8715  if(cnt) v->next = NULL;
8716  next = v->next; // saving next-pointer
8717  failed = jjLIST_PL(res, v);
8718  v->next = next; // writeback next-pointer
8719  return failed;
8720 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRUE
Definition: auxiliary.h:101
leftv next
Definition: subexpr.h:88
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition: iparith.cc:7480
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
Definition: tok.h:116
int BOOLEAN
Definition: auxiliary.h:88
ListNode * next
Definition: janet.h:31

§ jjBAREISS()

static BOOLEAN jjBAREISS ( leftv  res,
leftv  v 
)
static

Definition at line 3748 of file iparith.cc.

3749 {
3750  //matrix m=(matrix)v->Data();
3751  //lists l=mpBareiss(m,FALSE);
3752  intvec *iv;
3753  ideal m;
3754  sm_CallBareiss((ideal)v->Data(),0,0,m,&iv, currRing);
3756  l->Init(2);
3757  l->m[0].rtyp=MODUL_CMD;
3758  l->m[1].rtyp=INTVEC_CMD;
3759  l->m[0].data=(void *)m;
3760  l->m[1].data=(void *)iv;
3761  res->data = (char *)l;
3762  return FALSE;
3763 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1121
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
Definition: sparsmat.cc:404
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 5779 of file iparith.cc.

5780 {
5781  intvec *iv;
5782  ideal m;
5784  int k=(int)(long)w->Data();
5785  if (k>=0)
5786  {
5787  sm_CallBareiss((ideal)u->Data(),(int)(long)v->Data(),(int)(long)w->Data(),m,&iv, currRing);
5788  l->Init(2);
5789  l->m[0].rtyp=MODUL_CMD;
5790  l->m[1].rtyp=INTVEC_CMD;
5791  l->m[0].data=(void *)m;
5792  l->m[1].data=(void *)iv;
5793  }
5794  else
5795  {
5796  m=sm_CallSolv((ideal)u->Data(), currRing);
5797  l->Init(1);
5798  l->m[0].rtyp=IDEAL_CMD;
5799  l->m[0].data=(void *)m;
5800  }
5801  res->data = (char *)l;
5802  return FALSE;
5803 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
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:2372
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
void sm_CallBareiss(ideal I, int x, int y, ideal &M, intvec **iv, const ring R)
Definition: sparsmat.cc:404
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 3771 of file iparith.cc.

3772 {
3774  b->hnf();
3775  res->data=(char*)b;
3776  return FALSE;
3777 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
void hnf()
transforms INPLACE to HNF
Definition: bigintmat.cc:1670
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjBI2IM()

static BOOLEAN jjBI2IM ( leftv  res,
leftv  u 
)
static

Definition at line 3793 of file iparith.cc.

3794 {
3795  bigintmat *b=(bigintmat*)u->Data();
3796  res->data=(void *)bim2iv(b);
3797  return FALSE;
3798 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
intvec * bim2iv(bigintmat *b)
Definition: bigintmat.cc:344
void * Data()
Definition: subexpr.cc:1121
const poly b
Definition: syzextra.cc:213

§ jjBI2N()

static BOOLEAN jjBI2N ( leftv  res,
leftv  u 
)
static

Definition at line 3778 of file iparith.cc.

3779 {
3780  BOOLEAN bo=FALSE;
3781  number n=(number)u->CopyD();
3783  if (nMap!=NULL)
3784  res->data=nMap(n,coeffs_BIGINT,currRing->cf);
3785  else
3786  {
3787  Werror("cannot convert bigint to cring %s", nCoeffString(currRing->cf));
3788  bo=TRUE;
3789  }
3790  n_Delete(&n,coeffs_BIGINT);
3791  return bo;
3792 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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
#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
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:973
int BOOLEAN
Definition: auxiliary.h:88
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjBI2P()

static BOOLEAN jjBI2P ( leftv  res,
leftv  u 
)
static

Definition at line 3799 of file iparith.cc.

3800 {
3801  sleftv tmp;
3802  BOOLEAN bo=jjBI2N(&tmp,u);
3803  if (!bo)
3804  {
3805  number n=(number) tmp.data;
3806  if (nIsZero(n)) { res->data=NULL;nDelete(&n); }
3807  else
3808  {
3809  res->data=(void *)pNSet(n);
3810  }
3811  }
3812  return bo;
3813 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define pNSet(n)
Definition: polys.h:296
if(0 > strat->sl)
Definition: myNF.cc:73
static BOOLEAN jjBI2N(leftv res, leftv u)
Definition: iparith.cc:3778
void * data
Definition: subexpr.h:90
#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:88

§ jjBRACK_Bim()

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

Definition at line 5564 of file iparith.cc.

5565 {
5566  bigintmat *bim = (bigintmat *)u->Data();
5567  int r = (int)(long)v->Data();
5568  int c = (int)(long)w->Data();
5569  if ((r<1)||(r>bim->rows())||(c<1)||(c>bim->cols()))
5570  {
5571  Werror("wrong range[%d,%d] in bigintmat %s(%d x %d)",
5572  r,c,u->Fullname(),bim->rows(),bim->cols());
5573  return TRUE;
5574  }
5575  res->data=u->data; u->data=NULL;
5576  res->rtyp=u->rtyp; u->rtyp=0;
5577  res->name=u->name; u->name=NULL;
5578  Subexpr e=jjMakeSub(v);
5579  e->next=jjMakeSub(w);
5580  if (u->e==NULL)
5581  res->e=e;
5582  else
5583  {
5584  Subexpr h=u->e;
5585  while (h->next!=NULL) h=h->next;
5586  h->next=e;
5587  res->e=u->e;
5588  u->e=NULL;
5589  }
5590  return FALSE;
5591 }
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:101
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:89
int cols() const
Definition: bigintmat.h:145
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:8045
void * Data()
Definition: subexpr.cc:1121
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 5537 of file iparith.cc.

5538 {
5539  intvec *iv = (intvec *)u->Data();
5540  int r = (int)(long)v->Data();
5541  int c = (int)(long)w->Data();
5542  if ((r<1)||(r>iv->rows())||(c<1)||(c>iv->cols()))
5543  {
5544  Werror("wrong range[%d,%d] in intmat %s(%d x %d)",
5545  r,c,u->Fullname(),iv->rows(),iv->cols());
5546  return TRUE;
5547  }
5548  res->data=u->data; u->data=NULL;
5549  res->rtyp=u->rtyp; u->rtyp=0;
5550  res->name=u->name; u->name=NULL;
5551  Subexpr e=jjMakeSub(v);
5552  e->next=jjMakeSub(w);
5553  if (u->e==NULL) res->e=e;
5554  else
5555  {
5556  Subexpr h=u->e;
5557  while (h->next!=NULL) h=h->next;
5558  h->next=e;
5559  res->e=u->e;
5560  u->e=NULL;
5561  }
5562  return FALSE;
5563 }
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:101
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
int cols() const
Definition: intvec.h:87
int rtyp
Definition: subexpr.h:93
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:8045
void * Data()
Definition: subexpr.cc:1121
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 5592 of file iparith.cc.

5593 {
5594  matrix m= (matrix)u->Data();
5595  int r = (int)(long)v->Data();
5596  int c = (int)(long)w->Data();
5597  //Print("gen. elem %d, %d\n",r,c);
5598  if ((r<1)||(r>MATROWS(m))||(c<1)||(c>MATCOLS(m)))
5599  {
5600  Werror("wrong range[%d,%d] in matrix %s(%d x %d)",r,c,u->Fullname(),
5601  MATROWS(m),MATCOLS(m));
5602  return TRUE;
5603  }
5604  res->data=u->data; u->data=NULL;
5605  res->rtyp=u->rtyp; u->rtyp=0;
5606  res->name=u->name; u->name=NULL;
5607  Subexpr e=jjMakeSub(v);
5608  e->next=jjMakeSub(w);
5609  if (u->e==NULL)
5610  res->e=e;
5611  else
5612  {
5613  Subexpr h=u->e;
5614  while (h->next!=NULL) h=h->next;
5615  h->next=e;
5616  res->e=u->e;
5617  u->e=NULL;
5618  }
5619  return FALSE;
5620 }
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:89
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:93
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:8045
void * Data()
Definition: subexpr.cc:1121
#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 5621 of file iparith.cc.

5622 {
5623  sleftv t;
5624  sleftv ut;
5625  leftv p=NULL;
5626  intvec *iv=(intvec *)w->Data();
5627  int l;
5628  BOOLEAN nok;
5629 
5630  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5631  {
5632  WerrorS("cannot build expression lists from unnamed objects");
5633  return TRUE;
5634  }
5635  memcpy(&ut,u,sizeof(ut));
5636  memset(&t,0,sizeof(t));
5637  t.rtyp=INT_CMD;
5638  for (l=0;l< iv->length(); l++)
5639  {
5640  t.data=(char *)(long)((*iv)[l]);
5641  if (p==NULL)
5642  {
5643  p=res;
5644  }
5645  else
5646  {
5648  p=p->next;
5649  }
5650  memcpy(u,&ut,sizeof(ut));
5651  if (u->Typ() == MATRIX_CMD)
5652  nok=jjBRACK_Ma(p,u,v,&t);
5653  else if (u->Typ() == BIGINTMAT_CMD)
5654  nok=jjBRACK_Bim(p,u,v,&t);
5655  else /* INTMAT_CMD */
5656  nok=jjBRACK_Im(p,u,v,&t);
5657  if (nok)
5658  {
5659  while (res->next!=NULL)
5660  {
5661  p=res->next->next;
5662  omFreeBin((ADDRESS)res->next, sleftv_bin);
5663  // res->e aufraeumen !!!!
5664  res->next=p;
5665  }
5666  return TRUE;
5667  }
5668  }
5669  return FALSE;
5670 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5564
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
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:5537
int Typ()
Definition: subexpr.cc:979
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:88
#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:93
void * Data()
Definition: subexpr.cc:1121
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5592
int BOOLEAN
Definition: auxiliary.h:88
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 5671 of file iparith.cc.

5672 {
5673  sleftv t;
5674  sleftv ut;
5675  leftv p=NULL;
5676  intvec *iv=(intvec *)v->Data();
5677  int l;
5678  BOOLEAN nok;
5679 
5680  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5681  {
5682  WerrorS("cannot build expression lists from unnamed objects");
5683  return TRUE;
5684  }
5685  memcpy(&ut,u,sizeof(ut));
5686  memset(&t,0,sizeof(t));
5687  t.rtyp=INT_CMD;
5688  for (l=0;l< iv->length(); l++)
5689  {
5690  t.data=(char *)(long)((*iv)[l]);
5691  if (p==NULL)
5692  {
5693  p=res;
5694  }
5695  else
5696  {
5698  p=p->next;
5699  }
5700  memcpy(u,&ut,sizeof(ut));
5701  if (u->Typ() == MATRIX_CMD)
5702  nok=jjBRACK_Ma(p,u,&t,w);
5703  else if (u->Typ() == BIGINTMAT_CMD)
5704  nok=jjBRACK_Bim(p,u,&t,w);
5705  else /* INTMAT_CMD */
5706  nok=jjBRACK_Im(p,u,&t,w);
5707  if (nok)
5708  {
5709  while (res->next!=NULL)
5710  {
5711  p=res->next->next;
5712  omFreeBin((ADDRESS)res->next, sleftv_bin);
5713  // res->e aufraeumen !!
5714  res->next=p;
5715  }
5716  return TRUE;
5717  }
5718  }
5719  return FALSE;
5720 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5564
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
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:5537
int Typ()
Definition: subexpr.cc:979
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:88
#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:93
void * Data()
Definition: subexpr.cc:1121
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5592
int BOOLEAN
Definition: auxiliary.h:88
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 5721 of file iparith.cc.

5722 {
5723  sleftv t1,t2,ut;
5724  leftv p=NULL;
5725  intvec *vv=(intvec *)v->Data();
5726  intvec *wv=(intvec *)w->Data();
5727  int vl;
5728  int wl;
5729  BOOLEAN nok;
5730 
5731  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
5732  {
5733  WerrorS("cannot build expression lists from unnamed objects");
5734  return TRUE;
5735  }
5736  memcpy(&ut,u,sizeof(ut));
5737  memset(&t1,0,sizeof(sleftv));
5738  memset(&t2,0,sizeof(sleftv));
5739  t1.rtyp=INT_CMD;
5740  t2.rtyp=INT_CMD;
5741  for (vl=0;vl< vv->length(); vl++)
5742  {
5743  t1.data=(char *)(long)((*vv)[vl]);
5744  for (wl=0;wl< wv->length(); wl++)
5745  {
5746  t2.data=(char *)(long)((*wv)[wl]);
5747  if (p==NULL)
5748  {
5749  p=res;
5750  }
5751  else
5752  {
5754  p=p->next;
5755  }
5756  memcpy(u,&ut,sizeof(ut));
5757  if (u->Typ() == MATRIX_CMD)
5758  nok=jjBRACK_Ma(p,u,&t1,&t2);
5759  else if (u->Typ() == BIGINTMAT_CMD)
5760  nok=jjBRACK_Bim(p,u,&t1,&t2);
5761  else /* INTMAT_CMD */
5762  nok=jjBRACK_Im(p,u,&t1,&t2);
5763  if (nok)
5764  {
5765  res->CleanUp();
5766  return TRUE;
5767  }
5768  }
5769  }
5770  return FALSE;
5771 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static BOOLEAN jjBRACK_Bim(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5564
#define TRUE
Definition: auxiliary.h:101
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:5537
int Typ()
Definition: subexpr.cc:979
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:88
#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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
static BOOLEAN jjBRACK_Ma(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:5592
int BOOLEAN
Definition: auxiliary.h:88

§ jjBRACK_S()

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

Definition at line 5521 of file iparith.cc.

5522 {
5523  char *s= (char *)u->Data();
5524  int r = (int)(long)v->Data();
5525  int c = (int)(long)w->Data();
5526  int l = strlen(s);
5527 
5528  if ( (r<1) || (r>l) || (c<0) )
5529  {
5530  Werror("wrong range[%d,%d] in string %s",r,c,u->Fullname());
5531  return TRUE;
5532  }
5533  res->data = (char *)omAlloc((long)(c+1));
5534  sprintf((char *)res->data,"%-*.*s",c,c,s+r-1);
5535  return FALSE;
5536 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
void * Data()
Definition: subexpr.cc:1121
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 2922 of file iparith.cc.

2923 {
2924  res->data=NULL;
2925 
2926  if (rIsPluralRing(currRing))
2927  {
2928  const poly q = (poly)b->Data();
2929 
2930  if( q != NULL )
2931  {
2932  if( (poly)a->Data() != NULL )
2933  {
2934  poly p = (poly)a->CopyD(POLY_CMD); // p = copy!
2935  res->data = nc_p_Bracket_qq(p,q, currRing); // p will be destroyed!
2936  }
2937  }
2938  }
2939  return FALSE;
2940 }
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
Definition: old.gring.cc:2308
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjBREAK0()

static BOOLEAN jjBREAK0 ( leftv  ,
leftv   
)
static

Definition at line 6723 of file iparith.cc.

6724 {
6725 #ifdef HAVE_SDB
6726  sdb_show_bp();
6727 #endif
6728  return FALSE;
6729 }
#define FALSE
Definition: auxiliary.h:97
void sdb_show_bp()
Definition: sdb.cc:58

§ jjBREAK1()

static BOOLEAN jjBREAK1 ( leftv  ,
leftv  v 
)
static

Definition at line 6730 of file iparith.cc.

6731 {
6732 #ifdef HAVE_SDB
6733  if(v->Typ()==PROC_CMD)
6734  {
6735  int lineno=0;
6736  if((v->next!=NULL) && (v->next->Typ()==INT_CMD))
6737  {
6738  lineno=(int)(long)v->next->Data();
6739  }
6740  return sdb_set_breakpoint(v->Name(),lineno);
6741  }
6742  return TRUE;
6743 #else
6744  return FALSE;
6745 #endif
6746 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
Definition: sdb.cc:65
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjCALL1ARG()

static BOOLEAN jjCALL1ARG ( leftv  res,
leftv  v 
)
static

Definition at line 6747 of file iparith.cc.

6748 {
6749  return iiExprArith1(res,v,iiOp);
6750 }
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8422
int iiOp
Definition: iparith.cc:227

§ jjCALL1MANY()

static BOOLEAN jjCALL1MANY ( leftv  res,
leftv  u 
)
static

Definition at line 3814 of file iparith.cc.

3815 {
3816  return iiExprArithM(res,u,iiOp);
3817 }
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8722
int iiOp
Definition: iparith.cc:227

§ jjCALL2ARG()

static BOOLEAN jjCALL2ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6751 of file iparith.cc.

6752 {
6753  leftv v=u->next;
6754  u->next=NULL;
6755  BOOLEAN b=iiExprArith2(res,u,iiOp,v, (iiOp > 255));
6756  u->next=v;
6757  return b;
6758 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8235

§ jjCALL3ARG()

static BOOLEAN jjCALL3ARG ( leftv  res,
leftv  u 
)
static

Definition at line 6759 of file iparith.cc.

6760 {
6761  leftv v = u->next;
6762  leftv w = v->next;
6763  u->next = NULL;
6764  v->next = NULL;
6765  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
6766  u->next = v;
6767  v->next = w;
6768  return b;
6769 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8634
leftv next
Definition: subexpr.h:88
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:227
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213

§ jjCHAR()

static BOOLEAN jjCHAR ( leftv  res,
leftv  v 
)
static

Definition at line 3818 of file iparith.cc.

3819 {
3820  res->data = (char *)(long)rChar((ring)v->Data());
3821  return FALSE;
3822 }
#define FALSE
Definition: auxiliary.h:97
int rChar(ring r)
Definition: ring.cc:684
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjCHINREM_BI()

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

Definition at line 1656 of file iparith.cc.

1657 {
1658  intvec *c=(intvec*)u->Data();
1659  intvec* p=(intvec*)v->Data();
1660  int rl=p->length();
1661  number *x=(number *)omAlloc(rl*sizeof(number));
1662  number *q=(number *)omAlloc(rl*sizeof(number));
1663  int i;
1664  for(i=rl-1;i>=0;i--)
1665  {
1666  q[i]=n_Init((*p)[i], coeffs_BIGINT);
1667  x[i]=n_Init((*c)[i], coeffs_BIGINT);
1668  }
1669  CFArray iv(rl);
1670  number n=n_ChineseRemainderSym(x,q,rl,FALSE,iv,coeffs_BIGINT);
1671  for(i=rl-1;i>=0;i--)
1672  {
1673  n_Delete(&(q[i]),coeffs_BIGINT);
1674  n_Delete(&(x[i]),coeffs_BIGINT);
1675  }
1676  omFree(x); omFree(q);
1677  res->data=(char *)n;
1678  return FALSE;
1679 }
#define FALSE
Definition: auxiliary.h:97
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:90
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:1121
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 1766 of file iparith.cc.

1767 {
1768  coeffs cf;
1769  lists c=(lists)u->CopyD(); // list of ideal or bigint/int
1770  lists pl=NULL;
1771  intvec *p=NULL;
1772  if (v->Typ()==LIST_CMD) pl=(lists)v->Data();
1773  else p=(intvec*)v->Data();
1774  int rl=c->nr+1;
1775  ideal result;
1776  ideal *x=(ideal *)omAlloc(rl*sizeof(ideal));
1777  number *xx=NULL;
1778  int i;
1779  int return_type=c->m[0].Typ();
1780  if ((return_type!=IDEAL_CMD)
1781  && (return_type!=MODUL_CMD)
1782  && (return_type!=MATRIX_CMD)
1783  && (return_type!=POLY_CMD))
1784  {
1785  if((return_type!=BIGINT_CMD)&&(return_type!=INT_CMD))
1786  {
1787  WerrorS("poly/ideal/module/matrix expected");
1788  omFree(x); // delete c
1789  return TRUE;
1790  }
1791  else
1792  return_type=BIGINT_CMD;
1793  }
1794  if (return_type==BIGINT_CMD)
1795  cf=coeffs_BIGINT;
1796  else
1797  {
1798  cf=currRing->cf;
1799  if (nCoeff_is_Extension(cf) && (cf->extRing!=NULL))
1800  cf=cf->extRing->cf;
1801  }
1802  nMapFunc nMap=n_SetMap(coeffs_BIGINT,cf);
1803  if (return_type!=BIGINT_CMD)
1804  {
1805  for(i=rl-1;i>=0;i--)
1806  {
1807  if (c->m[i].Typ()!=return_type)
1808  {
1809  Werror("%s expected at pos %d",Tok2Cmdname(return_type),i+1);
1810  omFree(x); // delete c
1811  return TRUE;
1812  }
1813  if (return_type==POLY_CMD)
1814  {
1815  x[i]=idInit(1,1);
1816  x[i]->m[0]=(poly)c->m[i].CopyD();
1817  }
1818  else
1819  {
1820  x[i]=(ideal)c->m[i].CopyD();
1821  }
1822  //c->m[i].Init();
1823  }
1824  }
1825  else
1826  {
1827  if (nMap==NULL)
1828  {
1829  Werror("not implemented: map bigint -> %s", nCoeffString(cf));
1830  return TRUE;
1831  }
1832  xx=(number *)omAlloc(rl*sizeof(number));
1833  for(i=rl-1;i>=0;i--)
1834  {
1835  if (c->m[i].Typ()==INT_CMD)
1836  {
1837  xx[i]=n_Init(((int)(long)c->m[i].Data()),cf);
1838  }
1839  else if (c->m[i].Typ()==BIGINT_CMD)
1840  {
1841  xx[i]=nMap((number)c->m[i].Data(),coeffs_BIGINT,cf);
1842  }
1843  else
1844  {
1845  Werror("bigint expected at pos %d",i+1);
1846  omFree(x); // delete c
1847  omFree(xx); // delete c
1848  return TRUE;
1849  }
1850  }
1851  }
1852  number *q=(number *)omAlloc(rl*sizeof(number));
1853  if (p!=NULL)
1854  {
1855  for(i=rl-1;i>=0;i--)
1856  {
1857  q[i]=n_Init((*p)[i], cf);
1858  }
1859  }
1860  else
1861  {
1862  for(i=rl-1;i>=0;i--)
1863  {
1864  if (pl->m[i].Typ()==INT_CMD)
1865  {
1866  q[i]=n_Init((int)(long)pl->m[i].Data(),cf);
1867  }
1868  else if (pl->m[i].Typ()==BIGINT_CMD)
1869  {
1870  q[i]=nMap((number)(pl->m[i].Data()),coeffs_BIGINT,cf);
1871  }
1872  else
1873  {
1874  Werror("bigint expected at pos %d",i+1);
1875  for(i++;i<rl;i++)
1876  {
1877  n_Delete(&(q[i]),cf);
1878  }
1879  omFree(x); // delete c
1880  omFree(q); // delete pl
1881  if (xx!=NULL) omFree(xx); // delete c
1882  return TRUE;
1883  }
1884  }
1885  }
1886  if (return_type==BIGINT_CMD)
1887  {
1888  CFArray i_v(rl);
1889  number n=n_ChineseRemainderSym(xx,q,rl,TRUE,i_v,coeffs_BIGINT);
1890  res->data=(char *)n;
1891  }
1892  else
1893  {
1894  result=id_ChineseRemainder(x,q,rl,currRing);
1895  // deletes also x
1896  c->Clean();
1897  if ((return_type==POLY_CMD) &&(result!=NULL))
1898  {
1899  res->data=(char *)result->m[0];
1900  result->m[0]=NULL;
1901  idDelete(&result);
1902  }
1903  else
1904  res->data=(char *)result;
1905  }
1906  for(i=rl-1;i>=0;i--)
1907  {
1908  n_Delete(&(q[i]),cf);
1909  }
1910  omFree(q);
1911  res->rtyp=return_type;
1912  return result==NULL;
1913 }
sleftv * m
Definition: lists.h:45
Definition: tok.h:94
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
Definition: lists.h:22
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
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:979
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:90
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:8952
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
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
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
int rtyp
Definition: subexpr.h:93
Variable x
Definition: cfModGcd.cc:4023
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:860
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
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:973
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679
return result
Definition: facAbsBiFact.cc:76

§ jjCOEF()

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

Definition at line 1914 of file iparith.cc.

1915 {
1916  poly p=(poly)v->Data();
1917  if ((p==NULL)||(pNext(p)!=NULL)) return TRUE;
1918  res->data=(char *)mp_CoeffProc((poly)u->Data(),p /*(poly)v->Data()*/,currRing);
1919  return FALSE;
1920 }
matrix mp_CoeffProc(poly f, poly vars, const ring R)
Definition: matpol.cc:414
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjCOEF_M()

static BOOLEAN jjCOEF_M ( leftv  ,
leftv  v 
)
static

Definition at line 6771 of file iparith.cc.

6772 {
6774  if (iiCheckTypes(v,t))
6775  return TRUE;
6776  idhdl c=(idhdl)v->next->next->data;
6777  if (v->next->next->next->rtyp!=IDHDL) return TRUE;
6778  idhdl m=(idhdl)v->next->next->next->data;
6779  idDelete((ideal *)&(c->data.uideal));
6780  idDelete((ideal *)&(m->data.uideal));
6781  mp_Coef2((poly)v->Data(),(poly)v->next->Data(),
6782  (matrix *)&(c->data.umatrix),(matrix *)&(m->data.umatrix),currRing);
6783  return FALSE;
6784 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
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:88
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:516
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:6460
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
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 1932 of file iparith.cc.

1933 {
1934  poly p = pInit();
1935  int i;
1936  for (i=1; i<=currRing->N; i++)
1937  {
1938  pSetExp(p, i, 1);
1939  }
1940  pSetm(p);
1941  res->data = (void*)idCoeffOfKBase((ideal)(u->Data()),
1942  (ideal)(v->Data()), p);
1943  pDelete(&p);
1944  return FALSE;
1945 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2231
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjCOEFFS3_Id()

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

Definition at line 5804 of file iparith.cc.

5805 {
5806  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5807  {
5808  WerrorS("3rd argument must be a name of a matrix");
5809  return TRUE;
5810  }
5811  ideal i=(ideal)u->Data();
5812  int rank=(int)i->rank;
5813  BOOLEAN r=jjCOEFFS_Id(res,u,v);
5814  if (r) return TRUE;
5815  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5816  return FALSE;
5817 }
#define pVar(m)
Definition: polys.h:365
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition: iparith.cc:1921
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
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:377
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ jjCOEFFS3_KB()

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

Definition at line 5818 of file iparith.cc.

5819 {
5820  res->data=(void*)idCoeffOfKBase((ideal)(u->Data()),
5821  (ideal)(v->Data()),(poly)(w->Data()));
5822  return FALSE;
5823 }
#define FALSE
Definition: auxiliary.h:97
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2231
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjCOEFFS3_P()

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

Definition at line 5824 of file iparith.cc.

5825 {
5826  if ((w->rtyp!=IDHDL)||(w->e!=NULL))
5827  {
5828  WerrorS("3rd argument must be a name of a matrix");
5829  return TRUE;
5830  }
5831  // CopyD for POLY_CMD and VECTOR_CMD are identical:
5832  poly p=(poly)u->CopyD(POLY_CMD);
5833  ideal i=idInit(1,1);
5834  i->m[0]=p;
5835  sleftv t;
5836  memset(&t,0,sizeof(t));
5837  t.data=(char *)i;
5838  t.rtyp=IDEAL_CMD;
5839  int rank=1;
5840  if (u->Typ()==VECTOR_CMD)
5841  {
5842  i->rank=rank=pMaxComp(p);
5843  t.rtyp=MODUL_CMD;
5844  }
5845  BOOLEAN r=jjCOEFFS_Id(res,&t,v);
5846  t.CleanUp();
5847  if (r) return TRUE;
5848  mp_Monomials((matrix)res->data, rank, pVar((poly)v->Data()),(matrix)w->Data(),currRing);
5849  return FALSE;
5850 }
#define pVar(m)
Definition: polys.h:365
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Subexpr e
Definition: subexpr.h:107
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static BOOLEAN jjCOEFFS_Id(leftv res, leftv u, leftv v)
Definition: iparith.cc:1921
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
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:377
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjCOEFFS_Id()

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

Definition at line 1921 of file iparith.cc.

1922 {
1923  int i=pVar((poly)v->Data());
1924  if (i==0)
1925  {
1926  WerrorS("ringvar expected");
1927  return TRUE;
1928  }
1929  res->data=(char *)mp_Coeffs((ideal)u->CopyD(),i,currRing);
1930  return FALSE;
1931 }
#define pVar(m)
Definition: polys.h:365
#define FALSE
Definition: auxiliary.h:97
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:327
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjCOLCOL()

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

Definition at line 702 of file iparith.cc.

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

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

§ jjCOLS()

static BOOLEAN jjCOLS ( leftv  res,
leftv  v 
)
static

Definition at line 3823 of file iparith.cc.

3824 {
3825  res->data = (char *)(long)MATCOLS((matrix)(v->Data()));
3826  return FALSE;
3827 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define MATCOLS(i)
Definition: matpol.h:28
void * Data()
Definition: subexpr.cc:1121

§ jjCOLS_BIM()

static BOOLEAN jjCOLS_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 3828 of file iparith.cc.

3829 {
3830  res->data = (char *)(long)((bigintmat*)(v->Data()))->cols();
3831  return FALSE;
3832 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjCOLS_IV()

static BOOLEAN jjCOLS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 3833 of file iparith.cc.

3834 {
3835  res->data = (char *)(long)((intvec*)(v->Data()))->cols();
3836  return FALSE;
3837 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121

§ jjCOMPARE_BIM()

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

Definition at line 379 of file iparith.cc.

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

§ jjCOMPARE_IV()

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

Definition at line 351 of file iparith.cc.

352 {
353  intvec* a = (intvec * )(u->Data());
354  intvec* b = (intvec * )(v->Data());
355  int r=a->compare(b);
356  switch (iiOp)
357  {
358  case '<':
359  res->data = (char *) (r<0);
360  break;
361  case '>':
362  res->data = (char *) (r>0);
363  break;
364  case LE:
365  res->data = (char *) (r<=0);
366  break;
367  case GE:
368  res->data = (char *) (r>=0);
369  break;
370  case EQUAL_EQUAL:
371  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
372  res->data = (char *) (r==0);
373  break;
374  }
375  jjEQUAL_REST(res,u,v);
376  if(r==-2) { WerrorS("size incompatible"); return TRUE; }
377  return FALSE;
378 }
int compare(const intvec *o) const
Definition: intvec.cc:207
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:97
Definition: grammar.cc:270
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
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 407 of file iparith.cc.

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

§ jjCOMPARE_P()

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

Definition at line 434 of file iparith.cc.

435 {
436  poly p=(poly)u->Data();
437  poly q=(poly)v->Data();
438  int r=pCmp(p,q);
439  if (r==0)
440  {
441  number h=nSub(pGetCoeff(p),pGetCoeff(q));
442  /* compare lead coeffs */
443  r = -1+nIsZero(h)+2*nGreaterZero(h); /* -1: <, 0:==, 1: > */
444  nDelete(&h);
445  }
446  else if (p==NULL)
447  {
448  if (q==NULL)
449  {
450  /* compare 0, 0 */
451  r=0;
452  }
453  else if(pIsConstant(q))
454  {
455  /* compare 0, const */
456  r = 1-2*nGreaterZero(pGetCoeff(q)); /* -1: <, 1: > */
457  }
458  }
459  else if (q==NULL)
460  {
461  if (pIsConstant(p))
462  {
463  /* compare const, 0 */
464  r = -1+2*nGreaterZero(pGetCoeff(p)); /* -1: <, 1: > */
465  }
466  }
467  switch (iiOp)
468  {
469  case '<':
470  res->data = (char *) (r < 0);
471  break;
472  case '>':
473  res->data = (char *) (r > 0);
474  break;
475  case LE:
476  res->data = (char *) (r <= 0);
477  break;
478  case GE:
479  res->data = (char *) (r >= 0);
480  break;
481  //case EQUAL_EQUAL:
482  //case NOTEQUAL: /* negation handled by jjEQUAL_REST */
483  // res->data = (char *) (r == 0);
484  // break;
485  }
486  jjEQUAL_REST(res,u,v);
487  return FALSE;
488 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
Definition: grammar.cc:270
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
Definition: polys.h:115
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:90
const ring r
Definition: syzextra.cc:208
#define nGreaterZero(n)
Definition: numbers.h:27
Definition: grammar.cc:269
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
#define nSub(n1, n2)
Definition: numbers.h:22
#define nDelete(n)
Definition: numbers.h:16
#define nIsZero(n)
Definition: numbers.h:19
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
static Poly * h
Definition: janet.cc:978

§ jjCOMPARE_S()

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

Definition at line 489 of file iparith.cc.

490 {
491  char* a = (char * )(u->Data());
492  char* b = (char * )(v->Data());
493  int result = strcmp(a,b);
494  switch (iiOp)
495  {
496  case '<':
497  res->data = (char *) (result < 0);
498  break;
499  case '>':
500  res->data = (char *) (result > 0);
501  break;
502  case LE:
503  res->data = (char *) (result <= 0);
504  break;
505  case GE:
506  res->data = (char *) (result >= 0);
507  break;
508  case EQUAL_EQUAL:
509  case NOTEQUAL: /* negation handled by jjEQUAL_REST */
510  res->data = (char *) (result == 0);
511  break;
512  }
513  jjEQUAL_REST(res,u,v);
514  return FALSE;
515 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:97
Definition: grammar.cc:270
void * data
Definition: subexpr.h:90
Definition: grammar.cc:269
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
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 3838 of file iparith.cc.

3839 {
3840  // CopyD for POLY_CMD and VECTOR_CMD are identical:
3841  poly p=(poly)v->CopyD(POLY_CMD);
3842  if (p!=NULL) p_Cleardenom(p, currRing);
3843  res->data = (char *)p;
3844  return FALSE;
3845 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:2716
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjCONTRACT()

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

Definition at line 1946 of file iparith.cc.

1947 {
1948  res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data(),FALSE);
1949  return FALSE;
1950 }
#define FALSE
Definition: auxiliary.h:97
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
Definition: ideals.cc:1916
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjCOUNT_BI()

static BOOLEAN jjCOUNT_BI ( leftv  res,
leftv  v 
)
static

Definition at line 3846 of file iparith.cc.

3847 {
3848  res->data = (char *)(long)n_Size((number)v->Data(),coeffs_BIGINT);
3849  return FALSE;
3850 }
#define FALSE
Definition: auxiliary.h:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
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 3868 of file iparith.cc.

3869 {
3870  res->data = (char *)(long)((intvec*)(v->Data()))->length();
3871  return FALSE;
3872 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121

§ jjCOUNT_L()

static BOOLEAN jjCOUNT_L ( leftv  res,
leftv  v 
)
static

Definition at line 3856 of file iparith.cc.

3857 {
3858  lists l=(lists)v->Data();
3859  res->data = (char *)(long)(lSize(l)+1);
3860  return FALSE;
3861 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
int lSize(lists L)
Definition: lists.cc:25
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1121
int l
Definition: cfEzgcd.cc:94

§ jjCOUNT_M()

static BOOLEAN jjCOUNT_M ( leftv  res,
leftv  v 
)
static

Definition at line 3862 of file iparith.cc.

3863 {
3864  matrix m=(matrix)v->Data();
3865  res->data = (char *)(long)(MATROWS(m)*MATCOLS(m));
3866  return FALSE;
3867 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
#define MATCOLS(i)
Definition: matpol.h:28
void * Data()
Definition: subexpr.cc:1121
#define MATROWS(i)
Definition: matpol.h:27

§ jjCOUNT_N()

static BOOLEAN jjCOUNT_N ( leftv  res,
leftv  v 
)
static

Definition at line 3851 of file iparith.cc.

3852 {
3853  res->data = (char *)(long)nSize((number)v->Data());
3854  return FALSE;
3855 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define nSize(n)
Definition: numbers.h:39
void * Data()
Definition: subexpr.cc:1121

§ jjCOUNT_RES()

static BOOLEAN jjCOUNT_RES ( leftv  res,
leftv  v 
)
static

Definition at line 5490 of file iparith.cc.

5491 {
5492  res->data=(char *)(long)sySize((syStrategy)v->Data());
5493  return FALSE;
5494 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
int sySize(syStrategy syzstr)
Definition: syz1.cc:1840
void * Data()
Definition: subexpr.cc:1121

§ jjCOUNT_RG()

static BOOLEAN jjCOUNT_RG ( leftv  res,
leftv  v 
)
static

Definition at line 3873 of file iparith.cc.

3874 {
3875  ring r=(ring)v->Data();
3876  int elems=-1;
3877  if (rField_is_Zp(r)||rField_is_GF(r)) elems=r->cf->ch;
3878  else if (rField_is_Zp_a(r) && (r->cf->type==n_algExt))
3879  {
3880  extern int ipower ( int b, int n ); /* factory/cf_util */
3881  elems=ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));
3882  }
3883  res->data = (char *)(long)elems;
3884  return FALSE;
3885 }
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:518
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:510
void * data
Definition: subexpr.h:90
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:1121
const poly b
Definition: syzextra.cc:213

§ jjDEFINED()

static BOOLEAN jjDEFINED ( leftv  res,
leftv  v 
)
static

Definition at line 3941 of file iparith.cc.

3942 {
3943  if ((v->rtyp==IDHDL)
3944  && ((myynest==IDLEV((idhdl)v->data))||(0==IDLEV((idhdl)v->data))))
3945  {
3946  res->data=(void *)(long)(IDLEV((idhdl)v->data)+1);
3947  }
3948  else if (v->rtyp!=0) res->data=(void *)(-1);
3949  return FALSE;
3950 }
#define FALSE
Definition: auxiliary.h:97
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
int myynest
Definition: febase.cc:46
#define IDLEV(a)
Definition: ipid.h:118
int rtyp
Definition: subexpr.h:93

§ jjDEG()

static BOOLEAN jjDEG ( leftv  res,
leftv  v 
)
static

Definition at line 3886 of file iparith.cc.

3887 {
3888  int dummy;
3889  poly p=(poly)v->Data();
3890  if (p!=NULL) res->data = (char *)currRing->pLDeg(p,&dummy,currRing);
3891  else res->data=(char *)-1;
3892  return FALSE;
3893 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjDEG_IV()

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

Definition at line 1962 of file iparith.cc.

1963 {
1964  poly p=(poly)u->Data();
1965  if (p!=NULL)
1966  {
1967  short *iv=iv2array((intvec *)v->Data(),currRing);
1968  const long d = p_DegW(p,iv,currRing);
1969  omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(short) );
1970  res->data = (char *)(d);
1971  }
1972  else
1973  res->data=(char *)(long)(-1);
1974  return FALSE;
1975 }
#define FALSE
Definition: auxiliary.h:97
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:580
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
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:690
Definition: intvec.h:14
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjDEG_M()

static BOOLEAN jjDEG_M ( leftv  res,
leftv  u 
)
static

Definition at line 3894 of file iparith.cc.

3895 {
3896  ideal I=(ideal)u->Data();
3897  int d=-1;
3898  int dummy;
3899  int i;
3900  for(i=IDELEMS(I)-1;i>=0;i--)
3901  if (I->m[i]!=NULL) d=si_max(d,(int)currRing->pLDeg(I->m[i],&dummy,currRing));
3902  res->data = (char *)(long)d;
3903  return FALSE;
3904 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:123
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjDEG_M_IV()

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

Definition at line 1951 of file iparith.cc.

1952 {
1953  short *iv=iv2array((intvec *)v->Data(),currRing);
1954  ideal I=(ideal)u->Data();
1955  int d=-1;
1956  int i;
1957  for(i=IDELEMS(I);i>=0;i--) d=si_max(d,(int)p_DegW(I->m[i],iv,currRing));
1958  omFreeSize( (ADDRESS)iv, (rVar(currRing)+1)*sizeof(short) );
1959  res->data = (char *)((long)d);
1960  return FALSE;
1961 }
#define FALSE
Definition: auxiliary.h:97
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:580
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
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:690
Definition: intvec.h:14
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
void * Data()
Definition: subexpr.cc:1121

§ jjDEGREE()

static BOOLEAN jjDEGREE ( leftv  res,
leftv  v 
)
static

Definition at line 3905 of file iparith.cc.

3906 {
3907  SPrintStart();
3909  {
3910  ring origR = currRing;
3911  ring tempR = rCopy(origR);
3912  coeffs new_cf=nInitChar(n_Q,NULL);
3913  nKillChar(tempR->cf);
3914  tempR->cf=new_cf;
3915  rComplete(tempR);
3916  ideal vid = (ideal)v->Data();
3917  rChangeCurrRing(tempR);
3918  ideal vv = idrCopyR(vid, origR, currRing);
3919  sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
3920  vvAsLeftv.rtyp = IDEAL_CMD;
3921  vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
3922  if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
3923  assumeStdFlag(&vvAsLeftv);
3924  PrintS("// NOTE: computation of degree is being performed for\n");
3925  PrintS("// generic fibre, that is, over Q\n");
3926  intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
3927  scDegree(vv,module_w,currRing->qideal);
3928  idDelete(&vv);
3929  rChangeCurrRing(origR);
3930  rDelete(tempR);
3931  }
3932  assumeStdFlag(v);
3933  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
3934  scDegree((ideal)v->Data(),module_w,currRing->qideal);
3935  char *s=SPrintEnd();
3936  int l=strlen(s)-1;
3937  s[l]='\0';
3938  res->data=(void*)s;
3939  return FALSE;
3940 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
rational (GMP) numbers
Definition: coeffs.h:31
void * data
Definition: subexpr.h:90
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 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:3435
The main handler for Singular numbers which are suitable for Singular polynomials.
void scDegree(ideal S, intvec *modulweight, ideal Q)
Definition: hdegree.cc:822
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: tok.h:99
char * SPrintEnd()
Definition: reporter.cc:273
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:88
void rChangeCurrRing(ring r)
Definition: polys.cc:12
ring rCopy(ring r)
Definition: ring.cc:1619
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
void SPrintStart()
Definition: reporter.cc:246
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
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:329

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

3955 {
3956  number n = reinterpret_cast<number>(v->Data());
3957  res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing));
3958  return FALSE;
3959 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjDET()

static BOOLEAN jjDET ( leftv  res,
leftv  v 
)
static

Definition at line 3970 of file iparith.cc.

3971 {
3972  matrix m=(matrix)v->Data();
3973  poly p;
3974  if (sm_CheckDet((ideal)m,m->cols(),TRUE, currRing))
3975  {
3977  p=sm_CallDet(I, currRing);
3978  idDelete(&I);
3979  }
3980  else
3981  p=singclap_det(m,currRing);
3982  res ->data = (char *)p;
3983  return FALSE;
3984 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
poly sm_CallDet(ideal I, const ring R)
Definition: sparsmat.cc:359
#define TRUE
Definition: auxiliary.h:101
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1579
void * data
Definition: subexpr.h:90
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:308
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int & cols()
Definition: matpol.h:25
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
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 3985 of file iparith.cc.

3986 {
3987  bigintmat * m=(bigintmat*)v->Data();
3988  int i,j;
3989  i=m->rows();j=m->cols();
3990  if(i==j)
3991  res->data = (char *)(long)singclap_det_bi(m,coeffs_BIGINT);
3992  else
3993  {
3994  Werror("det of %d x %d bigintmat",i,j);
3995  return TRUE;
3996  }
3997  return FALSE;
3998 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1620
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjDET_I()

static BOOLEAN jjDET_I ( leftv  res,
leftv  v 
)
static

Definition at line 4019 of file iparith.cc.

4020 {
4021  intvec * m=(intvec*)v->Data();
4022  int i,j;
4023  i=m->rows();j=m->cols();
4024  if(i==j)
4025  res->data = (char *)(long)singclap_det_i(m,currRing);
4026  else
4027  {
4028  Werror("det of %d x %d intmat",i,j);
4029  return TRUE;
4030  }
4031  return FALSE;
4032 }
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
int singclap_det_i(intvec *m, const ring)
Definition: clapsing.cc:1602
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjDET_N2()

static BOOLEAN jjDET_N2 ( leftv  res,
leftv  v 
)
static

Definition at line 4000 of file iparith.cc.

4001 {
4002  bigintmat * m=(bigintmat*)v->Data();
4003  number2 r=(number2)omAlloc0(sizeof(*r));
4004  int i,j;
4005  i=m->rows();j=m->cols();
4006  if(i==j)
4007  {
4008  r->n=m->det();
4009  r->cf=m->basecoeffs();
4010  }
4011  else
4012  {
4013  Werror("det of %d x %d cmatrix",i,j);
4014  return TRUE;
4015  }
4016  return FALSE;
4017 }
number det()
det (via LaPlace in general, hnf for euc. rings)
Definition: bigintmat.cc:1522
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:101
const ring r
Definition: syzextra.cc:208
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
coeffs basecoeffs() const
Definition: bigintmat.h:147
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ jjDET_S()

static BOOLEAN jjDET_S ( leftv  res,
leftv  v 
)
static

Definition at line 4033 of file iparith.cc.

4034 {
4035  ideal I=(ideal)v->Data();
4036  poly p;
4037  if (IDELEMS(I)<1) return TRUE;
4038  if (sm_CheckDet(I,IDELEMS(I),FALSE, currRing))
4039  {
4041  p=singclap_det(m,currRing);
4042  idDelete((ideal *)&m);
4043  }
4044  else
4045  p=sm_CallDet(I, currRing);
4046  res->data = (char *)p;
4047  return FALSE;
4048 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
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:359
#define TRUE
Definition: auxiliary.h:101
poly singclap_det(const matrix m, const ring s)
Definition: clapsing.cc:1579
void * data
Definition: subexpr.h:90
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:308
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjDIFF_COEF()

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

Definition at line 4465 of file iparith.cc.

4466 {
4467  if (!nCoeff_is_transExt(currRing->cf))
4468  {
4469  WerrorS("differentiation not defined in the coefficient ring");
4470  return TRUE;
4471  }
4472  number n = (number) u->Data();
4473  number k = (number) v->Data();
4474  res->data = ntDiff(n,k,currRing->cf);
4475  return FALSE;
4476 }
number ntDiff(number a, number d, const coeffs cf)
Definition: transext.cc:811
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:90
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:932
void * Data()
Definition: subexpr.cc:1121

§ jjDIFF_ID()

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

Definition at line 1987 of file iparith.cc.

1988 {
1989  int i=pVar((poly)v->Data());
1990  if (i==0)
1991  {
1992  WerrorS("ringvar expected");
1993  return TRUE;
1994  }
1995  res->data=(char *)idDiff((matrix)(u->Data()),i);
1996  return FALSE;
1997 }
matrix idDiff(matrix i, int k)
Definition: ideals.cc:1903
#define pVar(m)
Definition: polys.h:365
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjDIFF_ID_ID()

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

Definition at line 1998 of file iparith.cc.

1999 {
2000  res->data=(char *)idDiffOp((ideal)u->Data(),(ideal)v->Data());
2001  return FALSE;
2002 }
#define FALSE
Definition: auxiliary.h:97
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
Definition: ideals.cc:1916
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjDIFF_P()

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

Definition at line 1976 of file iparith.cc.

1977 {
1978  int i=pVar((poly)v->Data());
1979  if (i==0)
1980  {
1981  WerrorS("ringvar expected");
1982  return TRUE;
1983  }
1984  res->data=(char *)pDiff((poly)(u->Data()),i);
1985  return FALSE;
1986 }
#define pVar(m)
Definition: polys.h:365
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1121
#define pDiff(a, b)
Definition: polys.h:279
polyrec * poly
Definition: hilb.h:10

§ jjDIM()

static BOOLEAN jjDIM ( leftv  res,
leftv  v 
)
static

Definition at line 4049 of file iparith.cc.

4050 {
4051  assumeStdFlag(v);
4053  {
4054  Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
4055  }
4056  if (rField_is_Ring(currRing))
4057  {
4058  ideal vid = (ideal)v->Data();
4059  int i = idPosConstant(vid);
4060  if ((i != -1) && (n_IsUnit(pGetCoeff(vid->m[i]),currRing->cf)))
4061  { /* ideal v contains unit; dim = -1 */
4062  res->data = (char *)-1L;
4063  return FALSE;
4064  }
4065  ideal vv = id_Head(vid,currRing);
4066  idSkipZeroes(vv);
4067  int j = idPosConstant(vv);
4068  long d;
4069  if(j == -1)
4070  {
4071  d = (long)scDimInt(vv, currRing->qideal);
4073  d++;
4074  }
4075  else
4076  {
4077  if(n_IsUnit(pGetCoeff(vv->m[j]),currRing->cf))
4078  d = -1;
4079  else
4080  d = (long)scDimInt(vv, currRing->qideal);
4081  }
4082  //Anne's Idea for std(4,2x) = 0 bug
4083  long dcurr = d;
4084  for(i=0;i<IDELEMS(vv);i++)
4085  {
4086  if(vv->m[i] != NULL && !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf))
4087  {
4088  ideal vc = idCopy(vv);
4089  poly c = pInit();
4090  pSetCoeff0(c,nCopy(pGetCoeff(vv->m[i])));
4091  idInsertPoly(vc,c);
4092  idSkipZeroes(vc);
4093  for(j = 0;j<IDELEMS(vc)-1;j++)
4094  {
4095  if((vc->m[j]!=NULL)
4096  && (n_DivBy(pGetCoeff(vc->m[j]),pGetCoeff(c),currRing->cf)))
4097  {
4098  pDelete(&vc->m[j]);
4099  }
4100  }
4101  idSkipZeroes(vc);
4102  j = idPosConstant(vc);
4103  if (j != -1) pDelete(&vc->m[j]);
4104  dcurr = (long)scDimInt(vc, currRing->qideal);
4105  // the following assumes the ground rings to be either zero- or one-dimensional
4106  if((j==-1) && rField_is_Ring_Z(currRing))
4107  {
4108  // should also be activated for other euclidean domains as groundfield
4109  dcurr++;
4110  }
4111  idDelete(&vc);
4112  }
4113  if(dcurr > d)
4114  d = dcurr;
4115  }
4116  res->data = (char *)d;
4117  idDelete(&vv);
4118  return FALSE;
4119  }
4120  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
4121  return FALSE;
4122 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:39
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:31
#define FALSE
Definition: auxiliary.h:97
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:122
void * data
Definition: subexpr.h:90
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:1458
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:748
ideal idCopy(ideal A)
Definition: ideals.h:62
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:1121
#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 2003 of file iparith.cc.

2004 {
2005  assumeStdFlag(v);
2007  {
2008  Warn("dim(%s,...) may be wrong because the mixed monomial ordering",v->Name());
2009  }
2010 #ifdef HAVE_RINGS
2011  if (rField_is_Ring(currRing))
2012  {
2013  //ring origR = currRing;
2014  //ring tempR = rCopy(origR);
2015  //coeffs new_cf=nInitChar(n_Q,NULL);
2016  //nKillChar(tempR->cf);
2017  //tempR->cf=new_cf;
2018  //rComplete(tempR);
2019  ideal vid = (ideal)v->Data();
2020  int i = idPosConstant(vid);
2021  if ((i != -1) && (n_IsUnit(pGetCoeff(vid->m[i]),currRing->cf)))
2022  { /* ideal v contains unit; dim = -1 */
2023  res->data = (char *)-1;
2024  return FALSE;
2025  }
2026  //rChangeCurrRing(tempR);
2027  //ideal vv = idrCopyR(vid, origR, currRing);
2028  ideal vv = id_Copy(vid, currRing);
2029  //ideal ww = idrCopyR((ideal)w->Data(), origR, currRing);
2030  ideal ww = id_Copy((ideal)w->Data(), currRing);
2031  /* drop degree zero generator from vv (if any) */
2032  if (i != -1) pDelete(&vv->m[i]);
2033  long d = (long)scDimInt(vv, ww);
2034  if (rField_is_Ring_Z(currRing) && (i == -1)) d++;
2035  res->data = (char *)d;
2036  idDelete(&vv); idDelete(&ww);
2037  //rChangeCurrRing(origR);
2038  //rDelete(tempR);
2039  return FALSE;
2040  }
2041 #endif
2042  if(currRing->qideal==NULL)
2043  res->data = (char *)((long)scDimInt((ideal)(v->Data()),(ideal)w->Data()));
2044  else
2045  {
2046  ideal q=idSimpleAdd(currRing->qideal,(ideal)w->Data());
2047  res->data = (char *)((long)scDimInt((ideal)(v->Data()),q));
2048  idDelete(&q);
2049  }
2050  return FALSE;
2051 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:39
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
else
Definition: myNF.cc:189
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define idSimpleAdd(A, B)
Definition: ideals.h:44
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:122
void * data
Definition: subexpr.h:90
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:1458
int i
Definition: cfEzgcd.cc:123
BOOLEAN rHasMixedOrdering(const ring r)
Definition: ring.h:748
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:1121
#define Warn
Definition: emacs.cc:80

§ jjDIM_R()

static BOOLEAN jjDIM_R ( leftv  res,
leftv  v 
)
static

Definition at line 5495 of file iparith.cc.

5496 {
5497  res->data = (char *)(long)syDim((syStrategy)v->Data());
5498  return FALSE;
5499 }
#define FALSE
Definition: auxiliary.h:97
int syDim(syStrategy syzstr)
Definition: syz1.cc:1860
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjDIV_BI()

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

Definition at line 1180 of file iparith.cc.

1181 {
1182  number q=(number)v->Data();
1183  if (n_IsZero(q,coeffs_BIGINT))
1184  {
1186  return TRUE;
1187  }
1188  q = n_Div((number)u->Data(),q,coeffs_BIGINT);
1190  res->data = (char *)q;
1191  return FALSE;
1192 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
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:90
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:1121
#define ii_div_by_0
Definition: iparith.cc:225

§ jjDIV_Ma()

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

Definition at line 1281 of file iparith.cc.

1282 {
1283  poly q=(poly)v->Data();
1284  if (q==NULL)
1285  {
1287  return TRUE;
1288  }
1289  matrix m=(matrix)(u->Data());
1290  int r=m->rows();
1291  int c=m->cols();
1292  matrix mm=mpNew(r,c);
1293  int i,j;
1294  for(i=r;i>0;i--)
1295  {
1296  for(j=c;j>0;j--)
1297  {
1298  if (pNext(q)!=NULL)
1299  {
1300  MATELEM(mm,i,j) = singclap_pdivide( MATELEM(m,i,j) ,
1301  q /*(poly)(v->Data())*/, currRing );
1302  }
1303  else
1304  MATELEM(mm,i,j) = pDivideM(pCopy(MATELEM(m,i,j)),pHead(q));
1305  }
1306  }
1307  id_Normalize((ideal)mm,currRing);
1308  res->data=(char *)mm;
1309  return FALSE;
1310 }
int & rows()
Definition: matpol.h:24
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:547
void * data
Definition: subexpr.h:90
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:277
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:48
int & cols()
Definition: matpol.h:25
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1121
#define ii_div_by_0
Definition: iparith.cc:225
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 1193 of file iparith.cc.

1194 {
1195  number q=(number)v->Data();
1196  if (nIsZero(q))
1197  {
1199  return TRUE;
1200  }
1201  q = nDiv((number)u->Data(),q);
1202  nNormalize(q);
1203  res->data = (char *)q;
1204  return FALSE;
1205 }
#define nNormalize(n)
Definition: numbers.h:30
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
#define nDiv(a, b)
Definition: numbers.h:32
#define nIsZero(n)
Definition: numbers.h:19
void * Data()
Definition: subexpr.cc:1121
#define ii_div_by_0
Definition: iparith.cc:225

§ jjDIV_P()

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

Definition at line 1206 of file iparith.cc.

1207 {
1208  poly q=(poly)v->Data();
1209  if (q==NULL)
1210  {
1212  return TRUE;
1213  }
1214  poly p=(poly)(u->Data());
1215  if (p==NULL)
1216  {
1217  res->data=NULL;
1218  return FALSE;
1219  }
1220  if ((pNext(q)!=NULL) && (!rField_is_Ring(currRing)))
1221  { /* This means that q != 0 consists of at least two terms.
1222  Moreover, currRing is over a field. */
1223  if(pGetComp(p)==0)
1224  {
1225  res->data=(void*)(singclap_pdivide(p /*(poly)(u->Data())*/ ,
1226  q /*(poly)(v->Data())*/ ,currRing));
1227  }
1228  else
1229  {
1230  int comps=pMaxComp(p);
1231  ideal I=idInit(comps,1);
1232  p=pCopy(p);
1233  poly h;
1234  int i;
1235  // conversion to a list of polys:
1236  while (p!=NULL)
1237  {
1238  i=pGetComp(p)-1;
1239  h=pNext(p);
1240  pNext(p)=NULL;
1241  pSetComp(p,0);
1242  I->m[i]=pAdd(I->m[i],p);
1243  p=h;
1244  }
1245  // division and conversion to vector:
1246  h=NULL;
1247  p=NULL;
1248  for(i=comps-1;i>=0;i--)
1249  {
1250  if (I->m[i]!=NULL)
1251  {
1252  h=singclap_pdivide(I->m[i],q,currRing);
1253  pSetCompP(h,i+1);
1254  p=pAdd(p,h);
1255  }
1256  }
1257  idDelete(&I);
1258  res->data=(void *)p;
1259  }
1260  }
1261  else
1262  { /* This means that q != 0 consists of just one term,
1263  or that currRing is over a coefficient ring. */
1264 #ifdef HAVE_RINGS
1265  if (!rField_is_Domain(currRing))
1266  {
1267  WerrorS("division only defined over coefficient domains");
1268  return TRUE;
1269  }
1270  if (pNext(q)!=NULL)
1271  {
1272  WerrorS("division over a coefficient domain only implemented for terms");
1273  return TRUE;
1274  }
1275 #endif
1276  res->data = (char *)pDivideM(pCopy(p),pHead(q));
1277  }
1278  pNormalize((poly)res->data);
1279  return FALSE;
1280 }
#define pAdd(p, q)
Definition: polys.h:186
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
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:547
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:90
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:286
#define pDivideM(a, b)
Definition: polys.h:277
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:1121
#define ii_div_by_0
Definition: iparith.cc:225
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 2052 of file iparith.cc.

2053 {
2054  ideal vi=(ideal)v->Data();
2055  int vl= IDELEMS(vi);
2056  ideal ui=(ideal)u->Data();
2057  int ul= IDELEMS(ui);
2058  ideal R; matrix U;
2059  ideal m = idLift(vi,ui,&R, FALSE,hasFlag(v,FLAG_STD),TRUE,&U);
2060  if (m==NULL) return TRUE;
2061  // now make sure that all matices have the corect size:
2063  int i;
2064  if (MATCOLS(U) != ul)
2065  {
2066  int mul=si_min(ul,MATCOLS(U));
2067  matrix UU=mpNew(ul,ul);
2068  int j;
2069  for(i=mul;i>0;i--)
2070  {
2071  for(j=mul;j>0;j--)
2072  {
2073  MATELEM(UU,i,j)=MATELEM(U,i,j);
2074  MATELEM(U,i,j)=NULL;
2075  }
2076  }
2077  idDelete((ideal *)&U);
2078  U=UU;
2079  }
2080  // make sure that U is a diagonal matrix of units
2081  for(i=ul;i>0;i--)
2082  {
2083  if(MATELEM(U,i,i)==NULL) MATELEM(U,i,i)=pOne();
2084  }
2086  L->Init(3);
2087  L->m[0].rtyp=MATRIX_CMD; L->m[0].data=(void *)T;
2088  L->m[1].rtyp=u->Typ(); L->m[1].data=(void *)R;
2089  L->m[2].rtyp=MATRIX_CMD; L->m[2].data=(void *)U;
2090  res->data=(char *)L;
2091  return FALSE;
2092 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
Definition: lists.h:22
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:298
#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:48
#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:93
void * Data()
Definition: subexpr.cc:1121
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891
omBin slists_bin
Definition: lists.cc:23
static jList * T
Definition: janet.cc:37
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ jjDIVISION4()

static BOOLEAN jjDIVISION4 ( leftv  res,
leftv  v 
)
static

Definition at line 6786 of file iparith.cc.

6787 { // may have 3 or 4 arguments
6788  leftv v1=v;
6789  leftv v2=v1->next;
6790  leftv v3=v2->next;
6791  leftv v4=v3->next;
6792  assumeStdFlag(v2);
6793 
6794  int i1=iiTestConvert(v1->Typ(),MODUL_CMD);
6795  int i2=iiTestConvert(v2->Typ(),MODUL_CMD);
6796 
6797  if((i1==0)||(i2==0)
6798  ||(v3->Typ()!=INT_CMD)||((v4!=NULL)&&(v4->Typ()!=INTVEC_CMD)))
6799  {
6800  WarnS("<module>,<module>,<int>[,<intvec>] expected!");
6801  return TRUE;
6802  }
6803 
6804  sleftv w1,w2;
6805  iiConvert(v1->Typ(),MODUL_CMD,i1,v1,&w1);
6806  iiConvert(v2->Typ(),MODUL_CMD,i2,v2,&w2);
6807  ideal P=(ideal)w1.Data();
6808  ideal Q=(ideal)w2.Data();
6809 
6810  int n=(int)(long)v3->Data();
6811  short *w=NULL;
6812  if(v4!=NULL)
6813  {
6814  w = iv2array((intvec *)v4->Data(),currRing);
6815  short * w0 = w + 1;
6816  int i = currRing->N;
6817  while( (i > 0) && ((*w0) > 0) )
6818  {
6819  w0++;
6820  i--;
6821  }
6822  if(i>0)
6823  WarnS("not all weights are positive!");
6824  }
6825 
6826  matrix T;
6827  ideal R;
6828  idLiftW(P,Q,n,T,R,w);
6829 
6830  w1.CleanUp();
6831  w2.CleanUp();
6832  if(w!=NULL)
6833  omFreeSize( (ADDRESS)w, (rVar(currRing)+1)*sizeof(short) );
6834 
6836  L->Init(2);
6837  L->m[1].rtyp=v1->Typ();
6838  if(v1->Typ()==POLY_CMD||v1->Typ()==VECTOR_CMD)
6839  {
6840  if(v1->Typ()==POLY_CMD)
6841  p_Shift(&R->m[0],-1,currRing);
6842  L->m[1].data=(void *)R->m[0];
6843  R->m[0]=NULL;
6844  idDelete(&R);
6845  }
6846  else if(v1->Typ()==IDEAL_CMD||v1->Typ()==MATRIX_CMD)
6847  L->m[1].data=(void *)id_Module2Matrix(R,currRing);
6848  else
6849  {
6850  L->m[1].rtyp=MODUL_CMD;
6851  L->m[1].data=(void *)R;
6852  }
6853  L->m[0].rtyp=MATRIX_CMD;
6854  L->m[0].data=(char *)T;
6855 
6856  res->data=L;
6857  res->rtyp=LIST_CMD;
6858 
6859  return FALSE;
6860 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
Definition: lists.h:22
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, short *w)
Definition: ideals.cc:1086
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
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:580
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
#define Q
Definition: sirandom.c:25
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:1458
int i
Definition: cfEzgcd.cc:123
matrix id_Module2Matrix(ideal mod, const ring R)
Definition: tok.h:99
leftv next
Definition: subexpr.h:88
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition: p_polys.cc:4515
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
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 1157 of file iparith.cc.

1158 {
1159  if (iiOp=='/') Warn("int division with `/`: use `div` instead in line >>%s<<",my_yylinebuf);
1160  int a= (int)(long)u->Data();
1161  int b= (int)(long)v->Data();
1162  if (b==0)
1163  {
1165  return TRUE;
1166  }
1167  int c=a%b;
1168  int r=0;
1169  switch (iiOp)
1170  {
1171  case '%':
1172  r=c; break;
1173  case '/':
1174  case INTDIV_CMD:
1175  r=((a-c) /b); break;
1176  }
1177  res->data=(void *)((long)r);
1178  return FALSE;
1179 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
char my_yylinebuf[80]
Definition: febase.cc:48
const ring r
Definition: syzextra.cc:208
Definition: tok.h:95
void * Data()
Definition: subexpr.cc:1121
#define ii_div_by_0
Definition: iparith.cc:225
int iiOp
Definition: iparith.cc:227
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 345 of file iparith.cc.

346 {
347  res->data=(char *)new intvec((int)(long)u->Data(),(int)(long)v->Data());
348  return FALSE;
349 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121

§ jjDUMMY()

static BOOLEAN jjDUMMY ( leftv  res,
leftv  u 
)
static

Definition at line 3669 of file iparith.cc.

3670 {
3671  res->data = (char *)u->CopyD();
3672  return FALSE;
3673 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjDUMP()

static BOOLEAN jjDUMP ( leftv  ,
leftv  v 
)
static

Definition at line 4123 of file iparith.cc.

4124 {
4125  si_link l = (si_link)v->Data();
4126  if (slDump(l))
4127  {
4128  const char *s;
4129  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
4130  else s=sNoName;
4131  Werror("cannot dump to `%s`",s);
4132  return TRUE;
4133  }
4134  else
4135  return FALSE;
4136 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
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 4137 of file iparith.cc.

4138 {
4139  res->data = (char *)pOne();
4140  int co=(int)(long)v->Data();
4141  if (co>0)
4142  {
4143  pSetComp((poly)res->data,co);
4144  pSetm((poly)res->data);
4145  }
4146  else WerrorS("argument of gen must be positive");
4147  return (co<=0);
4148 }
#define pSetm(p)
Definition: polys.h:253
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
#define pSetComp(p, v)
Definition: polys.h:38
#define pOne()
Definition: polys.h:298
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjELIMIN()

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

Definition at line 2093 of file iparith.cc.

2094 {
2095  res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data());
2096  //setFlag(res,FLAG_STD);
2097  return v->next!=NULL; //do not allow next like in eliminate(I,a(1..4))
2098 }
void * data
Definition: subexpr.h:90
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjELIMIN_HILB()

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

Definition at line 5851 of file iparith.cc.

5852 {
5853  res->data=(char *)idElimination((ideal)u->Data(),(poly)v->Data(),
5854  (intvec *)w->Data());
5855  //setFlag(res,FLAG_STD);
5856  return FALSE;
5857 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjELIMIN_IV()

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

Definition at line 2099 of file iparith.cc.

2100 {
2101  poly p=pOne();
2102  intvec *iv=(intvec*)v->Data();
2103  for(int i=iv->length()-1; i>=0; i--)
2104  {
2105  pSetExp(p,(*iv)[i],1);
2106  }
2107  pSetm(p);
2108  res->data=(char *)idElimination((ideal)u->Data(),p);
2109  pLmDelete(&p);
2110  //setFlag(res,FLAG_STD);
2111  return FALSE;
2112 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:97
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:90
ideal idElimination(ideal h1, poly delVar, intvec *hilb)
Definition: ideals.cc:1353
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:298
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjENVELOPE()

static BOOLEAN jjENVELOPE ( leftv  res,
leftv  a 
)
static

Definition at line 5175 of file iparith.cc.

5176 {
5177  ring r = (ring)a->Data();
5178  if (rIsPluralRing(r))
5179  {
5180  ring s = rEnvelope(r);
5181  res->data = s;
5182  }
5183  else res->data = rCopy(r);
5184  return FALSE;
5185 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
ring rEnvelope(ring R)
Definition: ring.cc:5513
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1619
void * Data()
Definition: subexpr.cc:1121

§ jjEQUAL_BI()

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

Definition at line 1311 of file iparith.cc.

1312 {
1313  res->data = (char *)((long)n_Equal((number)u->Data(),(number)v->Data(),coeffs_BIGINT));
1314  jjEQUAL_REST(res,u,v);
1315  return FALSE;
1316 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
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 1317 of file iparith.cc.

1318 {
1319  res->data = (char *)((int)((long)u->Data()) == (int)((long)v->Data()));
1320  jjEQUAL_REST(res,u,v);
1321  return FALSE;
1322 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjEQUAL_Ma()

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

Definition at line 1323 of file iparith.cc.

1324 {
1325  res->data = (char *)((long)mp_Equal((matrix)u->Data(),(matrix)v->Data(),currRing));
1326  jjEQUAL_REST(res,u,v);
1327  return FALSE;
1328 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121
BOOLEAN mp_Equal(matrix a, matrix b, const ring R)
Definition: matpol.cc:579

§ jjEQUAL_N()

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

Definition at line 1335 of file iparith.cc.

1336 {
1337  res->data = (char *)((long)nEqual((number)u->Data(),(number)v->Data()));
1338  jjEQUAL_REST(res,u,v);
1339  return FALSE;
1340 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
#define nEqual(n1, n2)
Definition: numbers.h:20
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjEQUAL_P()

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

Definition at line 1341 of file iparith.cc.

1342 {
1343  poly p=(poly)u->Data();
1344  poly q=(poly)v->Data();
1345  res->data = (char *) ((long)pEqualPolys(p,q));
1346  jjEQUAL_REST(res,u,v);
1347  return FALSE;
1348 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define pEqualPolys(p1, p2)
Definition: polys.h:384
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjEQUAL_R()

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

Definition at line 1329 of file iparith.cc.

1330 {
1331  res->data = (char *)(long)(u->Data()==v->Data());
1332  jjEQUAL_REST(res,u,v);
1333  return FALSE;
1334 }
static void jjEQUAL_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:1349
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjEQUAL_REST()

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

Definition at line 1349 of file iparith.cc.

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

§ jjERROR()

static BOOLEAN jjERROR ( leftv  ,
leftv  u 
)
static

Definition at line 2118 of file iparith.cc.

2119 {
2120  WerrorS((char *)u->Data());
2121  extern int inerror;
2122  inerror=3;
2123  return TRUE;
2124 }
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int inerror
Definition: grammar.cc:175
void * Data()
Definition: subexpr.cc:1121

§ jjEXECUTE()

static BOOLEAN jjEXECUTE ( leftv  ,
leftv  v 
)
static

Definition at line 4149 of file iparith.cc.

4150 {
4151  char * d = (char *)v->Data();
4152  char * s = (char *)omAlloc(strlen(d) + 13);
4153  strcpy( s, (char *)d);
4154  strcat( s, "\n;RETURN();\n");
4155  newBuffer(s,BT_execute);
4156  return yyparse();
4157 }
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:1121
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 2113 of file iparith.cc.

2114 {
2115  //Print("exportto %s -> %s\n",v->Name(),u->Name() );
2116  return iiExport(v,0,IDPACKAGE((idhdl)u->data));
2117 }
BOOLEAN iiExport(leftv v, int toLev)
Definition: ipshell.cc:1385
Definition: idrec.h:34
void * data
Definition: subexpr.h:90
#define IDPACKAGE(a)
Definition: ipid.h:136

§ jjEXTGCD_BI()

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

Definition at line 2125 of file iparith.cc.

2126 {
2127  number uu=(number)u->Data();number vv=(number)v->Data();
2129  number a,b;
2130  number p0=n_ExtGcd(uu,vv,&a,&b,coeffs_BIGINT);
2131  L->Init(3);
2132  L->m[0].rtyp=BIGINT_CMD; L->m[0].data=(void *)p0;
2133  L->m[1].rtyp=BIGINT_CMD; L->m[1].data=(void *)a;
2134  L->m[2].rtyp=BIGINT_CMD; L->m[2].data=(void *)b;
2135  res->rtyp=LIST_CMD;
2136  res->data=(char *)L;
2137  return FALSE;
2138 }
#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:97
Definition: tok.h:38
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:93
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
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 2139 of file iparith.cc.

2140 {
2141  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
2142  int p0=ABS(uu),p1=ABS(vv);
2143  int f0 = 1, f1 = 0, g0 = 0, g1 = 1, q, r;
2144 
2145  while ( p1!=0 )
2146  {
2147  q=p0 / p1;
2148  r=p0 % p1;
2149  p0 = p1; p1 = r;
2150  r = g0 - g1 * q;
2151  g0 = g1; g1 = r;
2152  r = f0 - f1 * q;
2153  f0 = f1; f1 = r;
2154  }
2155  int a = f0;
2156  int b = g0;
2157  if ( uu /*(int)(long)u->Data()*/ < 0 ) a=-a;
2158  if ( vv /*(int)(long)v->Data()*/ < 0 ) b=-b;
2160  L->Init(3);
2161  L->m[0].rtyp=INT_CMD; L->m[0].data=(void *)(long)p0;
2162  L->m[1].rtyp=INT_CMD; L->m[1].data=(void *)(long)a;
2163  L->m[2].rtyp=INT_CMD; L->m[2].data=(void *)(long)b;
2164  res->rtyp=LIST_CMD;
2165  res->data=(char *)L;
2166  return FALSE;
2167 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
const poly a
Definition: syzextra.cc:212
Definition: tok.h:94
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:114
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
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 2168 of file iparith.cc.

2169 {
2170  poly r,pa,pb;
2171  BOOLEAN ret=singclap_extgcd((poly)u->Data(),(poly)v->Data(),r,pa,pb,currRing);
2172  if (ret) return TRUE;
2174  L->Init(3);
2175  res->data=(char *)L;
2176  L->m[0].data=(void *)r;
2177  L->m[0].rtyp=POLY_CMD;
2178  L->m[1].data=(void *)pa;
2179  L->m[1].rtyp=POLY_CMD;
2180  L->m[2].data=(void *)pb;
2181  L->m[2].rtyp=POLY_CMD;
2182  return FALSE;
2183 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:93
BOOLEAN singclap_extgcd(poly f, poly g, poly &res, poly &pa, poly &pb, const ring r)
Definition: clapsing.cc:460
void * Data()
Definition: subexpr.cc:1121
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ jjFAC_P()

static BOOLEAN jjFAC_P ( leftv  res,
leftv  u 
)
static

Definition at line 4198 of file iparith.cc.

4199 {
4200  intvec *v=NULL;
4202  ideal f=singclap_factorize((poly)(u->CopyD()), &v, 0,currRing);
4203  if (f==NULL) return TRUE;
4204  ivTest(v);
4206  l->Init(2);
4207  l->m[0].rtyp=IDEAL_CMD;
4208  l->m[0].data=(void *)f;
4209  l->m[1].rtyp=INTVEC_CMD;
4210  l->m[1].data=(void *)v;
4211  res->data=(void *)l;
4212  return FALSE;
4213 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:90
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:7
Definition: tok.h:99
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:3381
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:93
omBin slists_bin
Definition: lists.cc:23
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:784
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94

§ jjFAC_P2()

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

Definition at line 2185 of file iparith.cc.

2186 {
2187  intvec *v=NULL;
2188  int sw=(int)(long)dummy->Data();
2189  int fac_sw=sw;
2190  if ((sw<0)||(sw>2)) fac_sw=1;
2192  ideal f=singclap_factorize((poly)(u->CopyD()), &v, fac_sw,currRing);
2193  if (f==NULL)
2194  return TRUE;
2195  switch(sw)
2196  {
2197  case 0:
2198  case 2:
2199  {
2201  l->Init(2);
2202  l->m[0].rtyp=IDEAL_CMD;
2203  l->m[0].data=(void *)f;
2204  l->m[1].rtyp=INTVEC_CMD;
2205  l->m[1].data=(void *)v;
2206  res->data=(void *)l;
2207  res->rtyp=LIST_CMD;
2208  return FALSE;
2209  }
2210  case 1:
2211  res->data=(void *)f;
2212  return FALSE;
2213  case 3:
2214  {
2215  poly p=f->m[0];
2216  int i=IDELEMS(f);
2217  f->m[0]=NULL;
2218  while(i>1)
2219  {
2220  i--;
2221  p=pMult(p,f->m[i]);
2222  f->m[i]=NULL;
2223  }
2224  res->data=(void *)p;
2225  res->rtyp=POLY_CMD;
2226  }
2227  return FALSE;
2228  }
2229  WerrorS("invalid switch");
2230  return TRUE;
2231 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:7
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
#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:3381
#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:93
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
omBin slists_bin
Definition: lists.cc:23
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:784
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94

§ jjFACSTD()

static BOOLEAN jjFACSTD ( leftv  res,
leftv  v 
)
static

Definition at line 4158 of file iparith.cc.

4159 {
4161  if (currRing->cf->convSingNFactoryN!=NULL) /* conversion to factory*/
4162  {
4163  ideal_list p,h;
4164  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL);
4165  if (h==NULL)
4166  {
4167  L->Init(1);
4168  L->m[0].data=(char *)idInit(1);
4169  L->m[0].rtyp=IDEAL_CMD;
4170  }
4171  else
4172  {
4173  p=h;
4174  int l=0;
4175  while (p!=NULL) { p=p->next;l++; }
4176  L->Init(l);
4177  l=0;
4178  while(h!=NULL)
4179  {
4180  L->m[l].data=(char *)h->d;
4181  L->m[l].rtyp=IDEAL_CMD;
4182  p=h->next;
4183  omFreeSize(h,sizeof(*h));
4184  h=p;
4185  l++;
4186  }
4187  }
4188  }
4189  else
4190  {
4191  WarnS("no factorization implemented");
4192  L->Init(1);
4193  iiExprArith1(&(L->m[0]),v,STD_CMD);
4194  }
4195  res->data=(void *)L;
4196  return FALSE;
4197 }
#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:8422
#define FALSE
Definition: auxiliary.h:97
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:90
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:93
void * Data()
Definition: subexpr.cc:1121
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 2232 of file iparith.cc.

2233 {
2234  ideal_list p,h;
2235  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL,(ideal)w->Data());
2236  p=h;
2237  int l=0;
2238  while (p!=NULL) { p=p->next;l++; }
2240  L->Init(l);
2241  l=0;
2242  while(h!=NULL)
2243  {
2244  L->m[l].data=(char *)h->d;
2245  L->m[l].rtyp=IDEAL_CMD;
2246  p=h->next;
2247  omFreeSize(h,sizeof(*h));
2248  h=p;
2249  l++;
2250  }
2251  res->data=(void *)L;
2252  return FALSE;
2253 }
#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:97
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * data
Definition: subexpr.h:90
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:93
void * Data()
Definition: subexpr.cc:1121
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 7731 of file iparith.cc.

7732 {
7733  /* compute two factors of h(x,y) modulo x^(d+1) in K[[x]][y],
7734  see a detailed documentation in /kernel/linear_algebra/linearAlgebra.h
7735 
7736  valid argument lists:
7737  - (poly h, int d),
7738  - (poly h, int d, poly f0, poly g0), optional: factors of h(0,y),
7739  - (poly h, int d, int xIndex, int yIndex), optional: indices of vars x & y
7740  in list of ring vars,
7741  - (poly h, int d, poly f0, poly g0, int xIndex, int yIndec),
7742  optional: all 4 optional args
7743  (The defaults are xIndex = 1, yIndex = 2, f0 and g0 polynomials as found
7744  by singclap_factorize and h(0, y)
7745  has exactly two distinct monic factors [possibly with exponent > 1].)
7746  result:
7747  - list with the two factors f and g such that
7748  h(x,y) = f(x,y)*g(x,y) mod x^(d+1) */
7749 
7750  poly h = NULL;
7751  int d = 1;
7752  poly f0 = NULL;
7753  poly g0 = NULL;
7754  int xIndex = 1; /* default index if none provided */
7755  int yIndex = 2; /* default index if none provided */
7756 
7757  leftv u = v; int factorsGiven = 0;
7758  if ((u == NULL) || (u->Typ() != POLY_CMD))
7759  {
7760  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7761  return TRUE;
7762  }
7763  else h = (poly)u->Data();
7764  u = u->next;
7765  if ((u == NULL) || (u->Typ() != INT_CMD))
7766  {
7767  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7768  return TRUE;
7769  }
7770  else d = (int)(long)u->Data();
7771  u = u->next;
7772  if ((u != NULL) && (u->Typ() == POLY_CMD))
7773  {
7774  if ((u->next == NULL) || (u->next->Typ() != POLY_CMD))
7775  {
7776  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7777  return TRUE;
7778  }
7779  else
7780  {
7781  f0 = (poly)u->Data();
7782  g0 = (poly)u->next->Data();
7783  factorsGiven = 1;
7784  u = u->next->next;
7785  }
7786  }
7787  if ((u != NULL) && (u->Typ() == INT_CMD))
7788  {
7789  if ((u->next == NULL) || (u->next->Typ() != INT_CMD))
7790  {
7791  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7792  return TRUE;
7793  }
7794  else
7795  {
7796  xIndex = (int)(long)u->Data();
7797  yIndex = (int)(long)u->next->Data();
7798  u = u->next->next;
7799  }
7800  }
7801  if (u != NULL)
7802  {
7803  WerrorS("expected arguments (poly, int [, poly, poly] [, int, int])");
7804  return TRUE;
7805  }
7806 
7807  /* checks for provided arguments */
7808  if (pIsConstant(h) || (factorsGiven && (pIsConstant(f0) || pIsConstant(g0))))
7809  {
7810  WerrorS("expected non-constant polynomial argument(s)");
7811  return TRUE;
7812  }
7813  int n = rVar(currRing);
7814  if ((xIndex < 1) || (n < xIndex))
7815  {
7816  Werror("index for variable x (%d) out of range [1..%d]", xIndex, n);
7817  return TRUE;
7818  }
7819  if ((yIndex < 1) || (n < yIndex))
7820  {
7821  Werror("index for variable y (%d) out of range [1..%d]", yIndex, n);
7822  return TRUE;
7823  }
7824  if (xIndex == yIndex)
7825  {
7826  WerrorS("expected distinct indices for variables x and y");
7827  return TRUE;
7828  }
7829 
7830  /* computation of f0 and g0 if missing */
7831  if (factorsGiven == 0)
7832  {
7833  poly h0 = pSubst(pCopy(h), xIndex, NULL);
7834  intvec* v = NULL;
7835  ideal i = singclap_factorize(h0, &v, 0,currRing);
7836 
7837  ivTest(v);
7838 
7839  if (i == NULL) return TRUE;
7840 
7841  idTest(i);
7842 
7843  if ((v->rows() != 3) || ((*v)[0] =! 1) || (!nIsOne(pGetCoeff(i->m[0]))))
7844  {
7845  WerrorS("expected h(0,y) to have exactly two distinct monic factors");
7846  return TRUE;
7847  }
7848  f0 = pPower(pCopy(i->m[1]), (*v)[1]);
7849  g0 = pPower(pCopy(i->m[2]), (*v)[2]);
7850  idDelete(&i);
7851  }
7852 
7853  poly f; poly g;
7854  henselFactors(xIndex, yIndex, h, f0, g0, d, f, g);
7856  L->Init(2);
7857  L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f;
7858  L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g;
7859  res->rtyp = LIST_CMD;
7860  res->data = (char*)L;
7861  return FALSE;
7862 }
#define pSubst(p, n, e)
Definition: polys.h:349
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
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:97
int rows() const
Definition: intvec.h:88
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
#define TRUE
Definition: auxiliary.h:101
#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:979
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:90
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:7
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
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:93
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
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:784
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:49

§ jjFAREY_BI()

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

Definition at line 2254 of file iparith.cc.

2255 {
2256  if (rField_is_Q(currRing))
2257  {
2258  number uu=(number)u->Data();
2259  number vv=(number)v->Data();
2260  res->data=(char *)n_Farey(uu,vv,currRing->cf);
2261  return FALSE;
2262  }
2263  else return TRUE;
2264 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121

§ jjFAREY_ID()

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

Definition at line 2265 of file iparith.cc.

2266 {
2267  ideal uu=(ideal)u->Data();
2268  number vv=(number)v->Data();
2269  res->data=(void*)id_Farey(uu,vv,currRing);
2270  res->rtyp=u->Typ();
2271  return FALSE;
2272 }
#define FALSE
Definition: auxiliary.h:97
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:2455
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121

§ jjFETCH()

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

Definition at line 2273 of file iparith.cc.

2274 {
2275  ring r=(ring)u->Data();
2276  idhdl w;
2277  int op=iiOp;
2278  nMapFunc nMap;
2279 
2280  if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
2281  {
2282  int *perm=NULL;
2283  int *par_perm=NULL;
2284  int par_perm_size=0;
2285  BOOLEAN bo;
2286  if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
2287  {
2288  // Allow imap/fetch to be make an exception only for:
2289  if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2292  ||
2293  (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp
2294  (rField_is_Zp(currRing, r->cf->ch) ||
2295  rField_is_Zp_a(currRing, r->cf->ch))) )
2296  {
2297  par_perm_size=rPar(r);
2298  }
2299  else
2300  {
2301  goto err_fetch;
2302  }
2303  }
2304  if ((iiOp!=FETCH_CMD) || (r->N!=currRing->N) || (rPar(r)!=rPar(currRing)))
2305  {
2306  perm=(int *)omAlloc0((r->N+1)*sizeof(int));
2307  if (par_perm_size!=0)
2308  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2309  op=IMAP_CMD;
2310  if (iiOp==IMAP_CMD)
2311  {
2312  int r_par=0;
2313  char ** r_par_names=NULL;
2314  if (r->cf->extRing!=NULL)
2315  {
2316  r_par=r->cf->extRing->N;
2317  r_par_names=r->cf->extRing->names;
2318  }
2319  int c_par=0;
2320  char ** c_par_names=NULL;
2321  if (currRing->cf->extRing!=NULL)
2322  {
2323  c_par=currRing->cf->extRing->N;
2324  c_par_names=currRing->cf->extRing->names;
2325  }
2326  maFindPerm(r->names, r->N, r_par_names, r_par,
2327  currRing->names,currRing->N,c_par_names, c_par,
2328  perm,par_perm, currRing->cf->type);
2329  }
2330  else
2331  {
2332  int i;
2333  if (par_perm_size!=0)
2334  for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2335  for(i=si_min(r->N,currRing->N);i>0;i--) perm[i]=i;
2336  }
2337  }
2338  if ((iiOp==FETCH_CMD) &&(BVERBOSE(V_IMAP)))
2339  {
2340  int i;
2341  for(i=0;i<si_min(r->N,currRing->N);i++)
2342  {
2343  Print("// var nr %d: %s -> %s\n",i,r->names[i],currRing->names[i]);
2344  }
2345  for(i=0;i<si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
2346  {
2347  Print("// par nr %d: %s -> %s\n",
2348  i,rParameter(r)[i],rParameter(currRing)[i]);
2349  }
2350  }
2351  if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
2352  sleftv tmpW;
2353  memset(&tmpW,0,sizeof(sleftv));
2354  tmpW.rtyp=IDTYP(w);
2355  tmpW.data=IDDATA(w);
2356  if ((bo=maApplyFetch(op,NULL,res,&tmpW, r,
2357  perm,par_perm,par_perm_size,nMap)))
2358  {
2359  Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
2360  }
2361  if (perm!=NULL)
2362  omFreeSize((ADDRESS)perm,(r->N+1)*sizeof(int));
2363  if (par_perm!=NULL)
2364  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2365  return bo;
2366  }
2367  else
2368  {
2369  Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
2370  }
2371  return TRUE;
2372 err_fetch:
2373  Werror("no identity map from %s (%s -> %s)",u->Fullname(),
2374  nCoeffString(r->cf),
2375  nCoeffString(currRing->cf));
2376  return TRUE;
2377 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:518
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:528
#define TRUE
Definition: auxiliary.h:101
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:118
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:613
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:127
idhdl get(const char *s, int lev)
Definition: ipid.cc:91
void * data
Definition: subexpr.h:90
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:8952
const ring r
Definition: syzextra.cc:208
const char * name
Definition: subexpr.h:89
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:93
void * Data()
Definition: subexpr.cc:1121
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:973
#define IDDATA(a)
Definition: ipid.h:123
int iiOp
Definition: iparith.cc:227
int perm[100]
int BOOLEAN
Definition: auxiliary.h:88
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 6979 of file iparith.cc.

6980 {
6981  ring r=(ring)u->Data();
6982  leftv v=u->next;
6983  leftv perm_var_l=v->next;
6984  leftv perm_par_l=v->next->next;
6985  if ((perm_var_l->Typ()!=INTVEC_CMD)
6986  ||((perm_par_l!=NULL)&&(perm_par_l->Typ()!=INTVEC_CMD))
6987  ||(u->Typ()!=RING_CMD))
6988  {
6989  WerrorS("fetch(<ring>,<name>[,<intvec>[,<intvec>])");
6990  return TRUE;
6991  }
6992  intvec *perm_var_v=(intvec*)perm_var_l->Data();
6993  intvec *perm_par_v=NULL;
6994  if (perm_par_l!=NULL)
6995  perm_par_v=(intvec*)perm_par_l->Data();
6996  idhdl w;
6997  nMapFunc nMap;
6998 
6999  if ((w=r->idroot->get(v->Name(),myynest))!=NULL)
7000  {
7001  int *perm=NULL;
7002  int *par_perm=NULL;
7003  int par_perm_size=0;
7004  BOOLEAN bo;
7005  if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
7006  {
7007  // Allow imap/fetch to be make an exception only for:
7008  if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
7011  ||
7012  (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp
7013  (rField_is_Zp(currRing, r->cf->ch) ||
7014  rField_is_Zp_a(currRing, r->cf->ch))) )
7015  {
7016  par_perm_size=rPar(r);
7017  }
7018  else
7019  {
7020  goto err_fetch;
7021  }
7022  }
7023  else
7024  par_perm_size=rPar(r);
7025  perm=(int *)omAlloc0((rVar(r)+1)*sizeof(int));
7026  if (par_perm_size!=0)
7027  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
7028  int i;
7029  if (perm_par_l==NULL)
7030  {
7031  if (par_perm_size!=0)
7032  for(i=si_min(rPar(r),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
7033  }
7034  else
7035  {
7036  if (par_perm_size==0) WarnS("source ring has no parameters");
7037  else
7038  {
7039  for(i=rPar(r)-1;i>=0;i--)
7040  {
7041  if (i<perm_par_v->length()) par_perm[i]=(*perm_par_v)[i];
7042  if ((par_perm[i]<-rPar(currRing))
7043  || (par_perm[i]>rVar(currRing)))
7044  {
7045  Warn("invalid entry for par %d: %d\n",i,par_perm[i]);
7046  par_perm[i]=0;
7047  }
7048  }
7049  }
7050  }
7051  for(i=rVar(r)-1;i>=0;i--)
7052  {
7053  if (i<perm_var_v->length()) perm[i+1]=(*perm_var_v)[i];
7054  if ((perm[i]<-rPar(currRing))
7055  || (perm[i]>rVar(currRing)))
7056  {
7057  Warn("invalid entry for var %d: %d\n",i,perm[i]);
7058  perm[i]=0;
7059  }
7060  }
7061  if (BVERBOSE(V_IMAP))
7062  {
7063  for(i=1;i<=si_min(rVar(r),rVar(currRing));i++)
7064  {
7065  if (perm[i]>0)
7066  Print("// var nr %d: %s -> var %s\n",i,r->names[i-1],currRing->names[perm[i]-1]);
7067  else if (perm[i]<0)
7068  Print("// var nr %d: %s -> par %s\n",i,r->names[i-1],rParameter(currRing)[-perm[i]-1]);
7069  }
7070  for(i=1;i<=si_min(rPar(r),rPar(currRing));i++) // possibly empty loop
7071  {
7072  if (par_perm[i-1]<0)
7073  Print("// par nr %d: %s -> par %s\n",
7074  i,rParameter(r)[i-1],rParameter(currRing)[-par_perm[i-1]-1]);
7075  else if (par_perm[i-1]>0)
7076  Print("// par nr %d: %s -> var %s\n",
7077  i,rParameter(r)[i-1],currRing->names[par_perm[i-1]-1]);
7078  }
7079  }
7080  if (IDTYP(w)==ALIAS_CMD) w=(idhdl)IDDATA(w);
7081  sleftv tmpW;
7082  memset(&tmpW,0,sizeof(sleftv));
7083  tmpW.rtyp=IDTYP(w);
7084  tmpW.data=IDDATA(w);
7085  if ((bo=maApplyFetch(IMAP_CMD,NULL,res,&tmpW, r,
7086  perm,par_perm,par_perm_size,nMap)))
7087  {
7088  Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ);
7089  }
7090  if (perm!=NULL)
7091  omFreeSize((ADDRESS)perm,(rVar(r)+1)*sizeof(int));
7092  if (par_perm!=NULL)
7093  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
7094  return bo;
7095  }
7096  else
7097  {
7098  Werror("identifier %s not found in %s",v->Fullname(),u->Fullname());
7099  }
7100  return TRUE;
7101 err_fetch:
7102  Werror("no identity map from %s (%s -> %s)",u->Fullname(),
7103  nCoeffString(r->cf),
7104  nCoeffString(currRing->cf));
7105  return TRUE;
7106 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:518
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:528
#define TRUE
Definition: auxiliary.h:101
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:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:613
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
const char * Fullname()
Definition: subexpr.h:127
idhdl get(const char *s, int lev)
Definition: ipid.cc:91
void * data
Definition: subexpr.h:90
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:8952
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
const char * name
Definition: subexpr.h:89
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
Definition: tok.h:99
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:88
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:93
void * Data()
Definition: subexpr.cc:1121
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:973
#define IDDATA(a)
Definition: ipid.h:123
int perm[100]
int BOOLEAN
Definition: auxiliary.h:88
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 2378 of file iparith.cc.

2379 {
2380  /*4
2381  * look for the substring what in the string where
2382  * return the position of the first char of what in where
2383  * or 0
2384  */
2385  char *where=(char *)u->Data();
2386  char *what=(char *)v->Data();
2387  char *found = strstr(where,what);
2388  if (found != NULL)
2389  {
2390  res->data=(char *)((found-where)+1);
2391  }
2392  /*else res->data=NULL;*/
2393  return FALSE;
2394 }
#define FALSE
Definition: auxiliary.h:97
bool found
Definition: facFactorize.cc:56
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjFIND3()

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

Definition at line 5858 of file iparith.cc.

5859 {
5860  /*4
5861  * look for the substring what in the string where
5862  * starting at position n
5863  * return the position of the first char of what in where
5864  * or 0
5865  */
5866  int n=(int)(long)w->Data();
5867  char *where=(char *)u->Data();
5868  char *what=(char *)v->Data();
5869  char *found;
5870  if ((1>n)||(n>(int)strlen(where)))
5871  {
5872  Werror("start position %d out of range",n);
5873  return TRUE;
5874  }
5875  found = strchr(where+n-1,*what);
5876  if (*(what+1)!='\0')
5877  {
5878  while((found !=NULL) && (strncmp(found+1,what+1,strlen(what+1))!=0))
5879  {
5880  found=strchr(found+1,*what);
5881  }
5882  }
5883  if (found != NULL)
5884  {
5885  res->data=(char *)((found-where)+1);
5886  }
5887  return FALSE;
5888 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
bool found
Definition: facFactorize.cc:56
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjFWALK()

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

Definition at line 2395 of file iparith.cc.

2396 {
2397  res->data=(char *)fractalWalkProc(u,v);
2398  setFlag( res, FLAG_STD );
2399  return FALSE;
2400 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#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 5889 of file iparith.cc.

5890 {
5891  if ((int)(long)w->Data()==0)
5892  res->data=(char *)walkProc(u,v);
5893  else
5894  res->data=(char *)fractalWalkProc(u,v);
5895  setFlag( res, FLAG_STD );
5896  return FALSE;
5897 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#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:1121

§ jjGCD_BI()

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

Definition at line 2415 of file iparith.cc.

2416 {
2417  number n1 = (number) u->Data();
2418  number n2 = (number) v->Data();
2419  res->data = n_Gcd(n1,n2,coeffs_BIGINT);
2420  return FALSE;
2421 }
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:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjGCD_I()

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

Definition at line 2401 of file iparith.cc.

2402 {
2403  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
2404  int p0=ABS(uu),p1=ABS(vv);
2405  int r;
2406  while ( p1!=0 )
2407  {
2408  r=p0 % p1;
2409  p0 = p1; p1 = r;
2410  }
2411  res->rtyp=INT_CMD;
2412  res->data=(char *)(long)p0;
2413  return FALSE;
2414 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
#define ABS(x)
Definition: auxiliary.h:114
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121

§ jjGCD_N()

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

Definition at line 2422 of file iparith.cc.

2423 {
2424  number a=(number) u->Data();
2425  number b=(number) v->Data();
2426  if (nIsZero(a))
2427  {
2428  if (nIsZero(b)) res->data=(char *)nInit(1);
2429  else res->data=(char *)nCopy(b);
2430  }
2431  else
2432  {
2433  if (nIsZero(b)) res->data=(char *)nCopy(a);
2434  //else res->data=(char *)n_Gcd(a, b, currRing->cf);
2435  else res->data=(char *)n_SubringGcd(a, b, currRing->cf);
2436  }
2437  return FALSE;
2438 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121
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 2439 of file iparith.cc.

2440 {
2441  res->data=(void *)singclap_gcd((poly)(u->CopyD(POLY_CMD)),
2442  (poly)(v->CopyD(POLY_CMD)),currRing);
2443  return FALSE;
2444 }
#define FALSE
Definition: auxiliary.h:97
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
Definition: clapsing.cc:287
void * data
Definition: subexpr.h:90
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:679

§ jjGE_BI()

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

Definition at line 1096 of file iparith.cc.

1097 {
1098  number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
1099  res->data = (char *) (n_GreaterZero(h,coeffs_BIGINT)||(n_IsZero(h,coeffs_BIGINT)));
1100  n_Delete(&h,coeffs_BIGINT);
1101  return FALSE;
1102 }
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:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121
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 1103 of file iparith.cc.

1104 {
1105  res->data = (char *)(long)((int)((long)u->Data()) >= (int)((long)v->Data()));
1106  return FALSE;
1107 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjGE_N()

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

Definition at line 1108 of file iparith.cc.

1109 {
1110  res->data = (char *)(long) (nGreater((number)u->Data(),(number)v->Data())
1111  || nEqual((number)u->Data(),(number)v->Data()));
1112  return FALSE;
1113 }
return
Definition: syzextra.cc:280
#define FALSE
Definition: auxiliary.h:97
#define nEqual(n1, n2)
Definition: numbers.h:20
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
#define nGreater(a, b)
Definition: numbers.h:28

§ jjGETDUMP()

static BOOLEAN jjGETDUMP ( leftv  ,
leftv  v 
)
static

Definition at line 4214 of file iparith.cc.

4215 {
4216  si_link l = (si_link)v->Data();
4217  if (slGetDump(l))
4218  {
4219  const char *s;
4220  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
4221  else s=sNoName;
4222  Werror("cannot get dump from `%s`",s);
4223  return TRUE;
4224  }
4225  else
4226  return FALSE;
4227 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
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 1114 of file iparith.cc.

1115 {
1116  number h=n_Sub((number)u->Data(),(number)v->Data(),coeffs_BIGINT);
1117  res->data = (char *)(long) (n_GreaterZero(h,coeffs_BIGINT)&&(!n_IsZero(h,coeffs_BIGINT)));
1118  n_Delete(&h,coeffs_BIGINT);
1119  return FALSE;
1120 }
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:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121
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 1121 of file iparith.cc.

1122 {
1123  res->data = (char *)(long)((int)((long)u->Data()) > (int)((long)v->Data()));
1124  return FALSE;
1125 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjGT_N()

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

Definition at line 1126 of file iparith.cc.

1127 {
1128  res->data = (char *)(long)(nGreater((number)u->Data(),(number)v->Data()));
1129  return FALSE;
1130 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
#define nGreater(a, b)
Definition: numbers.h:28

§ jjHIGHCORNER()

static BOOLEAN jjHIGHCORNER ( leftv  res,
leftv  v 
)
static

Definition at line 4228 of file iparith.cc.

4229 {
4230  assumeStdFlag(v);
4231  ideal I=(ideal)v->Data();
4232  res->data=(void *)iiHighCorner(I,0);
4233  return FALSE;
4234 }
#define FALSE
Definition: auxiliary.h:97
poly iiHighCorner(ideal I, int ak)
Definition: ipshell.cc:1485
void * data
Definition: subexpr.h:90
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void * Data()
Definition: subexpr.cc:1121

§ jjHIGHCORNER_M()

static BOOLEAN jjHIGHCORNER_M ( leftv  res,
leftv  v 
)
static

Definition at line 4235 of file iparith.cc.

4236 {
4237  assumeStdFlag(v);
4238  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4239  BOOLEAN delete_w=FALSE;
4240  ideal I=(ideal)v->Data();
4241  int i;
4242  poly p=NULL,po=NULL;
4243  int rk=id_RankFreeModule(I,currRing);
4244  if (w==NULL)
4245  {
4246  w = new intvec(rk);
4247  delete_w=TRUE;
4248  }
4249  for(i=rk;i>0;i--)
4250  {
4251  p=iiHighCorner(I,i);
4252  if (p==NULL)
4253  {
4254  WerrorS("module must be zero-dimensional");
4255  if (delete_w) delete w;
4256  return TRUE;
4257  }
4258  if (po==NULL)
4259  {
4260  po=p;
4261  }
4262  else
4263  {
4264  // now po!=NULL, p!=NULL
4265  int d=(currRing->pFDeg(po,currRing)-(*w)[pGetComp(po)-1] - currRing->pFDeg(p,currRing)+(*w)[i-1]);
4266  if (d==0)
4267  d=pLmCmp(po,p);
4268  if (d > 0)
4269  {
4270  pDelete(&p);
4271  }
4272  else // (d < 0)
4273  {
4274  pDelete(&po); po=p;
4275  }
4276  }
4277  }
4278  if (delete_w) delete w;
4279  res->data=(void *)po;
4280  return FALSE;
4281 }
#define FALSE
Definition: auxiliary.h:97
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:101
poly iiHighCorner(ideal I, int ak)
Definition: ipshell.cc:1485
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:90
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:1458
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pDelete(p_ptr)
Definition: polys.h:169
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ jjHILBERT()

static BOOLEAN jjHILBERT ( leftv  ,
leftv  v 
)
static

Definition at line 4282 of file iparith.cc.

4283 {
4285  {
4286  ring origR = currRing;
4287  ring tempR = rCopy(origR);
4288  coeffs new_cf=nInitChar(n_Q,NULL);
4289  nKillChar(tempR->cf);
4290  tempR->cf=new_cf;
4291  rComplete(tempR);
4292  ideal vid = (ideal)v->Data();
4293  rChangeCurrRing(tempR);
4294  ideal vv = idrCopyR(vid, origR, currRing);
4295  sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
4296  vvAsLeftv.rtyp = IDEAL_CMD;
4297  vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
4298  if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
4299  assumeStdFlag(&vvAsLeftv);
4300  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4301  PrintS("// performed for generic fibre, that is, over Q\n");
4302  intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
4303  //scHilbertPoly(vv,currRing->qideal);
4304  hLookSeries(vv,module_w,currRing->qideal);
4305  idDelete(&vv);
4306  rChangeCurrRing(origR);
4307  rDelete(tempR);
4308  return FALSE;
4309  }
4310  assumeStdFlag(v);
4311  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4312  //scHilbertPoly((ideal)v->Data(),currRing->qideal);
4313  hLookSeries((ideal)v->Data(),module_w,currRing->qideal);
4314  return FALSE;
4315 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
rational (GMP) numbers
Definition: coeffs.h:31
void * data
Definition: subexpr.h:90
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 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:3435
The main handler for Singular numbers which are suitable for Singular polynomials.
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: tok.h:99
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:88
void rChangeCurrRing(ring r)
Definition: polys.cc:12
ring rCopy(ring r)
Definition: ring.cc:1619
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1377
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329

§ jjHILBERT2()

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

Definition at line 2445 of file iparith.cc.

2446 {
2447 #ifdef HAVE_RINGS
2449  {
2450  ring origR = currRing;
2451  ring tempR = rCopy(origR);
2452  coeffs new_cf=nInitChar(n_Q,NULL);
2453  nKillChar(tempR->cf);
2454  tempR->cf=new_cf;
2455  rComplete(tempR);
2456  ideal uid = (ideal)u->Data();
2457  rChangeCurrRing(tempR);
2458  ideal uu = idrCopyR(uid, origR, currRing);
2459  sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
2460  uuAsLeftv.rtyp = IDEAL_CMD;
2461  uuAsLeftv.data = uu; uuAsLeftv.next = NULL;
2462  if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
2463  assumeStdFlag(&uuAsLeftv);
2464  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
2465  PrintS("// performed for generic fibre, that is, over Q\n");
2466  intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
2467  intvec *iv=hFirstSeries(uu,module_w,currRing->qideal);
2468  int returnWithTrue = 1;
2469  switch((int)(long)v->Data())
2470  {
2471  case 1:
2472  res->data=(void *)iv;
2473  returnWithTrue = 0;
2474  case 2:
2475  res->data=(void *)hSecondSeries(iv);
2476  delete iv;
2477  returnWithTrue = 0;
2478  }
2479  if (returnWithTrue)
2480  {
2482  delete iv;
2483  }
2484  idDelete(&uu);
2485  rChangeCurrRing(origR);
2486  rDelete(tempR);
2487  if (returnWithTrue) return TRUE; else return FALSE;
2488  }
2489 #endif
2490  assumeStdFlag(u);
2491  intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
2492  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal);
2493  switch((int)(long)v->Data())
2494  {
2495  case 1:
2496  res->data=(void *)iv;
2497  return FALSE;
2498  case 2:
2499  res->data=(void *)hSecondSeries(iv);
2500  delete iv;
2501  return FALSE;
2502  }
2503  delete iv;
2505  return TRUE;
2506 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
rational (GMP) numbers
Definition: coeffs.h:31
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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 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:3435
The main handler for Singular numbers which are suitable for Singular polynomials.
const char feNotImplemented[]
Definition: reporter.cc:54
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: tok.h:99
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:88
void rChangeCurrRing(ring r)
Definition: polys.cc:12
ring rCopy(ring r)
Definition: ring.cc:1619
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1306
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1298
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329

§ jjHILBERT3()

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

Definition at line 5898 of file iparith.cc.

5899 {
5900  intvec *wdegree=(intvec*)w->Data();
5901  if (wdegree->length()!=currRing->N)
5902  {
5903  Werror("weight vector must have size %d, not %d",
5904  currRing->N,wdegree->length());
5905  return TRUE;
5906  }
5908  {
5909  ring origR = currRing;
5910  ring tempR = rCopy(origR);
5911  coeffs new_cf=nInitChar(n_Q,NULL);
5912  nKillChar(tempR->cf);
5913  tempR->cf=new_cf;
5914  rComplete(tempR);
5915  ideal uid = (ideal)u->Data();
5916  rChangeCurrRing(tempR);
5917  ideal uu = idrCopyR(uid, origR, currRing);
5918  sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
5919  uuAsLeftv.rtyp = IDEAL_CMD;
5920  uuAsLeftv.data = uu; uuAsLeftv.next = NULL;
5921  if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
5922  assumeStdFlag(&uuAsLeftv);
5923  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
5924  PrintS("// performed for generic fibre, that is, over Q\n");
5925  intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
5926  intvec *iv=hFirstSeries(uu,module_w,currRing->qideal,wdegree);
5927  int returnWithTrue = 1;
5928  switch((int)(long)v->Data())
5929  {
5930  case 1:
5931  res->data=(void *)iv;
5932  returnWithTrue = 0;
5933  case 2:
5934  res->data=(void *)hSecondSeries(iv);
5935  delete iv;
5936  returnWithTrue = 0;
5937  }
5938  if (returnWithTrue)
5939  {
5941  delete iv;
5942  }
5943  idDelete(&uu);
5944  rChangeCurrRing(origR);
5945  rDelete(tempR);
5946  if (returnWithTrue) return TRUE; else return FALSE;
5947  }
5948  assumeStdFlag(u);
5949  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
5950  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal,wdegree);
5951  switch((int)(long)v->Data())
5952  {
5953  case 1:
5954  res->data=(void *)iv;
5955  return FALSE;
5956  case 2:
5957  res->data=(void *)hSecondSeries(iv);
5958  delete iv;
5959  return FALSE;
5960  }
5962  delete iv;
5963  return TRUE;
5964 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
rational (GMP) numbers
Definition: coeffs.h:31
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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 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:3435
The main handler for Singular numbers which are suitable for Singular polynomials.
const char feNotImplemented[]
Definition: reporter.cc:54
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: tok.h:99
#define FLAG_STD
Definition: ipid.h:106
leftv next
Definition: subexpr.h:88
void rChangeCurrRing(ring r)
Definition: polys.cc:12
ring rCopy(ring r)
Definition: ring.cc:1619
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
intvec * hSecondSeries(intvec *hseries1)
Definition: hilb.cc:1306
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
Definition: hilb.cc:1298
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
void Werror(const char *fmt,...)
Definition: reporter.cc:189
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329

§ jjHILBERT_IV()

static BOOLEAN jjHILBERT_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4316 of file iparith.cc.

4317 {
4319  {
4320  PrintS("// NOTE: computation of Hilbert series etc. is being\n");
4321  PrintS("// performed for generic fibre, that is, over Q\n");
4322  }
4323  res->data=(void *)hSecondSeries((intvec *)v->Data());
4324  return FALSE;
4325 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1306
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
void * Data()
Definition: subexpr.cc:1121

§ jjHOMOG1()

static BOOLEAN jjHOMOG1 ( leftv  res,
leftv  v 
)
static

Definition at line 4326 of file iparith.cc.

4327 {
4328  intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4329  ideal v_id=(ideal)v->Data();
4330  if (w==NULL)
4331  {
4332  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
4333  if (res->data!=NULL)
4334  {
4335  if (v->rtyp==IDHDL)
4336  {
4337  char *s_isHomog=omStrDup("isHomog");
4338  if (v->e==NULL)
4339  atSet((idhdl)(v->data),s_isHomog,w,INTVEC_CMD);
4340  else
4341  atSet((idhdl)(v->LData()),s_isHomog,w,INTVEC_CMD);
4342  }
4343  else if (w!=NULL) delete w;
4344  } // if res->data==NULL then w==NULL
4345  }
4346  else
4347  {
4348  res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w);
4349  if((res->data==NULL) && (v->rtyp==IDHDL))
4350  {
4351  if (v->e==NULL)
4352  atKill((idhdl)(v->data),"isHomog");
4353  else
4354  atKill((idhdl)(v->LData()),"isHomog");
4355  }
4356  }
4357  return FALSE;
4358 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
Definition: tok.h:99
#define atKill(H, A)
Definition: attrib.h:44
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
leftv LData()
Definition: subexpr.cc:1390
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:98
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjHOMOG1_W()

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

Definition at line 2546 of file iparith.cc.

2547 {
2548  intvec *w=new intvec(rVar(currRing));
2549  intvec *vw=(intvec*)u->Data();
2550  ideal v_id=(ideal)v->Data();
2551  pFDegProc save_FDeg=currRing->pFDeg;
2552  pLDegProc save_LDeg=currRing->pLDeg;
2553  BOOLEAN save_pLexOrder=currRing->pLexOrder;
2554  currRing->pLexOrder=FALSE;
2555  kHomW=vw;
2556  kModW=w;
2558  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
2559  currRing->pLexOrder=save_pLexOrder;
2560  kHomW=NULL;
2561  kModW=NULL;
2562  pRestoreDegProcs(currRing,save_FDeg,save_LDeg);
2563  if (w!=NULL) delete w;
2564  return FALSE;
2565 }
#define FALSE
Definition: auxiliary.h:97
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:45
void * data
Definition: subexpr.h:90
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:3497
long kHomModDeg(poly p, ring r)
Definition: kstd1.cc:2218
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3509
#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:1121
int BOOLEAN
Definition: auxiliary.h:88
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:98

§ jjHOMOG_ID()

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

Definition at line 2524 of file iparith.cc.

2525 {
2526  int i=pVar((poly)v->Data());
2527  if (i==0)
2528  {
2529  WerrorS("ringvar expected");
2530  return TRUE;
2531  }
2532  pFDegProc deg;
2533  if (currRing->pLexOrder && (currRing->order[0]==ringorder_lp))
2534  deg=p_Totaldegree;
2535  else
2536  deg=currRing->pFDeg;
2537  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
2538  int d=deg(p,currRing);
2539  pLmDelete(p);
2540  if (d==1)
2541  res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
2542  else
2543  WerrorS("variable must have weight 1");
2544  return (d!=1);
2545 }
#define pVar(m)
Definition: polys.h:365
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:101
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:90
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:298
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
void * Data()
Definition: subexpr.cc:1121
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 5965 of file iparith.cc.

5966 {
5967  PrintS("TODO\n");
5968  int i=pVar((poly)v->Data());
5969  if (i==0)
5970  {
5971  WerrorS("ringvar expected");
5972  return TRUE;
5973  }
5974  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5975  int d=pWTotaldegree(p);
5976  pLmDelete(p);
5977  if (d==1)
5978  res->data = (char *)id_Homogen((ideal)u->Data(), i, currRing);
5979  else
5980  WerrorS("variable must have weight 1");
5981  return (d!=1);
5982 }
#define pVar(m)
Definition: polys.h:365
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:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:298
#define pWTotaldegree(p)
Definition: polys.h:266
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjHOMOG_P()

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

Definition at line 2507 of file iparith.cc.

2508 {
2509  int i=pVar((poly)v->Data());
2510  if (i==0)
2511  {
2512  WerrorS("ringvar expected");
2513  return TRUE;
2514  }
2515  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
2516  int d=pWTotaldegree(p);
2517  pLmDelete(p);
2518  if (d==1)
2519  res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
2520  else
2521  WerrorS("variable must have weight 1");
2522  return (d!=1);
2523 }
#define pVar(m)
Definition: polys.h:365
#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:3154
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:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:298
#define pWTotaldegree(p)
Definition: polys.h:266
void * Data()
Definition: subexpr.cc:1121
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 5983 of file iparith.cc.

5984 {
5985  PrintS("TODO\n");
5986  int i=pVar((poly)v->Data());
5987  if (i==0)
5988  {
5989  WerrorS("ringvar expected");
5990  return TRUE;
5991  }
5992  poly p=pOne(); pSetExp(p,i,1); pSetm(p);
5993  int d=pWTotaldegree(p);
5994  pLmDelete(p);
5995  if (d==1)
5996  res->data = (char *)p_Homogen((poly)u->Data(), i, currRing);
5997  else
5998  WerrorS("variable must have weight 1");
5999  return (d!=1);
6000 }
#define pVar(m)
Definition: polys.h:365
#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:3154
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:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:298
#define pWTotaldegree(p)
Definition: polys.h:266
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjIDEAL_Ma()

static BOOLEAN jjIDEAL_Ma ( leftv  res,
leftv  v 
)
static

Definition at line 4365 of file iparith.cc.

4366 {
4367  matrix mat=(matrix)v->CopyD(MATRIX_CMD);
4368  IDELEMS((ideal)mat)=MATCOLS(mat)*MATROWS(mat);
4369  if (IDELEMS((ideal)mat)==0)
4370  {
4371  idDelete((ideal *)&mat);
4372  mat=(matrix)idInit(1,1);
4373  }
4374  else
4375  {
4376  MATROWS(mat)=1;
4377  mat->rank=1;
4378  idTest((ideal)mat);
4379  }
4380  res->data=(char *)mat;
4381  return FALSE;
4382 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:679
#define idTest(id)
Definition: ideals.h:49

§ jjIDEAL_Map()

static BOOLEAN jjIDEAL_Map ( leftv  res,
leftv  v 
)
static

Definition at line 4383 of file iparith.cc.

4384 {
4385  map m=(map)v->CopyD(MAP_CMD);
4386  omFree((ADDRESS)m->preimage);
4387  m->preimage=NULL;
4388  ideal I=(ideal)m;
4389  I->rank=1;
4390  res->data=(char *)I;
4391  return FALSE;
4392 }
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:97
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
#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:679

§ jjIDEAL_PL()

static BOOLEAN jjIDEAL_PL ( leftv  res,
leftv  v 
)
static

Definition at line 6886 of file iparith.cc.

6887 {
6888  int s=1;
6889  leftv h=v;
6890  if (h!=NULL) s=exprlist_length(h);
6891  ideal id=idInit(s,1);
6892  int rank=1;
6893  int i=0;
6894  poly p;
6895  while (h!=NULL)
6896  {
6897  switch(h->Typ())
6898  {
6899  case POLY_CMD:
6900  {
6901  p=(poly)h->CopyD(POLY_CMD);
6902  break;
6903  }
6904  case INT_CMD:
6905  {
6906  number n=nInit((int)(long)h->Data());
6907  if (!nIsZero(n))
6908  {
6909  p=pNSet(n);
6910  }
6911  else
6912  {
6913  p=NULL;
6914  nDelete(&n);
6915  }
6916  break;
6917  }
6918  case BIGINT_CMD:
6919  {
6920  number b=(number)h->Data();
6922  if (nMap==NULL) return TRUE;
6923  number n=nMap(b,coeffs_BIGINT,currRing->cf);
6924  if (!nIsZero(n))
6925  {
6926  p=pNSet(n);
6927  }
6928  else
6929  {
6930  p=NULL;
6931  nDelete(&n);
6932  }
6933  break;
6934  }
6935  case NUMBER_CMD:
6936  {
6937  number n=(number)h->CopyD(NUMBER_CMD);
6938  if (!nIsZero(n))
6939  {
6940  p=pNSet(n);
6941  }
6942  else
6943  {
6944  p=NULL;
6945  nDelete(&n);
6946  }
6947  break;
6948  }
6949  case VECTOR_CMD:
6950  {
6951  p=(poly)h->CopyD(VECTOR_CMD);
6952  if (iiOp!=MODUL_CMD)
6953  {
6954  idDelete(&id);
6955  pDelete(&p);
6956  return TRUE;
6957  }
6958  rank=si_max(rank,(int)pMaxComp(p));
6959  break;
6960  }
6961  default:
6962  {
6963  idDelete(&id);
6964  return TRUE;
6965  }
6966  }
6967  if ((iiOp==MODUL_CMD)&&(p!=NULL)&&(pGetComp(p)==0))
6968  {
6969  pSetCompP(p,1);
6970  }
6971  id->m[i]=p;
6972  i++;
6973  h=h->next;
6974  }
6975  id->rank=rank;
6976  res->data=(char *)id;
6977  return FALSE;
6978 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define pNSet(n)
Definition: polys.h:296
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:38
return P p
Definition: myNF.cc:203
int exprlist_length(leftv v)
Definition: ipshell.cc:546
#define TRUE
Definition: auxiliary.h:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:979
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:90
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:286
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:123
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:88
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:1121
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24
int iiOp
Definition: iparith.cc:227
static Poly * h
Definition: janet.cc:978
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjIDEAL_R()

static BOOLEAN jjIDEAL_R ( leftv  res,
leftv  v 
)
static

Definition at line 4393 of file iparith.cc.

4394 {
4395  if (currRing!=NULL)
4396  {
4397  ring q=(ring)v->Data();
4398  if (rSamePolyRep(currRing, q))
4399  {
4400  if (q->qideal==NULL)
4401  res->data=(char *)idInit(1,1);
4402  else
4403  res->data=(char *)idCopy(q->qideal);
4404  return FALSE;
4405  }
4406  }
4407  WerrorS("can only get ideal from identical qring");
4408  return TRUE;
4409 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:1682
ideal idCopy(ideal A)
Definition: ideals.h:62
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:1121

§ jjidElem()

static BOOLEAN jjidElem ( leftv  res,
leftv  v 
)
static

Definition at line 5419 of file iparith.cc.

5420 {
5421  res->data = (char *)(long)idElem((ideal)v->Data());
5422  return FALSE;
5423 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements

§ jjidFreeModule()

static BOOLEAN jjidFreeModule ( leftv  res,
leftv  v 
)
static

Definition at line 5424 of file iparith.cc.

5425 {
5426  res->data = (char *)id_FreeModule((int)(long)v->Data(), currRing);
5427  return FALSE;
5428 }
ideal id_FreeModule(int i, const ring r)
the free module of rank i
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjidHead()

static BOOLEAN jjidHead ( leftv  res,
leftv  v 
)
static

Definition at line 5444 of file iparith.cc.

5445 {
5446  res->data = (char *)id_Head((ideal)v->Data(),currRing);
5447  setFlag(res,FLAG_STD);
5448  return FALSE;
5449 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjidMaxIdeal()

static BOOLEAN jjidMaxIdeal ( leftv  res,
leftv  v 
)
static

Definition at line 4359 of file iparith.cc.

4360 {
4361  res->data = (char *)idMaxIdeal((int)(long)v->Data());
4362  setFlag(res,FLAG_STD);
4363  return FALSE;
4364 }
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition: ideals.h:35
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
void * Data()
Definition: subexpr.cc:1121

§ jjidMinBase()

static BOOLEAN jjidMinBase ( leftv  res,
leftv  v 
)
static

Definition at line 5450 of file iparith.cc.

5451 {
5452  res->data = (char *)idMinBase((ideal)v->Data());
5453  return FALSE;
5454 }
#define FALSE
Definition: auxiliary.h:97
ideal idMinBase(ideal h1)
Definition: ideals.cc:45
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjidTransp()

static BOOLEAN jjidTransp ( leftv  res,
leftv  v 
)
static

Definition at line 5500 of file iparith.cc.

5501 {
5502  res->data = (char *)id_Transp((ideal)v->Data(),currRing);
5503  return FALSE;
5504 }
ideal id_Transp(ideal a, const ring rRing)
transpose a module
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjidVec2Ideal()

static BOOLEAN jjidVec2Ideal ( leftv  res,
leftv  v 
)
static

Definition at line 5429 of file iparith.cc.

5430 {
5431  res->data = (char *)id_Vec2Ideal((poly)v->Data(), currRing);
5432  return FALSE;
5433 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121
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 4410 of file iparith.cc.

4411 {
4412  intvec *iv = (intvec *)v->CopyD(INTMAT_CMD);
4413  iv->makeVector();
4414  res->data = iv;
4415  return FALSE;
4416 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void makeVector()
Definition: intvec.h:94
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjIMPART()

static BOOLEAN jjIMPART ( leftv  res,
leftv  v 
)
static

Definition at line 4417 of file iparith.cc.

4418 {
4419  res->data = (char *)n_ImPart((number)v->Data(),currRing->cf);
4420  return FALSE;
4421 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjINDEPSET()

static BOOLEAN jjINDEPSET ( leftv  res,
leftv  v 
)
static

Definition at line 4422 of file iparith.cc.

4423 {
4424  assumeStdFlag(v);
4425  res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal);
4426  return FALSE;
4427 }
intvec * scIndIntvec(ideal S, ideal Q)
Definition: hdegree.cc:212
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121

§ jjINDEPSET2()

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

Definition at line 2566 of file iparith.cc.

2567 {
2568  assumeStdFlag(u);
2569  res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()),
2570  currRing->qideal);
2571  return FALSE;
2572 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
lists scIndIndset(ideal S, BOOLEAN all, ideal Q)
Definition: ipshell.cc:1024
void * Data()
Definition: subexpr.cc:1121

§ jjINDEX_I()

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

Definition at line 1372 of file iparith.cc.

1373 {
1374  res->rtyp=u->rtyp; u->rtyp=0;
1375  res->data=u->data; u->data=NULL;
1376  res->name=u->name; u->name=NULL;
1377  res->e=u->e; u->e=NULL;
1378  if (res->e==NULL) res->e=jjMakeSub(v);
1379  else
1380  {
1381  Subexpr sh=res->e;
1382  while (sh->next != NULL) sh=sh->next;
1383  sh->next=jjMakeSub(v);
1384  }
1385  if (u->next!=NULL)
1386  {
1388  BOOLEAN bo=iiExprArith2(rn,u->next,iiOp,v);
1389  res->next=rn;
1390  return bo;
1391  }
1392  return FALSE;
1393 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
sleftv * leftv
Definition: structs.h:60
void * data
Definition: subexpr.h:90
const char * name
Definition: subexpr.h:89
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:88
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:8045
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8235

§ jjINDEX_IV()

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

Definition at line 1394 of file iparith.cc.

1395 {
1396  if ((u->rtyp!=IDHDL)||(u->e!=NULL))
1397  {
1398  WerrorS("indexed object must have a name");
1399  return TRUE;
1400  }
1401  intvec * iv=(intvec *)v->Data();
1402  leftv p=NULL;
1403  int i;
1404  sleftv t;
1405  memset(&t,0,sizeof(t));
1406  t.rtyp=INT_CMD;
1407  for (i=0;i<iv->length(); i++)
1408  {
1409  t.data=(char *)((long)(*iv)[i]);
1410  if (p==NULL)
1411  {
1412  p=res;
1413  }
1414  else
1415  {
1417  p=p->next;
1418  }
1419  p->rtyp=IDHDL;
1420  p->data=u->data;
1421  p->name=u->name;
1422  p->flag=u->flag;
1423  p->e=jjMakeSub(&t);
1424  }
1425  u->rtyp=0;
1426  u->data=NULL;
1427  u->name=NULL;
1428  return FALSE;
1429 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
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:90
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
const char * name
Definition: subexpr.h:89
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
#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:93
static Subexpr jjMakeSub(leftv e)
Definition: iparith.cc:8045
void * Data()
Definition: subexpr.cc:1121

§ jjINDEX_P()

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

Definition at line 1430 of file iparith.cc.

1431 {
1432  poly p=(poly)u->Data();
1433  int i=(int)(long)v->Data();
1434  int j=0;
1435  while (p!=NULL)
1436  {
1437  j++;
1438  if (j==i)
1439  {
1440  res->data=(char *)pHead(p);
1441  return FALSE;
1442  }
1443  pIter(p);
1444  }
1445  return FALSE;
1446 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
#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:1121
polyrec * poly
Definition: hilb.h:10

§ jjINDEX_P_IV()

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

Definition at line 1447 of file iparith.cc.

1448 {
1449  poly p=(poly)u->Data();
1450  poly r=NULL;
1451  intvec *iv=(intvec *)v->CopyD(INTVEC_CMD);
1452  int i;
1453  int sum=0;
1454  for(i=iv->length()-1;i>=0;i--)
1455  sum+=(*iv)[i];
1456  int j=0;
1457  while ((p!=NULL) && (sum>0))
1458  {
1459  j++;
1460  for(i=iv->length()-1;i>=0;i--)
1461  {
1462  if (j==(*iv)[i])
1463  {
1464  r=pAdd(r,pHead(p));
1465  sum-=j;
1466  (*iv)[i]=0;
1467  break;
1468  }
1469  }
1470  pIter(p);
1471  }
1472  delete iv;
1473  res->data=(char *)r;
1474  return FALSE;
1475 }
#define pAdd(p, q)
Definition: polys.h:186
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
#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
Definition: tok.h:99
#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:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjINDEX_V()

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

Definition at line 1476 of file iparith.cc.

1477 {
1478  poly p=(poly)u->CopyD(VECTOR_CMD);
1479  poly r=p; // pointer to the beginning of component i
1480  poly o=NULL;
1481  int i=(int)(long)v->Data();
1482  while (p!=NULL)
1483  {
1484  if (pGetComp(p)!=i)
1485  {
1486  if (r==p) r=pNext(p);
1487  if (o!=NULL)
1488  {
1489  if (pNext(o)!=NULL) pLmDelete(&pNext(o));
1490  p=pNext(o);
1491  }
1492  else
1493  pLmDelete(&p);
1494  }
1495  else
1496  {
1497  pSetComp(p, 0);
1498  p_SetmComp(p, currRing);
1499  o=p;
1500  p=pNext(o);
1501  }
1502  }
1503  res->data=(char *)r;
1504  return FALSE;
1505 }
#define FALSE
Definition: auxiliary.h:97
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:90
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:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjINDEX_V_IV()

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

Definition at line 1506 of file iparith.cc.

1507 {
1508  poly p=(poly)u->CopyD(VECTOR_CMD);
1509  if (p!=NULL)
1510  {
1511  poly r=pOne();
1512  poly hp=r;
1513  intvec *iv=(intvec *)v->Data();
1514  int i;
1515  loop
1516  {
1517  for(i=0;i<iv->length();i++)
1518  {
1519  if (((int)pGetComp(p))==(*iv)[i])
1520  {
1521  poly h;
1522  pSplit(p,&h);
1523  pNext(hp)=p;
1524  p=h;
1525  pIter(hp);
1526  break;
1527  }
1528  }
1529  if (p==NULL) break;
1530  if (i==iv->length())
1531  {
1532  pLmDelete(&p);
1533  if (p==NULL) break;
1534  }
1535  }
1536  pLmDelete(&r);
1537  res->data=(char *)r;
1538  }
1539  return FALSE;
1540 }
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:97
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:90
#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:298
#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:1121
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjINTERPOLATION()

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

Definition at line 2579 of file iparith.cc.

2580 {
2581  const lists L = (lists)l->Data();
2582  const int n = L->nr; assume (n >= 0);
2583  std::vector<ideal> V(n + 1);
2584 
2585  for(int i = n; i >= 0; i--) V[i] = (ideal)(L->m[i].Data());
2586 
2587  res->data=interpolation(V, (intvec*)v->Data());
2588  setFlag(res,FLAG_STD);
2589  return errorreported;
2590 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
ideal interpolation(const std::vector< ideal > &L, intvec *v)
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
#define assume(x)
Definition: mod2.h:403
#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:1121

§ jjINTERRED()

static BOOLEAN jjINTERRED ( leftv  res,
leftv  v 
)
static

Definition at line 4428 of file iparith.cc.

4429 {
4430  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
4432  Warn("interred: this command is experimental over the integers");
4433  if (TEST_OPT_PROT) { PrintLn(); mflush(); }
4434  res->data = result;
4435  return FALSE;
4436 }
void PrintLn()
Definition: reporter.cc:310
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#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:3436
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
void * Data()
Definition: subexpr.cc:1121
return result
Definition: facAbsBiFact.cc:76
#define Warn
Definition: emacs.cc:80

§ jjINTERSECT()

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

Definition at line 2573 of file iparith.cc.

2574 {
2575  res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data());
2577  return FALSE;
2578 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ideal idSect(ideal h1, ideal h2)
Definition: ideals.cc:201
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define TEST_OPT_RETURN_SB
Definition: options.h:107
void * Data()
Definition: subexpr.cc:1121

§ jjINTERSECT_PL()

static BOOLEAN jjINTERSECT_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7107 of file iparith.cc.

7108 {
7109  leftv h=v;
7110  int l=v->listLength();
7111  resolvente r=(resolvente)omAlloc0(l*sizeof(ideal));
7112  BOOLEAN *copied=(BOOLEAN *)omAlloc0(l*sizeof(BOOLEAN));
7113  int t=0;
7114  // try to convert to IDEAL_CMD
7115  while (h!=NULL)
7116  {
7117  if (iiTestConvert(h->Typ(),IDEAL_CMD)!=0)
7118  {
7119  t=IDEAL_CMD;
7120  }
7121  else break;
7122  h=h->next;
7123  }
7124  // if failure, try MODUL_CMD
7125  if (t==0)
7126  {
7127  h=v;
7128  while (h!=NULL)
7129  {
7130  if (iiTestConvert(h->Typ(),MODUL_CMD)!=0)
7131  {
7132  t=MODUL_CMD;
7133  }
7134  else break;
7135  h=h->next;
7136  }
7137  }
7138  // check for success in converting
7139  if (t==0)
7140  {
7141  WerrorS("cannot convert to ideal or module");
7142  return TRUE;
7143  }
7144  // call idMultSect
7145  h=v;
7146  int i=0;
7147  sleftv tmp;
7148  while (h!=NULL)
7149  {
7150  if (h->Typ()==t)
7151  {
7152  r[i]=(ideal)h->Data(); /*no copy*/
7153  h=h->next;
7154  }
7155  else if(iiConvert(h->Typ(),t,iiTestConvert(h->Typ(),t),h,&tmp))
7156  {
7157  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
7158  omFreeSize((ADDRESS)r,l*sizeof(ideal));
7159  Werror("cannot convert arg. %d to %s",i+1,Tok2Cmdname(t));
7160  return TRUE;
7161  }
7162  else
7163  {
7164  r[i]=(ideal)tmp.Data(); /*now it's a copy*/
7165  copied[i]=TRUE;
7166  h=tmp.next;
7167  }
7168  i++;
7169  }
7170  res->rtyp=t;
7171  res->data=(char *)idMultSect(r,i);
7172  while(i>0)
7173  {
7174  i--;
7175  if (copied[i]) idDelete(&(r[i]));
7176  }
7177  omFreeSize((ADDRESS)copied,l*sizeof(BOOLEAN));
7178  omFreeSize((ADDRESS)r,l*sizeof(ideal));
7179  return FALSE;
7180 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:61
#define TRUE
Definition: auxiliary.h:101
ideal idMultSect(resolvente arg, int length)
Definition: ideals.cc:340
void * ADDRESS
Definition: auxiliary.h:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8952
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
ideal * resolvente
Definition: ideals.h:20
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
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 6001 of file iparith.cc.

6002 {
6003  intvec* im= new intvec((int)(long)v->Data(),(int)(long)w->Data(), 0);
6004  intvec* arg = (intvec*) u->Data();
6005  int i, n = si_min(im->cols()*im->rows(), arg->cols()*arg->rows());
6006 
6007  for (i=0; i<n; i++)
6008  {
6009  (*im)[i] = (*arg)[i];
6010  }
6011 
6012  res->data = (char *)im;
6013  return FALSE;
6014 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1121

§ jjINTVEC_PL()

static BOOLEAN jjINTVEC_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7343 of file iparith.cc.

7344 {
7345  int i=0;
7346  leftv h=v;
7347  if (h!=NULL) i=exprlist_length(h);
7348  intvec *iv=new intvec(i);
7349  i=0;
7350  while (h!=NULL)
7351  {
7352  if(h->Typ()==INT_CMD)
7353  {
7354  (*iv)[i]=(int)(long)h->Data();
7355  }
7356  else if (h->Typ()==INTVEC_CMD)
7357  {
7358  intvec *ivv=(intvec*)h->Data();
7359  for(int j=0;j<ivv->length();j++,i++)
7360  {
7361  (*iv)[i]=(*ivv)[j];
7362  }
7363  i--;
7364  }
7365  else
7366  {
7367  delete iv;
7368  return TRUE;
7369  }
7370  i++;
7371  h=h->next;
7372  }
7373  res->data=(char *)iv;
7374  return FALSE;
7375 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
int exprlist_length(leftv v)
Definition: ipshell.cc:546
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
leftv next
Definition: subexpr.h:88
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:1121
static Poly * h
Definition: janet.cc:978

§ jjIS_RINGVAR0()

static BOOLEAN jjIS_RINGVAR0 ( leftv  res,
leftv   
)
static

Definition at line 4448 of file iparith.cc.

4449 {
4450  res->data = (char *)0;
4451  return FALSE;
4452 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90

§ jjIS_RINGVAR_P()

static BOOLEAN jjIS_RINGVAR_P ( leftv  res,
leftv  v 
)
static

Definition at line 4437 of file iparith.cc.

4438 {
4439  res->data = (char *)(long)pVar((poly)v->Data());
4440  return FALSE;
4441 }
#define pVar(m)
Definition: polys.h:365
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjIS_RINGVAR_S()

static BOOLEAN jjIS_RINGVAR_S ( leftv  res,
leftv  v 
)
static

Definition at line 4442 of file iparith.cc.

4443 {
4444  res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing->names,
4445  currRing->N)+1);
4446  return FALSE;
4447 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjJACOB_M()

static BOOLEAN jjJACOB_M ( leftv  res,
leftv  a 
)
static

Definition at line 4484 of file iparith.cc.

4485 {
4486  ideal id = (ideal)a->Data();
4487  id = id_Transp(id,currRing);
4488  int W = IDELEMS(id);
4489 
4490  ideal result = idInit(W * currRing->N, id->rank);
4491  poly *p = result->m;
4492 
4493  for( int v = 1; v <= currRing->N; v++ )
4494  {
4495  poly* q = id->m;
4496  for( int i = 0; i < W; i++, p++, q++ )
4497  *p = pDiff( *q, v );
4498  }
4499  idDelete(&id);
4500 
4501  res->data = (char *)result;
4502  return FALSE;
4503 }
ideal id_Transp(ideal a, const ring rRing)
transpose a module
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:1121
#define pDiff(a, b)
Definition: polys.h:279
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 4453 of file iparith.cc.

4454 {
4455  ideal i=idInit(currRing->N,1);
4456  int k;
4457  poly p=(poly)(v->Data());
4458  for (k=currRing->N;k>0;k--)
4459  {
4460  i->m[k-1]=pDiff(p,k);
4461  }
4462  res->data = (char *)i;
4463  return FALSE;
4464 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:90
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:1121
#define pDiff(a, b)
Definition: polys.h:279
polyrec * poly
Definition: hilb.h:10

§ jjJanetBasis()

static BOOLEAN jjJanetBasis ( leftv  res,
leftv  v 
)
static

Definition at line 2597 of file iparith.cc.

2598 {
2599  extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
2600  return jjStdJanetBasis(res,v,0);
2601 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
Definition: wrapper.cc:52
int BOOLEAN
Definition: auxiliary.h:88

§ jjJanetBasis2()

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

Definition at line 2591 of file iparith.cc.

2592 {
2593  extern BOOLEAN jjStdJanetBasis(leftv res, leftv v,int flag);
2594  return jjStdJanetBasis(res,u,(int)(long)v->Data());
2595 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN jjStdJanetBasis(leftv res, leftv v, int flag)
flag: 0: JB, 1: SB
Definition: wrapper.cc:52
void * Data()
Definition: subexpr.cc:1121
int BOOLEAN
Definition: auxiliary.h:88

§ jjJET4()

static BOOLEAN jjJET4 ( leftv  res,
leftv  u 
)
static

Definition at line 7376 of file iparith.cc.

7377 {
7378  short t1[]={4,POLY_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7379  short t2[]={4,VECTOR_CMD,POLY_CMD,POLY_CMD,INTVEC_CMD};
7380  short t3[]={4,IDEAL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7381  short t4[]={4,MODUL_CMD,MATRIX_CMD,INT_CMD,INTVEC_CMD};
7382  leftv u1=u;
7383  leftv u2=u1->next;
7384  leftv u3=u2->next;
7385  leftv u4=u3->next;
7386  if (iiCheckTypes(u,t1)||iiCheckTypes(u,t2))
7387  {
7388  if(!pIsUnit((poly)u2->Data()))
7389  {
7390  WerrorS("2nd argument must be a unit");
7391  return TRUE;
7392  }
7393  res->rtyp=u1->Typ();
7394  res->data=(char*)pSeries((int)(long)u3->Data(),pCopy((poly)u1->Data()),
7395  pCopy((poly)u2->Data()),(intvec*)u4->Data());
7396  return FALSE;
7397  }
7398  else
7399  if (iiCheckTypes(u,t3)||iiCheckTypes(u,t4))
7400  {
7401  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7402  {
7403  WerrorS("2nd argument must be a diagonal matrix of units");
7404  return TRUE;
7405  }
7406  res->rtyp=u1->Typ();
7407  res->data=(char*)idSeries(
7408  (int)(long)u3->Data(),
7409  idCopy((ideal)u1->Data()),
7410  mp_Copy((matrix)u2->Data(), currRing),
7411  (intvec*)u4->Data()
7412  );
7413  return FALSE;
7414  }
7415  else
7416  {
7417  Werror("%s(`poly`,`poly`,`int`,`intvec`) exppected",
7418  Tok2Cmdname(iiOp));
7419  return TRUE;
7420  }
7421 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
else
Definition: myNF.cc:189
Definition: tok.h:94
return
Definition: syzextra.cc:280
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:8952
ideal idSeries(int n, ideal M, matrix U, intvec *w)
Definition: ideals.cc:1886
Definition: intvec.h:14
Definition: tok.h:99
ideal idCopy(ideal A)
Definition: ideals.h:62
leftv next
Definition: subexpr.h:88
#define pSeries(n, p, u, w)
Definition: polys.h:355
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:6460
int rtyp
Definition: subexpr.h:93
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:721
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
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 2607 of file iparith.cc.

2608 {
2609  res->data = (char *)id_Jet((ideal)u->Data(),(int)(long)v->Data(),currRing);
2610  return FALSE;
2611 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjJET_ID_IV()

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

Definition at line 6032 of file iparith.cc.

6033 {
6034  res->data = (char *)id_JetW((ideal)u->Data(),(int)(long)v->Data(),
6035  (intvec *)w->Data(),currRing);
6036  return FALSE;
6037 }
#define FALSE
Definition: auxiliary.h:97
ideal id_JetW(ideal i, int d, intvec *iv, const ring R)
void * data
Definition: subexpr.h:90
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:1121

§ jjJET_ID_M()

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

Definition at line 6038 of file iparith.cc.

6039 {
6040  if (!mp_IsDiagUnit((matrix)v->Data(), currRing))
6041  {
6042  WerrorS("2nd argument must be a diagonal matrix of units");
6043  return TRUE;
6044  }
6045  res->data = (char *)idSeries((int)(long)w->Data(),(ideal)u->CopyD(),
6046  (matrix)v->CopyD());
6047  return FALSE;
6048 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:1886
ip_smatrix * matrix
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:721
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjJET_P()

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

Definition at line 2602 of file iparith.cc.

2603 {
2604  res->data = (char *)pJet((poly)u->CopyD(), (int)(long)v->Data());
2605  return FALSE;
2606 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define pJet(p, m)
Definition: polys.h:351
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjJET_P_IV()

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

Definition at line 6015 of file iparith.cc.

6016 {
6017  short *iw=iv2array((intvec *)w->Data(),currRing);
6018  res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
6019  omFreeSize( (ADDRESS)iw, (rVar(currRing)+1)*sizeof(short) );
6020  return FALSE;
6021 }
#define FALSE
Definition: auxiliary.h:97
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:580
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10
#define ppJetW(p, m, iv)
Definition: polys.h:352

§ jjJET_P_P()

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

Definition at line 6022 of file iparith.cc.

6023 {
6024  if (!pIsUnit((poly)v->Data()))
6025  {
6026  WerrorS("2nd argument must be a unit");
6027  return TRUE;
6028  }
6029  res->data = (char *)p_Series((int)(long)w->Data(),(poly)u->CopyD(),(poly)v->CopyD(),NULL,currRing);
6030  return FALSE;
6031 }
#define FALSE
Definition: auxiliary.h:97
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:4279
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjKBASE()

static BOOLEAN jjKBASE ( leftv  res,
leftv  v 
)
static

Definition at line 4506 of file iparith.cc.

4507 {
4508  assumeStdFlag(v);
4509  res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal);
4510  return FALSE;
4511 }
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition: hdegree.cc:1354
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121

§ jjKBASE2()

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

Definition at line 2612 of file iparith.cc.

2613 {
2614  assumeStdFlag(u);
2615  intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
2616  res->data = (char *)scKBase((int)(long)v->Data(),
2617  (ideal)(u->Data()),currRing->qideal, w_u);
2618  if (w_u!=NULL)
2619  {
2620  atSet(res,omStrDup("isHomog"),ivCopy(w_u),INTVEC_CMD);
2621  }
2622  return FALSE;
2623 }
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition: hdegree.cc:1354
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:97
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:90
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:1458
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjKERNEL()

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

Definition at line 2625 of file iparith.cc.

2626 {
2627  return jjPREIMAGE(res,u,v,NULL);
2628 }
static BOOLEAN jjPREIMAGE(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6266
#define NULL
Definition: omList.c:10

§ jjKLAMMER()

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

Definition at line 1542 of file iparith.cc.

1543 {
1544  if(u->name==NULL) return TRUE;
1545  char * nn = (char *)omAlloc(strlen(u->name) + 14);
1546  sprintf(nn,"%s(%d)",u->name,(int)(long)v->Data());
1547  omFree((ADDRESS)u->name);
1548  u->name=NULL;
1549  char *n=omStrDup(nn);
1550  omFree((ADDRESS)nn);
1551  syMake(res,n);
1552  if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
1553  return FALSE;
1554 }
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
Definition: iparith.cc:1583
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * name
Definition: subexpr.h:89
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1484
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjKLAMMER_IV()

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

Definition at line 1555 of file iparith.cc.

1556 {
1557  intvec * iv=(intvec *)v->Data();
1558  leftv p=NULL;
1559  int i;
1560  long slen = strlen(u->name) + 14;
1561  char *n = (char*) omAlloc(slen);
1562 
1563  for (i=0;i<iv->length(); i++)
1564  {
1565  if (p==NULL)
1566  {
1567  p=res;
1568  }
1569  else
1570  {
1572  p=p->next;
1573  }
1574  sprintf(n,"%s(%d)",u->name,(*iv)[i]);
1575  syMake(p,omStrDup(n));
1576  }
1577  omFree((ADDRESS)u->name);
1578  u->name = NULL;
1579  omFreeSize(n, slen);
1580  if (u->next!=NULL) return jjKLAMMER_rest(res,u->next,v);
1581  return FALSE;
1582 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static BOOLEAN jjKLAMMER_rest(leftv res, leftv u, leftv v)
Definition: iparith.cc:1583
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:118
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:89
#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:88
#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:1121
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1484
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjKLAMMER_PL()

static BOOLEAN jjKLAMMER_PL ( leftv  res,
leftv  u 
)
static

Definition at line 7459 of file iparith.cc.

7460 {
7461  if ((yyInRingConstruction)
7462  && ((strcmp(u->Name(),"real")==0) || (strcmp(u->Name(),"complex")==0)))
7463  {
7464  memcpy(res,u,sizeof(sleftv));
7465  memset(u,0,sizeof(sleftv));
7466  return FALSE;
7467  }
7468  leftv v=u->next;
7469  BOOLEAN b;
7470  if(v==NULL)
7471  b=iiExprArith1(res,u,iiOp);
7472  else
7473  {
7474  u->next=NULL;
7475  b=iiExprArith2(res,u,iiOp,v);
7476  u->next=v;
7477  }
7478  return b;
7479 }
BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8422
#define FALSE
Definition: auxiliary.h:97
const char * Name()
Definition: subexpr.h:122
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8235

§ jjKLAMMER_rest()

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

Definition at line 1583 of file iparith.cc.

1584 {
1586  memset(tmp,0,sizeof(sleftv));
1587  BOOLEAN b;
1588  if (v->Typ()==INTVEC_CMD)
1589  b=jjKLAMMER_IV(tmp,u,v);
1590  else
1591  b=jjKLAMMER(tmp,u,v);
1592  if (b)
1593  {
1594  omFreeBin(tmp,sleftv_bin);
1595  return TRUE;
1596  }
1597  leftv h=res;
1598  while (h->next!=NULL) h=h->next;
1599  h->next=tmp;
1600  return FALSE;
1601 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jjKLAMMER_IV(leftv res, leftv u, leftv v)
Definition: iparith.cc:1555
#define TRUE
Definition: auxiliary.h:101
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:979
poly res
Definition: myNF.cc:322
static BOOLEAN jjKLAMMER(leftv res, leftv u, leftv v)
Definition: iparith.cc:1542
omBin sleftv_bin
Definition: subexpr.cc:50
Definition: tok.h:99
leftv next
Definition: subexpr.h:88
#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:88
const poly b
Definition: syzextra.cc:213

§ jjKoszul()

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

Definition at line 2629 of file iparith.cc.

2630 {
2631  return mpKoszul(res, u,v,NULL);
2632 }
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition: ipshell.cc:2998
#define NULL
Definition: omList.c:10

§ jjKoszul_Id()

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

Definition at line 2633 of file iparith.cc.

2634 {
2635  sleftv h;
2636  memset(&h,0,sizeof(sleftv));
2637  h.rtyp=INT_CMD;
2638  h.data=(void *)(long)IDELEMS((ideal)v->Data());
2639  return mpKoszul(res, u, &h, v);
2640 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
Definition: ipshell.cc:2998
void * data
Definition: subexpr.h:90
#define IDELEMS(i)
Definition: simpleideals.h:24
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
static Poly * h
Definition: janet.cc:978

§ jjL2R()

static BOOLEAN jjL2R ( leftv  res,
leftv  v 
)
static

Definition at line 4512 of file iparith.cc.

4513 {
4514  res->data=(char *)syConvList((lists)v->Data());
4515  if (res->data != NULL)
4516  return FALSE;
4517  else
4518  return TRUE;
4519 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
syStrategy syConvList(lists li)
Definition: ipshell.cc:3161
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjLE_BI()

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

Definition at line 1131 of file iparith.cc.

1132 {
1133  return jjGE_BI(res,v,u);
1134 }
static BOOLEAN jjGE_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:1096

§ jjLE_I()

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

Definition at line 1135 of file iparith.cc.

1136 {
1137  res->data = (char *)(long)((int)((long)u->Data()) <= (int)((long)v->Data()));
1138  return FALSE;
1139 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjLE_N()

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

Definition at line 1140 of file iparith.cc.

1141 {
1142  return jjGE_N(res,v,u);
1143 }
static BOOLEAN jjGE_N(leftv res, leftv u, leftv v)
Definition: iparith.cc:1108

§ jjLEADCOEF()

static BOOLEAN jjLEADCOEF ( leftv  res,
leftv  v 
)
static

Definition at line 4520 of file iparith.cc.

4521 {
4522  poly p=(poly)v->Data();
4523  if (p==NULL)
4524  {
4525  res->data=(char *)nInit(0);
4526  }
4527  else
4528  {
4529  res->data=(char *)nCopy(pGetCoeff(p));
4530  }
4531  return FALSE;
4532 }
#define FALSE
Definition: auxiliary.h:97
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:90
#define NULL
Definition: omList.c:10
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1121
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 4533 of file iparith.cc.

4534 {
4535  poly p=(poly)v->Data();
4536  int s=currRing->N;
4537  if (v->Typ()==VECTOR_CMD) s++;
4538  intvec *iv=new intvec(s);
4539  if (p!=NULL)
4540  {
4541  for(int i = currRing->N;i;i--)
4542  {
4543  (*iv)[i-1]=pGetExp(p,i);
4544  }
4545  if (s!=currRing->N)
4546  (*iv)[currRing->N]=pGetComp(p);
4547  }
4548  res->data=(char *)iv;
4549  return FALSE;
4550 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
int Typ()
Definition: subexpr.cc:979
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjLEADMONOM()

static BOOLEAN jjLEADMONOM ( leftv  res,
leftv  v 
)
static

Definition at line 4551 of file iparith.cc.

4552 {
4553  poly p=(poly)v->Data();
4554  if (p == NULL)
4555  {
4556  res->data = (char*) NULL;
4557  }
4558  else
4559  {
4560  poly lm = pLmInit(p);
4561  pSetCoeff(lm, nInit(1));
4562  res->data = (char*) lm;
4563  }
4564  return FALSE;
4565 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
#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:1121
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 2641 of file iparith.cc.

2642 {
2643  int ul= IDELEMS((ideal)u->Data());
2644  int vl= IDELEMS((ideal)v->Data());
2645  ideal m = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,
2646  hasFlag(u,FLAG_STD));
2647  if (m==NULL) return TRUE;
2648  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
2649  return FALSE;
2650 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891

§ jjLIFT3()

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

Definition at line 6565 of file iparith.cc.

6566 {
6567  if (w->rtyp!=IDHDL) return TRUE;
6568  int ul= IDELEMS((ideal)u->Data());
6569  int vl= IDELEMS((ideal)v->Data());
6570  ideal m
6571  = idLift((ideal)u->Data(),(ideal)v->Data(),NULL,FALSE,hasFlag(u,FLAG_STD),
6572  FALSE, (matrix *)(&(IDMATRIX((idhdl)(w->data)))));
6573  if (m==NULL) return TRUE;
6574  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
6575  return FALSE;
6576 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
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:93
void * Data()
Definition: subexpr.cc:1121
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:891
#define IDMATRIX(a)
Definition: ipid.h:131

§ jjLIFTSTD()

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

Definition at line 2651 of file iparith.cc.

2652 {
2653  if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
2654  idhdl h=(idhdl)v->data;
2655  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
2656  res->data = (char *)idLiftStd((ideal)u->Data(),
2657  &(h->data.umatrix),testHomog);
2658  setFlag(res,FLAG_STD); v->flag=0;
2659  return FALSE;
2660 }
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz)
Definition: ideals.cc:704
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
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 6577 of file iparith.cc.

6578 {
6579  if ((v->rtyp!=IDHDL)||(v->e!=NULL)) return TRUE;
6580  if ((w->rtyp!=IDHDL)||(w->e!=NULL)) return TRUE;
6581  idhdl hv=(idhdl)v->data;
6582  idhdl hw=(idhdl)w->data;
6583  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
6584  res->data = (char *)idLiftStd((ideal)u->Data(),
6585  &(hv->data.umatrix),testHomog,
6586  &(hw->data.uideal));
6587  setFlag(res,FLAG_STD); v->flag=0; w->flag=0;
6588  return FALSE;
6589 }
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_STD
Definition: ipid.h:106
#define NULL
Definition: omList.c:10
ideal idLiftStd(ideal h1, matrix *ma, tHomog hi, ideal *syz)
Definition: ideals.cc:704
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
utypes data
Definition: idrec.h:40

§ jjLIST_PL()

BOOLEAN jjLIST_PL ( leftv  res,
leftv  v 
)

Definition at line 7480 of file iparith.cc.

7481 {
7482  int sl=0;
7483  if (v!=NULL) sl = v->listLength();
7484  lists L;
7485  if((sl==1)&&(v->Typ()==RESOLUTION_CMD))
7486  {
7487  int add_row_shift = 0;
7488  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
7489  if (weights!=NULL) add_row_shift=weights->min_in();
7490  L=syConvRes((syStrategy)v->Data(),FALSE,add_row_shift);
7491  }
7492  else
7493  {
7495  leftv h=NULL;
7496  int i;
7497  int rt;
7498 
7499  L->Init(sl);
7500  for (i=0;i<sl;i++)
7501  {
7502  if (h!=NULL)
7503  { /* e.g. not in the first step:
7504  * h is the pointer to the old sleftv,
7505  * v is the pointer to the next sleftv
7506  * (in this moment) */
7507  h->next=v;
7508  }
7509  h=v;
7510  v=v->next;
7511  h->next=NULL;
7512  rt=h->Typ();
7513  if (rt==0)
7514  {
7515  L->Clean();
7516  Werror("`%s` is undefined",h->Fullname());
7517  return TRUE;
7518  }
7519  if (rt==RING_CMD)
7520  {
7521  L->m[i].rtyp=rt; L->m[i].data=h->Data();
7522  ((ring)L->m[i].data)->ref++;
7523  }
7524  else
7525  L->m[i].Copy(h);
7526  }
7527  }
7528  res->data=(char *)L;
7529  return FALSE;
7530 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3088
int listLength()
Definition: subexpr.cc:61
#define TRUE
Definition: auxiliary.h:101
int min_in()
Definition: intvec.h:113
int Typ()
Definition: subexpr.cc:979
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void Copy(leftv e)
Definition: subexpr.cc:660
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
leftv next
Definition: subexpr.h:88
INLINE_THIS void Init(int l=0)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:93
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1121
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 4570 of file iparith.cc.

4571 {
4572  ring r=rCompose((lists)v->Data());
4573  if (r==NULL) return TRUE;
4574  res->data=(char *)r;
4575  return FALSE;
4576 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:2708
void * Data()
Definition: subexpr.cc:1121

§ jjLOAD()

BOOLEAN jjLOAD ( const char *  s,
BOOLEAN  autoexport 
)

load lib/module given in v

Definition at line 5332 of file iparith.cc.

5333 {
5334  char libnamebuf[256];
5335  lib_types LT = type_of_LIB(s, libnamebuf);
5336 
5337 #ifdef HAVE_DYNAMIC_LOADING
5338  extern BOOLEAN load_modules(const char *newlib, char *fullpath, BOOLEAN autoexport);
5339 #endif /* HAVE_DYNAMIC_LOADING */
5340  switch(LT)
5341  {
5342  default:
5343  case LT_NONE:
5344  Werror("%s: unknown type", s);
5345  break;
5346  case LT_NOTFOUND:
5347  Werror("cannot open %s", s);
5348  break;
5349 
5350  case LT_SINGULAR:
5351  {
5352  char *plib = iiConvName(s);
5353  idhdl pl = IDROOT->get(plib,0);
5354  if (pl==NULL)
5355  {
5356  pl = enterid( plib,0, PACKAGE_CMD, &(basePack->idroot), TRUE );
5357  IDPACKAGE(pl)->language = LANG_SINGULAR;
5358  IDPACKAGE(pl)->libname=omStrDup(plib);
5359  }
5360  else if (IDTYP(pl)!=PACKAGE_CMD)
5361  {
5362  Werror("can not create package `%s`",plib);
5363  omFree(plib);
5364  return TRUE;
5365  }
5366  package savepack=currPack;
5367  currPack=IDPACKAGE(pl);
5368  IDPACKAGE(pl)->loaded=TRUE;
5369  char libnamebuf[256];
5370  FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
5371  BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
5372  currPack=savepack;
5373  IDPACKAGE(pl)->loaded=(!bo);
5374  return bo;
5375  }
5376  case LT_BUILTIN:
5377  SModulFunc_t iiGetBuiltinModInit(const char*);
5378  return load_builtin(s,autoexport, iiGetBuiltinModInit(s));
5379  case LT_MACH_O:
5380  case LT_ELF:
5381  case LT_HPUX:
5382 #ifdef HAVE_DYNAMIC_LOADING
5383  return load_modules(s, libnamebuf, autoexport);
5384 #else /* HAVE_DYNAMIC_LOADING */
5385  WerrorS("Dynamic modules are not supported by this version of Singular");
5386  break;
5387 #endif /* HAVE_DYNAMIC_LOADING */
5388  }
5389  return TRUE;
5390 }
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:101
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:259
#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
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition: iplib.cc:1052
#define NULL
Definition: omList.c:10
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition: iplib.cc:643
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
int(* SModulFunc_t)(SModulFunctions *)
Definition: ipid.h:82
char libnamebuf[128]
Definition: libparse.cc:1096
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
Definition: iplib.cc:807
char * iiConvName(const char *libname)
Definition: iplib.cc:1184
int BOOLEAN
Definition: auxiliary.h:88
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition: iplib.cc:955
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjLOAD1()

static BOOLEAN jjLOAD1 ( leftv  ,
leftv  v 
)
static

Definition at line 4566 of file iparith.cc.

4567 {
4568  return jjLOAD((char*)v->Data(),FALSE);
4569 }
#define FALSE
Definition: auxiliary.h:97
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5332
void * Data()
Definition: subexpr.cc:1121

§ jjLOAD2()

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

Definition at line 2661 of file iparith.cc.

2662 {
2663  return jjLOAD((char*)v->Data(),TRUE);
2664 }
#define TRUE
Definition: auxiliary.h:101
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5332
void * Data()
Definition: subexpr.cc:1121

§ jjLOAD_E()

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

Definition at line 2665 of file iparith.cc.

2666 {
2667  char * s=(char *)u->Data();
2668  if(strcmp(s, "with")==0)
2669  return jjLOAD((char*)v->Data(), TRUE);
2670  if (strcmp(s,"try")==0)
2671  return jjLOAD_TRY((char*)v->Data());
2672  WerrorS("invalid second argument");
2673  WerrorS("load(\"libname\" [,option]);");
2674  return TRUE;
2675 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define TRUE
Definition: auxiliary.h:101
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:5332
BOOLEAN jjLOAD_TRY(const char *s)
Definition: iparith.cc:5396
void * Data()
Definition: subexpr.cc:1121

§ jjLOAD_TRY()

BOOLEAN jjLOAD_TRY ( const char *  s)

Definition at line 5396 of file iparith.cc.

5397 {
5398  void (*WerrorS_save)(const char *s) = WerrorS_callback;
5401  BOOLEAN bo=jjLOAD(s,TRUE);
5402  if (TEST_OPT_PROT && (bo || (WerrorS_dummy_cnt>0)))
5403  Print("loading of >%s< failed\n",s);
5404  WerrorS_callback=WerrorS_save;
5405  errorreported=0;
5406  return FALSE;
5407 }
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:5391
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5332
static void WerrorS_dummy(const char *)
Definition: iparith.cc:5392
void(* WerrorS_callback)(const char *s)
Definition: feFopen.cc:21
short errorreported
Definition: feFopen.cc:23
int BOOLEAN
Definition: auxiliary.h:88

§ jjLT_BI()

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

Definition at line 1144 of file iparith.cc.

1145 {
1146  return jjGT_BI(res,v,u);
1147 }
static BOOLEAN jjGT_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:1114

§ jjLT_I()

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

Definition at line 1148 of file iparith.cc.

1149 {
1150  res->data = (char *)(long)((int)((long)u->Data()) < (int)((long)v->Data()));
1151  return FALSE;
1152 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjLT_N()

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

Definition at line 1153 of file iparith.cc.

1154 {
1155  return jjGT_N(res,v,u);
1156 }
static BOOLEAN jjGT_N(leftv res, leftv u, leftv v)
Definition: iparith.cc:1126

§ jjLU_DECOMP()

static BOOLEAN jjLU_DECOMP ( leftv  res,
leftv  v 
)
static

Definition at line 4586 of file iparith.cc.

4587 {
4588  /* computes the LU-decomposition of a matrix M;
4589  i.e., M = P * L * U, where
4590  - P is a row permutation matrix,
4591  - L is in lower triangular form,
4592  - U is in upper row echelon form
4593  Then, we also have P * M = L * U.
4594  A list [P, L, U] is returned. */
4595  matrix mat = (const matrix)v->Data();
4596  if (!idIsConstant((ideal)mat))
4597  {
4598  WerrorS("matrix must be constant");
4599  return TRUE;
4600  }
4601  matrix pMat;
4602  matrix lMat;
4603  matrix uMat;
4604 
4605  luDecomp(mat, pMat, lMat, uMat);
4606 
4608  ll->Init(3);
4609  ll->m[0].rtyp=MATRIX_CMD; ll->m[0].data=(void *)pMat;
4610  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)lMat;
4611  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)uMat;
4612  res->data=(char*)ll;
4613 
4614  return FALSE;
4615 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:93
void * Data()
Definition: subexpr.cc:1121
omBin slists_bin
Definition: lists.cc:23
#define idIsConstant(I)
Definition: ideals.h:42

§ jjLU_INVERSE()

static BOOLEAN jjLU_INVERSE ( leftv  res,
leftv  v 
)
static

Definition at line 7181 of file iparith.cc.

7182 {
7183  /* computation of the inverse of a quadratic matrix A
7184  using the L-U-decomposition of A;
7185  There are two valid parametrisations:
7186  1) exactly one argument which is just the matrix A,
7187  2) exactly three arguments P, L, U which already
7188  realise the L-U-decomposition of A, that is,
7189  P * A = L * U, and P, L, and U satisfy the
7190  properties decribed in method 'jjLU_DECOMP';
7191  see there;
7192  If A is invertible, the list [1, A^(-1)] is returned,
7193  otherwise the list [0] is returned. Thus, the user may
7194  inspect the first entry of the returned list to see
7195  whether A is invertible. */
7196  matrix iMat; int invertible;
7197  short t1[]={1,MATRIX_CMD};
7198  short t2[]={3,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
7199  if (iiCheckTypes(v,t1))
7200  {
7201  matrix aMat = (matrix)v->Data();
7202  int rr = aMat->rows();
7203  int cc = aMat->cols();
7204  if (rr != cc)
7205  {
7206  Werror("given matrix (%d x %d) is not quadratic, hence not invertible", rr, cc);
7207  return TRUE;
7208  }
7209  if (!idIsConstant((ideal)aMat))
7210  {
7211  WerrorS("matrix must be constant");
7212  return TRUE;
7213  }
7214  invertible = luInverse(aMat, iMat);
7215  }
7216  else if (iiCheckTypes(v,t2))
7217  {
7218  matrix pMat = (matrix)v->Data();
7219  matrix lMat = (matrix)v->next->Data();
7220  matrix uMat = (matrix)v->next->next->Data();
7221  int rr = uMat->rows();
7222  int cc = uMat->cols();
7223  if (rr != cc)
7224  {
7225  Werror("third matrix (%d x %d) is not quadratic, hence not invertible",
7226  rr, cc);
7227  return TRUE;
7228  }
7229  if (!idIsConstant((ideal)pMat)
7230  || (!idIsConstant((ideal)lMat))
7231  || (!idIsConstant((ideal)uMat))
7232  )
7233  {
7234  WerrorS("matricesx must be constant");
7235  return TRUE;
7236  }
7237  invertible = luInverseFromLUDecomp(pMat, lMat, uMat, iMat);
7238  }
7239  else
7240  {
7241  Werror("expected either one or three matrices");
7242  return TRUE;
7243  }
7244 
7245  /* build the return structure; a list with either one or two entries */
7247  if (invertible)
7248  {
7249  ll->Init(2);
7250  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7251  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)iMat;
7252  }
7253  else
7254  {
7255  ll->Init(1);
7256  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)invertible;
7257  }
7258 
7259  res->data=(char*)ll;
7260  return FALSE;
7261 }
int & rows()
Definition: matpol.h:24
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: tok.h:94
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:88
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:6460
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:93
void * Data()
Definition: subexpr.cc:1121
omBin slists_bin
Definition: lists.cc:23
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define idIsConstant(I)
Definition: ideals.h:42

§ jjLU_SOLVE()

static BOOLEAN jjLU_SOLVE ( leftv  res,
leftv  v 
)
static

Definition at line 7262 of file iparith.cc.

7263 {
7264  /* for solving a linear equation system A * x = b, via the
7265  given LU-decomposition of the matrix A;
7266  There is one valid parametrisation:
7267  1) exactly four arguments P, L, U, b;
7268  P, L, and U realise the L-U-decomposition of A, that is,
7269  P * A = L * U, and P, L, and U satisfy the
7270  properties decribed in method 'jjLU_DECOMP';
7271  see there;
7272  b is the right-hand side vector of the equation system;
7273  The method will return a list of either 1 entry or three entries:
7274  1) [0] if there is no solution to the system;
7275  2) [1, x, H] if there is at least one solution;
7276  x is any solution of the given linear system,
7277  H is the matrix with column vectors spanning the homogeneous
7278  solution space.
7279  The method produces an error if matrix and vector sizes do not fit. */
7280  short t[]={4,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD,MATRIX_CMD};
7281  if (!iiCheckTypes(v,t))
7282  {
7283  WerrorS("expected exactly three matrices and one vector as input");
7284  return TRUE;
7285  }
7286  matrix pMat = (matrix)v->Data();
7287  matrix lMat = (matrix)v->next->Data();
7288  matrix uMat = (matrix)v->next->next->Data();
7289  matrix bVec = (matrix)v->next->next->next->Data();
7290  matrix xVec; int solvable; matrix homogSolSpace;
7291  if (pMat->rows() != pMat->cols())
7292  {
7293  Werror("first matrix (%d x %d) is not quadratic",
7294  pMat->rows(), pMat->cols());
7295  return TRUE;
7296  }
7297  if (lMat->rows() != lMat->cols())
7298  {
7299  Werror("second matrix (%d x %d) is not quadratic",
7300  lMat->rows(), lMat->cols());
7301  return TRUE;
7302  }
7303  if (lMat->rows() != uMat->rows())
7304  {
7305  Werror("second matrix (%d x %d) and third matrix (%d x %d) do not fit",
7306  lMat->rows(), lMat->cols(), uMat->rows(), uMat->cols());
7307  return TRUE;
7308  }
7309  if (uMat->rows() != bVec->rows())
7310  {
7311  Werror("third matrix (%d x %d) and vector (%d x 1) do not fit",
7312  uMat->rows(), uMat->cols(), bVec->rows());
7313  return TRUE;
7314  }
7315  if (!idIsConstant((ideal)pMat)
7316  ||(!idIsConstant((ideal)lMat))
7317  ||(!idIsConstant((ideal)uMat))
7318  )
7319  {
7320  WerrorS("matrices must be constant");
7321  return TRUE;
7322  }
7323  solvable = luSolveViaLUDecomp(pMat, lMat, uMat, bVec, xVec, homogSolSpace);
7324 
7325  /* build the return structure; a list with either one or three entries */
7327  if (solvable)
7328  {
7329  ll->Init(3);
7330  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7331  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
7332  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
7333  }
7334  else
7335  {
7336  ll->Init(1);
7337  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
7338  }
7339 
7340  res->data=(char*)ll;
7341  return FALSE;
7342 }
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:94
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
ip_smatrix * matrix
leftv next
Definition: subexpr.h:88
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:6460
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
omBin slists_bin
Definition: lists.cc:23
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define idIsConstant(I)
Definition: ideals.h:42

§ jjMakeSub()

static Subexpr jjMakeSub ( leftv  e)
static

Definition at line 8045 of file iparith.cc.

8046 {
8047  assume( e->Typ()==INT_CMD );
8048  Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
8049  r->start =(int)(long)e->Data();
8050  return r;
8051 }
Definition: tok.h:94
int Typ()
Definition: subexpr.cc:979
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
omBin sSubexpr_bin
Definition: subexpr.cc:49
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void * Data()
Definition: subexpr.cc:1121

§ jjMAP()

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

Definition at line 1638 of file iparith.cc.

1639 {
1640  //Print("try to map %s with %s\n",$3.Name(),$1.Name());
1641  leftv sl=NULL;
1642  if ((v->e==NULL)&&(v->name!=NULL))
1643  {
1644  map m=(map)u->Data();
1645  sl=iiMap(m,v->name);
1646  }
1647  else
1648  {
1649  Werror("%s(<name>) expected",u->Name());
1650  }
1651  if (sl==NULL) return TRUE;
1652  memcpy(res,sl,sizeof(sleftv));
1654  return FALSE;
1655 }
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:84
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
const char * Name()
Definition: subexpr.h:122
const char * name
Definition: subexpr.h:89
int m
Definition: cfEzgcd.cc:119
omBin sleftv_bin
Definition: subexpr.cc:50
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
leftv iiMap(map theMap, const char *what)
Definition: ipshell.cc:609
#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 6503 of file iparith.cc.

6504 {
6505  int mi=(int)(long)v->Data();
6506  int ni=(int)(long)w->Data();
6507  if ((mi<1)||(ni<1))
6508  {
6509  Werror("converting ideal to matrix: dimensions must be positive(%dx%d)",mi,ni);
6510  return TRUE;
6511  }
6512  matrix m=mpNew(mi,ni);
6513  ideal I=(ideal)u->CopyD(IDEAL_CMD);
6514  int i=si_min(IDELEMS(I),mi*ni);
6515  //for(i=i-1;i>=0;i--)
6516  //{
6517  // m->m[i]=I->m[i];
6518  // I->m[i]=NULL;
6519  //}
6520  memcpy(m->m,I->m,i*sizeof(poly));
6521  memset(I->m,0,i*sizeof(poly));
6522  id_Delete(&I,currRing);
6523  res->data = (char *)m;
6524  return FALSE;
6525 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:48
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjMATRIX_Ma()

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

Definition at line 6539 of file iparith.cc.

6540 {
6541  int mi=(int)(long)v->Data();
6542  int ni=(int)(long)w->Data();
6543  if ((mi<1)||(ni<1))
6544  {
6545  Werror("converting matrix to matrix: dimensions must be positive(%dx%d)",mi,ni);
6546  return TRUE;
6547  }
6548  matrix m=mpNew(mi,ni);
6549  matrix I=(matrix)u->CopyD(MATRIX_CMD);
6550  int r=si_min(MATROWS(I),mi);
6551  int c=si_min(MATCOLS(I),ni);
6552  int i,j;
6553  for(i=r;i>0;i--)
6554  {
6555  for(j=c;j>0;j--)
6556  {
6557  MATELEM(m,i,j)=MATELEM(I,i,j);
6558  MATELEM(I,i,j)=NULL;
6559  }
6560  }
6561  id_Delete((ideal *)&I,currRing);
6562  res->data = (char *)m;
6563  return FALSE;
6564 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:48
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
#define MATROWS(i)
Definition: matpol.h:27
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679
#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 6526 of file iparith.cc.

6527 {
6528  int mi=(int)(long)v->Data();
6529  int ni=(int)(long)w->Data();
6530  if ((mi<1)||(ni<1))
6531  {
6532  Werror("converting module to matrix: dimensions must be positive(%dx%d)",mi,ni);
6533  return TRUE;
6534  }
6535  res->data = (char *)id_Module2formatedMatrix((ideal)u->CopyD(MODUL_CMD),
6536  mi,ni,currRing);
6537  return FALSE;
6538 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjMEMORY()

static BOOLEAN jjMEMORY ( leftv  res,
leftv  v 
)
static

Definition at line 4616 of file iparith.cc.

4617 {
4618  omUpdateInfo();
4619  switch(((int)(long)v->Data()))
4620  {
4621  case 0:
4622  res->data=(char *)n_Init(om_Info.UsedBytes,coeffs_BIGINT);
4623  break;
4624  case 1:
4625  res->data = (char *)n_Init(om_Info.CurrentBytesSystem,coeffs_BIGINT);
4626  break;
4627  case 2:
4628  res->data = (char *)n_Init(om_Info.MaxBytesSystem,coeffs_BIGINT);
4629  break;
4630  default:
4631  omPrintStats(stdout);
4632  omPrintInfo(stdout);
4633  omPrintBinStats(stdout);
4634  res->data = (char *)0;
4635  res->rtyp = NONE;
4636  }
4637  return FALSE;
4638  res->data = (char *)0;
4639  return FALSE;
4640 }
void omPrintInfo(FILE *fd)
Definition: omStats.c:127
#define FALSE
Definition: auxiliary.h:97
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:114
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
omInfo_t om_Info
Definition: omStats.c:13
void omUpdateInfo()
Definition: omStats.c:24
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
#define NONE
Definition: tok.h:216

§ jjMINOR_M()

static BOOLEAN jjMINOR_M ( leftv  res,
leftv  v 
)
static

Definition at line 6057 of file iparith.cc.

6058 {
6059  /* Here's the use pattern for the minor command:
6060  minor ( matrix_expression m, int_expression minorSize,
6061  optional ideal_expression IasSB, optional int_expression k,
6062  optional string_expression algorithm,
6063  optional int_expression cachedMinors,
6064  optional int_expression cachedMonomials )
6065  This method here assumes that there are at least two arguments.
6066  - If IasSB is present, it must be a std basis. All minors will be
6067  reduced w.r.t. IasSB.
6068  - If k is absent, all non-zero minors will be computed.
6069  If k is present and k > 0, the first k non-zero minors will be
6070  computed.
6071  If k is present and k < 0, the first |k| minors (some of which
6072  may be zero) will be computed.
6073  If k is present and k = 0, an error is reported.
6074  - If algorithm is absent, all the following arguments must be absent too.
6075  In this case, a heuristic picks the best-suited algorithm (among
6076  Bareiss, Laplace, and Laplace with caching).
6077  If algorithm is present, it must be one of "Bareiss", "bareiss",
6078  "Laplace", "laplace", "Cache", "cache". In the cases "Cache" and
6079  "cache" two more arguments may be given, determining how many entries
6080  the cache may have at most, and how many cached monomials there are at
6081  most. (Cached monomials are counted over all cached polynomials.)
6082  If these two additional arguments are not provided, 200 and 100000
6083  will be used as defaults.
6084  */
6085  matrix m;
6086  leftv u=v->next;
6087  v->next=NULL;
6088  int v_typ=v->Typ();
6089  if (v_typ==MATRIX_CMD)
6090  {
6091  m = (const matrix)v->Data();
6092  }
6093  else
6094  {
6095  if (v_typ==0)
6096  {
6097  Werror("`%s` is undefined",v->Fullname());
6098  return TRUE;
6099  }
6100  // try to convert to MATRIX:
6101  int ii=iiTestConvert(v_typ,MATRIX_CMD);
6102  BOOLEAN bo;
6103  sleftv tmp;
6104  if (ii>0) bo=iiConvert(v_typ,MATRIX_CMD,ii,v,&tmp);
6105  else bo=TRUE;
6106  if (bo)
6107  {
6108  Werror("cannot convert %s to matrix",Tok2Cmdname(v_typ));
6109  return TRUE;
6110  }
6111  m=(matrix)tmp.data;
6112  }
6113  const int mk = (const int)(long)u->Data();
6114  bool noIdeal = true; bool noK = true; bool noAlgorithm = true;
6115  bool noCacheMinors = true; bool noCacheMonomials = true;
6116  ideal IasSB; int k; char* algorithm; int cacheMinors; int cacheMonomials;
6117 
6118  /* here come the different cases of correct argument sets */
6119  if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD))
6120  {
6121  IasSB = (ideal)u->next->Data();
6122  noIdeal = false;
6123  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
6124  {
6125  k = (int)(long)u->next->next->Data();
6126  noK = false;
6127  assume(k != 0);
6128  if ((u->next->next->next != NULL) &&
6129  (u->next->next->next->Typ() == STRING_CMD))
6130  {
6131  algorithm = (char*)u->next->next->next->Data();
6132  noAlgorithm = false;
6133  if ((u->next->next->next->next != NULL) &&
6134  (u->next->next->next->next->Typ() == INT_CMD))
6135  {
6136  cacheMinors = (int)(long)u->next->next->next->next->Data();
6137  noCacheMinors = false;
6138  if ((u->next->next->next->next->next != NULL) &&
6139  (u->next->next->next->next->next->Typ() == INT_CMD))
6140  {
6141  cacheMonomials =
6142  (int)(long)u->next->next->next->next->next->Data();
6143  noCacheMonomials = false;
6144  }
6145  }
6146  }
6147  }
6148  }
6149  else if ((u->next != NULL) && (u->next->Typ() == INT_CMD))
6150  {
6151  k = (int)(long)u->next->Data();
6152  noK = false;
6153  assume(k != 0);
6154  if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD))
6155  {
6156  algorithm = (char*)u->next->next->Data();
6157  noAlgorithm = false;
6158  if ((u->next->next->next != NULL) &&
6159  (u->next->next->next->Typ() == INT_CMD))
6160  {
6161  cacheMinors = (int)(long)u->next->next->next->Data();
6162  noCacheMinors = false;
6163  if ((u->next->next->next->next != NULL) &&
6164  (u->next->next->next->next->Typ() == INT_CMD))
6165  {
6166  cacheMonomials = (int)(long)u->next->next->next->next->Data();
6167  noCacheMonomials = false;
6168  }
6169  }
6170  }
6171  }
6172  else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD))
6173  {
6174  algorithm = (char*)u->next->Data();
6175  noAlgorithm = false;
6176  if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
6177  {
6178  cacheMinors = (int)(long)u->next->next->Data();
6179  noCacheMinors = false;
6180  if ((u->next->next->next != NULL) &&
6181  (u->next->next->next->Typ() == INT_CMD))
6182  {
6183  cacheMonomials = (int)(long)u->next->next->next->Data();
6184  noCacheMonomials = false;
6185  }
6186  }
6187  }
6188 
6189  /* upper case conversion for the algorithm if present */
6190  if (!noAlgorithm)
6191  {
6192  if (strcmp(algorithm, "bareiss") == 0)
6193  algorithm = (char*)"Bareiss";
6194  if (strcmp(algorithm, "laplace") == 0)
6195  algorithm = (char*)"Laplace";
6196  if (strcmp(algorithm, "cache") == 0)
6197  algorithm = (char*)"Cache";
6198  }
6199 
6200  v->next=u;
6201  /* here come some tests */
6202  if (!noIdeal)
6203  {
6204  assumeStdFlag(u->next);
6205  }
6206  if ((!noK) && (k == 0))
6207  {
6208  WerrorS("Provided number of minors to be computed is zero.");
6209  return TRUE;
6210  }
6211  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") != 0)
6212  && (strcmp(algorithm, "Laplace") != 0)
6213  && (strcmp(algorithm, "Cache") != 0))
6214  {
6215  WerrorS("Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
6216  return TRUE;
6217  }
6218  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
6220  {
6221  Werror("Bareiss algorithm not defined over coefficient rings %s",
6222  "with zero divisors.");
6223  return TRUE;
6224  }
6225  res->rtyp=IDEAL_CMD;
6226  if ((mk < 1) || (mk > m->rows()) || (mk > m->cols()))
6227  {
6228  ideal I=idInit(1,1);
6229  if (mk<1) I->m[0]=p_One(currRing);
6230  //Werror("invalid size of minors: %d (matrix is (%d x %d))", mk,
6231  // m->rows(), m->cols());
6232  res->data=(void*)I;
6233  return FALSE;
6234  }
6235  if ((!noAlgorithm) && (strcmp(algorithm, "Cache") == 0)
6236  && (noCacheMinors || noCacheMonomials))
6237  {
6238  cacheMinors = 200;
6239  cacheMonomials = 100000;
6240  }
6241 
6242  /* here come the actual procedure calls */
6243  if (noAlgorithm)
6244  res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k),
6245  (noIdeal ? 0 : IasSB), false);
6246  else if (strcmp(algorithm, "Cache") == 0)
6247  res->data = getMinorIdealCache(m, mk, (noK ? 0 : k),
6248  (noIdeal ? 0 : IasSB), 3, cacheMinors,
6249  cacheMonomials, false);
6250  else
6251  res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm,
6252  (noIdeal ? 0 : IasSB), false);
6253  if (v_typ!=MATRIX_CMD) idDelete((ideal *)&m);
6254  return FALSE;
6255 }
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:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
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:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
int Typ()
Definition: subexpr.cc:979
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
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:8952
poly p_One(const ring r)
Definition: p_polys.cc:1313
#define assume(x)
Definition: mod2.h:403
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
leftv next
Definition: subexpr.h:88
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:93
void * Data()
Definition: subexpr.cc:1121
static BOOLEAN currRingIsOverIntegralDomain()
Definition: iparith.cc:6049
int BOOLEAN
Definition: auxiliary.h:88
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjMINRES_R()

static BOOLEAN jjMINRES_R ( leftv  res,
leftv  v 
)
static

Definition at line 4666 of file iparith.cc.

4667 {
4668  intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
4669 
4670  syStrategy tmp=(syStrategy)v->Data();
4671  tmp = syMinimize(tmp); // enrich itself!
4672 
4673  res->data=(char *)tmp;
4674 
4675  if (weights!=NULL)
4676  atSet(res, omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
4677 
4678  return FALSE;
4679 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:97
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
syStrategy syMinimize(syStrategy syzstr)
Definition: syz1.cc:2403
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 869 of file iparith.cc.

870 {
871  res->data = (char *)(n_Sub((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
872  return jjPLUSMINUS_Gen(res,u,v);
873 }
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:640
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjMINUS_BIM()

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

Definition at line 894 of file iparith.cc.

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

§ jjMINUS_I()

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

Definition at line 853 of file iparith.cc.

854 {
855  void *ap=u->Data(); void *bp=v->Data();
856  int aa=(int)(long)ap;
857  int bb=(int)(long)bp;
858  int cc=aa-bb;
859  unsigned int a=(unsigned int)(unsigned long)ap;
860  unsigned int b=(unsigned int)(unsigned long)bp;
861  unsigned int c=a-b;
862  if (((Sy_bit(31)&a)!=(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c)))
863  {
864  WarnS("int overflow(-), result may be wrong");
865  }
866  res->data = (char *)((long)cc);
867  return jjPLUSMINUS_Gen(res,u,v);
868 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
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:90
void * Data()
Definition: subexpr.cc:1121
const poly b
Definition: syzextra.cc:213

§ jjMINUS_IV()

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

Definition at line 884 of file iparith.cc.

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

§ jjMINUS_MA()

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

Definition at line 904 of file iparith.cc.

905 {
906  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
907  res->data = (char *)(mp_Sub(A , B, currRing));
908  if (res->data==NULL)
909  {
910  Werror("matrix size not compatible(%dx%d, %dx%d)",
911  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
912  return TRUE;
913  }
914  return jjPLUSMINUS_Gen(res,u,v);
915  return FALSE;
916 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
#define MATROWS(i)
Definition: matpol.h:27
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:207
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 874 of file iparith.cc.

875 {
876  res->data = (char *)(nSub((number)u->Data(), (number)v->Data()));
877  return jjPLUSMINUS_Gen(res,u,v);
878 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
void * data
Definition: subexpr.h:90
#define nSub(n1, n2)
Definition: numbers.h:22
void * Data()
Definition: subexpr.cc:1121

§ jjMINUS_P()

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

Definition at line 879 of file iparith.cc.

880 {
881  res->data = (char *)(pSub((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
882  return jjPLUSMINUS_Gen(res,u,v);
883 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
void * data
Definition: subexpr.h:90
#define pSub(a, b)
Definition: polys.h:270
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjMOD_BI()

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

Definition at line 2725 of file iparith.cc.

2726 {
2727  number q=(number)v->Data();
2728  if (n_IsZero(q,coeffs_BIGINT))
2729  {
2731  return TRUE;
2732  }
2733  res->data =(char *) n_IntMod((number)u->Data(),q,coeffs_BIGINT);
2734  return FALSE;
2735 }
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:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121
#define ii_div_by_0
Definition: iparith.cc:225

§ jjMOD_N()

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

Definition at line 2736 of file iparith.cc.

2737 {
2738  number q=(number)v->Data();
2739  if (nIsZero(q))
2740  {
2742  return TRUE;
2743  }
2744  res->data =(char *) n_IntMod((number)u->Data(),q,currRing->cf);
2745  return FALSE;
2746 }
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:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:1121
#define ii_div_by_0
Definition: iparith.cc:225

§ jjMODULO()

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

Definition at line 2676 of file iparith.cc.

2677 {
2678  intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
2679  tHomog hom=testHomog;
2680  if (w_u!=NULL)
2681  {
2682  w_u=ivCopy(w_u);
2683  hom=isHomog;
2684  }
2685  intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
2686  if (w_v!=NULL)
2687  {
2688  w_v=ivCopy(w_v);
2689  hom=isHomog;
2690  }
2691  if ((w_u!=NULL) && (w_v==NULL))
2692  w_v=ivCopy(w_u);
2693  if ((w_v!=NULL) && (w_u==NULL))
2694  w_u=ivCopy(w_v);
2695  ideal u_id=(ideal)u->Data();
2696  ideal v_id=(ideal)v->Data();
2697  if (w_u!=NULL)
2698  {
2699  if ((*w_u).compare((w_v))!=0)
2700  {
2701  WarnS("incompatible weights");
2702  delete w_u; w_u=NULL;
2703  hom=testHomog;
2704  }
2705  else
2706  {
2707  if ((!idTestHomModule(u_id,currRing->qideal,w_v))
2708  || (!idTestHomModule(v_id,currRing->qideal,w_v)))
2709  {
2710  WarnS("wrong weights");
2711  delete w_u; w_u=NULL;
2712  hom=testHomog;
2713  }
2714  }
2715  }
2716  res->data = (char *)idModulo(u_id,v_id ,hom,&w_u);
2717  if (w_u!=NULL)
2718  {
2719  atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD);
2720  }
2721  delete w_v;
2722  //if (TEST_OPT_RETURN_SB) setFlag(res,FLAG_STD);
2723  return FALSE;
2724 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w)
Definition: ideals.cc:1988
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjMONITOR1()

static BOOLEAN jjMONITOR1 ( leftv  res,
leftv  v 
)
static

Definition at line 2748 of file iparith.cc.

2749 {
2750  return jjMONITOR2(res,v,NULL);
2751 }
#define NULL
Definition: omList.c:10
static BOOLEAN jjMONITOR2(leftv res, leftv u, leftv v)
Definition: iparith.cc:2752

§ jjMONITOR2()

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

Definition at line 2752 of file iparith.cc.

2753 {
2754 #if 0
2755  char *opt=(char *)v->Data();
2756  int mode=0;
2757  while(*opt!='\0')
2758  {
2759  if (*opt=='i') mode |= SI_PROT_I;
2760  else if (*opt=='o') mode |= SI_PROT_O;
2761  opt++;
2762  }
2763  monitor((char *)(u->Data()),mode);
2764 #else
2765  si_link l=(si_link)u->Data();
2766  if (slOpen(l,SI_LINK_WRITE,u)) return TRUE;
2767  if(strcmp(l->m->type,"ASCII")!=0)
2768  {
2769  Werror("ASCII link required, not `%s`",l->m->type);
2770  slClose(l);
2771  return TRUE;
2772  }
2773  SI_LINK_SET_CLOSE_P(l); // febase handles the FILE*
2774  if ( l->name[0]!='\0') // "" is the stop condition
2775  {
2776  const char *opt;
2777  int mode=0;
2778  if (v==NULL) opt=(const char*)"i";
2779  else opt=(const char *)v->Data();
2780  while(*opt!='\0')
2781  {
2782  if (*opt=='i') mode |= SI_PROT_I;
2783  else if (*opt=='o') mode |= SI_PROT_O;
2784  opt++;
2785  }
2786  monitor((FILE *)l->data,mode);
2787  }
2788  else
2789  monitor(NULL,0);
2790  return FALSE;
2791 #endif
2792 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#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:1121
#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 2793 of file iparith.cc.

2794 {
2795  intvec *iv=(intvec *)v->Data();
2796  poly p=pOne();
2797  int i,e;
2798  BOOLEAN err=FALSE;
2799  for(i=si_min(currRing->N,iv->length()); i>0; i--)
2800  {
2801  e=(*iv)[i-1];
2802  if (e>=0) pSetExp(p,i,e);
2803  else err=TRUE;
2804  }
2805  if (iv->length()==(currRing->N+1))
2806  {
2807  res->rtyp=VECTOR_CMD;
2808  e=(*iv)[currRing->N];
2809  if (e>=0) pSetComp(p,e);
2810  else err=TRUE;
2811  }
2812  pSetm(p);
2813  res->data=(char*)p;
2814  if(err) { pDelete(&p); WerrorS("no negative exponent allowed"); }
2815  return err;
2816 }
#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:124
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:298
int length() const
Definition: intvec.h:86
#define pDelete(p_ptr)
Definition: polys.h:169
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ jjmpTrace()

static BOOLEAN jjmpTrace ( leftv  res,
leftv  v 
)
static

Definition at line 5465 of file iparith.cc.

5466 {
5467  res->data = (char *)mp_Trace((matrix)v->Data(),currRing);
5468  return FALSE;
5469 }
#define FALSE
Definition: auxiliary.h:97
poly mp_Trace(matrix a, const ring R)
Definition: matpol.cc:289
void * data
Definition: subexpr.h:90
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:1121

§ jjmpTransp()

static BOOLEAN jjmpTransp ( leftv  res,
leftv  v 
)
static

Definition at line 5470 of file iparith.cc.

5471 {
5472  res->data = (char *)mp_Transp((matrix)v->Data(),currRing);
5473  return FALSE;
5474 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
matrix mp_Transp(matrix a, const ring R)
Definition: matpol.cc:268
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:1121

§ jjMSTD()

static BOOLEAN jjMSTD ( leftv  res,
leftv  v 
)
static

Definition at line 4645 of file iparith.cc.

4646 {
4647  int t=v->Typ();
4648  ideal r,m;
4649  r=kMin_std((ideal)v->Data(),currRing->qideal,testHomog,NULL,m);
4651  l->Init(2);
4652  l->m[0].rtyp=t;
4653  l->m[0].data=(char *)r;
4654  setFlag(&(l->m[0]),FLAG_STD);
4655  l->m[1].rtyp=t;
4656  l->m[1].data=(char *)m;
4657  res->data=(char *)l;
4658  return FALSE;
4659 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:1121
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 4660 of file iparith.cc.

4661 {
4662  assumeStdFlag(v);
4663  res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal);
4664  return FALSE;
4665 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121

§ jjN2BI()

static BOOLEAN jjN2BI ( leftv  res,
leftv  v 
)
static

Definition at line 4680 of file iparith.cc.

4681 {
4682  number n,i; i=(number)v->Data();
4684  if (nMap!=NULL)
4685  n=nMap(i,currRing->cf,coeffs_BIGINT);
4686  else goto err;
4687  res->data=(void *)n;
4688  return FALSE;
4689 err:
4690  WerrorS("cannot convert to bigint"); return TRUE;
4691 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121

§ jjNAMEOF()

static BOOLEAN jjNAMEOF ( leftv  res,
leftv  v 
)
static

Definition at line 4692 of file iparith.cc.

4693 {
4694  res->data = (char *)v->name;
4695  if (res->data==NULL) res->data=omStrDup("");
4696  v->name=NULL;
4697  return FALSE;
4698 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
const char * name
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjNAMES()

static BOOLEAN jjNAMES ( leftv  res,
leftv  v 
)
static

Definition at line 4699 of file iparith.cc.

4700 {
4701  res->data=ipNameList(((ring)v->Data())->idroot);
4702  return FALSE;
4703 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
lists ipNameList(idhdl root)
Definition: ipid.cc:527
void * Data()
Definition: subexpr.cc:1121

§ jjNAMES0()

static BOOLEAN jjNAMES0 ( leftv  res,
leftv   
)
static

Definition at line 7531 of file iparith.cc.

7532 {
7533  res->data=(void *)ipNameList(IDROOT);
7534  return FALSE;
7535 }
#define FALSE
Definition: auxiliary.h:97
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:90
lists ipNameList(idhdl root)
Definition: ipid.cc:527

§ jjNAMES_I()

static BOOLEAN jjNAMES_I ( leftv  res,
leftv  v 
)
static

Definition at line 4704 of file iparith.cc.

4705 {
4706  res->data=ipNameListLev((IDROOT),(int)(long)v->Data());
4707  return FALSE;
4708 }
#define FALSE
Definition: auxiliary.h:97
#define IDROOT
Definition: ipid.h:20
void * data
Definition: subexpr.h:90
lists ipNameListLev(idhdl root, int lev)
Definition: ipid.cc:550
void * Data()
Definition: subexpr.cc:1121

§ jjNEWSTRUCT2()

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

Definition at line 2817 of file iparith.cc.

2818 {
2819  // u: the name of the new type
2820  // v: the elements
2821  newstruct_desc d=newstructFromString((const char *)v->Data());
2822  if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
2823  return d==NULL;
2824 }
newstruct_desc newstructFromString(const char *s)
Definition: newstruct.cc:796
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
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 6256 of file iparith.cc.

6257 {
6258  // u: the name of the new type
6259  // v: the parent type
6260  // w: the elements
6261  newstruct_desc d=newstructChildFromString((const char *)v->Data(),
6262  (const char *)w->Data());
6263  if (d!=NULL) newstruct_setup((const char *)u->Data(),d);
6264  return (d==NULL);
6265 }
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
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 5505 of file iparith.cc.

5506 {
5507  number n=(number)u->CopyD(); // n_Int may call n_Normalize
5508  res->data=(char *)(long)iin_Int(n,currRing->cf);
5509  n_Delete(&n,currRing->cf);
5510  return FALSE;
5511 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:230
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjnlInt()

static BOOLEAN jjnlInt ( leftv  res,
leftv  u 
)
static

Definition at line 5512 of file iparith.cc.

5513 {
5514  number n=(number)u->Data();
5515  res->data=(char *)(long)iin_Int(n,coeffs_BIGINT );
5516  return FALSE;
5517 }
#define FALSE
Definition: auxiliary.h:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
static int iin_Int(number &n, coeffs cf)
Definition: iparith.cc:230

§ jjNOT()

static BOOLEAN jjNOT ( leftv  res,
leftv  v 
)
static

Definition at line 4709 of file iparith.cc.

4710 {
4711  res->data=(char*)(long)((long)v->Data()==0 ? 1 : 0);
4712  return FALSE;
4713 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjNULL()

static BOOLEAN jjNULL ( leftv  ,
leftv   
)
static

Definition at line 3674 of file iparith.cc.

3675 {
3676  return FALSE;
3677 }
#define FALSE
Definition: auxiliary.h:97

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

3964 {
3965  number n = reinterpret_cast<number>(v->Data());
3966  res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing));
3967  return FALSE;
3968 }
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:97
void * data
Definition: subexpr.h:90
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:1121

§ jjNVARS()

static BOOLEAN jjNVARS ( leftv  res,
leftv  v 
)
static

Definition at line 4714 of file iparith.cc.

4715 {
4716  res->data = (char *)(long)(((ring)(v->Data()))->N);
4717  return FALSE;
4718 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjOP_BI_BIM()

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

Definition at line 288 of file iparith.cc.

289 {
290  return jjOP_BIM_BI(res, v, u);
291 }
static BOOLEAN jjOP_BIM_BI(leftv res, leftv u, leftv v)
Definition: iparith.cc:275

§ jjOP_BIM_BI()

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

Definition at line 275 of file iparith.cc.

276 {
277  bigintmat* aa= (bigintmat *)u->Data();
278  number bb = (number)(v->Data());
279  if (errorreported) return TRUE;
280  bigintmat *cc=NULL;
281  switch (iiOp)
282  {
283  case '*': cc=bimMult(aa,bb,coeffs_BIGINT); break;
284  }
285  res->data=(char *)cc;
286  return cc==NULL;
287 }
Matrices of numbers.
Definition: bigintmat.h:51
#define TRUE
Definition: auxiliary.h:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121
int iiOp
Definition: iparith.cc:227

§ jjOP_BIM_I()

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

Definition at line 256 of file iparith.cc.

257 {
258  bigintmat* aa= (bigintmat *)u->Data();
259  int bb = (int)(long)(v->Data());
260  if (errorreported) return TRUE;
261  bigintmat *cc=NULL;
262  switch (iiOp)
263  {
264  case '+': cc=bimAdd(aa,bb); break;
265  case '-': cc=bimSub(aa,bb); break;
266  case '*': cc=bimMult(aa,bb); break;
267  }
268  res->data=(char *)cc;
269  return cc==NULL;
270 }
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:101
void * data
Definition: subexpr.h:90
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:1121
int iiOp
Definition: iparith.cc:227

§ jjOP_I_BIM()

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

Definition at line 271 of file iparith.cc.

272 {
273  return jjOP_BIM_I(res, v, u);
274 }
static BOOLEAN jjOP_BIM_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:256

§ jjOP_I_IM()

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

Definition at line 328 of file iparith.cc.

329 {
330  return jjOP_IM_I(res,v,u);
331 }
static BOOLEAN jjOP_IM_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:313

§ jjOP_I_IV()

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

Definition at line 309 of file iparith.cc.

310 {
311  return jjOP_IV_I(res,v,u);
312 }
static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
Definition: iparith.cc:292

§ jjOP_IM_I()

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

Definition at line 313 of file iparith.cc.

314 {
315  intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
316  int bb = (int)(long)(v->Data());
317  int i=si_min(aa->rows(),aa->cols());
318  switch (iiOp)
319  {
320  case '+': for (;i>0;i--) IMATELEM(*aa,i,i) += bb;
321  break;
322  case '-': for (;i>0;i--) IMATELEM(*aa,i,i) -= bb;
323  break;
324  }
325  res->data=(char *)aa;
326  return FALSE;
327 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjOP_IV_I()

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

Definition at line 292 of file iparith.cc.

293 {
294  intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
295  int bb = (int)(long)(v->Data());
296  if (errorreported) return TRUE;
297  switch (iiOp)
298  {
299  case '+': (*aa) += bb; break;
300  case '-': (*aa) -= bb; break;
301  case '*': (*aa) *= bb; break;
302  case '/':
303  case INTDIV_CMD: (*aa) /= bb; break;
304  case '%': (*aa) %= bb; break;
305  }
306  res->data=(char *)aa;
307  return FALSE;
308 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
Definition: tok.h:99
short errorreported
Definition: feFopen.cc:23
Definition: tok.h:95
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjOP_REST()

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

Definition at line 516 of file iparith.cc.

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

§ jjOpenClose()

static BOOLEAN jjOpenClose ( leftv  ,
leftv  v 
)
static

Definition at line 4719 of file iparith.cc.

4720 {
4721  si_link l=(si_link)v->Data();
4722  if (iiOp==OPEN_CMD) return slOpen(l, SI_LINK_OPEN,v);
4723  else { slPrepClose(l); return slClose(l);}
4724 }
Definition: tok.h:142
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
int l
Definition: cfEzgcd.cc:94

§ jjOPPOSE()

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

Definition at line 2941 of file iparith.cc.

2942 {
2943  /* number, poly, vector, ideal, module, matrix */
2944  ring r = (ring)a->Data();
2945  if (r == currRing)
2946  {
2947  res->data = b->Data();
2948  res->rtyp = b->rtyp;
2949  return FALSE;
2950  }
2951  if (!rIsLikeOpposite(currRing, r))
2952  {
2953  Werror("%s is not an opposite ring to current ring",a->Fullname());
2954  return TRUE;
2955  }
2956  idhdl w;
2957  if( ((w=r->idroot->get(b->Name(),myynest))!=NULL) && (b->e==NULL))
2958  {
2959  int argtype = IDTYP(w);
2960  switch (argtype)
2961  {
2962  case NUMBER_CMD:
2963  {
2964  /* since basefields are equal, we can apply nCopy */
2965  res->data = nCopy((number)IDDATA(w));
2966  res->rtyp = argtype;
2967  break;
2968  }
2969  case POLY_CMD:
2970  case VECTOR_CMD:
2971  {
2972  poly q = (poly)IDDATA(w);
2973  res->data = pOppose(r,q,currRing);
2974  res->rtyp = argtype;
2975  break;
2976  }
2977  case IDEAL_CMD:
2978  case MODUL_CMD:
2979  {
2980  ideal Q = (ideal)IDDATA(w);
2981  res->data = idOppose(r,Q,currRing);
2982  res->rtyp = argtype;
2983  break;
2984  }
2985  case MATRIX_CMD:
2986  {
2987  ring save = currRing;
2988  rChangeCurrRing(r);
2989  matrix m = (matrix)IDDATA(w);
2990  ideal Q = id_Matrix2Module(mp_Copy(m, currRing),currRing);
2991  rChangeCurrRing(save);
2992  ideal S = idOppose(r,Q,currRing);
2993  id_Delete(&Q, r);
2994  res->data = id_Module2Matrix(S,currRing);
2995  res->rtyp = argtype;
2996  break;
2997  }
2998  default:
2999  {
3000  WerrorS("unsupported type in oppose");
3001  return TRUE;
3002  }
3003  }
3004  }
3005  else
3006  {
3007  Werror("identifier %s not found in %s",b->Fullname(),a->Fullname());
3008  return TRUE;
3009  }
3010  return FALSE;
3011 }
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3427
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:3400
Subexpr e
Definition: subexpr.h:107
#define FALSE
Definition: auxiliary.h:97
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define Q
Definition: sirandom.c:25
const char * Name()
Definition: subexpr.h:122
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:3466
const char * Fullname()
Definition: subexpr.h:127
idhdl get(const char *s, int lev)
Definition: ipid.cc:91
void * data
Definition: subexpr.h:90
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:93
#define nCopy(n)
Definition: numbers.h:15
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
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 5160 of file iparith.cc.

5161 {
5162  ring r = (ring)a->Data();
5163  //if (rIsPluralRing(r))
5164  if (r->OrdSgn==1)
5165  {
5166  res->data = rOpposite(r);
5167  }
5168  else
5169  {
5170  WarnS("opposite only for global orderings");
5171  res->data = rCopy(r);
5172  }
5173  return FALSE;
5174 }
#define FALSE
Definition: auxiliary.h:97
ring rOpposite(ring src)
Definition: ring.cc:5185
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
ring rCopy(ring r)
Definition: ring.cc:1619
void * Data()
Definition: subexpr.cc:1121

§ jjOPTION_PL()

static BOOLEAN jjOPTION_PL ( leftv  res,
leftv  v 
)
static

Definition at line 7536 of file iparith.cc.

7537 {
7538  if(v==NULL)
7539  {
7540  res->data=(char *)showOption();
7541  return FALSE;
7542  }
7543  res->rtyp=NONE;
7544  return setOption(res,v);
7545 }
#define FALSE
Definition: auxiliary.h:97
char * showOption()
Definition: misc_ip.cc:717
void * data
Definition: subexpr.h:90
BOOLEAN setOption(leftv res, leftv v)
Definition: misc_ip.cc:575
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
#define NONE
Definition: tok.h:216

§ jjOR_I()

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

Definition at line 1367 of file iparith.cc.

1368 {
1369  res->data = (char *)((long)u->Data() || (long)v->Data());
1370  return FALSE;
1371 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjORD()

static BOOLEAN jjORD ( leftv  res,
leftv  v 
)
static

Definition at line 4725 of file iparith.cc.

4726 {
4727  poly p=(poly)v->Data();
4728  res->data=(char *)( p==NULL ? -1 : currRing->pFDeg(p,currRing) );
4729  return FALSE;
4730 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjP2BI()

static BOOLEAN jjP2BI ( leftv  res,
leftv  v 
)
static

Definition at line 4771 of file iparith.cc.

4772 {
4773  poly p=(poly)v->Data();
4774  if (p==NULL) { res->data=(char *)n_Init(0,coeffs_BIGINT); return FALSE; }
4775  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4776  {
4777  WerrorS("poly must be constant");
4778  return TRUE;
4779  }
4780  number i=pGetCoeff(p);
4781  number n;
4783  if (nMap!=NULL)
4784  n=nMap(i,currRing->cf,coeffs_BIGINT);
4785  else goto err;
4786  res->data=(void *)n;
4787  return FALSE;
4788 err:
4789  WerrorS("cannot convert to bigint"); return TRUE;
4790 }
#define FALSE
Definition: auxiliary.h:97
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:101
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:90
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:1121
polyrec * poly
Definition: hilb.h:10

§ jjP2I()

static BOOLEAN jjP2I ( leftv  res,
leftv  v 
)
static

Definition at line 4791 of file iparith.cc.

4792 {
4793  poly p=(poly)v->Data();
4794  if (p==NULL) { /*res->data=(char *)0;*/ return FALSE; }
4795  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
4796  {
4797  WerrorS("poly must be constant");
4798  return TRUE;
4799  }
4800  res->data = (char *)(long)iin_Int(pGetCoeff(p),currRing->cf);
4801  return FALSE;
4802 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
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:90
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:1121
polyrec * poly
Definition: hilb.h:10
static int iin_Int(number &n, coeffs cf)
Definition: iparith.cc:230

§ jjP2N()

static BOOLEAN jjP2N ( leftv  res,
leftv  v 
)
static

Definition at line 4839 of file iparith.cc.

4840 {
4841  number n;
4842  poly p;
4843  if (((p=(poly)v->Data())!=NULL)
4844  && (pIsConstant(p)))
4845  {
4846  n=nCopy(pGetCoeff(p));
4847  }
4848  else
4849  {
4850  n=nInit(0);
4851  }
4852  res->data = (char *)n;
4853  return FALSE;
4854 }
#define FALSE
Definition: auxiliary.h:97
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:90
#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:1121
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 4731 of file iparith.cc.

4732 {
4733  int i=(int)(long)v->Data();
4734  int p=0;
4735  p=rPar(currRing);
4736  if ((0<i) && (i<=p))
4737  {
4738  res->data=(char *)n_Param(i,currRing);
4739  }
4740  else
4741  {
4742  Werror("par number %d out of range 1..%d",i,p);
4743  return TRUE;
4744  }
4745  return FALSE;
4746 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjPARDEG()

static BOOLEAN jjPARDEG ( leftv  res,
leftv  v 
)
static

Definition at line 4747 of file iparith.cc.

4748 {
4749  number nn=(number)v->Data();
4750  res->data = (char *)(long)n_ParDeg(nn, currRing);
4751  return FALSE;
4752 }
#define FALSE
Definition: auxiliary.h:97
static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
Definition: coeffs.h:804
void * data
Definition: subexpr.h:90
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:1121

§ jjPARSTR1()

static BOOLEAN jjPARSTR1 ( leftv  res,
leftv  v 
)
static

Definition at line 4753 of file iparith.cc.

4754 {
4755  if (currRing==NULL)
4756  {
4757  WerrorS("no ring active");
4758  return TRUE;
4759  }
4760  int i=(int)(long)v->Data();
4761  int p=0;
4762  if ((0<i) && (rParameter(currRing)!=NULL) && (i<=(p=rPar(currRing))))
4763  res->data=omStrDup(rParameter(currRing)[i-1]);
4764  else
4765  {
4766  Werror("par number %d out of range 1..%d",i,p);
4767  return TRUE;
4768  }
4769  return FALSE;
4770 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:613
void * data
Definition: subexpr.h:90
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:1121
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 2825 of file iparith.cc.

2826 {
2827  idhdl h=(idhdl)u->data;
2828  int i=(int)(long)v->Data();
2829  int p=0;
2830  if ((0<i)
2831  && (rParameter(IDRING(h))!=NULL)
2832  && (i<=(p=rPar(IDRING(h)))))
2833  res->data=omStrDup(rParameter(IDRING(h))[i-1]);
2834  else
2835  {
2836  Werror("par number %d out of range 1..%d",i,p);
2837  return TRUE;
2838  }
2839  return FALSE;
2840 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define TRUE
Definition: auxiliary.h:101
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:613
Definition: idrec.h:34
void * data
Definition: subexpr.h:90
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:1121
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 4577 of file iparith.cc.

4578 {
4579  /* call method jjPFAC2 with second argument = 0 (meaning that no
4580  valid bound for the prime factors has been given) */
4581  sleftv tmp;
4582  memset(&tmp, 0, sizeof(tmp));
4583  tmp.rtyp = INT_CMD;
4584  return jjPFAC2(res, v, &tmp);
4585 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3310
int rtyp
Definition: subexpr.h:93

§ jjPFAC2()

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

Definition at line 3310 of file iparith.cc.

3311 {
3312  number n1; int i;
3313 
3314  if ((u->Typ() == BIGINT_CMD) ||
3315  ((u->Typ() == NUMBER_CMD) && rField_is_Q(currRing)))
3316  {
3317  n1 = (number)u->CopyD();
3318  }
3319  else if (u->Typ() == INT_CMD)
3320  {
3321  i = (int)(long)u->Data();
3322  n1 = n_Init(i, coeffs_BIGINT);
3323  }
3324  else
3325  {
3326  return TRUE;
3327  }
3328 
3329  i = (int)(long)v->Data();
3330 
3331  lists l = primeFactorisation(n1, i);
3332  n_Delete(&n1, coeffs_BIGINT);
3333  res->data = (char*)l;
3334  return FALSE;
3335 }
Definition: tok.h:94
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
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:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
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:1121
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:679
int l
Definition: cfEzgcd.cc:94

§ jjpHead()

static BOOLEAN jjpHead ( leftv  res,
leftv  v 
)
static

Definition at line 5439 of file iparith.cc.

5440 {
5441  res->data = (char *)pHead((poly)v->Data());
5442  return FALSE;
5443 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#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:1121
polyrec * poly
Definition: hilb.h:10

§ jjpLength()

static BOOLEAN jjpLength ( leftv  res,
leftv  v 
)
static

Definition at line 5414 of file iparith.cc.

5415 {
5416  res->data = (char *)(long)pLength((poly)v->Data());
5417  return FALSE;
5418 }
#define FALSE
Definition: auxiliary.h:97
static int pLength(poly a)
Definition: p_polys.h:189
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjPlural_mat_mat()

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

Definition at line 2902 of file iparith.cc.

2903 {
2904  if( currRing->qideal != NULL )
2905  {
2906  WerrorS("basering must NOT be a qring!");
2907  return TRUE;
2908  }
2909 
2910  if (iiOp==NCALGEBRA_CMD)
2911  {
2912  return nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,currRing,false,true,false,currRing);
2913  }
2914  else
2915  {
2916  ring r=rCopy(currRing);
2917  BOOLEAN result=nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,r,false,true,false,currRing);
2918  res->data=r;
2919  return result;
2920  }
2921 }
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:2747
ring rCopy(ring r)
Definition: ring.cc:1619
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
return result
Definition: facAbsBiFact.cc:76

§ jjPlural_mat_poly()

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

Definition at line 2882 of file iparith.cc.

2883 {
2884  if( currRing->qideal != NULL )
2885  {
2886  WerrorS("basering must NOT be a qring!");
2887  return TRUE;
2888  }
2889 
2890  if (iiOp==NCALGEBRA_CMD)
2891  {
2892  return nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),currRing,false,true,false,currRing);
2893  }
2894  else
2895  {
2896  ring r=rCopy(currRing);
2897  BOOLEAN result=nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),r,false,true,false,currRing);
2898  res->data=r;
2899  return result;
2900  }
2901 }
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:2747
ring rCopy(ring r)
Definition: ring.cc:1619
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
return result
Definition: facAbsBiFact.cc:76

§ jjPlural_num_mat()

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

Definition at line 2862 of file iparith.cc.

2863 {
2864  if( currRing->qideal != NULL )
2865  {
2866  WerrorS("basering must NOT be a qring!");
2867  return TRUE;
2868  }
2869 
2870  if (iiOp==NCALGEBRA_CMD)
2871  {
2872  return nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,currRing,false,true,false,currRing);
2873  }
2874  else
2875  {
2876  ring r=rCopy(currRing);
2877  BOOLEAN result=nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,r,false,true,false,currRing);
2878  res->data=r;
2879  return result;
2880  }
2881 }
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:2747
ring rCopy(ring r)
Definition: ring.cc:1619
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
return result
Definition: facAbsBiFact.cc:76

§ jjPlural_num_poly()

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

Definition at line 2842 of file iparith.cc.

2843 {
2844  if( currRing->qideal != NULL )
2845  {
2846  WerrorS("basering must NOT be a qring!");
2847  return TRUE;
2848  }
2849 
2850  if (iiOp==NCALGEBRA_CMD)
2851  {
2852  return nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),currRing,false,true,false,currRing);
2853  }
2854  else
2855  {
2856  ring r=rCopy(currRing);
2857  BOOLEAN result=nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),r,false,true,false,currRing);
2858  res->data=r;
2859  return result;
2860  }
2861 }
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:2747
ring rCopy(ring r)
Definition: ring.cc:1619
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
int BOOLEAN
Definition: auxiliary.h:88
return result
Definition: facAbsBiFact.cc:76

§ jjPLUS_BI()

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

Definition at line 776 of file iparith.cc.

777 {
778  res->data = (char *)(n_Add((number)u->Data(), (number)v->Data(),coeffs_BIGINT));
779  return jjPLUSMINUS_Gen(res,u,v);
780 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121

§ jjPLUS_BIM()

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

Definition at line 801 of file iparith.cc.

802 {
803  res->data = (char *)bimAdd((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
804  if (res->data==NULL)
805  {
806  WerrorS("bigintmat/cmatrix not compatible");
807  return TRUE;
808  }
809  return jjPLUSMINUS_Gen(res,u,v);
810 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
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:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjPLUS_I()

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

Definition at line 764 of file iparith.cc.

765 {
766  unsigned int a=(unsigned int)(unsigned long)u->Data();
767  unsigned int b=(unsigned int)(unsigned long)v->Data();
768  unsigned int c=a+b;
769  res->data = (char *)((long)c);
770  if (((Sy_bit(31)&a)==(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c)))
771  {
772  WarnS("int overflow(+), result may be wrong");
773  }
774  return jjPLUSMINUS_Gen(res,u,v);
775 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
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:90
void * Data()
Definition: subexpr.cc:1121
const poly b
Definition: syzextra.cc:213

§ jjPLUS_ID()

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

Definition at line 848 of file iparith.cc.

849 {
850  res->data = (char *)idAdd((ideal)u->Data(),(ideal)v->Data());
851  return jjPLUSMINUS_Gen(res,u,v);
852 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition: ideals.h:70

§ jjPLUS_IV()

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

Definition at line 791 of file iparith.cc.

792 {
793  res->data = (char *)ivAdd((intvec*)(u->Data()), (intvec*)(v->Data()));
794  if (res->data==NULL)
795  {
796  WerrorS("intmat size not compatible");
797  return TRUE;
798  }
799  return jjPLUSMINUS_Gen(res,u,v);
800 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
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 811 of file iparith.cc.

812 {
813  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
814  res->data = (char *)(mp_Add(A , B, currRing));
815  if (res->data==NULL)
816  {
817  Werror("matrix size not compatible(%dx%d, %dx%d)",
818  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
819  return TRUE;
820  }
821  return jjPLUSMINUS_Gen(res,u,v);
822 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:190
#define NULL
Definition: omList.c:10
b *CanonicalForm B
Definition: facBivar.cc:51
void * Data()
Definition: subexpr.cc:1121
#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 823 of file iparith.cc.

824 {
825  matrix m=(matrix)u->Data();
827  if (iiOp=='+')
828  res->data = (char *)mp_Add(m , p,currRing);
829  else
830  res->data = (char *)mp_Sub(m , p,currRing);
831  idDelete((ideal *)&p);
832  return jjPLUSMINUS_Gen(res,u,v);
833 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
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:124
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:190
void * Data()
Definition: subexpr.cc:1121
matrix mp_Sub(matrix a, matrix b, const ring R)
Definition: matpol.cc:207
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjPLUS_N()

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

Definition at line 781 of file iparith.cc.

782 {
783  res->data = (char *)(nAdd((number)u->Data(), (number)v->Data()));
784  return jjPLUSMINUS_Gen(res,u,v);
785 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
#define nAdd(n1, n2)
Definition: numbers.h:18

§ jjPLUS_P()

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

Definition at line 786 of file iparith.cc.

787 {
788  res->data = (char *)(pAdd((poly)u->CopyD(POLY_CMD) , (poly)v->CopyD(POLY_CMD)));
789  return jjPLUSMINUS_Gen(res,u,v);
790 }
static BOOLEAN jjPLUSMINUS_Gen(leftv res, leftv u, leftv v)
Definition: iparith.cc:640
#define pAdd(p, q)
Definition: polys.h:186
void * data
Definition: subexpr.h:90
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjPLUS_P_MA()

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

Definition at line 834 of file iparith.cc.

835 {
836  return jjPLUS_MA_P(res,v,u);
837 }
static BOOLEAN jjPLUS_MA_P(leftv res, leftv u, leftv v)
Definition: iparith.cc:823

§ jjPLUS_S()

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

Definition at line 838 of file iparith.cc.

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

§ jjPLUSMINUS_Gen()

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

Definition at line 640 of file iparith.cc.

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

§ jjPLUSPLUS()

static BOOLEAN jjPLUSPLUS ( leftv  ,
leftv  u 
)
static

Definition at line 3688 of file iparith.cc.

3689 {
3690  if (IDTYP((idhdl)u->data)==INT_CMD)
3691  {
3692  int i=IDINT((idhdl)u->data);
3693  if (iiOp==PLUSPLUS) i++;
3694  else i--;
3695  IDDATA((idhdl)u->data)=(char *)(long)i;
3696  return FALSE;
3697  }
3698  return TRUE;
3699 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
void * data
Definition: subexpr.h:90
#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:227

§ jjpMaxComp()

static BOOLEAN jjpMaxComp ( leftv  res,
leftv  v 
)
static

Definition at line 5460 of file iparith.cc.

5461 {
5462  res->data = (char *)pMaxComp((poly)v->Data());
5463  return FALSE;
5464 }
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjPOWER_BI()

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

Definition at line 578 of file iparith.cc.

579 {
580  int e=(int)(long)v->Data();
581  number n=(number)u->Data();
582  if (e>=0)
583  {
584  n_Power(n,e,(number*)&res->data,coeffs_BIGINT);
585  }
586  else
587  {
588  WerrorS("exponent must be non-negative");
589  return TRUE;
590  }
591  if (u!=NULL) return jjOP_REST(res,u,v);
592  return FALSE;
593 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:1121

§ jjPOWER_I()

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

Definition at line 532 of file iparith.cc.

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

§ jjPOWER_ID()

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

Definition at line 634 of file iparith.cc.

635 {
636  res->data = (char *)id_Power((ideal)(u->Data()),(int)(long)(v->Data()), currRing);
637  if (u!=NULL) return jjOP_REST(res,u,v);
638  return FALSE;
639 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjPOWER_N()

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

Definition at line 594 of file iparith.cc.

595 {
596  int e=(int)(long)v->Data();
597  number n=(number)u->Data();
598  int d=0;
599  if (e<0)
600  {
601  n=nInvers(n);
602  e=-e;
603  d=1;
604  }
605  number r;
606  nPower(n,e,(number*)&r);
607  res->data=(char*)r;
608  if (d) nDelete(&n);
609  if (u!=NULL) return jjOP_REST(res,u,v);
610  return FALSE;
611 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
#define nPower(a, b, res)
Definition: numbers.h:38
void * data
Definition: subexpr.h:90
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:1121

§ jjPOWER_P()

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

Definition at line 612 of file iparith.cc.

613 {
614  int v_i=(int)(long)v->Data();
615  if (v_i<0)
616  {
617  WerrorS("exponent must be non-negative");
618  return TRUE;
619  }
620  poly u_p=(poly)u->CopyD(POLY_CMD);
621  if ((u_p!=NULL)
622  && ((v_i!=0) &&
623  ((long)pTotaldegree(u_p) > (signed long)currRing->bitmask / (signed long)v_i/2)))
624  {
625  Werror("OVERFLOW in power(d=%ld, e=%d, max=%ld)",
626  pTotaldegree(u_p),v_i,currRing->bitmask/2);
627  pDelete(&u_p);
628  return TRUE;
629  }
630  res->data = (char *)pPower(u_p,v_i);
631  if (u!=NULL) return jjOP_REST(res,u,v);
632  return errorreported; /* pPower may set errorreported via Werror */
633 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:265
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:1121
#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:679

§ jjPREIMAGE()

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

Definition at line 6266 of file iparith.cc.

6267 {
6268  // handles preimage(r,phi,i) and kernel(r,phi)
6269  idhdl h;
6270  ring rr;
6271  map mapping;
6272  BOOLEAN kernel_cmd= (iiOp==KERNEL_CMD);
6273 
6274  if ((v->name==NULL) || (!kernel_cmd && (w->name==NULL)))
6275  {
6276  WerrorS("2nd/3rd arguments must have names");
6277  return TRUE;
6278  }
6279  rr=(ring)u->Data();
6280  const char *ring_name=u->Name();
6281  if ((h=rr->idroot->get(v->name,myynest))!=NULL)
6282  {
6283  if (h->typ==MAP_CMD)
6284  {
6285  mapping=IDMAP(h);
6286  idhdl preim_ring=IDROOT->get(mapping->preimage,myynest);
6287  if ((preim_ring==NULL)
6288  || (IDRING(preim_ring)!=currRing))
6289  {
6290  Werror("preimage ring `%s` is not the basering",mapping->preimage);
6291  return TRUE;
6292  }
6293  }
6294  else if (h->typ==IDEAL_CMD)
6295  {
6296  mapping=IDMAP(h);
6297  }
6298  else
6299  {
6300  Werror("`%s` is no map nor ideal",IDID(h));
6301  return TRUE;
6302  }
6303  }
6304  else
6305  {
6306  Werror("`%s` is not defined in `%s`",v->name,ring_name);
6307  return TRUE;
6308  }
6309  ideal image;
6310  if (kernel_cmd) image=idInit(1,1);
6311  else
6312  {
6313  if ((h=rr->idroot->get(w->name,myynest))!=NULL)
6314  {
6315  if (h->typ==IDEAL_CMD)
6316  {
6317  image=IDIDEAL(h);
6318  }
6319  else
6320  {
6321  Werror("`%s` is no ideal",IDID(h));
6322  return TRUE;
6323  }
6324  }
6325  else
6326  {
6327  Werror("`%s` is not defined in `%s`",w->name,ring_name);
6328  return TRUE;
6329  }
6330  }
6331  if (((currRing->qideal!=NULL) && (rHasLocalOrMixedOrdering_currRing()))
6332  || ((rr->qideal!=NULL) && (rHasLocalOrMixedOrdering(rr))))
6333  {
6334  WarnS("preimage in local qring may be wrong: use Ring::preimageLoc instead");
6335  }
6336  res->data=(char *)maGetPreimage(rr,mapping,image,currRing);
6337  if (kernel_cmd) idDelete(&image);
6338  return (res->data==NULL/* is of type ideal, should not be NULL*/);
6339 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:747
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:31
#define IDID(a)
Definition: ipid.h:119
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:101
#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:122
Definition: idrec.h:34
idhdl get(const char *s, int lev)
Definition: ipid.cc:91
void * data
Definition: subexpr.h:90
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:89
#define IDMAP(a)
Definition: ipid.h:132
#define rHasLocalOrMixedOrdering_currRing()
Definition: ring.h:754
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:1121
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:227
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjPREIMAGE_R()

static BOOLEAN jjPREIMAGE_R ( leftv  res,
leftv  v 
)
static

Definition at line 4803 of file iparith.cc.

4804 {
4805  map mapping=(map)v->Data();
4806  syMake(res,omStrDup(mapping->preimage));
4807  return FALSE;
4808 }
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:97
void * Data()
Definition: subexpr.cc:1121
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1484
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjPRIME()

static BOOLEAN jjPRIME ( leftv  res,
leftv  v 
)
static

Definition at line 4809 of file iparith.cc.

4810 {
4811  int i = IsPrime((int)(long)(v->Data()));
4812  res->data = (char *)(long)(i > 1 ? i : 2);
4813  return FALSE;
4814 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
int IsPrime(int p)
Definition: prime.cc:61
void * Data()
Definition: subexpr.cc:1121

§ jjPROC()

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

Definition at line 1602 of file iparith.cc.

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

3745 {
3746  return jjPROC(res,u,NULL);
3747 }
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition: iparith.cc:1602
#define NULL
Definition: omList.c:10

§ jjPROC3()

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

Definition at line 5772 of file iparith.cc.

5773 {
5775  memcpy(v->next,w,sizeof(sleftv));
5776  memset(w,0,sizeof(sleftv));
5777  return jjPROC(res,u,v);
5778 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
Definition: iparith.cc:1602
sleftv * leftv
Definition: structs.h:60
omBin sleftv_bin
Definition: subexpr.cc:50
leftv next
Definition: subexpr.h:88

§ jjPRUNE()

static BOOLEAN jjPRUNE ( leftv  res,
leftv  v 
)
static

Definition at line 4815 of file iparith.cc.

4816 {
4817  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4818  ideal v_id=(ideal)v->Data();
4819  if (w!=NULL)
4820  {
4821  if (!idTestHomModule(v_id,currRing->qideal,w))
4822  {
4823  WarnS("wrong weights");
4824  w=NULL;
4825  // and continue at the non-homog case below
4826  }
4827  else
4828  {
4829  w=ivCopy(w);
4830  intvec **ww=&w;
4831  res->data = (char *)idMinEmbedding(v_id,FALSE,ww);
4832  atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD);
4833  return FALSE;
4834  }
4835  }
4836  res->data = (char *)idMinEmbedding(v_id);
4837  return FALSE;
4838 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
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:2297
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: intvec.h:14
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjQRDS()

static BOOLEAN jjQRDS ( leftv  res,
leftv  INPUT 
)
static

Definition at line 7921 of file iparith.cc.

7922 {
7923  if ((INPUT->Typ() != MATRIX_CMD) ||
7924  (INPUT->next->Typ() != NUMBER_CMD) ||
7925  (INPUT->next->next->Typ() != NUMBER_CMD) ||
7926  (INPUT->next->next->next->Typ() != NUMBER_CMD))
7927  {
7928  WerrorS("expected (matrix, number, number, number) as arguments");
7929  return TRUE;
7930  }
7931  leftv u = INPUT; leftv v = u->next; leftv w = v->next; leftv x = w->next;
7932  res->data = (char *)qrDoubleShift((matrix)(u->Data()),
7933  (number)(v->Data()),
7934  (number)(w->Data()),
7935  (number)(x->Data()));
7936  return FALSE;
7937 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
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:979
void * data
Definition: subexpr.h:90
leftv next
Definition: subexpr.h:88
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:1121

§ jjQUOT()

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

Definition at line 3014 of file iparith.cc.

3015 {
3016  res->data = (char *)idQuot((ideal)u->Data(),(ideal)v->Data(),
3017  hasFlag(u,FLAG_STD),u->Typ()==v->Typ());
3018  id_DelMultiples((ideal)(res->data),currRing);
3020  return FALSE;
3021 }
#define FALSE
Definition: auxiliary.h:97
int Typ()
Definition: subexpr.cc:979
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
Definition: ideals.cc:1260
void * data
Definition: subexpr.h:90
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:1121

§ jjRANDOM()

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

Definition at line 3022 of file iparith.cc.

3023 {
3024  int i=(int)(long)u->Data();
3025  int j=(int)(long)v->Data();
3026  if (j-i <0) {WerrorS("invalid range for random"); return TRUE;}
3027  res->data =(char *)(long)((i > j) ? i : (siRand() % (j-i+1)) + i);
3028  return FALSE;
3029 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1121
int siRand()
Definition: sirandom.c:41

§ jjRANDOM_CF()

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

Definition at line 6366 of file iparith.cc.

6368 {
6369  coeffs cf=(coeffs)w->Data();
6370  if ((cf==NULL) ||(cf->cfRandom==NULL))
6371  {
6372  Werror("no random function defined for coeff %d",cf->type);
6373  return TRUE;
6374  }
6375  else
6376  {
6377  number n= n_Random(siRand,(number)v->Data(),(number)w->Data(),cf);
6378  number2 nn=(number2)omAlloc(sizeof(*nn));
6379  nn->cf=cf;
6380  nn->n=n;
6381  res->data=nn;
6382  return FALSE;
6383  }
6384  return TRUE;
6385 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define omAlloc(size)
Definition: omAllocDecl.h:210
static FORCE_INLINE number n_Random(siRandProc p, number p1, number p2, const coeffs cf)
Definition: coeffs.h:980
void * data
Definition: subexpr.h:90
The main handler for Singular numbers which are suitable for Singular polynomials.
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int siRand()
Definition: sirandom.c:41

§ jjRANDOM_Im()

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

Definition at line 6340 of file iparith.cc.

6341 {
6342  int di, k;
6343  int i=(int)(long)u->Data();
6344  int r=(int)(long)v->Data();
6345  int c=(int)(long)w->Data();
6346  if ((r<=0) || (c<=0)) return TRUE;
6347  intvec *iv = new intvec(r, c, 0);
6348  if (iv->rows()==0)
6349  {
6350  delete iv;
6351  return TRUE;
6352  }
6353  if (i!=0)
6354  {
6355  if (i<0) i = -i;
6356  di = 2 * i + 1;
6357  for (k=0; k<iv->length(); k++)
6358  {
6359  (*iv)[k] = ((siRand() % di) - i);
6360  }
6361  }
6362  res->data = (char *)iv;
6363  return FALSE;
6364 }
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:101
int k
Definition: cfEzgcd.cc:93
void * data
Definition: subexpr.h:90
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:1121
int siRand()
Definition: sirandom.c:41

§ jjRANK1()

static BOOLEAN jjRANK1 ( leftv  res,
leftv  v 
)
static

Definition at line 4871 of file iparith.cc.

4872 {
4873  matrix m =(matrix)v->Data();
4874  int rank = luRank(m, 0);
4875  res->data =(char *)(long)rank;
4876  return FALSE;
4877 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjRANK2()

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

Definition at line 3030 of file iparith.cc.

3031 {
3032  matrix m =(matrix)u->Data();
3033  int isRowEchelon = (int)(long)v->Data();
3034  if (isRowEchelon != 1) isRowEchelon = 0;
3035  int rank = luRank(m, isRowEchelon);
3036  res->data =(char *)(long)rank;
3037  return FALSE;
3038 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjrCharStr()

static BOOLEAN jjrCharStr ( leftv  res,
leftv  v 
)
static

Definition at line 5434 of file iparith.cc.

5435 {
5436  res->data = rCharStr((ring)v->Data());
5437  return FALSE;
5438 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
Definition: ring.cc:618

§ jjREAD()

static BOOLEAN jjREAD ( leftv  res,
leftv  v 
)
static

Definition at line 4878 of file iparith.cc.

4879 {
4880  return jjREAD2(res,v,NULL);
4881 }
static BOOLEAN jjREAD2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3039
#define NULL
Definition: omList.c:10

§ jjREAD2()

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

Definition at line 3039 of file iparith.cc.

3040 {
3041  si_link l=(si_link)u->Data();
3042  leftv r=slRead(l,v);
3043  if (r==NULL)
3044  {
3045  const char *s;
3046  if ((l!=NULL)&&(l->name!=NULL)) s=l->name;
3047  else s=sNoName;
3048  Werror("cannot read from `%s`",s);
3049  return TRUE;
3050  }
3051  memcpy(res,r,sizeof(sleftv));
3053  return FALSE;
3054 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
const char sNoName[]
Definition: subexpr.cc:56
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
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:1121
#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 6602 of file iparith.cc.

6603 {
6604  assumeStdFlag(v);
6605  if (!idIsZeroDim((ideal)v->Data()))
6606  {
6607  Werror("`%s` must be 0-dimensional",v->Name());
6608  return TRUE;
6609  }
6610  res->data = (char *)redNF((ideal)v->CopyD(),(ideal)u->CopyD(),
6611  (matrix)w->CopyD());
6612  return FALSE;
6613 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
const char * Name()
Definition: subexpr.h:122
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1654
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:163
void * data
Definition: subexpr.h:90
ip_smatrix * matrix
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjREDUCE3_CP()

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

Definition at line 6590 of file iparith.cc.

6591 {
6592  assumeStdFlag(v);
6593  if (!idIsZeroDim((ideal)v->Data()))
6594  {
6595  Werror("`%s` must be 0-dimensional",v->Name());
6596  return TRUE;
6597  }
6598  res->data = (char *)redNF((ideal)v->CopyD(),(poly)u->CopyD(),
6599  (poly)w->CopyD());
6600  return FALSE;
6601 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
const char * Name()
Definition: subexpr.h:122
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1654
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:163
void * data
Definition: subexpr.h:90
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjREDUCE3_ID()

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

Definition at line 6621 of file iparith.cc.

6622 {
6623  assumeStdFlag(v);
6624  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(),
6625  0,(int)(long)w->Data());
6626  return FALSE;
6627 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121

§ jjREDUCE3_P()

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

Definition at line 6614 of file iparith.cc.

6615 {
6616  assumeStdFlag(v);
6617  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(),
6618  0,(int)(long)w->Data());
6619  return FALSE;
6620 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjREDUCE4()

static BOOLEAN jjREDUCE4 ( leftv  res,
leftv  u 
)
static

Definition at line 7546 of file iparith.cc.

7547 {
7548  leftv u1=u;
7549  leftv u2=u1->next;
7550  leftv u3=u2->next;
7551  leftv u4=u3->next;
7552  if((u3->Typ()==INT_CMD)&&(u4->Typ()==INTVEC_CMD))
7553  {
7554  int save_d=Kstd1_deg;
7555  Kstd1_deg=(int)(long)u3->Data();
7556  kModW=(intvec *)u4->Data();
7557  BITSET save2;
7558  SI_SAVE_OPT2(save2);
7560  u2->next=NULL;
7561  BOOLEAN r=jjCALL2ARG(res,u);
7562  kModW=NULL;
7563  Kstd1_deg=save_d;
7564  SI_RESTORE_OPT2(save2);
7565  u->next->next=u3;
7566  return r;
7567  }
7568  else
7569  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7570  (u4->Typ()==INT_CMD))
7571  {
7572  assumeStdFlag(u3);
7573  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7574  {
7575  WerrorS("2nd argument must be a diagonal matrix of units");
7576  return TRUE;
7577  }
7578  res->rtyp=IDEAL_CMD;
7579  res->data=(char*)redNF(
7580  idCopy((ideal)u3->Data()),
7581  idCopy((ideal)u1->Data()),
7582  mp_Copy((matrix)u2->Data(), currRing),
7583  (int)(long)u4->Data()
7584  );
7585  return FALSE;
7586  }
7587  else
7588  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7589  (u4->Typ()==INT_CMD))
7590  {
7591  assumeStdFlag(u3);
7592  if(!pIsUnit((poly)u2->Data()))
7593  {
7594  WerrorS("2nd argument must be a unit");
7595  return TRUE;
7596  }
7597  res->rtyp=POLY_CMD;
7598  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7599  pCopy((poly)u2->Data()),(int)(long)u4->Data());
7600  return FALSE;
7601  }
7602  else
7603  {
7604  Werror("%s(`poly`,`ideal`,`int`,`intvec`) expected",Tok2Cmdname(iiOp));
7605  return TRUE;
7606  }
7607 }
static BOOLEAN jjCALL2ARG(leftv res, leftv u)
Definition: iparith.cc:6751
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define BITSET
Definition: structs.h:18
int Typ()
Definition: subexpr.cc:979
#define Sy_bit(x)
Definition: options.h:30
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1654
void * data
Definition: subexpr.h:90
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:8952
const ring r
Definition: syzextra.cc:208
intvec * kModW
Definition: kstd1.cc:2206
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
Definition: tok.h:99
#define V_DEG_STOP
Definition: options.h:67
ideal idCopy(ideal A)
Definition: ideals.h:62
leftv next
Definition: subexpr.h:88
#define SI_RESTORE_OPT2(A)
Definition: options.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:721
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:236
int iiOp
Definition: iparith.cc:227
unsigned si_opt_2
Definition: options.c:6
int BOOLEAN
Definition: auxiliary.h:88
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 7608 of file iparith.cc.

7609 {
7610  leftv u1=u;
7611  leftv u2=u1->next;
7612  leftv u3=u2->next;
7613  leftv u4=u3->next;
7614  leftv u5=u4->next;
7615  if((u1->Typ()==IDEAL_CMD)&&(u2->Typ()==MATRIX_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7616  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7617  {
7618  assumeStdFlag(u3);
7619  if(!mp_IsDiagUnit((matrix)u2->Data(), currRing))
7620  {
7621  WerrorS("2nd argument must be a diagonal matrix of units");
7622  return TRUE;
7623  }
7624  res->rtyp=IDEAL_CMD;
7625  res->data=(char*)redNF(
7626  idCopy((ideal)u3->Data()),
7627  idCopy((ideal)u1->Data()),
7628  mp_Copy((matrix)u2->Data(),currRing),
7629  (int)(long)u4->Data(),
7630  (intvec*)u5->Data()
7631  );
7632  return FALSE;
7633  }
7634  else
7635  if((u1->Typ()==POLY_CMD)&&(u2->Typ()==POLY_CMD)&&(u3->Typ()==IDEAL_CMD)&&
7636  (u4->Typ()==INT_CMD)&&(u5->Typ()==INTVEC_CMD))
7637  {
7638  assumeStdFlag(u3);
7639  if(!pIsUnit((poly)u2->Data()))
7640  {
7641  WerrorS("2nd argument must be a unit");
7642  return TRUE;
7643  }
7644  res->rtyp=POLY_CMD;
7645  res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
7646  pCopy((poly)u2->Data()),
7647  (int)(long)u4->Data(),(intvec*)u5->Data());
7648  return FALSE;
7649  }
7650  else
7651  {
7652  Werror("%s(`ideal`,`ideal`,`matrix`,`int`,`intvec`) exppected",
7653  Tok2Cmdname(iiOp));
7654  return TRUE;
7655  }
7656 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define pIsUnit(p)
return true if the Lm is a constant <>0
Definition: polys.h:223
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1654
void * data
Definition: subexpr.h:90
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:8952
Definition: intvec.h:14
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
Definition: tok.h:99
ideal idCopy(ideal A)
Definition: ideals.h:62
leftv next
Definition: subexpr.h:88
int rtyp
Definition: subexpr.h:93
BOOLEAN mp_IsDiagUnit(matrix U, const ring R)
Definition: matpol.cc:721
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
polyrec * poly
Definition: hilb.h:10
int iiOp
Definition: iparith.cc:227
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 3063 of file iparith.cc.

3064 {
3065  ideal ui=(ideal)u->Data();
3066  ideal vi=(ideal)v->Data();
3067  if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
3068  assumeStdFlag(v);
3069  res->data = (char *)kNF(vi,currRing->qideal,ui);
3070  return FALSE;
3071 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjREDUCE_P()

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

Definition at line 3055 of file iparith.cc.

3056 {
3057  ideal vi=(ideal)v->Data();
3058  if (currRing->qideal!=NULL || vi->ncols>1 || rIsPluralRing(currRing))
3059  assumeStdFlag(v);
3060  res->data = (char *)kNF(vi,currRing->qideal,(poly)u->Data());
3061  return FALSE;
3062 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10

§ jjREGULARITY()

static BOOLEAN jjREGULARITY ( leftv  res,
leftv  v 
)
static

Definition at line 4882 of file iparith.cc.

4883 {
4884  res->data = (char *)(long)iiRegularity((lists)v->Data());
4885  return FALSE;
4886 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
int iiRegularity(lists L)
Definition: ipshell.cc:958
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjREPART()

static BOOLEAN jjREPART ( leftv  res,
leftv  v 
)
static

Definition at line 4887 of file iparith.cc.

4888 {
4889  res->data = (char *)n_RePart((number)v->Data(),currRing->cf);
4890  return FALSE;
4891 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121

§ jjRES()

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

Definition at line 3190 of file iparith.cc.

3191 {
3192  int maxl=(int)(long)v->Data();
3193  if (maxl<0)
3194  {
3195  WerrorS("length for res must not be negative");
3196  return TRUE;
3197  }
3198  syStrategy r;
3199  intvec *weights=NULL;
3200  int wmaxl=maxl;
3201  ideal u_id=(ideal)u->Data();
3202 
3203  maxl--;
3204  if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/
3205  {
3206  maxl = currRing->N-1+2*(iiOp==MRES_CMD);
3207  if (currRing->qideal!=NULL)
3208  {
3209  Warn(
3210  "full resolution in a qring may be infinite, setting max length to %d",
3211  maxl+1);
3212  }
3213  }
3214  weights=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
3215  if (weights!=NULL)
3216  {
3217  if (!idTestHomModule(u_id,currRing->qideal,weights))
3218  {
3219  WarnS("wrong weights given:");weights->show();PrintLn();
3220  weights=NULL;
3221  }
3222  }
3223  intvec *ww=NULL;
3224  int add_row_shift=0;
3225  if (weights!=NULL)
3226  {
3227  ww=ivCopy(weights);
3228  add_row_shift = ww->min_in();
3229  (*ww) -= add_row_shift;
3230  }
3231  if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
3232  {
3233  r=syResolution(u_id,maxl, ww, iiOp==MRES_CMD);
3234  }
3235  else if (iiOp==SRES_CMD)
3236  // r=sySchreyerResolvente(u_id,maxl+1,&l);
3237  r=sySchreyer(u_id,maxl+1);
3238  else if (iiOp == LRES_CMD)
3239  {
3240  int dummy;
3241  if((currRing->qideal!=NULL)||
3242  (!idHomIdeal (u_id,NULL)))
3243  {
3244  WerrorS
3245  ("`lres` not implemented for inhomogeneous input or qring");
3246  return TRUE;
3247  }
3248  if(currRing->N == 1)
3249  WarnS("the current implementation of `lres` may not work in the case of a single variable");
3250  r=syLaScala3(u_id,&dummy);
3251  }
3252  else if (iiOp == KRES_CMD)
3253  {
3254  int dummy;
3255  if((currRing->qideal!=NULL)||
3256  (!idHomIdeal (u_id,NULL)))
3257  {
3258  WerrorS
3259  ("`kres` not implemented for inhomogeneous input or qring");
3260  return TRUE;
3261  }
3262  r=syKosz(u_id,&dummy);
3263  }
3264  else
3265  {
3266  int dummy;
3267  if((currRing->qideal!=NULL)||
3268  (!idHomIdeal (u_id,NULL)))
3269  {
3270  WerrorS
3271  ("`hres` not implemented for inhomogeneous input or qring");
3272  return TRUE;
3273  }
3274  ideal u_id_copy=idCopy(u_id);
3275  idSkipZeroes(u_id_copy);
3276  r=syHilb(u_id_copy,&dummy);
3277  idDelete(&u_id_copy);
3278  }
3279  if (r==NULL) return TRUE;
3280  //res->data=(void *)liMakeResolv(r,l,wmaxl,u->Typ(),weights);
3281  r->list_length=wmaxl;
3282  res->data=(void *)r;
3283  if ((weights!=NULL) && (ww!=NULL)) { delete ww; ww=NULL; }
3284  if ((r->weights!=NULL) && (r->weights[0]!=NULL))
3285  {
3286  ww=ivCopy(r->weights[0]);
3287  if (weights!=NULL) (*ww) += add_row_shift;
3288  atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
3289  }
3290  else
3291  {
3292  if (weights!=NULL)
3293  {
3294  atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);
3295  }
3296  }
3297 
3298  // test the La Scala case' output
3299  assume( ((iiOp == LRES_CMD) || (iiOp == HRES_CMD)) == (r->syRing != NULL) );
3300  assume( (r->syRing != NULL) == (r->resPairs != NULL) );
3301 
3302  if(iiOp != HRES_CMD)
3303  assume( (r->minres != NULL) || (r->fullres != NULL) ); // is wrong for HRES_CMD...
3304  else
3305  assume( (r->orderedRes != NULL) || (r->res != NULL) ); // analog for hres...
3306 
3307  return FALSE;
3308 }
intvec ** weights
Definition: syz.h:45
syStrategy syKosz(ideal arg, int *length)
Definition: syz3.cc:1761
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Definition: tok.h:107
void PrintLn()
Definition: reporter.cc:310
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:178
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:101
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:118
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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:403
syStrategy sySchreyer(ideal arg, int maxlength)
Definition: syz0.cc:1024
Definition: tok.h:99
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:62
resolvente minres
Definition: syz.h:58
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
Definition: tok.h:129
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:93
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:89
void * Data()
Definition: subexpr.cc:1121
short list_length
Definition: syz.h:62
Definition: tok.h:164
syStrategy syHilb(ideal arg, int *length)
Definition: syz2.cc:953
int iiOp
Definition: iparith.cc:227
syStrategy syLaScala3(ideal arg, int *length)
Definition: syz1.cc:2435
#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 6629 of file iparith.cc.

6630 {
6631  int maxl=(int)v->Data();
6632  ideal u_id=(ideal)u->Data();
6633  int l=0;
6634  resolvente r;
6635  intvec **weights=NULL;
6636  int wmaxl=maxl;
6637  maxl--;
6638  if ((maxl==-1) && (iiOp!=MRES_CMD))
6639  maxl = currRing->N-1;
6640  if ((iiOp == RES_CMD) || (iiOp == MRES_CMD))
6641  {
6642  intvec * iv=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
6643  if (iv!=NULL)
6644  {
6645  l=1;
6646  if (!idTestHomModule(u_id,currRing->qideal,iv))
6647  {
6648  WarnS("wrong weights");
6649  iv=NULL;
6650  }
6651  else
6652  {
6653  weights = (intvec**)omAlloc0Bin(char_ptr_bin);
6654  weights[0] = ivCopy(iv);
6655  }
6656  }
6657  r=syResolvente(u_id,maxl,&l, &weights, iiOp==MRES_CMD);
6658  }
6659  else
6660  r=sySchreyerResolvente((ideal)u->Data(),maxl+1,&l);
6661  if (r==NULL) return TRUE;
6662  int t3=u->Typ();
6663  iiMakeResolv(r,l,wmaxl,w->name,t3,weights);
6664  return FALSE;
6665 }
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition: syz.cc:394
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:101
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:979
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:89
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
Definition: syz0.cc:861
Definition: tok.h:99
void iiMakeResolv(resolvente r, int length, int rlen, char *name, int typ0, intvec **weights)
Definition: ipshell.cc:768
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
Definition: tok.h:129
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
ideal * resolvente
Definition: ideals.h:20
Definition: tok.h:164
int iiOp
Definition: iparith.cc:227
int l
Definition: cfEzgcd.cc:94

§ jjRESERVED0()

static BOOLEAN jjRESERVED0 ( leftv  ,
leftv   
)
static

Definition at line 7657 of file iparith.cc.

7658 {
7659  int i=1;
7660  int nCount = (sArithBase.nCmdUsed-1)/3;
7661  if((3*nCount)<sArithBase.nCmdUsed) nCount++;
7662  //Print("CMDS: %d/%d\n", sArithBase.nCmdUsed,
7663  // sArithBase.nCmdAllocated);
7664  for(i=0; i<nCount; i++)
7665  {
7666  Print("%-20s",sArithBase.sCmds[i+1].name);
7667  if(i+1+nCount<sArithBase.nCmdUsed)
7668  Print("%-20s",sArithBase.sCmds[i+1+nCount].name);
7669  if(i+1+2*nCount<sArithBase.nCmdUsed)
7670  Print("%-20s",sArithBase.sCmds[i+1+2*nCount].name);
7671  //if ((i%3)==1) PrintLn();
7672  PrintLn();
7673  }
7674  PrintLn();
7676  return FALSE;
7677 }
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
void printBlackboxTypes()
list all defined type (for debugging)
Definition: blackbox.cc:206
int nCmdUsed
number of commands used
Definition: iparith.cc:196
int i
Definition: cfEzgcd.cc:123
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ jjRESERVEDNAME()

static BOOLEAN jjRESERVEDNAME ( leftv  res,
leftv  v 
)
static

Definition at line 4855 of file iparith.cc.

4856 {
4857  char *s= (char *)v->Data();
4858  int i = 1;
4859  for(i=0; i<sArithBase.nCmdUsed; i++)
4860  {
4861  //Print("test %d, >>%s<<, tab:>>%s<<\n",i,s,sArithBase.sCmds[i].name);
4862  if (strcmp(s, sArithBase.sCmds[i].name) == 0)
4863  {
4864  res->data = (char *)1;
4865  return FALSE;
4866  }
4867  }
4868  //res->data = (char *)0;
4869  return FALSE;
4870 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
int nCmdUsed
number of commands used
Definition: iparith.cc:196
int i
Definition: cfEzgcd.cc:123
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
void * Data()
Definition: subexpr.cc:1121
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191

§ jjRING3()

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

Definition at line 6667 of file iparith.cc.

6668 {
6669  res->data=(void *)rInit(u,v,w);
6670  return (res->data==NULL);
6671 }
void * data
Definition: subexpr.h:90
ring rInit(leftv pn, leftv rv, leftv ord)
Definition: ipshell.cc:5503
#define NULL
Definition: omList.c:10

§ jjRING_LIST()

static BOOLEAN jjRING_LIST ( leftv  res,
leftv  v 
)
static

Definition at line 4907 of file iparith.cc.

4908 {
4909  ring r=(ring)v->Data();
4910  if (r!=NULL)
4911  res->data = (char *)rDecompose_list_cf((ring)v->Data());
4912  return (r==NULL)||(res->data==NULL);
4913 }
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
lists rDecompose_list_cf(const ring r)
Definition: ipshell.cc:1890

§ jjRING_PL()

static BOOLEAN jjRING_PL ( leftv  res,
leftv  a 
)
static

Definition at line 8022 of file iparith.cc.

8023 {
8024  Print("construct ring\n");
8025  if (a->Typ()!=CRING_CMD)
8026  {
8027  WerrorS("expected `Ring` [ `id` ... ]");
8028  return TRUE;
8029  }
8030  assume(a->next!=NULL);
8031  leftv names=a->next;
8032  int N=names->listLength();
8033  char **n=(char**)omAlloc0(N*sizeof(char*));
8034  for(int i=0; i<N;i++,names=names->next)
8035  {
8036  n[i]=(char *)names->Name();
8037  }
8038  coeffs cf=(coeffs)a->CopyD();
8039  res->data=rDefault(cf,N,n, ringorder_dp);
8040  omFreeSize(n,N*sizeof(char*));
8041  return FALSE;
8042 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:61
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
Definition: tok.h:55
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
#define assume(x)
Definition: mod2.h:403
The main handler for Singular numbers which are suitable for Singular polynomials.
ring rDefault(const coeffs cf, int N, char **n, int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
Definition: ring.cc:113
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:679
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ jjRINGLIST()

static BOOLEAN jjRINGLIST ( leftv  res,
leftv  v 
)
static

Definition at line 4892 of file iparith.cc.

4893 {
4894  ring r=(ring)v->Data();
4895  if (r!=NULL)
4896  res->data = (char *)rDecompose((ring)v->Data());
4897  return (r==NULL)||(res->data==NULL);
4898 }
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
lists rDecompose(const ring r)
Definition: ipshell.cc:2023
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjRINGLIST_C()

static BOOLEAN jjRINGLIST_C ( leftv  res,
leftv  v 
)
static

Definition at line 4900 of file iparith.cc.

4901 {
4902  coeffs r=(coeffs)v->Data();
4903  if (r!=NULL)
4904  return rDecompose_CF(res,r);
4905  return TRUE;
4906 }
#define TRUE
Definition: auxiliary.h:101
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:1121
BOOLEAN rDecompose_CF(leftv res, const coeffs C)
Definition: ipshell.cc:1817

§ jjrOrdStr()

static BOOLEAN jjrOrdStr ( leftv  res,
leftv  v 
)
static

Definition at line 5475 of file iparith.cc.

5476 {
5477  res->data = rOrdStr((ring)v->Data());
5478  return FALSE;
5479 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
char * rOrdStr(ring r)
Definition: ring.cc:522

§ jjROWS()

static BOOLEAN jjROWS ( leftv  res,
leftv  v 
)
static

Definition at line 4915 of file iparith.cc.

4916 {
4917  ideal i = (ideal)v->Data();
4918  res->data = (char *)i->rank;
4919  return FALSE;
4920 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1121

§ jjROWS_BIM()

static BOOLEAN jjROWS_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 4921 of file iparith.cc.

4922 {
4923  res->data = (char *)(long)((bigintmat*)(v->Data()))->rows();
4924  return FALSE;
4925 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjROWS_IV()

static BOOLEAN jjROWS_IV ( leftv  res,
leftv  v 
)
static

Definition at line 4926 of file iparith.cc.

4927 {
4928  res->data = (char *)(long)((intvec*)(v->Data()))->rows();
4929  return FALSE;
4930 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121

§ jjRPAR()

static BOOLEAN jjRPAR ( leftv  res,
leftv  v 
)
static

Definition at line 4931 of file iparith.cc.

4932 {
4933  res->data = (char *)(long)rPar(((ring)v->Data()));
4934  return FALSE;
4935 }
#define FALSE
Definition: auxiliary.h:97
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjrParStr()

static BOOLEAN jjrParStr ( leftv  res,
leftv  v 
)
static

Definition at line 5485 of file iparith.cc.

5486 {
5487  res->data = rParStr((ring)v->Data());
5488  return FALSE;
5489 }
#define FALSE
Definition: auxiliary.h:97
char * rParStr(ring r)
Definition: ring.cc:620
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjRSUM()

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

Definition at line 3336 of file iparith.cc.

3337 {
3338  ring r;
3339  int i=rSum((ring)u->Data(),(ring)v->Data(),r);
3340  res->data = (char *)r;
3341  return (i==-1);
3342 }
void * data
Definition: subexpr.h:90
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1302
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
void * Data()
Definition: subexpr.cc:1121

§ jjrVarStr()

static BOOLEAN jjrVarStr ( leftv  res,
leftv  v 
)
static

Definition at line 5480 of file iparith.cc.

5481 {
5482  res->data = rVarStr((ring)v->Data());
5483  return FALSE;
5484 }
char * rVarStr(ring r)
Definition: ring.cc:594
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjSBA()

static BOOLEAN jjSBA ( leftv  res,
leftv  v 
)
static

Definition at line 4980 of file iparith.cc.

4981 {
4982  ideal result;
4983  ideal v_id=(ideal)v->Data();
4984  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
4985  tHomog hom=testHomog;
4986  if (w!=NULL)
4987  {
4988  if (!idTestHomModule(v_id,currRing->qideal,w))
4989  {
4990  WarnS("wrong weights");
4991  w=NULL;
4992  }
4993  else
4994  {
4995  hom=isHomog;
4996  w=ivCopy(w);
4997  }
4998  }
4999  result=kSba(v_id,currRing->qideal,hom,&w,1,0);
5000  idSkipZeroes(result);
5001  res->data = (char *)result;
5003  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
5004  return FALSE;
5005 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:97
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:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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 5006 of file iparith.cc.

5007 {
5008  ideal result;
5009  ideal v_id=(ideal)v->Data();
5010  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
5011  tHomog hom=testHomog;
5012  if (w!=NULL)
5013  {
5014  if (!idTestHomModule(v_id,currRing->qideal,w))
5015  {
5016  WarnS("wrong weights");
5017  w=NULL;
5018  }
5019  else
5020  {
5021  hom=isHomog;
5022  w=ivCopy(w);
5023  }
5024  }
5025  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0);
5026  idSkipZeroes(result);
5027  res->data = (char *)result;
5029  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
5030  return FALSE;
5031 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:97
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:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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 5032 of file iparith.cc.

5033 {
5034  ideal result;
5035  ideal v_id=(ideal)v->Data();
5036  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
5037  tHomog hom=testHomog;
5038  if (w!=NULL)
5039  {
5040  if (!idTestHomModule(v_id,currRing->qideal,w))
5041  {
5042  WarnS("wrong weights");
5043  w=NULL;
5044  }
5045  else
5046  {
5047  hom=isHomog;
5048  w=ivCopy(w);
5049  }
5050  }
5051  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());
5052  idSkipZeroes(result);
5053  res->data = (char *)result;
5055  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
5056  return FALSE;
5057 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:97
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:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
return result
Definition: facAbsBiFact.cc:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjSIMPL_ID()

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

Definition at line 3349 of file iparith.cc.

3350 {
3351  int sw = (int)(long)v->Data();
3352  // CopyD for IDEAL_CMD and MODUL_CMD are identical:
3353  ideal id = (ideal)u->CopyD(IDEAL_CMD);
3354  if (sw & SIMPL_LMDIV)
3355  {
3356  id_DelDiv(id,currRing);
3357  }
3358  if (sw & SIMPL_LMEQ)
3359  {
3361  }
3362  if (sw & SIMPL_MULT)
3363  {
3365  }
3366  else if(sw & SIMPL_EQU)
3367  {
3368  id_DelEquals(id,currRing);
3369  }
3370  if (sw & SIMPL_NULL)
3371  {
3372  idSkipZeroes(id);
3373  }
3374  if (sw & SIMPL_NORM)
3375  {
3376  id_Norm(id,currRing);
3377  }
3378  res->data = (char * )id;
3379  return FALSE;
3380 }
#define SIMPL_LMDIV
Definition: iparith.cc:3343
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:3345
#define FALSE
Definition: auxiliary.h:97
void id_Norm(ideal id, const ring r)
ideal id = (id[i]), result is leadcoeff(id[i]) = 1
#define SIMPL_EQU
Definition: iparith.cc:3346
void * data
Definition: subexpr.h:90
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:3348
#define SIMPL_LMEQ
Definition: iparith.cc:3344
#define SIMPL_NULL
Definition: iparith.cc:3347
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjSIMPL_P()

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

Definition at line 3440 of file iparith.cc.

3441 {
3442  int sw = (int)(long)v->Data();
3443  // CopyD for POLY_CMD and VECTOR_CMD are identical:
3444  poly p = (poly)u->CopyD(POLY_CMD);
3445  if (sw & SIMPL_NORM)
3446  {
3447  pNorm(p);
3448  }
3449  res->data = (char * )p;
3450  return FALSE;
3451 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
#define SIMPL_NORM
Definition: iparith.cc:3348
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjSLIM_GB()

static BOOLEAN jjSLIM_GB ( leftv  res,
leftv  u 
)
static

Definition at line 4936 of file iparith.cc.

4937 {
4938 #ifdef HAVE_PLURAL
4939  const bool bIsSCA = rIsSCA(currRing);
4940 #else
4941  const bool bIsSCA = false;
4942 #endif
4943 
4944  if ((currRing->qideal!=NULL) && !bIsSCA)
4945  {
4946  WerrorS("qring not supported by slimgb at the moment");
4947  return TRUE;
4948  }
4950  {
4951  WerrorS("ordering must be global for slimgb");
4952  return TRUE;
4953  }
4954  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
4955  // tHomog hom=testHomog;
4956  ideal u_id=(ideal)u->Data();
4957  if (w!=NULL)
4958  {
4959  if (!idTestHomModule(u_id,currRing->qideal,w))
4960  {
4961  WarnS("wrong weights");
4962  w=NULL;
4963  }
4964  else
4965  {
4966  w=ivCopy(w);
4967  // hom=isHomog;
4968  }
4969  }
4970 
4971  assume(u_id->rank>=id_RankFreeModule(u_id, currRing));
4972  res->data=(char *)t_rep_gb(currRing,
4973  u_id,u_id->rank);
4974  //res->data=(char *)t_rep_gb(currRing, u_id);
4975 
4977  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
4978  return FALSE;
4979 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:97
ideal t_rep_gb(ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
Definition: tgb.cc:3558
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
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:403
#define setFlag(A, F)
Definition: ipid.h:110
Definition: tok.h:99
#define FLAG_STD
Definition: ipid.h:106
#define rHasLocalOrMixedOrdering_currRing()
Definition: ring.h:754
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
static bool rIsSCA(const ring r)
Definition: nc.h:206
void * Data()
Definition: subexpr.cc:1121
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjSort_Id()

static BOOLEAN jjSort_Id ( leftv  res,
leftv  v 
)
static

Definition at line 5084 of file iparith.cc.

5085 {
5086  res->data = (char *)idSort((ideal)v->Data());
5087  return FALSE;
5088 }
#define FALSE
Definition: auxiliary.h:97
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:171
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjSQR_FREE()

static BOOLEAN jjSQR_FREE ( leftv  res,
leftv  u 
)
static

Definition at line 5089 of file iparith.cc.

5090 {
5092  intvec *v=NULL;
5093  ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, 0, currRing);
5094  if (f==NULL) return TRUE;
5095  ivTest(v);
5097  l->Init(2);
5098  l->m[0].rtyp=IDEAL_CMD;
5099  l->m[0].data=(void *)f;
5100  l->m[1].rtyp=INTVEC_CMD;
5101  l->m[1].data=(void *)v;
5102  res->data=(void *)l;
5103  return FALSE;
5104 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:1155
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define ivTest(v)
Definition: intvec.h:149
void * data
Definition: subexpr.h:90
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:7
Definition: tok.h:99
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:3381
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:93
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94

§ jjSQR_FREE2()

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

Definition at line 3382 of file iparith.cc.

3383 {
3384  intvec *v=NULL;
3385  int sw=(int)(long)dummy->Data();
3386  int fac_sw=sw;
3387  if (sw<0) fac_sw=1;
3389  ideal f=singclap_sqrfree((poly)(u->CopyD()), &v, fac_sw, currRing);
3390  if (f==NULL)
3391  return TRUE;
3392  switch(sw)
3393  {
3394  case 0:
3395  case 2:
3396  {
3398  l->Init(2);
3399  l->m[0].rtyp=IDEAL_CMD;
3400  l->m[0].data=(void *)f;
3401  l->m[1].rtyp=INTVEC_CMD;
3402  l->m[1].data=(void *)v;
3403  res->data=(void *)l;
3404  res->rtyp=LIST_CMD;
3405  return FALSE;
3406  }
3407  case 1:
3408  res->data=(void *)f;
3409  return FALSE;
3410  case 3:
3411  {
3412  poly p=f->m[0];
3413  int i=IDELEMS(f);
3414  f->m[0]=NULL;
3415  while(i>1)
3416  {
3417  i--;
3418  p=pMult(p,f->m[i]);
3419  f->m[i]=NULL;
3420  }
3421  res->data=(void *)p;
3422  res->rtyp=POLY_CMD;
3423  }
3424  return FALSE;
3425  }
3426  WerrorS("invalid switch");
3427  return FALSE;
3428 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
ideal singclap_sqrfree(poly f, intvec **v, int with_exps, const ring r)
Definition: clapsing.cc:1155
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:7
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
#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:3381
#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:93
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94

§ jjSTATUS2()

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

Definition at line 3429 of file iparith.cc.

3430 {
3431  res->data = omStrDup(slStatus((si_link) u->Data(), (char *) v->Data()));
3432  return FALSE;
3433 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjSTATUS2L()

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

Definition at line 3434 of file iparith.cc.

3435 {
3436  res->data = (void *)(long)slStatusSsiL((lists) u->Data(), (int)(long) v->Data());
3437  //return (res->data== (void*)(long)-2);
3438  return FALSE;
3439 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjSTATUS3()

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

Definition at line 6672 of file iparith.cc.

6673 {
6674  int yes;
6675  jjSTATUS2(res, u, v);
6676  yes = (strcmp((char *) res->data, (char *) w->Data()) == 0);
6677  omFree((ADDRESS) res->data);
6678  res->data = (void *)(long)yes;
6679  return FALSE;
6680 }
#define FALSE
Definition: auxiliary.h:97
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
#define omFree(addr)
Definition: omAllocDecl.h:261
void * Data()
Definition: subexpr.cc:1121
static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v)
Definition: iparith.cc:3429

§ jjSTATUS_M()

static BOOLEAN jjSTATUS_M ( leftv  res,
leftv  v 
)
static

Definition at line 7863 of file iparith.cc.

7864 {
7865  if ((v->Typ() != LINK_CMD) ||
7866  (v->next->Typ() != STRING_CMD) ||
7867  (v->next->next->Typ() != STRING_CMD) ||
7868  (v->next->next->next->Typ() != INT_CMD))
7869  return TRUE;
7870  jjSTATUS3(res, v, v->next, v->next->next);
7871 #if defined(HAVE_USLEEP)
7872  if (((long) res->data) == 0L)
7873  {
7874  int i_s = (int)(long) v->next->next->next->Data();
7875  if (i_s > 0)
7876  {
7877  usleep((int)(long) v->next->next->next->Data());
7878  jjSTATUS3(res, v, v->next, v->next->next);
7879  }
7880  }
7881 #elif defined(HAVE_SLEEP)
7882  if (((int) res->data) == 0)
7883  {
7884  int i_s = (int) v->next->next->next->Data();
7885  if (i_s > 0)
7886  {
7887  si_sleep((is - 1)/1000000 + 1);
7888  jjSTATUS3(res, v, v->next, v->next->next);
7889  }
7890  }
7891 #endif
7892  return FALSE;
7893 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
leftv next
Definition: subexpr.h:88
Definition: tok.h:115
void * Data()
Definition: subexpr.cc:1121
static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6672

§ jjSTD()

static BOOLEAN jjSTD ( leftv  res,
leftv  v 
)
static

Definition at line 5058 of file iparith.cc.

5059 {
5060  ideal result;
5061  ideal v_id=(ideal)v->Data();
5062  intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD);
5063  tHomog hom=testHomog;
5064  if (w!=NULL)
5065  {
5066  if (!idTestHomModule(v_id,currRing->qideal,w))
5067  {
5068  WarnS("wrong weights");
5069  w=NULL;
5070  }
5071  else
5072  {
5073  hom=isHomog;
5074  w=ivCopy(w);
5075  }
5076  }
5077  result=kStd(v_id,currRing->qideal,hom,&w);
5078  idSkipZeroes(result);
5079  res->data = (char *)result;
5081  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
5082  return FALSE;
5083 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
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:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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 3478 of file iparith.cc.

3479 {
3480  ideal result;
3481  assumeStdFlag(u);
3482  ideal i1=(ideal)(u->Data());
3483  ideal i0;
3484  int r=v->Typ();
3485  if ((/*v->Typ()*/r==POLY_CMD) ||(r==VECTOR_CMD))
3486  {
3487  i0=idInit(1,i1->rank); // TODO: rank is wrong (if v is a vector!)
3488  i0->m[0]=(poly)v->Data();
3489  int ii0=idElem(i0); /* size of i0 */
3490  i1=idSimpleAdd(i1,i0); //
3491  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
3492  idDelete(&i0);
3493  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3494  tHomog hom=testHomog;
3495 
3496  if (w!=NULL)
3497  {
3498  if (!idTestHomModule(i1,currRing->qideal,w))
3499  {
3500  // no warnung: this is legal, if i in std(i,p)
3501  // is homogeneous, but p not
3502  w=NULL;
3503  }
3504  else
3505  {
3506  w=ivCopy(w);
3507  hom=isHomog;
3508  }
3509  }
3510  BITSET save1;
3511  SI_SAVE_OPT1(save1);
3513  /* ii0 appears to be the position of the first element of il that
3514  does not belong to the old SB ideal */
3515  result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0);
3516  SI_RESTORE_OPT1(save1);
3517  idDelete(&i1);
3518  idSkipZeroes(result);
3519  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3520  res->data = (char *)result;
3521  }
3522  else /*IDEAL/MODULE*/
3523  {
3524  i0=(ideal)v->CopyD();
3525  int ii0=idElem(i0); /* size of i0 */
3526  i1=idSimpleAdd(i1,i0); //
3527  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
3528  idDelete(&i0);
3529  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3530  tHomog hom=testHomog;
3531 
3532  if (w!=NULL)
3533  {
3534  if (!idTestHomModule(i1,currRing->qideal,w))
3535  {
3536  // no warnung: this is legal, if i in std(i,p)
3537  // is homogeneous, but p not
3538  w=NULL;
3539  }
3540  else
3541  {
3542  w=ivCopy(w);
3543  hom=isHomog;
3544  }
3545  }
3546  if (ii0*4 >= 3*IDELEMS(i1)) // MAGIC: add few poly to large SB: 3/4
3547  {
3548  BITSET save1;
3549  SI_SAVE_OPT1(save1);
3551  /* ii0 appears to be the position of the first element of il that
3552  does not belong to the old SB ideal */
3553  result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0);
3554  SI_RESTORE_OPT1(save1);
3555  }
3556  else
3557  {
3558  result=kStd(i1,currRing->qideal,hom,&w);
3559  }
3560  idDelete(&i1);
3561  idSkipZeroes(result);
3562  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3563  res->data = (char *)result;
3564  }
3566  return FALSE;
3567 }
unsigned si_opt_1
Definition: options.c:5
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
#define idSimpleAdd(A, B)
Definition: ideals.h:44
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:979
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
Definition: tok.h:99
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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:679
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 3452 of file iparith.cc.

3453 {
3454  ideal result;
3455  intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
3456  tHomog hom=testHomog;
3457  ideal u_id=(ideal)(u->Data());
3458  if (w!=NULL)
3459  {
3460  if (!idTestHomModule(u_id,currRing->qideal,w))
3461  {
3462  WarnS("wrong weights:");w->show();PrintLn();
3463  w=NULL;
3464  }
3465  else
3466  {
3467  w=ivCopy(w);
3468  hom=isHomog;
3469  }
3470  }
3471  result=kStd(u_id,currRing->qideal,hom,&w,(intvec *)v->Data());
3472  idSkipZeroes(result);
3473  res->data = (char *)result;
3474  setFlag(res,FLAG_STD);
3475  if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
3476  return FALSE;
3477 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
void PrintLn()
Definition: reporter.cc:310
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
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:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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 6681 of file iparith.cc.

6682 {
6683  intvec *vw=(intvec *)w->Data(); // weights of vars
6684  if (vw->length()!=currRing->N)
6685  {
6686  Werror("%d weights for %d variables",vw->length(),currRing->N);
6687  return TRUE;
6688  }
6689  ideal result;
6690  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
6691  tHomog hom=testHomog;
6692  ideal u_id=(ideal)(u->Data());
6693  if (ww!=NULL)
6694  {
6695  if (!idTestHomModule(u_id,currRing->qideal,ww))
6696  {
6697  WarnS("wrong weights");
6698  ww=NULL;
6699  }
6700  else
6701  {
6702  ww=ivCopy(ww);
6703  hom=isHomog;
6704  }
6705  }
6706  result=kStd(u_id,
6707  currRing->qideal,
6708  hom,
6709  &ww, // module weights
6710  (intvec *)v->Data(), // hilbert series
6711  0,0, // syzComp, newIdeal
6712  vw); // weights of vars
6713  idSkipZeroes(result);
6714  res->data = (char *)result;
6715  setFlag(res,FLAG_STD);
6716  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
6717  return FALSE;
6718 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:101
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:90
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
Definition: tok.h:99
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define FLAG_STD
Definition: ipid.h:106
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1121
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 7938 of file iparith.cc.

7939 { ideal result;
7940  leftv u = INPUT; /* an ideal, weighted homogeneous and standard */
7941  leftv v = u->next; /* one additional polynomial or ideal */
7942  leftv h = v->next; /* Hilbert vector */
7943  leftv w = h->next; /* weight vector */
7944  assumeStdFlag(u);
7945  ideal i1=(ideal)(u->Data());
7946  ideal i0;
7947  if (((u->Typ()!=IDEAL_CMD)&&(u->Typ()!=MODUL_CMD))
7948  || (h->Typ()!=INTVEC_CMD)
7949  || (w->Typ()!=INTVEC_CMD))
7950  {
7951  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7952  return TRUE;
7953  }
7954  intvec *vw=(intvec *)w->Data(); // weights of vars
7955  /* merging std_hilb_w and std_1 */
7956  if (vw->length()!=currRing->N)
7957  {
7958  Werror("%d weights for %d variables",vw->length(),currRing->N);
7959  return TRUE;
7960  }
7961  int r=v->Typ();
7962  BOOLEAN cleanup_i0=FALSE;
7963  if ((r==POLY_CMD) ||(r==VECTOR_CMD))
7964  {
7965  i0=idInit(1,i1->rank);
7966  i0->m[0]=(poly)v->Data();
7967  cleanup_i0=TRUE;
7968  }
7969  else if (r==IDEAL_CMD)/* IDEAL */
7970  {
7971  i0=(ideal)v->Data();
7972  }
7973  else
7974  {
7975  WerrorS("expected `std(`ideal/module`,`poly/vector`,`intvec`,`intvec`)");
7976  return TRUE;
7977  }
7978  int ii0=idElem(i0);
7979  i1 = idSimpleAdd(i1,i0);
7980  if (cleanup_i0)
7981  {
7982  memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
7983  idDelete(&i0);
7984  }
7985  intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
7986  tHomog hom=testHomog;
7987  /* u_id from jjSTD_W is now i1 as in jjSTD_1 */
7988  if (ww!=NULL)
7989  {
7990  if (!idTestHomModule(i1,currRing->qideal,ww))
7991  {
7992  WarnS("wrong weights");
7993  ww=NULL;
7994  }
7995  else
7996  {
7997  ww=ivCopy(ww);
7998  hom=isHomog;
7999  }
8000  }
8001  BITSET save1;
8002  SI_SAVE_OPT1(save1);
8004  result=kStd(i1,
8005  currRing->qideal,
8006  hom,
8007  &ww, // module weights
8008  (intvec *)h->Data(), // hilbert series
8009  0, // syzComp, whatever it is...
8010  IDELEMS(i1)-ii0, // new ideal
8011  vw); // weights of vars
8012  SI_RESTORE_OPT1(save1);
8013  idDelete(&i1);
8014  idSkipZeroes(result);
8015  res->data = (char *)result;
8016  if (!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
8017  if (ww!=NULL) atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);
8018  return FALSE;
8019 }
unsigned si_opt_1
Definition: options.c:5
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
#define idSimpleAdd(A, B)
Definition: ideals.h:44
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:101
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:979
#define Sy_bit(x)
Definition: options.h:30
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
tHomog
Definition: structs.h:37
#define setFlag(A, F)
Definition: ipid.h:110
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
Definition: tok.h:99
#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:88
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
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:88
#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 7678 of file iparith.cc.

7679 {
7680  if (v == NULL)
7681  {
7682  res->data = omStrDup("");
7683  return FALSE;
7684  }
7685  int n = v->listLength();
7686  if (n == 1)
7687  {
7688  res->data = v->String();
7689  return FALSE;
7690  }
7691 
7692  char** slist = (char**) omAlloc(n*sizeof(char*));
7693  int i, j;
7694 
7695  for (i=0, j=0; i<n; i++, v = v ->next)
7696  {
7697  slist[i] = v->String();
7698  assume(slist[i] != NULL);
7699  j+=strlen(slist[i]);
7700  }
7701  char* s = (char*) omAlloc((j+1)*sizeof(char));
7702  *s='\0';
7703  for (i=0;i<n;i++)
7704  {
7705  strcat(s, slist[i]);
7706  omFree(slist[i]);
7707  }
7708  omFreeSize(slist, n*sizeof(char*));
7709  res->data = s;
7710  return FALSE;
7711 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:97
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int listLength()
Definition: subexpr.cc:61
#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:723
void * data
Definition: subexpr.h:90
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
#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 5409 of file iparith.cc.

5410 {
5411  res->data = (char *)strlen((char *)v->Data());
5412  return FALSE;
5413 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjSUBST_Id()

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

Definition at line 6441 of file iparith.cc.

6442 {
6443  int ringvar;
6444  poly monomexpr;
6445  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6446  if (nok) return TRUE;
6447  ideal id=(ideal)u->Data();
6448  if (ringvar>0)
6449  {
6450  BOOLEAN overflow=FALSE;
6451  if (monomexpr!=NULL)
6452  {
6453  long deg_monexp=pTotaldegree(monomexpr);
6454  for(int i=IDELEMS(id)-1;i>=0;i--)
6455  {
6456  poly p=id->m[i];
6457  if ((p!=NULL) && (pTotaldegree(p)!=0) &&
6458  ((unsigned long)deg_monexp > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6459  {
6460  overflow=TRUE;
6461  break;
6462  }
6463  }
6464  }
6465  if (overflow)
6466  Warn("possible OVERFLOW in subst, max exponent is %ld",currRing->bitmask/2);
6467  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6468  {
6469  if (res->rtyp==MATRIX_CMD) id=(ideal)mp_Copy((matrix)id,currRing);
6470  else id=id_Copy(id,currRing);
6471  res->data = id_Subst(id, ringvar, monomexpr, currRing);
6472  }
6473  else
6474  res->data = idSubstPoly(id,ringvar,monomexpr);
6475  }
6476  else
6477  {
6478  res->data = idSubstPar(id,-ringvar,monomexpr);
6479  }
6480  return FALSE;
6481 }
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:97
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:6387
static long pTotaldegree(poly p)
Definition: polys.h:265
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:93
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1121
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88
#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 6485 of file iparith.cc.

6486 {
6487  return jjSUBST_Id_X(res,u,v,w,INT_CMD);
6488 }
Definition: tok.h:94
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6493

§ jjSUBST_Id_N()

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

Definition at line 6489 of file iparith.cc.

6490 {
6491  return jjSUBST_Id_X(res,u,v,w,NUMBER_CMD);
6492 }
static BOOLEAN jjSUBST_Id_X(leftv res, leftv u, leftv v, leftv w, int input_type)
Definition: iparith.cc:6493

§ jjSUBST_Id_X()

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

Definition at line 6493 of file iparith.cc.

6494 {
6495  sleftv tmp;
6496  memset(&tmp,0,sizeof(tmp));
6497  // do not check the result, conversion from int/number to poly works always
6498  iiConvert(input_type,POLY_CMD,iiTestConvert(input_type,POLY_CMD),w,&tmp);
6499  BOOLEAN b=jjSUBST_Id(res,u,v,&tmp);
6500  tmp.CleanUp();
6501  return b;
6502 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
static BOOLEAN jjSUBST_Id(leftv res, leftv u, leftv v, leftv w)
Definition: iparith.cc:6441
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213

§ jjSUBST_M()

static BOOLEAN jjSUBST_M ( leftv  res,
leftv  u 
)
static

Definition at line 7894 of file iparith.cc.

7895 {
7896  leftv v = u->next; // number of args > 0
7897  if (v==NULL) return TRUE;
7898  leftv w = v->next;
7899  if (w==NULL) return TRUE;
7900  leftv rest = w->next;;
7901 
7902  u->next = NULL;
7903  v->next = NULL;
7904  w->next = NULL;
7905  BOOLEAN b = iiExprArith3(res, iiOp, u, v, w);
7906  if ((rest!=NULL) && (!b))
7907  {
7908  sleftv tmp_res;
7909  leftv tmp_next=res->next;
7910  res->next=rest;
7911  memset(&tmp_res,0,sizeof(tmp_res));
7912  b = iiExprArithM(&tmp_res,res,iiOp);
7913  memcpy(res,&tmp_res,sizeof(tmp_res));
7914  res->next=tmp_next;
7915  }
7916  u->next = v;
7917  v->next = w;
7918  // rest was w->next, but is already cleaned
7919  return b;
7920 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:8634
#define TRUE
Definition: auxiliary.h:101
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:8722
leftv next
Definition: subexpr.h:88
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:227
int BOOLEAN
Definition: auxiliary.h:88
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 6415 of file iparith.cc.

6416 {
6417  int ringvar;
6418  poly monomexpr;
6419  BOOLEAN nok=jjSUBST_Test(v,w,ringvar,monomexpr);
6420  if (nok) return TRUE;
6421  poly p=(poly)u->Data();
6422  if (ringvar>0)
6423  {
6424  if ((monomexpr!=NULL) && (p!=NULL) && (pTotaldegree(p)!=0) &&
6425  ((unsigned long)pTotaldegree(monomexpr) > (currRing->bitmask / (unsigned long)pTotaldegree(p)/2)))
6426  {
6427  Warn("possible OVERFLOW in subst, max exponent is %ld, substituting deg %d by deg %d",currRing->bitmask/2, pTotaldegree(monomexpr), pTotaldegree(p));
6428  //return TRUE;
6429  }
6430  if ((monomexpr==NULL)||(pNext(monomexpr)==NULL))
6431  res->data = pSubst((poly)u->CopyD(res->rtyp),ringvar,monomexpr);
6432  else
6433  res->data= pSubstPoly(p,ringvar,monomexpr);
6434  }
6435  else
6436  {
6437  res->data=pSubstPar(p,-ringvar,monomexpr);
6438  }
6439  return FALSE;
6440 }
#define pSubst(p, n, e)
Definition: polys.h:349
poly pSubstPoly(poly p, int var, poly image)
Definition: maps_ip.cc:390
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:6387
static long pTotaldegree(poly p)
Definition: polys.h:265
poly pSubstPar(poly p, int par, poly image)
Definition: maps_ip.cc:253
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88
void * CopyD(int t)
Definition: subexpr.cc:679
#define Warn
Definition: emacs.cc:80

§ jjSUBST_Test()

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

Definition at line 6387 of file iparith.cc.

6389 {
6390  monomexpr=(poly)w->Data();
6391  poly p=(poly)v->Data();
6392 #if 0
6393  if (pLength(monomexpr)>1)
6394  {
6395  Werror("`%s` substitutes a ringvar only by a term",
6397  return TRUE;
6398  }
6399 #endif
6400  if ((ringvar=pVar(p))==0)
6401  {
6402  if ((p!=NULL) && (currRing->cf->extRing!=NULL))
6403  {
6404  number n = pGetCoeff(p);
6405  ringvar= -n_IsParam(n, currRing);
6406  }
6407  if(ringvar==0)
6408  {
6409  WerrorS("ringvar/par expected");
6410  return TRUE;
6411  }
6412  }
6413  return FALSE;
6414 }
#define pVar(m)
Definition: polys.h:365
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
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
static int pLength(poly a)
Definition: p_polys.h:189
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:8952
Definition: tok.h:182
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
int n_IsParam(const number m, const ring r)
TODO: rewrite somehow...
Definition: ring.cc:5638
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjsyMinBase()

static BOOLEAN jjsyMinBase ( leftv  res,
leftv  v 
)
static

Definition at line 5455 of file iparith.cc.

5456 {
5457  res->data = (char *)syMinBase((ideal)v->Data());
5458  return FALSE;
5459 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
ideal syMinBase(ideal arg)
Definition: syz.cc:1025

§ jjSYZYGY()

static BOOLEAN jjSYZYGY ( leftv  res,
leftv  v 
)
static

Definition at line 5106 of file iparith.cc.

5107 {
5108  intvec *w=NULL;
5109  res->data = (char *)idSyzygies((ideal)v->Data(),testHomog,&w);
5110  if (w!=NULL) delete w;
5112  return FALSE;
5113 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_STD
Definition: ipid.h:106
#define TEST_OPT_RETURN_SB
Definition: options.h:107
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
void * Data()
Definition: subexpr.cc:1121
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
Definition: ideals.cc:515

§ jjTEST()

static BOOLEAN jjTEST ( leftv  ,
leftv  v 
)
static

Definition at line 7712 of file iparith.cc.

7713 {
7714  do
7715  {
7716  if (v->Typ()!=INT_CMD)
7717  return TRUE;
7718  test_cmd((int)(long)v->Data());
7719  v=v->next;
7720  }
7721  while (v!=NULL);
7722  return FALSE;
7723 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
leftv next
Definition: subexpr.h:88
void test_cmd(int i)
Definition: ipshell.cc:508
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_BI()

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

Definition at line 929 of file iparith.cc.

930 {
931  res->data = (char *)(n_Mult( (number)u->Data(), (number)v->Data(),coeffs_BIGINT));
932  if ((v->next!=NULL) || (u->next!=NULL))
933  return jjOP_REST(res,u,v);
934  return FALSE;
935 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_BIM()

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

Definition at line 1013 of file iparith.cc.

1014 {
1015  res->data = (char *)bimMult((bigintmat*)(u->Data()), (bigintmat*)(v->Data()));
1016  if (res->data==NULL)
1017  {
1018  WerrorS("bigintmat/cmatrix not compatible");
1019  return TRUE;
1020  }
1021  if ((v->next!=NULL) || (u->next!=NULL))
1022  return jjOP_REST(res,u,v);
1023  return FALSE;
1024 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
bigintmat * bimMult(bigintmat *a, bigintmat *b)
Definition: bigintmat.cc:256
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_I()

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

Definition at line 917 of file iparith.cc.

918 {
919  int a=(int)(long)u->Data();
920  int b=(int)(long)v->Data();
921  int64 c=(int64)a * (int64)b;
922  if ((c>INT_MAX)||(c<INT_MIN))
923  WarnS("int overflow(*), result may be wrong");
924  res->data = (char *)((long)((int)c));
925  if ((u->Next()!=NULL) || (v->Next()!=NULL))
926  return jjOP_REST(res,u,v);
927  return FALSE;
928 }
const poly a
Definition: syzextra.cc:212
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
long int64
Definition: auxiliary.h:69
#define WarnS
Definition: emacs.cc:81
void * data
Definition: subexpr.h:90
leftv Next()
Definition: subexpr.h:138
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
const poly b
Definition: syzextra.cc:213

§ jjTIMES_ID()

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

Definition at line 993 of file iparith.cc.

994 {
995  res->data = (char *)idMult((ideal)u->Data(),(ideal)v->Data());
996  id_Normalize((ideal)res->data,currRing);
997  if ((v->next!=NULL) || (u->next!=NULL))
998  return jjOP_REST(res,u,v);
999  return FALSE;
1000 }
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:516
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:88
ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition: ideals.h:86
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_IV()

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

Definition at line 1001 of file iparith.cc.

1002 {
1003  res->data = (char *)ivMult((intvec*)(u->Data()), (intvec*)(v->Data()));
1004  if (res->data==NULL)
1005  {
1006  WerrorS("intmat size not compatible");
1007  return TRUE;
1008  }
1009  if ((v->next!=NULL) || (u->next!=NULL))
1010  return jjOP_REST(res,u,v);
1011  return FALSE;
1012 }
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
leftv next
Definition: subexpr.h:88
intvec * ivMult(intvec *a, intvec *b)
Definition: intvec.cc:332
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_MA()

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

Definition at line 1081 of file iparith.cc.

1082 {
1083  matrix A=(matrix)u->Data(); matrix B=(matrix)v->Data();
1084  res->data = (char *)mp_Mult(A,B,currRing);
1085  if (res->data==NULL)
1086  {
1087  Werror("matrix size not compatible(%dx%d, %dx%d) in *",
1088  MATROWS(A),MATCOLS(A),MATROWS(B),MATCOLS(B));
1089  return TRUE;
1090  }
1091  id_Normalize((ideal)res->data,currRing);
1092  if ((v->next!=NULL) || (u->next!=NULL))
1093  return jjOP_REST(res,u,v);
1094  return FALSE;
1095 }
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:516
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:88
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition: matpol.cc:224
#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:1121
#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 1025 of file iparith.cc.

1026 {
1028  if (nMap==NULL) return TRUE;
1029  number n=nMap((number)v->Data(),coeffs_BIGINT,currRing->cf);
1030  poly p=pNSet(n);
1031  ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1032  res->data = (char *)I;
1033  return FALSE;
1034 }
#define pNSet(n)
Definition: polys.h:296
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:159
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjTIMES_MA_BI2()

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

Definition at line 1035 of file iparith.cc.

1036 {
1037  return jjTIMES_MA_BI1(res,v,u);
1038 }
static BOOLEAN jjTIMES_MA_BI1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1025

§ jjTIMES_MA_I1()

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

Definition at line 1071 of file iparith.cc.

1072 {
1073  res->data = (char *)mp_MultI((matrix)u->CopyD(MATRIX_CMD),(int)(long)v->Data(),currRing);
1074  id_Normalize((ideal)res->data,currRing);
1075  return FALSE;
1076 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:146
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjTIMES_MA_I2()

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

Definition at line 1077 of file iparith.cc.

1078 {
1079  return jjTIMES_MA_I1(res,v,u);
1080 }
static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1071

§ jjTIMES_MA_N1()

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

Definition at line 1059 of file iparith.cc.

1060 {
1061  number n=(number)v->CopyD(NUMBER_CMD);
1062  poly p=pNSet(n);
1063  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1064  id_Normalize((ideal)res->data,currRing);
1065  return FALSE;
1066 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pNSet(n)
Definition: polys.h:296
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:159
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjTIMES_MA_N2()

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

Definition at line 1067 of file iparith.cc.

1068 {
1069  return jjTIMES_MA_N1(res,v,u);
1070 }
static BOOLEAN jjTIMES_MA_N1(leftv res, leftv u, leftv v)
Definition: iparith.cc:1059

§ jjTIMES_MA_P1()

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

Definition at line 1039 of file iparith.cc.

1040 {
1041  poly p=(poly)v->CopyD(POLY_CMD);
1042  int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
1043  ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
1044  if (r>0) I->rank=r;
1046  res->data = (char *)I;
1047  return FALSE;
1048 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:159
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
long rank
Definition: matpol.h:20

§ jjTIMES_MA_P2()

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

Definition at line 1049 of file iparith.cc.

1050 {
1051  poly p=(poly)u->CopyD(POLY_CMD);
1052  int r=pMaxComp(p);/* recompute the rank for the case ideal*vector*/
1053  ideal I= (ideal)pMultMp(p,(matrix)v->CopyD(MATRIX_CMD),currRing);
1054  if (r>0) I->rank=r;
1056  res->data = (char *)I;
1057  return FALSE;
1058 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define pMaxComp(p)
Definition: polys.h:282
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
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:176
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679
long rank
Definition: matpol.h:20

§ jjTIMES_N()

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

Definition at line 936 of file iparith.cc.

937 {
938  res->data = (char *)(nMult( (number)u->Data(), (number)v->Data()));
939  number n=(number)res->data;
940  nNormalize(n);
941  res->data=(char *)n;
942  if ((v->next!=NULL) || (u->next!=NULL))
943  return jjOP_REST(res,u,v);
944  return FALSE;
945 }
#define nNormalize(n)
Definition: numbers.h:30
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define nMult(n1, n2)
Definition: numbers.h:17
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121

§ jjTIMES_P()

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

Definition at line 946 of file iparith.cc.

947 {
948  poly a;
949  poly b;
950  if (v->next==NULL)
951  {
952  a=(poly)u->CopyD(POLY_CMD); // works also for VECTOR_CMD
953  if (u->next==NULL)
954  {
955  b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
956  if ((a!=NULL) && (b!=NULL)
957  && ((long)pTotaldegree(a)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)-(long)pTotaldegree(b)))
958  {
959  Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
960  pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
961  }
962  res->data = (char *)(pMult( a, b));
963  pNormalize((poly)res->data);
964  return FALSE;
965  }
966  // u->next exists: copy v
967  b=pCopy((poly)v->Data());
968  if ((a!=NULL) && (b!=NULL)
969  && (pTotaldegree(a)+pTotaldegree(b)>si_max((long)rVar(currRing),(long)currRing->bitmask/2)))
970  {
971  Warn("possible OVERFLOW in mult(d=%ld, d=%ld, max=%ld)",
972  pTotaldegree(a),pTotaldegree(b),currRing->bitmask/2);
973  }
974  res->data = (char *)(pMult( a, b));
975  pNormalize((poly)res->data);
976  return jjOP_REST(res,u,v);
977  }
978  // v->next exists: copy u
979  a=pCopy((poly)u->Data());
980  b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
981  if ((a!=NULL) && (b!=NULL)
982  && ((unsigned long)(pTotaldegree(a)+pTotaldegree(b))>=currRing->bitmask/2))
983  {
984  pDelete(&a);
985  pDelete(&b);
986  WerrorS("OVERFLOW");
987  return TRUE;
988  }
989  res->data = (char *)(pMult( a, b));
990  pNormalize((poly)res->data);
991  return jjOP_REST(res,u,v);
992 }
const poly a
Definition: syzextra.cc:212
static BOOLEAN jjOP_REST(leftv res, leftv u, leftv v)
Definition: iparith.cc:516
#define FALSE
Definition: auxiliary.h:97
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:265
pNormalize(P.p)
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
leftv next
Definition: subexpr.h:88
#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:1121
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
void * CopyD(int t)
Definition: subexpr.cc:679
#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 5144 of file iparith.cc.

5145 {
5146  res->data = (char *)(long)ivTrace((intvec*)(v->Data()));
5147  return FALSE;
5148 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121
int ivTrace(intvec *o)
Definition: intvec.cc:322

§ jjTRANSP_BIM()

static BOOLEAN jjTRANSP_BIM ( leftv  res,
leftv  v 
)
static

Definition at line 5149 of file iparith.cc.

5150 {
5151  res->data = (char *)(((bigintmat*)(v->Data()))->transpose());
5152  return FALSE;
5153 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjTRANSP_IV()

static BOOLEAN jjTRANSP_IV ( leftv  res,
leftv  v 
)
static

Definition at line 5154 of file iparith.cc.

5155 {
5156  res->data = (char *)ivTranp((intvec*)(v->Data()));
5157  return FALSE;
5158 }
#define FALSE
Definition: auxiliary.h:97
intvec * ivTranp(intvec *o)
Definition: intvec.cc:310
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
void * Data()
Definition: subexpr.cc:1121

§ jjTWOSTD()

static BOOLEAN jjTWOSTD ( leftv  res,
leftv  a 
)
static

Definition at line 5186 of file iparith.cc.

5187 {
5188  if (rIsPluralRing(currRing)) res->data=(ideal)twostd((ideal)a->Data());
5189  else res->data=(ideal)a->CopyD();
5190  setFlag(res,FLAG_STD);
5191  setFlag(res,FLAG_TWOSTD);
5192  return FALSE;
5193 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1121
void * CopyD(int t)
Definition: subexpr.cc:679
ideal twostd(ideal I)
Compute two-sided GB:
Definition: nc.cc:21

§ jjTYPEOF()

static BOOLEAN jjTYPEOF ( leftv  res,
leftv  v 
)
static

Definition at line 5196 of file iparith.cc.

5197 {
5198  int t=(int)(long)v->data;
5199  switch (t)
5200  {
5201  #ifdef SINGULAR_4_1
5202  case CRING_CMD:
5203  #endif
5204  case INT_CMD:
5205  case POLY_CMD:
5206  case VECTOR_CMD:
5207  case STRING_CMD:
5208  case INTVEC_CMD:
5209  case IDEAL_CMD:
5210  case MATRIX_CMD:
5211  case MODUL_CMD:
5212  case MAP_CMD:
5213  case PROC_CMD:
5214  case RING_CMD:
5215  //case QRING_CMD:
5216  case INTMAT_CMD:
5217  case BIGINTMAT_CMD:
5218  case NUMBER_CMD:
5219  #ifdef SINGULAR_4_1
5220  case CNUMBER_CMD:
5221  #endif
5222  case BIGINT_CMD:
5223  case LIST_CMD:
5224  case PACKAGE_CMD:
5225  case LINK_CMD:
5226  case RESOLUTION_CMD:
5227  res->data=omStrDup(Tok2Cmdname(t)); break;
5228  case DEF_CMD:
5229  case NONE: res->data=omStrDup("none"); break;
5230  default:
5231  {
5232  if (t>MAX_TOK)
5233  res->data=omStrDup(getBlackboxName(t));
5234  else
5235  res->data=omStrDup("?unknown type?");
5236  break;
5237  }
5238  }
5239  return FALSE;
5240 }
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:38
Definition: tok.h:213
void * data
Definition: subexpr.h:90
const char * Tok2Cmdname(int tok)
Definition: iparith.cc:8952
Definition: tok.h:55
Definition: tok.h:57
Definition: tok.h:99
Definition: tok.h:115
Definition: tok.h:116
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition: blackbox.cc:183
#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 3700 of file iparith.cc.

3701 {
3702  number n=(number)u->CopyD(BIGINT_CMD);
3703  n=n_InpNeg(n,coeffs_BIGINT);
3704  res->data = (char *)n;
3705  return FALSE;
3706 }
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:38
coeffs coeffs_BIGINT
Definition: ipid.cc:54
void * data
Definition: subexpr.h:90
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:679

§ jjUMINUS_BIM()

static BOOLEAN jjUMINUS_BIM ( leftv  res,
leftv  u 
)
static

Definition at line 3737 of file iparith.cc.

3738 {
3739  bigintmat *bim=(bigintmat *)u->CopyD(BIGINTMAT_CMD);
3740  (*bim)*=(-1);
3741  res->data = (char *)bim;
3742  return FALSE;
3743 }
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjUMINUS_I()

static BOOLEAN jjUMINUS_I ( leftv  res,
leftv  u 
)
static

Definition at line 3707 of file iparith.cc.

3708 {
3709  res->data = (char *)(-(long)u->Data());
3710  return FALSE;
3711 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121

§ jjUMINUS_IV()

static BOOLEAN jjUMINUS_IV ( leftv  res,
leftv  u 
)
static

Definition at line 3730 of file iparith.cc.

3731 {
3732  intvec *iv=(intvec *)u->CopyD(INTVEC_CMD);
3733  (*iv)*=(-1);
3734  res->data = (char *)iv;
3735  return FALSE;
3736 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
Definition: tok.h:99
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjUMINUS_MA()

static BOOLEAN jjUMINUS_MA ( leftv  res,
leftv  u 
)
static

Definition at line 3724 of file iparith.cc.

3725 {
3726  poly m1=pISet(-1);
3727  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),m1,currRing);
3728  return FALSE;
3729 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:159
polyrec * poly
Definition: hilb.h:10
#define pISet(i)
Definition: polys.h:295
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjUMINUS_N()

static BOOLEAN jjUMINUS_N ( leftv  res,
leftv  u 
)
static

Definition at line 3712 of file iparith.cc.

3713 {
3714  number n=(number)u->CopyD(NUMBER_CMD);
3715  n=nInpNeg(n);
3716  res->data = (char *)n;
3717  return FALSE;
3718 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define nInpNeg(n)
Definition: numbers.h:21
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjUMINUS_P()

static BOOLEAN jjUMINUS_P ( leftv  res,
leftv  u 
)
static

Definition at line 3719 of file iparith.cc.

3720 {
3721  res->data = (char *)pNeg((poly)u->CopyD(POLY_CMD));
3722  return FALSE;
3723 }
#define FALSE
Definition: auxiliary.h:97
#define pNeg(p)
Definition: polys.h:181
void * data
Definition: subexpr.h:90
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjUNIVARIATE()

static BOOLEAN jjUNIVARIATE ( leftv  res,
leftv  v 
)
static

Definition at line 5241 of file iparith.cc.

5242 {
5243  res->data=(char *)(long)pIsUnivariate((poly)v->Data());
5244  return FALSE;
5245 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * Data()
Definition: subexpr.cc:1121
#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 5246 of file iparith.cc.

5247 {
5248  int i=(int)(long)v->Data();
5249  if ((0<i) && (i<=currRing->N))
5250  {
5251  poly p=pOne();
5252  pSetExp(p,i,1);
5253  pSetm(p);
5254  res->data=(char *)p;
5255  }
5256  else
5257  {
5258  Werror("var number %d out of range 1..%d",i,currRing->N);
5259  return TRUE;
5260  }
5261  return FALSE;
5262 }
#define pSetm(p)
Definition: polys.h:253
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
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:298
void * Data()
Definition: subexpr.cc:1121
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 5263 of file iparith.cc.

5264 {
5265  if (currRing==NULL)
5266  {
5267  WerrorS("no ring active");
5268  return TRUE;
5269  }
5270  int i=(int)(long)v->Data();
5271  if ((0<i) && (i<=currRing->N))
5272  res->data=omStrDup(currRing->names[i-1]);
5273  else
5274  {
5275  Werror("var number %d out of range 1..%d",i,currRing->N);
5276  return TRUE;
5277  }
5278  return FALSE;
5279 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
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:1121
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 3568 of file iparith.cc.

3569 {
3570  idhdl h=(idhdl)u->data;
3571  int i=(int)(long)v->Data();
3572  if ((0<i) && (i<=IDRING(h)->N))
3573  res->data=omStrDup(IDRING(h)->names[i-1]);
3574  else
3575  {
3576  Werror("var number %d out of range 1..%d",i,IDRING(h)->N);
3577  return TRUE;
3578  }
3579  return FALSE;
3580 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
Definition: idrec.h:34
void * data
Definition: subexpr.h:90
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:1121
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 5280 of file iparith.cc.

5281 {
5282  assumeStdFlag(v);
5283  res->data = (char *)(long)scMult0Int((ideal)v->Data(),currRing->qideal);
5284  return FALSE;
5285 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1458
void * Data()
Definition: subexpr.cc:1121

§ jjWAIT1ST1()

BOOLEAN jjWAIT1ST1 ( leftv  res,
leftv  u 
)

Definition at line 5286 of file iparith.cc.

5287 {
5288 // input: u: a list with links of type
5289 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5290 // returns: -1: the read state of all links is eof
5291 // i>0: (at least) u[i] is ready
5292  lists Lforks = (lists)u->Data();
5293  int i = slStatusSsiL(Lforks, -1);
5294  if(i == -2) /* error */
5295  {
5296  return TRUE;
5297  }
5298  res->data = (void*)(long)i;
5299  return FALSE;
5300 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1121

§ jjWAIT1ST2()

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

Definition at line 3581 of file iparith.cc.

3582 {
3583 // input: u: a list with links of type
3584 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3585 // v: timeout for select in milliseconds
3586 // or 0 for polling
3587 // returns: ERROR (via Werror): timeout negative
3588 // -1: the read state of all links is eof
3589 // 0: timeout (or polling): none ready
3590 // i>0: (at least) L[i] is ready
3591  lists Lforks = (lists)u->Data();
3592  int t = (int)(long)v->Data();
3593  if(t < 0)
3594  {
3595  WerrorS("negative timeout"); return TRUE;
3596  }
3597  int i = slStatusSsiL(Lforks, t*1000);
3598  if(i == -2) /* error */
3599  {
3600  return TRUE;
3601  }
3602  res->data = (void*)(long)i;
3603  return FALSE;
3604 }
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1121

§ jjWAITALL1()

BOOLEAN jjWAITALL1 ( leftv  res,
leftv  u 
)

Definition at line 5301 of file iparith.cc.

5302 {
5303 // input: u: a list with links of type
5304 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
5305 // returns: -1: the read state of all links is eof
5306 // 1: all links are ready
5307 // (caution: at least one is ready, but some maybe dead)
5308  lists Lforks = (lists)u->CopyD();
5309  int i;
5310  int j = -1;
5311  for(int nfinished = 0; nfinished < Lforks->nr+1; nfinished++)
5312  {
5313  i = slStatusSsiL(Lforks, -1);
5314  if(i == -2) /* error */
5315  {
5316  return TRUE;
5317  }
5318  if(i == -1)
5319  {
5320  break;
5321  }
5322  j = 1;
5323  Lforks->m[i-1].CleanUp();
5324  Lforks->m[i-1].rtyp=DEF_CMD;
5325  Lforks->m[i-1].data=NULL;
5326  }
5327  res->data = (void*)(long)j;
5328  Lforks->Clean();
5329  return FALSE;
5330 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
int j
Definition: myNF.cc:70
Definition: tok.h:57
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void Clean(ring r=currRing)
Definition: lists.h:25
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjWAITALL2()

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

Definition at line 3605 of file iparith.cc.

3606 {
3607 // input: u: a list with links of type
3608 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch
3609 // v: timeout for select in milliseconds
3610 // or 0 for polling
3611 // returns: ERROR (via Werror): timeout negative
3612 // -1: the read state of all links is eof
3613 // 0: timeout (or polling): none ready
3614 // 1: all links are ready
3615 // (caution: at least one is ready, but some maybe dead)
3616  lists Lforks = (lists)u->CopyD();
3617  int timeout = 1000*(int)(long)v->Data();
3618  if(timeout < 0)
3619  {
3620  WerrorS("negative timeout"); return TRUE;
3621  }
3622  int t = getRTimer()/TIMER_RESOLUTION; // in seconds
3623  int i;
3624  int ret = -1;
3625  for(int nfinished = 0; nfinished < Lforks->nr+1; nfinished++)
3626  {
3627  i = slStatusSsiL(Lforks, timeout);
3628  if(i > 0) /* Lforks[i] is ready */
3629  {
3630  ret = 1;
3631  Lforks->m[i-1].CleanUp();
3632  Lforks->m[i-1].rtyp=DEF_CMD;
3633  Lforks->m[i-1].data=NULL;
3634  timeout = si_max(0,timeout - 1000*(getRTimer()/TIMER_RESOLUTION - t));
3635  }
3636  else /* terminate the for loop */
3637  {
3638  if(i == -2) /* error */
3639  {
3640  return TRUE;
3641  }
3642  if(i == 0) /* timeout */
3643  {
3644  ret = 0;
3645  }
3646  break;
3647  }
3648  }
3649  Lforks->Clean();
3650  res->data = (void*)(long)ret;
3651  return FALSE;
3652 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
int getRTimer()
Definition: timer.cc:172
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
#define TIMER_RESOLUTION
Definition: mod2.h:38
Definition: tok.h:57
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
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:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjWEDGE()

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

Definition at line 3653 of file iparith.cc.

3654 {
3655  res->data = (char *)mp_Wedge((matrix)u->Data(),(int)(long)v->Data(),currRing);
3656  return FALSE;
3657 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
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:1656
void * Data()
Definition: subexpr.cc:1121

§ jjWRONG()

static BOOLEAN jjWRONG ( leftv  ,
leftv   
)
static

Definition at line 3660 of file iparith.cc.

3661 {
3662  return TRUE;
3663 }
#define TRUE
Definition: auxiliary.h:101

§ pHeadProc()

poly pHeadProc ( poly  p)

Definition at line 237 of file iparith.cc.

238 {
239  return pHead(p);
240 }
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 2708 of file ipshell.cc.

2709 {
2710  if ((L->nr!=3)
2711 #ifdef HAVE_PLURAL
2712  &&(L->nr!=5)
2713 #endif
2714  )
2715  return NULL;
2716  int is_gf_char=0;
2717  // 0: char/ cf - ring
2718  // 1: list (var)
2719  // 2: list (ord)
2720  // 3: qideal
2721  // possibly:
2722  // 4: C
2723  // 5: D
2724 
2725  ring R = (ring) omAlloc0Bin(sip_sring_bin);
2726 
2727  // ------------------------------------------------------------------
2728  // 0: char:
2729 #ifdef SINGULAR_4_1
2730  if (L->m[0].Typ()==CRING_CMD)
2731  {
2732  R->cf=(coeffs)L->m[0].Data();
2733  R->cf->ref++;
2734  }
2735  else
2736 #endif
2737  if (L->m[0].Typ()==INT_CMD)
2738  {
2739  int ch = (int)(long)L->m[0].Data();
2740  assume( ch >= 0 );
2741 
2742  if (ch == 0) // Q?
2743  R->cf = nInitChar(n_Q, NULL);
2744  else
2745  {
2746  int l = IsPrime(ch); // Zp?
2747  if( l != ch )
2748  {
2749  Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
2750  ch = l;
2751  }
2752  R->cf = nInitChar(n_Zp, (void*)(long)ch);
2753  }
2754  }
2755  else if (L->m[0].Typ()==LIST_CMD) // something complicated...
2756  {
2757  lists LL=(lists)L->m[0].Data();
2758 
2759 #ifdef HAVE_RINGS
2760  if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
2761  {
2762  rComposeRing(LL, R); // Ring!?
2763  }
2764  else
2765 #endif
2766  if (LL->nr < 3)
2767  rComposeC(LL,R); // R, long_R, long_C
2768  else
2769  {
2770  if (LL->m[0].Typ()==INT_CMD)
2771  {
2772  int ch = (int)(long)LL->m[0].Data();
2773  while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
2774  if (fftable[is_gf_char]==0) is_gf_char=-1;
2775 
2776  if(is_gf_char!= -1)
2777  {
2778  GFInfo param;
2779 
2780  param.GFChar = ch;
2781  param.GFDegree = 1;
2782  param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
2783 
2784  // nfInitChar should be able to handle the case when ch is in fftables!
2785  R->cf = nInitChar(n_GF, (void*)&param);
2786  }
2787  }
2788 
2789  if( R->cf == NULL )
2790  {
2791  ring extRing = rCompose((lists)L->m[0].Data(),FALSE);
2792 
2793  if (extRing==NULL)
2794  {
2795  WerrorS("could not create the specified coefficient field");
2796  goto rCompose_err;
2797  }
2798 
2799  if( extRing->qideal != NULL ) // Algebraic extension
2800  {
2801  AlgExtInfo extParam;
2802 
2803  extParam.r = extRing;
2804 
2805  R->cf = nInitChar(n_algExt, (void*)&extParam);
2806  }
2807  else // Transcendental extension
2808  {
2809  TransExtInfo extParam;
2810  extParam.r = extRing;
2811  assume( extRing->qideal == NULL );
2812 
2813  R->cf = nInitChar(n_transExt, &extParam);
2814  }
2815  }
2816  }
2817  }
2818  else
2819  {
2820  WerrorS("coefficient field must be described by `int` or `list`");
2821  goto rCompose_err;
2822  }
2823 
2824  if( R->cf == NULL )
2825  {
2826  WerrorS("could not create coefficient field described by the input!");
2827  goto rCompose_err;
2828  }
2829 
2830  // ------------------------- VARS ---------------------------
2831  if (rComposeVar(L,R)) goto rCompose_err;
2832  // ------------------------ ORDER ------------------------------
2833  if (rComposeOrder(L,check_comp,R)) goto rCompose_err;
2834 
2835  // ------------------------ ??????? --------------------
2836 
2837  rRenameVars(R);
2838  rComplete(R);
2839 
2840  // ------------------------ Q-IDEAL ------------------------
2841 
2842  if (L->m[3].Typ()==IDEAL_CMD)
2843  {
2844  ideal q=(ideal)L->m[3].Data();
2845  if (q->m[0]!=NULL)
2846  {
2847  if (R->cf != currRing->cf) //->cf->ch!=currRing->cf->ch)
2848  {
2849  #if 0
2850  WerrorS("coefficient fields must be equal if q-ideal !=0");
2851  goto rCompose_err;
2852  #else
2853  ring orig_ring=currRing;
2854  rChangeCurrRing(R);
2855  int *perm=NULL;
2856  int *par_perm=NULL;
2857  int par_perm_size=0;
2858  nMapFunc nMap;
2859 
2860  if ((nMap=nSetMap(orig_ring->cf))==NULL)
2861  {
2862  if (rEqual(orig_ring,currRing))
2863  {
2864  nMap=n_SetMap(currRing->cf, currRing->cf);
2865  }
2866  else
2867  // Allow imap/fetch to be make an exception only for:
2868  if ( (rField_is_Q_a(orig_ring) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a)
2871  ||
2872  (rField_is_Zp_a(orig_ring) && // Zp(a..) -> Zp(a..) || Zp
2873  (rField_is_Zp(currRing, rInternalChar(orig_ring)) ||
2874  rField_is_Zp_a(currRing, rInternalChar(orig_ring)))) )
2875  {
2876  par_perm_size=rPar(orig_ring);
2877 
2878 // if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
2879 // naSetChar(rInternalChar(orig_ring),orig_ring);
2880 // else ntSetChar(rInternalChar(orig_ring),orig_ring);
2881 
2882  nSetChar(currRing->cf);
2883  }
2884  else
2885  {
2886  WerrorS("coefficient fields must be equal if q-ideal !=0");
2887  goto rCompose_err;
2888  }
2889  }
2890  perm=(int *)omAlloc0((orig_ring->N+1)*sizeof(int));
2891  if (par_perm_size!=0)
2892  par_perm=(int *)omAlloc0(par_perm_size*sizeof(int));
2893  int i;
2894  #if 0
2895  // use imap:
2896  maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2897  currRing->names,currRing->N,currRing->parameter, currRing->P,
2898  perm,par_perm, currRing->ch);
2899  #else
2900  // use fetch
2901  if ((rPar(orig_ring)>0) && (rPar(currRing)==0))
2902  {
2903  for(i=si_min(rPar(orig_ring),rVar(currRing))-1;i>=0;i--) par_perm[i]=i+1;
2904  }
2905  else if (par_perm_size!=0)
2906  for(i=si_min(rPar(orig_ring),rPar(currRing))-1;i>=0;i--) par_perm[i]=-(i+1);
2907  for(i=si_min(orig_ring->N,rVar(currRing));i>0;i--) perm[i]=i;
2908  #endif
2909  ideal dest_id=idInit(IDELEMS(q),1);
2910  for(i=IDELEMS(q)-1; i>=0; i--)
2911  {
2912  dest_id->m[i]=p_PermPoly(q->m[i],perm,orig_ring, currRing,nMap,
2913  par_perm,par_perm_size);
2914  // PrintS("map:");pWrite(dest_id->m[i]);PrintLn();
2915  pTest(dest_id->m[i]);
2916  }
2917  R->qideal=dest_id;
2918  if (perm!=NULL)
2919  omFreeSize((ADDRESS)perm,(orig_ring->N+1)*sizeof(int));
2920  if (par_perm!=NULL)
2921  omFreeSize((ADDRESS)par_perm,par_perm_size*sizeof(int));
2922  rChangeCurrRing(orig_ring);
2923  #endif
2924  }
2925  else
2926  R->qideal=idrCopyR(q,currRing,R);
2927  }
2928  }
2929  else
2930  {
2931  WerrorS("q-ideal must be given as `ideal`");
2932  goto rCompose_err;
2933  }
2934 
2935 
2936  // ---------------------------------------------------------------
2937  #ifdef HAVE_PLURAL
2938  if (L->nr==5)
2939  {
2940  if (nc_CallPlural((matrix)L->m[4].Data(),
2941  (matrix)L->m[5].Data(),
2942  NULL,NULL,
2943  R,
2944  true, // !!!
2945  true, false,
2946  currRing, FALSE)) goto rCompose_err;
2947  // takes care about non-comm. quotient! i.e. calls "nc_SetupQuotient" due to last true
2948  }
2949  #endif
2950  return R;
2951 
2952 rCompose_err:
2953  if (R->N>0)
2954  {
2955  int i;
2956  if (R->names!=NULL)
2957  {
2958  i=R->N-1;
2959  while (i>=0) { if (R->names[i]!=NULL) omFree(R->names[i]); i--; }
2960  omFree(R->names);
2961  }
2962  }
2963  if (R->order!=NULL) omFree(R->order);
2964  if (R->block0!=NULL) omFree(R->block0);
2965  if (R->block1!=NULL) omFree(R->block1);
2966  if (R->wvhdl!=NULL) omFree(R->wvhdl);
2967  omFree(R);
2968  return NULL;
2969 }
sleftv * m
Definition: lists.h:45
Definition: tok.h:94
ring r
Definition: algext.h:40
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:518
static BOOLEAN rComposeVar(const lists L, ring R)
Definition: ipshell.cc:2413
Definition: lists.h:22
ring rCompose(const lists L, const BOOLEAN check_comp)
Definition: ipshell.cc:2708
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:124
#define FALSE
Definition: auxiliary.h:97
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define pTest(p)
Definition: polys.h:399
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:580
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:528
void * ADDRESS
Definition: auxiliary.h:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
void rComposeC(lists L, ring R)
Definition: ipshell.cc:2208
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:55
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:3939
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
Definition: ipshell.cc:2458
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:3435
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:403
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
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:61
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
int IsPrime(int p)
Definition: prime.cc:61
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well
Definition: ring.cc:1634
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:2372
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:2747
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:2279
#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:1121
#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:677
Definition: tok.h:116
int perm[100]
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329
#define Warn
Definition: emacs.cc:80

§ Tok2Cmdname()

const char* Tok2Cmdname ( int  tok)

Definition at line 8952 of file iparith.cc.

8953 {
8954  if (tok <= 0)
8955  {
8956  return sArithBase.sCmds[0].name;
8957  }
8958  if (tok==ANY_TYPE) return "any_type";
8959  if (tok==COMMAND) return "command";
8960  if (tok==NONE) return "nothing";
8961  //if (tok==IFBREAK) return "if_break";
8962  //if (tok==VECTOR_FROM_POLYS) return "vector_from_polys";
8963  //if (tok==ORDER_VECTOR) return "ordering";
8964  //if (tok==REF_VAR) return "ref";
8965  //if (tok==OBJECT) return "object";
8966  //if (tok==PRINT_EXPR) return "print_expr";
8967  if (tok==IDHDL) return "identifier";
8968  #ifdef SINGULAR_4_1
8969  //if (tok==CRING_CMD) return "Ring";
8970  #endif
8971  if (tok>MAX_TOK) return getBlackboxName(tok);
8972  int i;
8973  for(i=0; i<sArithBase.nCmdUsed; i++)
8974  //while (sArithBase.sCmds[i].tokval!=0)
8975  {
8976  if ((sArithBase.sCmds[i].tokval == tok)&&
8977  (sArithBase.sCmds[i].alias==0))
8978  {
8979  return sArithBase.sCmds[i].name;
8980  }
8981  }
8982  // try gain for alias/old names:
8983  for(i=0; i<sArithBase.nCmdUsed; i++)
8984  {
8985  if (sArithBase.sCmds[i].tokval == tok)
8986  {
8987  return sArithBase.sCmds[i].name;
8988  }
8989  }
8990  return sArithBase.sCmds[0].name;
8991 }
#define ANY_TYPE
Definition: tok.h:30
Definition: tok.h:213
#define IDHDL
Definition: tok.h:31
int nCmdUsed
number of commands used
Definition: iparith.cc:196
int i
Definition: cfEzgcd.cc:123
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:206
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:191
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
Definition: blackbox.cc:183
#define NONE
Definition: tok.h:216
#define COMMAND
Definition: tok.h:29

§ WerrorS_dummy()

static void WerrorS_dummy ( const char *  )
static

Definition at line 5392 of file iparith.cc.

5393 {
5395 }
static int WerrorS_dummy_cnt
Definition: iparith.cc:5391

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

§ sArithBase

SArithBase sArithBase
static

Base entry for arithmetic.

Definition at line 206 of file iparith.cc.

§ singclap_factorize_retry

int singclap_factorize_retry

Definition at line 3381 of file iparith.cc.

§ WerrorS_dummy_cnt

int WerrorS_dummy_cnt =0
static

Definition at line 5391 of file iparith.cc.