Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ring.h File Reference
#include "misc/auxiliary.h"
#include "coeffs/coeffs.h"
#include "misc/intvec.h"
#include "misc/int64vec.h"
#include "polys/monomials/monomials.h"

Go to the source code of this file.

Data Structures

struct  sro_dp
 
struct  sro_wp
 
struct  sro_am
 
struct  sro_wp64
 
struct  sro_cp
 
struct  sro_syzcomp
 
struct  sro_syz
 
struct  sro_ISTemp
 
struct  sro_IS
 
struct  sro_ord
 
struct  ring
 
union  sro_ord.data
 

Macros

#define rTest(r)   rDBTest(r, __FILE__, __LINE__)
 

Typedefs

typedef idrecidhdl
 
typedef struct p_Procs_s p_Procs_s
 
typedef kBucketkBucket_pt
 
typedef long(* pLDegProc) (poly p, int *length, ring r)
 
typedef long(* pFDegProc) (poly p, ring r)
 
typedef void(* p_SetmProc) (poly p, const ring r)
 
typedef poly(* pShallowCopyDeleteProc) (poly s_p, ring source_r, ring dest_r, omBin dest_bin)
 returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == dest_r->N and that orderings are the same More...
 
typedef skStrategykStrategy
 
typedef poly(* NF_Proc) (ideal, ideal, poly, int, int, const ring _currRing)
 
typedef ideal(* BBA_Proc) (const ideal, const ideal, const intvec *, const intvec *, kStrategy strat, const ring)
 

Enumerations

enum  ro_typ {
  ro_dp, ro_wp, ro_am, ro_wp64,
  ro_wp_neg, ro_cp, ro_syzcomp, ro_syz,
  ro_isTemp, ro_is, ro_none
}
 
enum  rRingOrder_t {
  ringorder_no = 0, ringorder_a, ringorder_a64, ringorder_c,
  ringorder_C, ringorder_M, ringorder_S, ringorder_s,
  ringorder_lp, ringorder_dp, ringorder_rp, ringorder_Dp,
  ringorder_wp, ringorder_Wp, ringorder_ls, ringorder_ds,
  ringorder_Ds, ringorder_ws, ringorder_Ws, ringorder_am,
  ringorder_L, ringorder_aa, ringorder_rs, ringorder_IS,
  ringorder_unspec
}
 order stuff More...
 
enum  rOrderType_t {
  rOrderType_General = 0, rOrderType_CompExp, rOrderType_ExpComp, rOrderType_Exp,
  rOrderType_Syz, rOrderType_Schreyer, rOrderType_Syz2dpc, rOrderType_ExpNoComp
}
 

Functions

ring rDefault (int ch, int N, char **n)
 
ring rDefault (const coeffs cf, int N, char **n, const rRingOrder_t o=ringorder_lp)
 
ring rDefault (int ch, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl=NULL)
 
ring rDefault (const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl=NULL, unsigned long bitmask=0)
 
unsigned long rGetExpSize (unsigned long bitmask, int &bits, int N)
 
int r_IsRingVar (const char *n, char **names, int N)
 
void rWrite (ring r, BOOLEAN details=FALSE)
 
ring rCopy (ring r)
 
ring rCopy0 (const ring r, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
 
ring rCopy0AndAddA (ring r, int64vec *wv64, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
 
ring rOpposite (ring r)
 
ring rEnvelope (ring r)
 
static BOOLEAN rIsPluralRing (const ring r)
 we must always have this test! More...
 
static BOOLEAN rIsLPRing (const ring r)
 
static BOOLEAN rIsNCRing (const ring r)
 
static BOOLEAN rIsRatGRing (const ring r)
 
void rChangeSComps (int *currComponents, long *currShiftedComponents, int length, ring r)
 
void rGetSComps (int **currComponents, long **currShiftedComponents, int *length, ring r)
 
const char * rSimpleOrdStr (int ord)
 
rRingOrder_t rOrderName (char *ordername)
 
char * rOrdStr (ring r)
 
char * rVarStr (ring r)
 
char * rCharStr (ring r)
 TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar. More...
 
char * rString (ring r)
 
int rChar (ring r)
 
char * rParStr (ring r)
 
int rSum (ring r1, ring r2, ring &sum)
 
int rSumInternal (ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp)
 returns -1 for not compatible, 1 for compatible (and sum) dp_dp:0: block ordering, 1: dp,dp, 2: aa(...),dp vartest: check for name conflicts More...
 
BOOLEAN rEqual (ring r1, ring r2, BOOLEAN qr=TRUE)
 returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well More...
 
BOOLEAN rSamePolyRep (ring r1, ring r2)
 returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analogue to rEqual but not so strict More...
 
void rUnComplete (ring r)
 
BOOLEAN rRing_is_Homog (ring r)
 
BOOLEAN rRing_has_CompLastBlock (ring r)
 
static BOOLEAN rField_is_Ring_2toM (const ring r)
 
static BOOLEAN rField_is_Ring_PtoM (const ring r)
 
static BOOLEAN rField_is_Ring (const ring r)
 
static BOOLEAN rField_is_Domain (const ring r)
 
static BOOLEAN rField_has_Units (const ring r)
 
static BOOLEAN rField_is_Zp (const ring r)
 
static BOOLEAN rField_is_Zp (const ring r, int p)
 
static BOOLEAN rField_is_Q (const ring r)
 
static BOOLEAN rField_is_Z (const ring r)
 
static BOOLEAN rField_is_Zn (const ring r)
 
static BOOLEAN rField_is_numeric (const ring r)
 
static BOOLEAN rField_is_R (const ring r)
 
static BOOLEAN rField_is_GF (const ring r)
 
static BOOLEAN rField_is_GF (const ring r, int q)
 
static BOOLEAN rField_is_Zp_a (const ring r)
 
static BOOLEAN rField_is_Zp_a (const ring r, int p)
 
static BOOLEAN rField_is_Q_a (const ring r)
 
static BOOLEAN rField_is_long_R (const ring r)
 
static BOOLEAN rField_is_long_C (const ring r)
 
static BOOLEAN rField_has_simple_inverse (const ring r)
 
static BOOLEAN rField_has_simple_Alloc (const ring r)
 Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies. More...
 
n_coeffType rFieldType (const ring r)
 
BOOLEAN rComplete (ring r, int force=0)
 this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffset), unless they already exist with force == 1, new fields are always created (overwritten), even if they exist More...
 
void p_SetGlobals (const ring r, BOOLEAN complete=TRUE)
 set all properties of a new ring - also called by rComplete More...
 
static int rBlocks (ring r)
 
static char * rRingVar (short i, const ring r)
 
static BOOLEAN rShortOut (const ring r)
 
static BOOLEAN rCanShortOut (const ring r)
 
static short rVar (const ring r)
 #define rVar(r) (r->N) More...
 
static int rPar (const ring r)
 (r->cf->P) More...
 
static char const ** rParameter (const ring r)
 (r->cf->parameter) More...
 
static number n_Param (const short iParameter, const ring r)
 return the specified parameter as a (new!) number in the given polynomial ring, or NULL if invalid parameters (as variables) begin with 1! More...
 
int n_IsParam (number m, const ring r)
 if m == var(i)/1 => return i, More...
 
static int rInternalChar (const ring r)
 
static BOOLEAN rMinpolyIsNULL (const ring r)
 Tests whether '(r->cf->minpoly) == NULL'. More...
 
static BOOLEAN rIsSyzIndexRing (const ring r)
 
static int rGetCurrSyzLimit (const ring r)
 
void rSetSyzComp (int k, const ring r)
 
ring rAssure_HasComp (const ring r)
 
ring rAssure_SyzOrder (const ring r, BOOLEAN complete)
 
ring rAssure_SyzComp (const ring r, BOOLEAN complete=TRUE)
 
ring rAssure_InducedSchreyerOrdering (const ring r, BOOLEAN complete=TRUE, int sgn=1)
 
ring rAssure_dp_S (const ring r)
 
ring rAssure_dp_C (const ring r)
 
ring rAssure_C_dp (const ring r)
 
ring rAssure_c_dp (const ring r)
 
ring rAssure_CompLastBlock (const ring r, BOOLEAN complete=TRUE)
 makes sure that c/C ordering is last ordering More...
 
ring rAssure_SyzComp_CompLastBlock (const ring r)
 makes sure that c/C ordering is last ordering and SyzIndex is first More...
 
ring rAssure_TDeg (const ring r, int &pos)
 
BOOLEAN rHasTDeg (const ring r)
 
int rGetMaxSyzComp (int i, const ring r)
 return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit More...
 
BOOLEAN rHasSimpleOrder (const ring r)
 
BOOLEAN rHas_c_Ordering (const ring r)
 
BOOLEAN rHasSimpleLexOrder (const ring r)
 returns TRUE, if simple lp or ls ordering More...
 
BOOLEAN rHasGlobalOrdering (const ring r)
 
BOOLEAN rHasLocalOrMixedOrdering (const ring r)
 
BOOLEAN rHasMixedOrdering (const ring r)
 
BOOLEAN rOrd_is_Totaldegree_Ordering (const ring r)
 
BOOLEAN rOrd_SetCompRequiresSetm (const ring r)
 return TRUE if p_SetComp requires p_Setm More...
 
rOrderType_t rGetOrderType (ring r)
 
BOOLEAN rIsPolyVar (int i, const ring r)
 returns TRUE if var(i) belongs to p-block More...
 
static BOOLEAN rOrd_is_Comp_dp (const ring r)
 
BOOLEAN rDBTest (ring r, const char *fn, const int l)
 
ring rModifyRing (ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit)
 
ring rModifyRing_Wp (ring r, int *weights)
 construct Wp, C ring More...
 
void rModify_a_to_A (ring r)
 
void rKillModifiedRing (ring r)
 
void rKillModified_Wp_Ring (ring r)
 
ring rModifyRing_Simple (ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit, BOOLEAN &simple)
 
void rDebugPrint (const ring r)
 
void p_DebugPrint (poly p, const ring r)
 
int64rGetWeightVec (const ring r)
 
void rSetWeightVec (ring r, int64 *wv)
 
poly rGetVar (const int varIndex, const ring r)
 
BOOLEAN rSetISReference (const ring r, const ideal F, const int i=0, const int p=0)
 Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r, we will DO a copy! We will use it AS IS! returns true is everything was allright! More...
 
int rGetISPos (const int p, const ring r)
 return the position of the p^th IS block order block in r->typ[]... More...
 
void pISUpdateComponents (ideal F, const intvec *const V, const int MIN, const ring r)
 
BOOLEAN rCheckIV (const intvec *iv)
 
int rTypeOfMatrixOrder (const intvec *order)
 
void rDelete (ring r)
 unconditionally deletes fields in r More...
 
ring rPlusVar (const ring r, char *v, int left)
 K[x],"y" -> K[x,y] resp. K[y,x]. More...
 
ring rMinusVar (const ring r, char *v)
 undo rPlusVar More...
 

Variables

omBin sip_sring_bin
 

Data Structure Documentation

◆ sro_dp

struct sro_dp

Definition at line 113 of file ring.h.

Data Fields
short end
short place
short start

◆ sro_wp

struct sro_wp

Definition at line 122 of file ring.h.

Data Fields
short end
short place
short start
int * weights

◆ sro_am

struct sro_am

Definition at line 132 of file ring.h.

Data Fields
short end
short len_gen
short place
short start
int * weights
int * weights_m

◆ sro_wp64

struct sro_wp64

Definition at line 147 of file ring.h.

Data Fields
short end
short place
short start
int64 * weights64

◆ sro_cp

struct sro_cp

Definition at line 157 of file ring.h.

Data Fields
short end
short place
short start

◆ sro_syzcomp

struct sro_syzcomp

Definition at line 166 of file ring.h.

Data Fields
int * Components
long length
short place
long * ShiftedComponents

◆ sro_syz

struct sro_syz

Definition at line 178 of file ring.h.

Data Fields
int curr_index
int limit
short place
int * syz_index

◆ sro_ISTemp

struct sro_ISTemp

Definition at line 194 of file ring.h.

Data Fields
int * pVarOffset
short start
int suffixpos

◆ sro_IS

struct sro_IS

Definition at line 204 of file ring.h.

Data Fields
short end
ideal F
int limit
int * pVarOffset
short start

◆ sro_ord

struct sro_ord

Definition at line 218 of file ring.h.

Data Fields
union sro_ord data
ro_typ ord_typ
int order_index

◆ sro_ord.data

union sro_ord.data

Definition at line 222 of file ring.h.

Data Fields
sro_am am
sro_cp cp
sro_dp dp
sro_IS is
sro_ISTemp isTemp
sro_syz syz
sro_syzcomp syzcomp
sro_wp wp
sro_wp64 wp64

Macro Definition Documentation

◆ rTest

#define rTest (   r)    rDBTest(r, __FILE__, __LINE__)

Definition at line 780 of file ring.h.

Typedef Documentation

◆ BBA_Proc

typedef ideal(* BBA_Proc) (const ideal, const ideal, const intvec *, const intvec *, kStrategy strat, const ring)

Definition at line 244 of file ring.h.

◆ idhdl

typedef idrec* idhdl

Definition at line 21 of file ring.h.

◆ kBucket_pt

typedef kBucket* kBucket_pt

Definition at line 24 of file ring.h.

◆ kStrategy

Definition at line 240 of file ring.h.

◆ NF_Proc

typedef poly(* NF_Proc) (ideal, ideal, poly, int, int, const ring _currRing)

Definition at line 243 of file ring.h.

◆ p_Procs_s

typedef struct p_Procs_s p_Procs_s

Definition at line 23 of file ring.h.

◆ p_SetmProc

typedef void(* p_SetmProc) (poly p, const ring r)

Definition at line 39 of file ring.h.

◆ pFDegProc

typedef long(* pFDegProc) (poly p, ring r)

Definition at line 38 of file ring.h.

◆ pLDegProc

typedef long(* pLDegProc) (poly p, int *length, ring r)

Definition at line 37 of file ring.h.

◆ pShallowCopyDeleteProc

typedef poly(* pShallowCopyDeleteProc) (poly s_p, ring source_r, ring dest_r, omBin dest_bin)

returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == dest_r->N and that orderings are the same

Definition at line 44 of file ring.h.

Enumeration Type Documentation

◆ ro_typ

enum ro_typ
Enumerator
ro_dp 
ro_wp 
ro_am 
ro_wp64 
ro_wp_neg 
ro_cp 
ro_syzcomp 
ro_syz 
ro_isTemp 
ro_is 
ro_none 

Definition at line 50 of file ring.h.

51 {
52  ro_dp, // total degree with weights 1
53  ro_wp, // total weighted degree with weights>0 in wvhdl
54  ro_am, // weights for vars + weights for gen
55  ro_wp64, // weighted64 degree weights in wvhdl
56  ro_wp_neg, // total weighted degree with weights in Z in wvhdl
57  // (with possibly negative weights)
58  ro_cp, // ??ordering duplicates variables
59  ro_syzcomp, // ??ordering indicates "subset" of component number (ringorder_S)
60  ro_syz, // component number if <=syzcomp else 0 (ringorder_s)
61  ro_isTemp, ro_is, // ??Induced Syzygy (Schreyer) ordering (and prefix data placeholder dummy) (ringorder_IS)
62  ro_none
63 }
Definition: ring.h:60
Definition: ring.h:53
Definition: ring.h:62
Definition: ring.h:58
Definition: ring.h:56
Definition: ring.h:61
Definition: ring.h:61
Definition: ring.h:55
Definition: ring.h:52
Definition: ring.h:54

◆ rOrderType_t

Enumerator
rOrderType_General 

non-simple ordering as specified by currRing

rOrderType_CompExp 

simple ordering, component has priority

rOrderType_ExpComp 

simple ordering, exponent vector has priority component not compatible with exp-vector order

rOrderType_Exp 

simple ordering, exponent vector has priority component is compatible with exp-vector order

rOrderType_Syz 

syzygy ordering

rOrderType_Schreyer 

Schreyer ordering.

rOrderType_Syz2dpc 

syzcomp2dpc

rOrderType_ExpNoComp 

simple ordering, differences in component are not considered

Definition at line 97 of file ring.h.

98 {
99  rOrderType_General = 0, ///< non-simple ordering as specified by currRing
100  rOrderType_CompExp, ///< simple ordering, component has priority
101  rOrderType_ExpComp, ///< simple ordering, exponent vector has priority
102  ///< component not compatible with exp-vector order
103  rOrderType_Exp, ///< simple ordering, exponent vector has priority
104  ///< component is compatible with exp-vector order
105  rOrderType_Syz, ///< syzygy ordering
106  rOrderType_Schreyer, ///< Schreyer ordering
107  rOrderType_Syz2dpc, ///< syzcomp2dpc
108  rOrderType_ExpNoComp ///< simple ordering, differences in component are
109  ///< not considered
110 } rOrderType_t;
non-simple ordering as specified by currRing
Definition: ring.h:99
simple ordering, exponent vector has priority component is compatible with exp-vector order ...
Definition: ring.h:103
simple ordering, component has priority
Definition: ring.h:100
Schreyer ordering.
Definition: ring.h:106
simple ordering, exponent vector has priority component not compatible with exp-vector order ...
Definition: ring.h:101
syzygy ordering
Definition: ring.h:105
syzcomp2dpc
Definition: ring.h:107
rOrderType_t
Definition: ring.h:97
simple ordering, differences in component are not considered
Definition: ring.h:108

◆ rRingOrder_t

order stuff

Enumerator
ringorder_no 
ringorder_a 
ringorder_a64 

for int64 weights

ringorder_c 
ringorder_C 
ringorder_M 
ringorder_S 

S?

ringorder_s 

s?

ringorder_lp 
ringorder_dp 
ringorder_rp 
ringorder_Dp 
ringorder_wp 
ringorder_Wp 
ringorder_ls 
ringorder_ds 
ringorder_Ds 
ringorder_ws 
ringorder_Ws 
ringorder_am 
ringorder_L 
ringorder_aa 

for idElimination, like a, except pFDeg, pWeigths ignore it

ringorder_rs 

opposite of ls

ringorder_IS 

Induced (Schreyer) ordering.

ringorder_unspec 

Definition at line 67 of file ring.h.

68 {
69  ringorder_no = 0,
71  ringorder_a64, ///< for int64 weights
75  ringorder_S, ///< S?
76  ringorder_s, ///< s?
90  // the following are only used internally
91  ringorder_aa, ///< for idElimination, like a, except pFDeg, pWeigths ignore it
92  ringorder_rs, ///< opposite of ls
93  ringorder_IS, ///< Induced (Schreyer) ordering
95 } rRingOrder_t;
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:91
for int64 weights
Definition: ring.h:71
opposite of ls
Definition: ring.h:92
rRingOrder_t
order stuff
Definition: ring.h:67
Induced (Schreyer) ordering.
Definition: ring.h:93
S?
Definition: ring.h:75
s?
Definition: ring.h:76

Function Documentation

◆ n_IsParam()

int n_IsParam ( const number  m,
const ring  r 
)

if m == var(i)/1 => return i,

if m == var(i)/1 => return i,

Definition at line 5674 of file ring.cc.

5675 {
5676  assume(r != NULL);
5677  const coeffs C = r->cf;
5678  assume(C != NULL);
5679 
5681 
5682  const n_coeffType _filed_type = getCoeffType(C);
5683 
5684  if(( _filed_type == n_algExt )||( _filed_type == n_polyExt ))
5685  return naIsParam(m, C);
5686 
5687  if( _filed_type == n_transExt )
5688  return ntIsParam(m, C);
5689 
5690  Werror("n_IsParam: IsParam is not to be used for (coeff_type = %d)",getCoeffType(C));
5691 
5692  return 0;
5693 }
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
int naIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
Definition: algext.cc:1093
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
int m
Definition: cfEzgcd.cc:121
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
n_coeffType
Definition: coeffs.h:27
#define NULL
Definition: omList.c:12
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:868
int ntIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
Definition: transext.cc:2209
void Werror(const char *fmt,...)
Definition: reporter.cc:189
used to represent polys as coeffcients
Definition: coeffs.h:35

◆ n_Param()

static number n_Param ( const short  iParameter,
const ring  r 
)
inlinestatic

return the specified parameter as a (new!) number in the given polynomial ring, or NULL if invalid parameters (as variables) begin with 1!

Definition at line 646 of file ring.h.

647 {
648  assume(r != NULL);
649  const coeffs C = r->cf;
650  assume(C != NULL);
651  return n_Param(iParameter, C);
652 // const n_coeffType _filed_type = getCoeffType(C);
653 //
654 // if ( iParameter <= 0 || iParameter > rPar(r) )
655 // // Wrong parameter
656 // return NULL;
657 //
658 // if( _filed_type == n_algExt )
659 // return naParameter(iParameter, C);
660 //
661 // if( _filed_type == n_transExt )
662 // return ntParameter(iParameter, C);
663 //
664 // if (_filed_type == n_GF)// if (nCoeff_is_GF(C))
665 // {
666 // number nfPar (int i, const coeffs);
667 // return nfPar(iParameter, C);
668 // }
669 //
670 // if (_filed_type == n_long_C) // if (nCoeff_is_long_C(C))
671 // {
672 // number ngcPar(int i, const coeffs r);
673 // return ngcPar(iParameter, C);
674 // }
675 //
676 // return NULL;
677 }
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12
static number n_Param(const short iParameter, const ring r)
return the specified parameter as a (new!) number in the given polynomial ring, or NULL if invalid pa...
Definition: ring.h:646

◆ p_DebugPrint()

void p_DebugPrint ( poly  p,
const ring  r 
)

Definition at line 4246 of file ring.cc.

4247 {
4248  int i,j;
4249  p_Write(p,r);
4250  j=2;
4251  while(p!=NULL)
4252  {
4253  Print("\nexp[0..%d]\n",r->ExpL_Size-1);
4254  for(i=0;i<r->ExpL_Size;i++)
4255  Print("%ld ",p->exp[i]);
4256  PrintLn();
4257  Print("v0:%ld ",p_GetComp(p, r));
4258  for(i=1;i<=r->N;i++) Print(" v%d:%ld",i,p_GetExp(p,i, r));
4259  PrintLn();
4260  pIter(p);
4261  j--;
4262  if (j==0) { PrintS("...\n"); break; }
4263  }
4264 }
int j
Definition: facHensel.cc:105
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
#define p_GetComp(p, r)
Definition: monomials.h:64
#define pIter(p)
Definition: monomials.h:37
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:468
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
#define NULL
Definition: omList.c:12
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:249
int p
Definition: cfModGcd.cc:4019

◆ p_SetGlobals()

void p_SetGlobals ( const ring  r,
BOOLEAN  complete = TRUE 
)

set all properties of a new ring - also called by rComplete

Definition at line 3359 of file ring.cc.

3360 {
3361 // // // if (r->ppNoether!=NULL) p_Delete(&r->ppNoether,r); // ???
3362 
3363  r->pLexOrder=r->LexOrder;
3364  if (complete)
3365  {
3367  si_opt_1 |= r->options;
3368  }
3369 }
unsigned si_opt_1
Definition: options.c:5
#define TEST_RINGDEP_OPTS
Definition: options.h:99

◆ pISUpdateComponents()

void pISUpdateComponents ( ideal  F,
const intvec *const  V,
const int  MIN,
const ring  r 
)

Definition at line 4283 of file ring.cc.

4284 {
4285  assume( V != NULL );
4286  assume( MIN >= 0 );
4287 
4288  if( F == NULL )
4289  return;
4290 
4291  for( int j = (F->ncols*F->nrows) - 1; j >= 0; j-- )
4292  {
4293 #ifdef PDEBUG
4294  Print("F[%d]:", j);
4295  p_wrp(F->m[j], r);
4296 #endif
4297 
4298  for( poly p = F->m[j]; p != NULL; pIter(p) )
4299  {
4300  int c = p_GetComp(p, r);
4301 
4302  if( c > MIN )
4303  {
4304 #ifdef PDEBUG
4305  Print("gen[%d] -> gen(%d)\n", c, MIN + (*V)[ c - MIN - 1 ]);
4306 #endif
4307 
4308  p_SetComp( p, MIN + (*V)[ c - MIN - 1 ], r );
4309  }
4310  }
4311 #ifdef PDEBUG
4312  Print("new F[%d]:", j);
4313  p_Test(F->m[j], r);
4314  p_wrp(F->m[j], r);
4315 #endif
4316  }
4317 }
int j
Definition: facHensel.cc:105
#define Print
Definition: emacs.cc:80
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:246
#define p_GetComp(p, r)
Definition: monomials.h:64
#define MIN(a, b)
Definition: omDebug.c:102
#define pIter(p)
Definition: monomials.h:37
#define assume(x)
Definition: mod2.h:390
#define p_Test(p, r)
Definition: p_polys.h:162
#define NULL
Definition: omList.c:12
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:280
int p
Definition: cfModGcd.cc:4019

◆ r_IsRingVar()

int r_IsRingVar ( const char *  n,
char **  names,
int  N 
)

Definition at line 212 of file ring.cc.

213 {
214  if (names!=NULL)
215  {
216  for (int i=0; i<N; i++)
217  {
218  if (names[i]==NULL) return -1;
219  if (strcmp(n,names[i]) == 0) return (int)i;
220  }
221  }
222  return -1;
223 }
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12

◆ rAssure_C_dp()

ring rAssure_C_dp ( const ring  r)

Definition at line 4915 of file ring.cc.

4916 {
4918 }
static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r)
Definition: ring.cc:4748

◆ rAssure_c_dp()

ring rAssure_c_dp ( const ring  r)

Definition at line 4920 of file ring.cc.

4921 {
4923 }
static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r)
Definition: ring.cc:4748

◆ rAssure_CompLastBlock()

ring rAssure_CompLastBlock ( const ring  r,
BOOLEAN  complete = TRUE 
)

makes sure that c/C ordering is last ordering

Definition at line 4638 of file ring.cc.

4639 {
4640  int last_block = rBlocks(r) - 2;
4641  if (r->order[last_block] != ringorder_c &&
4642  r->order[last_block] != ringorder_C)
4643  {
4644  int c_pos = 0;
4645  int i;
4646 
4647  for (i=0; i< last_block; i++)
4648  {
4649  if (r->order[i] == ringorder_c || r->order[i] == ringorder_C)
4650  {
4651  c_pos = i;
4652  break;
4653  }
4654  }
4655  if (c_pos != -1)
4656  {
4657  ring new_r = rCopy0(r, FALSE, TRUE);
4658  for (i=c_pos+1; i<=last_block; i++)
4659  {
4660  new_r->order[i-1] = new_r->order[i];
4661  new_r->block0[i-1] = new_r->block0[i];
4662  new_r->block1[i-1] = new_r->block1[i];
4663  new_r->wvhdl[i-1] = new_r->wvhdl[i];
4664  }
4665  new_r->order[last_block] = r->order[c_pos];
4666  new_r->block0[last_block] = r->block0[c_pos];
4667  new_r->block1[last_block] = r->block1[c_pos];
4668  new_r->wvhdl[last_block] = r->wvhdl[c_pos];
4669  if (complete)
4670  {
4671  rComplete(new_r, 1);
4672 
4673 #ifdef HAVE_PLURAL
4674  if (rIsPluralRing(r))
4675  {
4676  if ( nc_rComplete(r, new_r, false) ) // no qideal!
4677  {
4678 #ifndef SING_NDEBUG
4679  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4680 #endif
4681  }
4682  }
4683  assume(rIsPluralRing(r) == rIsPluralRing(new_r));
4684 #endif
4685  }
4686  return new_r;
4687  }
4688  }
4689  return r;
4690 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:78
static int rBlocks(ring r)
Definition: ring.h:562
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
int i
Definition: cfEzgcd.cc:125

◆ rAssure_dp_C()

ring rAssure_dp_C ( const ring  r)

Definition at line 4910 of file ring.cc.

4911 {
4913 }
static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r)
Definition: ring.cc:4748

◆ rAssure_dp_S()

ring rAssure_dp_S ( const ring  r)

Definition at line 4905 of file ring.cc.

4906 {
4908 }
static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r)
Definition: ring.cc:4748
S?
Definition: ring.h:75

◆ rAssure_HasComp()

ring rAssure_HasComp ( const ring  r)

Definition at line 4583 of file ring.cc.

4584 {
4585  int last_block;
4586  int i=0;
4587  do
4588  {
4589  if (r->order[i] == ringorder_c ||
4590  r->order[i] == ringorder_C) return r;
4591  if (r->order[i] == 0)
4592  break;
4593  i++;
4594  } while (1);
4595  //WarnS("re-creating ring with comps");
4596  last_block=i-1;
4597 
4598  ring new_r = rCopy0(r, FALSE, FALSE);
4599  i+=2;
4600  new_r->wvhdl=(int **)omAlloc0(i * sizeof(int *));
4601  new_r->order = (rRingOrder_t *) omAlloc0(i * sizeof(rRingOrder_t));
4602  new_r->block0 = (int *) omAlloc0(i * sizeof(int));
4603  new_r->block1 = (int *) omAlloc0(i * sizeof(int));
4604  memcpy(new_r->order,r->order,(i-1) * sizeof(rRingOrder_t));
4605  memcpy(new_r->block0,r->block0,(i-1) * sizeof(int));
4606  memcpy(new_r->block1,r->block1,(i-1) * sizeof(int));
4607  for (int j=0; j<=last_block; j++)
4608  {
4609  if (r->wvhdl[j]!=NULL)
4610  {
4611  new_r->wvhdl[j] = (int*) omMemDup(r->wvhdl[j]);
4612  }
4613  }
4614  last_block++;
4615  new_r->order[last_block]=ringorder_C;
4616  //new_r->block0[last_block]=0;
4617  //new_r->block1[last_block]=0;
4618  //new_r->wvhdl[last_block]=NULL;
4619 
4620  rComplete(new_r, 1);
4621 
4622 #ifdef HAVE_PLURAL
4623  if (rIsPluralRing(r))
4624  {
4625  if ( nc_rComplete(r, new_r, false) ) // no qideal!
4626  {
4627 #ifndef SING_NDEBUG
4628  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4629 #endif
4630  }
4631  }
4632  assume(rIsPluralRing(r) == rIsPluralRing(new_r));
4633 #endif
4634 
4635  return new_r;
4636 }
int j
Definition: facHensel.cc:105
#define omMemDup(s)
Definition: omAllocDecl.h:264
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
#define WarnS
Definition: emacs.cc:78
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
rRingOrder_t
order stuff
Definition: ring.h:67
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rAssure_InducedSchreyerOrdering()

ring rAssure_InducedSchreyerOrdering ( const ring  r,
BOOLEAN  complete = TRUE,
int  sgn = 1 
)

Definition at line 4794 of file ring.cc.

4795 { // TODO: ???? Add leading Syz-comp ordering here...????
4796 
4797 #if MYTEST
4798  Print("rAssure_InducedSchreyerOrdering(r, complete = %d, sgn = %d): r: \n", complete, sgn);
4799  rWrite(r);
4800 #ifdef RDEBUG
4801  rDebugPrint(r);
4802 #endif
4803  PrintLn();
4804 #endif
4805  assume((sgn == 1) || (sgn == -1));
4806 
4807  ring res=rCopy0(r, FALSE, FALSE); // No qideal & ordering copy.
4808 
4809  int n = rBlocks(r); // Including trailing zero!
4810 
4811  // Create 2 more blocks for prefix/suffix:
4812  res->order=(rRingOrder_t *)omAlloc0((n+2)*sizeof(rRingOrder_t)); // 0 .. n+1
4813  res->block0=(int *)omAlloc0((n+2)*sizeof(int));
4814  res->block1=(int *)omAlloc0((n+2)*sizeof(int));
4815  int ** wvhdl =(int **)omAlloc0((n+2)*sizeof(int**));
4816 
4817  // Encapsulate all existing blocks between induced Schreyer ordering markers: prefix and suffix!
4818  // Note that prefix and suffix have the same ringorder marker and only differ in block[] parameters!
4819 
4820  // new 1st block
4821  int j = 0;
4822  res->order[j] = ringorder_IS; // Prefix
4823  res->block0[j] = res->block1[j] = 0;
4824  // wvhdl[j] = NULL;
4825  j++;
4826 
4827  for(int i = 0; (i <= n) && (r->order[i] != 0); i++, j++) // i = [0 .. n-1] <- non-zero old blocks
4828  {
4829  res->order [j] = r->order [i];
4830  res->block0[j] = r->block0[i];
4831  res->block1[j] = r->block1[i];
4832 
4833  if (r->wvhdl[i] != NULL)
4834  {
4835  wvhdl[j] = (int*) omMemDup(r->wvhdl[i]);
4836  } // else wvhdl[j] = NULL;
4837  }
4838 
4839  // new last block
4840  res->order [j] = ringorder_IS; // Suffix
4841  res->block0[j] = res->block1[j] = sgn; // Sign of v[o]: 1 for C, -1 for c
4842  // wvhdl[j] = NULL;
4843  j++;
4844 
4845  // res->order [j] = 0; // The End!
4846  res->wvhdl = wvhdl;
4847 
4848  // j == the last zero block now!
4849  assume(j == (n+1));
4850  assume(res->order[0]==ringorder_IS);
4851  assume(res->order[j-1]==ringorder_IS);
4852  assume(res->order[j]==0);
4853 
4854 
4855  if (complete)
4856  {
4857  rComplete(res, 1);
4858 
4859 #ifdef HAVE_PLURAL
4860  if (rIsPluralRing(r))
4861  {
4862  if ( nc_rComplete(r, res, false) ) // no qideal!
4863  {
4864 #ifndef SING_NDEBUG
4865  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4866 #endif
4867  }
4868  }
4869  assume(rIsPluralRing(r) == rIsPluralRing(res));
4870 #endif
4871 
4872 
4873 #ifdef HAVE_PLURAL
4874  ring old_ring = r;
4875 #endif
4876 
4877  if (r->qideal!=NULL)
4878  {
4879  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
4880 
4881  assume(id_RankFreeModule(res->qideal, res) == 0);
4882 
4883 #ifdef HAVE_PLURAL
4884  if( rIsPluralRing(res) )
4885  if( nc_SetupQuotient(res, r, true) )
4886  {
4887 // WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?
4888  }
4889 
4890 #endif
4891  assume(id_RankFreeModule(res->qideal, res) == 0);
4892  }
4893 
4894 #ifdef HAVE_PLURAL
4895  assume((res->qideal==NULL) == (old_ring->qideal==NULL));
4896  assume(rIsPluralRing(res) == rIsPluralRing(old_ring));
4897  assume(rIsSCA(res) == rIsSCA(old_ring));
4898  assume(ncRingType(res) == ncRingType(old_ring));
4899 #endif
4900  }
4901 
4902  return res;
4903 }
int j
Definition: facHensel.cc:105
#define omMemDup(s)
Definition: omAllocDecl.h:264
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
int sgn(const Rational &a)
Definition: GMPrat.cc:430
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
#define WarnS
Definition: emacs.cc:78
static int rBlocks(ring r)
Definition: ring.h:562
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
rRingOrder_t
order stuff
Definition: ring.h:67
void rDebugPrint(const ring r)
Definition: ring.cc:4041
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:226
#define NULL
Definition: omList.c:12
static bool rIsSCA(const ring r)
Definition: nc.h:190
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rAssure_SyzComp()

ring rAssure_SyzComp ( const ring  r,
BOOLEAN  complete = TRUE 
)

Definition at line 4392 of file ring.cc.

4393 {
4394  if ( r->order[0] == ringorder_s ) return r;
4395 
4396  if ( r->order[0] == ringorder_IS )
4397  {
4398 #ifndef SING_NDEBUG
4399  WarnS("rAssure_SyzComp: input ring has an IS-ordering!");
4400 #endif
4401 // return r;
4402  }
4403  ring res=rCopy0(r, FALSE, FALSE);
4404  int i=rBlocks(r);
4405  int j;
4406 
4407  res->order=(rRingOrder_t *)omAlloc((i+1)*sizeof(rRingOrder_t));
4408  res->block0=(int *)omAlloc0((i+1)*sizeof(int));
4409  res->block1=(int *)omAlloc0((i+1)*sizeof(int));
4410  int ** wvhdl =(int **)omAlloc0((i+1)*sizeof(int**));
4411  for(j=i;j>0;j--)
4412  {
4413  res->order[j]=r->order[j-1];
4414  res->block0[j]=r->block0[j-1];
4415  res->block1[j]=r->block1[j-1];
4416  if (r->wvhdl[j-1] != NULL)
4417  {
4418  wvhdl[j] = (int*) omMemDup(r->wvhdl[j-1]);
4419  }
4420  }
4421  res->order[0]=ringorder_s;
4422 
4423  res->wvhdl = wvhdl;
4424 
4425  if (complete)
4426  {
4427  rComplete(res, 1);
4428 #ifdef HAVE_PLURAL
4429  if (rIsPluralRing(r))
4430  {
4431  if ( nc_rComplete(r, res, false) ) // no qideal!
4432  {
4433 #ifndef SING_NDEBUG
4434  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4435 #endif
4436  }
4437  }
4438  assume(rIsPluralRing(r) == rIsPluralRing(res));
4439 #endif
4440 
4441 #ifdef HAVE_PLURAL
4442  ring old_ring = r;
4443 #endif
4444  if (r->qideal!=NULL)
4445  {
4446  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
4447  assume(id_RankFreeModule(res->qideal, res) == 0);
4448 #ifdef HAVE_PLURAL
4449  if( rIsPluralRing(res) )
4450  {
4451  if( nc_SetupQuotient(res, r, true) )
4452  {
4453 // WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?
4454  }
4455  assume(id_RankFreeModule(res->qideal, res) == 0);
4456  }
4457 #endif
4458  }
4459 
4460 #ifdef HAVE_PLURAL
4461  assume((res->qideal==NULL) == (old_ring->qideal==NULL));
4462  assume(rIsPluralRing(res) == rIsPluralRing(old_ring));
4463  assume(rIsSCA(res) == rIsSCA(old_ring));
4464  assume(ncRingType(res) == ncRingType(old_ring));
4465 #endif
4466  }
4467  return res;
4468 }
int j
Definition: facHensel.cc:105
#define omMemDup(s)
Definition: omAllocDecl.h:264
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int rBlocks(ring r)
Definition: ring.h:562
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
rRingOrder_t
order stuff
Definition: ring.h:67
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
#define NULL
Definition: omList.c:12
static bool rIsSCA(const ring r)
Definition: nc.h:190
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
s?
Definition: ring.h:76
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rAssure_SyzComp_CompLastBlock()

ring rAssure_SyzComp_CompLastBlock ( const ring  r)

makes sure that c/C ordering is last ordering and SyzIndex is first

? rChangeCurrRing(new_r);

Definition at line 4693 of file ring.cc.

4694 {
4695  rTest(r);
4696 
4697  ring new_r_1 = rAssure_CompLastBlock(r, FALSE); // due to this FALSE - no completion!
4698  ring new_r = rAssure_SyzComp(new_r_1, FALSE); // new_r_1 is used only here!!!
4699 
4700  if (new_r == r)
4701  return r;
4702 
4703  ring old_r = r;
4704  if (new_r_1 != new_r && new_r_1 != old_r) rDelete(new_r_1);
4705 
4706  rComplete(new_r, TRUE);
4707 #ifdef HAVE_PLURAL
4708  if (rIsPluralRing(old_r))
4709  {
4710  if ( nc_rComplete(old_r, new_r, false) ) // no qideal!
4711  {
4712 # ifndef SING_NDEBUG
4713  WarnS("error in nc_rComplete"); // cleanup? rDelete(res); return r; // just go on...?
4714 # endif
4715  }
4716  }
4717 #endif
4718 
4719 ///? rChangeCurrRing(new_r);
4720  if (old_r->qideal != NULL)
4721  {
4722  new_r->qideal = idrCopyR(old_r->qideal, old_r, new_r);
4723  }
4724 
4725 #ifdef HAVE_PLURAL
4726  if( rIsPluralRing(old_r) )
4727  if( nc_SetupQuotient(new_r, old_r, true) )
4728  {
4729 #ifndef SING_NDEBUG
4730  WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?
4731 #endif
4732  }
4733 #endif
4734 
4735 #ifdef HAVE_PLURAL
4736  assume((new_r->qideal==NULL) == (old_r->qideal==NULL));
4737  assume(rIsPluralRing(new_r) == rIsPluralRing(old_r));
4738  assume(rIsSCA(new_r) == rIsSCA(old_r));
4739  assume(ncRingType(new_r) == ncRingType(old_r));
4740 #endif
4741 
4742  rTest(new_r);
4743  rTest(old_r);
4744  return new_r;
4745 }
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:78
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition: ring.cc:4392
#define rTest(r)
Definition: ring.h:780
ring rAssure_CompLastBlock(ring r, BOOLEAN complete)
makes sure that c/C ordering is last ordering
Definition: ring.cc:4638
#define NULL
Definition: omList.c:12
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static bool rIsSCA(const ring r)
Definition: nc.h:190
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:191
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159

◆ rAssure_SyzOrder()

ring rAssure_SyzOrder ( const ring  r,
BOOLEAN  complete 
)

Definition at line 4387 of file ring.cc.

4388 {
4389  if ( r->order[0] == ringorder_c ) return r;
4390  return rAssure_SyzComp(r,complete);
4391 }
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition: ring.cc:4392

◆ rAssure_TDeg()

ring rAssure_TDeg ( const ring  r,
int &  pos 
)

Definition at line 4488 of file ring.cc.

4489 {
4490  int i;
4491  if (r->typ!=NULL)
4492  {
4493  for(i=r->OrdSize-1;i>=0;i--)
4494  {
4495  if ((r->typ[i].ord_typ==ro_dp)
4496  && (r->typ[i].data.dp.start==1)
4497  && (r->typ[i].data.dp.end==r->N))
4498  {
4499  pos=r->typ[i].data.dp.place;
4500  //printf("no change, pos=%d\n",pos);
4501  return r;
4502  }
4503  }
4504  }
4505 
4506 #ifdef HAVE_PLURAL
4507  nc_struct* save=r->GetNC();
4508  r->GetNC()=NULL;
4509 #endif
4510  ring res=rCopy(r);
4511  if (res->qideal!=NULL)
4512  {
4513  id_Delete(&res->qideal,r);
4514  }
4515 
4516  i=rBlocks(r);
4517  int j;
4518 
4519  res->ExpL_Size=r->ExpL_Size+1; // one word more in each monom
4520  res->PolyBin=omGetSpecBin(POLYSIZE + (res->ExpL_Size)*sizeof(long));
4521  omFree((ADDRESS)res->ordsgn);
4522  res->ordsgn=(long *)omAlloc0(res->ExpL_Size*sizeof(long));
4523  for(j=0;j<r->CmpL_Size;j++)
4524  {
4525  res->ordsgn[j] = r->ordsgn[j];
4526  }
4527  res->OrdSize=r->OrdSize+1; // one block more for pSetm
4528  if (r->typ!=NULL)
4529  omFree((ADDRESS)res->typ);
4530  res->typ=(sro_ord*)omAlloc0(res->OrdSize*sizeof(sro_ord));
4531  if (r->typ!=NULL)
4532  memcpy(res->typ,r->typ,r->OrdSize*sizeof(sro_ord));
4533  // the additional block for pSetm: total degree at the last word
4534  // but not included in the compare part
4535  res->typ[res->OrdSize-1].ord_typ=ro_dp;
4536  res->typ[res->OrdSize-1].data.dp.start=1;
4537  res->typ[res->OrdSize-1].data.dp.end=res->N;
4538  res->typ[res->OrdSize-1].data.dp.place=res->ExpL_Size-1;
4539  pos=res->ExpL_Size-1;
4540  //res->pOrdIndex=pos; //NO: think of a(1,0),dp !
4541  extern void p_Setm_General(poly p, ring r);
4542  res->p_Setm=p_Setm_General;
4543  // ----------------------------
4544  omFree((ADDRESS)res->p_Procs);
4545  res->p_Procs = (p_Procs_s*)omAlloc(sizeof(p_Procs_s));
4546 
4547  p_ProcsSet(res, res->p_Procs);
4548 #ifdef HAVE_PLURAL
4549  r->GetNC()=save;
4550  if (rIsPluralRing(r))
4551  {
4552  if ( nc_rComplete(r, res, false) ) // no qideal!
4553  {
4554 #ifndef SING_NDEBUG
4555  WarnS("error in nc_rComplete");
4556 #endif
4557  // just go on..
4558  }
4559  }
4560 #endif
4561  if (r->qideal!=NULL)
4562  {
4563  res->qideal=idrCopyR_NoSort(r->qideal,r, res);
4564 #ifdef HAVE_PLURAL
4565  if (rIsPluralRing(res))
4566  {
4567 // nc_SetupQuotient(res, currRing);
4568  nc_SetupQuotient(res, r); // ?
4569  }
4570  assume((res->qideal==NULL) == (r->qideal==NULL));
4571 #endif
4572  }
4573 
4574 #ifdef HAVE_PLURAL
4575  assume(rIsPluralRing(res) == rIsPluralRing(r));
4576  assume(rIsSCA(res) == rIsSCA(r));
4577  assume(ncRingType(res) == ncRingType(r));
4578 #endif
4579 
4580  return res;
4581 }
void p_Setm_General(poly p, const ring r)
Definition: p_polys.cc:152
int j
Definition: facHensel.cc:105
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
struct p_Procs_s p_Procs_s
Definition: ring.h:23
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:133
#define POLYSIZE
Definition: monomials.h:233
#define WarnS
Definition: emacs.cc:78
Definition: nc.h:67
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int rBlocks(ring r)
Definition: ring.h:562
CanonicalForm res
Definition: facAbsFact.cc:64
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
Definition: ring.h:218
int i
Definition: cfEzgcd.cc:125
#define omGetSpecBin(size)
Definition: omBin.h:11
ring rCopy(ring r)
Definition: ring.cc:1645
#define NULL
Definition: omList.c:12
void p_ProcsSet(ring r, p_Procs_s *p_Procs)
Definition: p_Procs_Set.h:141
static bool rIsSCA(const ring r)
Definition: nc.h:190
Definition: ring.h:52
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
int p
Definition: cfModGcd.cc:4019
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rBlocks()

static int rBlocks ( ring  r)
inlinestatic

Definition at line 562 of file ring.h.

563 {
564  assume(r != NULL);
565  int i=0;
566  while (r->order[i]!=0) i++;
567  return i+1;
568 }
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12

◆ rCanShortOut()

static BOOLEAN rCanShortOut ( const ring  r)
inlinestatic

Definition at line 580 of file ring.h.

581 {
582  assume(r != NULL); return (r->CanShortOut);
583 }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rChangeSComps()

void rChangeSComps ( int *  currComponents,
long *  currShiftedComponents,
int  length,
ring  r 
)

Definition at line 4362 of file ring.cc.

4363 {
4364 #ifdef PDEBUG
4365  rDBChangeSComps(currComponents, currShiftedComponents, length, r);
4366 #else
4367  rNChangeSComps(currComponents, currShiftedComponents, r);
4368 #endif
4369 }
long * currShiftedComponents
Definition: syz1.cc:34
static void rDBChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4340
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
static void rNChangeSComps(int *currComponents, long *currShiftedComponents, ring r)
Definition: ring.cc:4324

◆ rChar()

int rChar ( ring  r)

Definition at line 713 of file ring.cc.

713 { return r->cf->ch; }

◆ rCharStr()

char* rCharStr ( ring  r)

TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.

Definition at line 647 of file ring.cc.

647 { assume( r != NULL ); return nCoeffString(r->cf); }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
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:981

◆ rCheckIV()

BOOLEAN rCheckIV ( const intvec iv)

Definition at line 175 of file ring.cc.

176 {
177  if ((iv->length()!=2)&&(iv->length()!=3))
178  {
179  WerrorS("weights only for orderings wp,ws,Wp,Ws,a,M");
180  return TRUE;
181  }
182  return FALSE;
183 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
int length() const
Definition: intvec.h:94

◆ rComplete()

BOOLEAN rComplete ( ring  r,
int  force = 0 
)

this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffset), unless they already exist with force == 1, new fields are always created (overwritten), even if they exist

Definition at line 3394 of file ring.cc.

3395 {
3396  if (r->VarOffset!=NULL && force == 0) return FALSE;
3397  rSetOutParams(r);
3398  int n=rBlocks(r)-1;
3399  int i;
3400  int bits;
3401  r->bitmask=rGetExpSize(r->bitmask,bits,r->N);
3402  r->BitsPerExp = bits;
3403  r->ExpPerLong = BIT_SIZEOF_LONG / bits;
3404  r->divmask=rGetDivMask(bits);
3405 
3406  // will be used for ordsgn:
3407  long *tmp_ordsgn=(long *)omAlloc0(3*(n+r->N)*sizeof(long));
3408  // will be used for VarOffset:
3409  int *v=(int *)omAlloc((r->N+1)*sizeof(int));
3410  for(i=r->N; i>=0 ; i--)
3411  {
3412  v[i]=-1;
3413  }
3414  sro_ord *tmp_typ=(sro_ord *)omAlloc0(3*(n+r->N)*sizeof(sro_ord));
3415  int typ_i=0;
3416  int prev_ordsgn=0;
3417 
3418  // fill in v, tmp_typ, tmp_ordsgn, determine typ_i (== ordSize)
3419  int j=0;
3420  int j_bits=BITS_PER_LONG;
3421 
3422  BOOLEAN need_to_add_comp=FALSE; // Only for ringorder_s and ringorder_S!
3423 
3424  for(i=0;i<n;i++)
3425  {
3426  tmp_typ[typ_i].order_index=i;
3427  switch (r->order[i])
3428  {
3429  case ringorder_a:
3430  case ringorder_aa:
3431  rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i],
3432  r->wvhdl[i]);
3433  typ_i++;
3434  break;
3435 
3436  case ringorder_am:
3437  rO_WMDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i],
3438  r->wvhdl[i]);
3439  typ_i++;
3440  break;
3441 
3442  case ringorder_a64:
3443  rO_WDegree64(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3444  tmp_typ[typ_i], (int64 *)(r->wvhdl[i]));
3445  typ_i++;
3446  break;
3447 
3448  case ringorder_c:
3449  rO_Align(j, j_bits);
3450  rO_LexVars_neg(j, j_bits, 0,0, prev_ordsgn,tmp_ordsgn,v,BITS_PER_LONG, -1);
3451  r->ComponentOrder=1;
3452  break;
3453 
3454  case ringorder_C:
3455  rO_Align(j, j_bits);
3456  rO_LexVars(j, j_bits, 0,0, prev_ordsgn,tmp_ordsgn,v,BITS_PER_LONG, -1);
3457  r->ComponentOrder=-1;
3458  break;
3459 
3460  case ringorder_M:
3461  {
3462  int k,l;
3463  k=r->block1[i]-r->block0[i]+1; // number of vars
3464  for(l=0;l<k;l++)
3465  {
3466  rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3467  tmp_typ[typ_i],
3468  r->wvhdl[i]+(r->block1[i]-r->block0[i]+1)*l);
3469  typ_i++;
3470  }
3471  break;
3472  }
3473 
3474  case ringorder_lp:
3475  rO_LexVars(j, j_bits, r->block0[i],r->block1[i], prev_ordsgn,
3476  tmp_ordsgn,v,bits, -1);
3477  break;
3478 
3479  case ringorder_ls:
3480  rO_LexVars_neg(j, j_bits, r->block0[i],r->block1[i], prev_ordsgn,
3481  tmp_ordsgn,v, bits, -1);
3482  break;
3483 
3484  case ringorder_rs:
3485  rO_LexVars_neg(j, j_bits, r->block1[i],r->block0[i], prev_ordsgn,
3486  tmp_ordsgn,v, bits, -1);
3487  break;
3488 
3489  case ringorder_rp:
3490  rO_LexVars(j, j_bits, r->block1[i],r->block0[i], prev_ordsgn,
3491  tmp_ordsgn,v, bits, -1);
3492  break;
3493 
3494  case ringorder_dp:
3495  if (r->block0[i]==r->block1[i])
3496  {
3497  rO_LexVars(j, j_bits, r->block0[i],r->block0[i], prev_ordsgn,
3498  tmp_ordsgn,v, bits, -1);
3499  }
3500  else
3501  {
3502  rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3503  tmp_typ[typ_i]);
3504  typ_i++;
3505  rO_LexVars_neg(j, j_bits, r->block1[i],r->block0[i]+1,
3506  prev_ordsgn,tmp_ordsgn,v,bits, r->block0[i]);
3507  }
3508  break;
3509 
3510  case ringorder_Dp:
3511  if (r->block0[i]==r->block1[i])
3512  {
3513  rO_LexVars(j, j_bits, r->block0[i],r->block0[i], prev_ordsgn,
3514  tmp_ordsgn,v, bits, -1);
3515  }
3516  else
3517  {
3518  rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3519  tmp_typ[typ_i]);
3520  typ_i++;
3521  rO_LexVars(j, j_bits, r->block0[i],r->block1[i]-1, prev_ordsgn,
3522  tmp_ordsgn,v, bits, r->block1[i]);
3523  }
3524  break;
3525 
3526  case ringorder_ds:
3527  if (r->block0[i]==r->block1[i])
3528  {
3529  rO_LexVars_neg(j, j_bits,r->block0[i],r->block1[i],prev_ordsgn,
3530  tmp_ordsgn,v,bits, -1);
3531  }
3532  else
3533  {
3534  rO_TDegree_neg(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3535  tmp_typ[typ_i]);
3536  typ_i++;
3537  rO_LexVars_neg(j, j_bits, r->block1[i],r->block0[i]+1,
3538  prev_ordsgn,tmp_ordsgn,v,bits, r->block0[i]);
3539  }
3540  break;
3541 
3542  case ringorder_Ds:
3543  if (r->block0[i]==r->block1[i])
3544  {
3545  rO_LexVars_neg(j, j_bits, r->block0[i],r->block0[i],prev_ordsgn,
3546  tmp_ordsgn,v, bits, -1);
3547  }
3548  else
3549  {
3550  rO_TDegree_neg(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3551  tmp_typ[typ_i]);
3552  typ_i++;
3553  rO_LexVars(j, j_bits, r->block0[i],r->block1[i]-1, prev_ordsgn,
3554  tmp_ordsgn,v, bits, r->block1[i]);
3555  }
3556  break;
3557 
3558  case ringorder_wp:
3559  rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3560  tmp_typ[typ_i], r->wvhdl[i]);
3561  typ_i++;
3562  { // check for weights <=0
3563  int jj;
3564  BOOLEAN have_bad_weights=FALSE;
3565  for(jj=r->block1[i]-r->block0[i];jj>=0; jj--)
3566  {
3567  if (r->wvhdl[i][jj]<=0) have_bad_weights=TRUE;
3568  }
3569  if (have_bad_weights)
3570  {
3571  rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3572  tmp_typ[typ_i]);
3573  typ_i++;
3574  }
3575  }
3576  if (r->block1[i]!=r->block0[i])
3577  {
3578  rO_LexVars_neg(j, j_bits,r->block1[i],r->block0[i]+1, prev_ordsgn,
3579  tmp_ordsgn, v,bits, r->block0[i]);
3580  }
3581  break;
3582 
3583  case ringorder_Wp:
3584  rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3585  tmp_typ[typ_i], r->wvhdl[i]);
3586  typ_i++;
3587  { // check for weights <=0
3588  int jj;
3589  BOOLEAN have_bad_weights=FALSE;
3590  for(jj=r->block1[i]-r->block0[i];jj>=0; jj--)
3591  {
3592  if (r->wvhdl[i][jj]<=0) have_bad_weights=TRUE;
3593  }
3594  if (have_bad_weights)
3595  {
3596  rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3597  tmp_typ[typ_i]);
3598  typ_i++;
3599  }
3600  }
3601  if (r->block1[i]!=r->block0[i])
3602  {
3603  rO_LexVars(j, j_bits,r->block0[i],r->block1[i]-1, prev_ordsgn,
3604  tmp_ordsgn,v, bits, r->block1[i]);
3605  }
3606  break;
3607 
3608  case ringorder_ws:
3609  rO_WDegree_neg(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3610  tmp_typ[typ_i], r->wvhdl[i]);
3611  typ_i++;
3612  if (r->block1[i]!=r->block0[i])
3613  {
3614  rO_LexVars_neg(j, j_bits,r->block1[i],r->block0[i]+1, prev_ordsgn,
3615  tmp_ordsgn, v,bits, r->block0[i]);
3616  }
3617  break;
3618 
3619  case ringorder_Ws:
3620  rO_WDegree_neg(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
3621  tmp_typ[typ_i], r->wvhdl[i]);
3622  typ_i++;
3623  if (r->block1[i]!=r->block0[i])
3624  {
3625  rO_LexVars(j, j_bits,r->block0[i],r->block1[i]-1, prev_ordsgn,
3626  tmp_ordsgn,v, bits, r->block1[i]);
3627  }
3628  break;
3629 
3630  case ringorder_S:
3631  assume(typ_i == 1); // For LaScala3 only: on the 2nd place ([1])!
3632  // TODO: for K[x]: it is 0...?!
3633  rO_Syzcomp(j, j_bits,prev_ordsgn, tmp_ordsgn,tmp_typ[typ_i]);
3634  need_to_add_comp=TRUE;
3635  r->ComponentOrder=-1;
3636  typ_i++;
3637  break;
3638 
3639  case ringorder_s:
3640  assume(typ_i == 0 && j == 0);
3641  rO_Syz(j, j_bits, prev_ordsgn, r->block0[i], tmp_ordsgn, tmp_typ[typ_i]); // set syz-limit?
3642  need_to_add_comp=TRUE;
3643  r->ComponentOrder=-1;
3644  typ_i++;
3645  break;
3646 
3647  case ringorder_IS:
3648  {
3649 
3650  assume( r->block0[i] == r->block1[i] );
3651  const int s = r->block0[i];
3652  assume( -2 < s && s < 2);
3653 
3654  if(s == 0) // Prefix IS
3655  rO_ISPrefix(j, j_bits, prev_ordsgn, tmp_ordsgn, r->N, v, tmp_typ[typ_i++]); // What about prev_ordsgn?
3656  else // s = +1 or -1 // Note: typ_i might be incrimented here inside!
3657  {
3658  rO_ISSuffix(j, j_bits, prev_ordsgn, tmp_ordsgn, r->N, v, tmp_typ, typ_i, s); // Suffix.
3659  need_to_add_comp=FALSE;
3660  }
3661 
3662  break;
3663  }
3664  case ringorder_unspec:
3665  case ringorder_no:
3666  default:
3667  dReportError("undef. ringorder used\n");
3668  break;
3669  }
3670  }
3671  rCheckOrdSgn(r,n-1);
3672 
3673  int j0=j; // save j
3674  int j_bits0=j_bits; // save jbits
3675  rO_Align(j,j_bits);
3676  r->CmpL_Size = j;
3677 
3678  j_bits=j_bits0; j=j0;
3679 
3680  // fill in some empty slots with variables not already covered
3681  // v0 is special, is therefore normally already covered
3682  // now we do have rings without comp...
3683  if((need_to_add_comp) && (v[0]== -1))
3684  {
3685  if (prev_ordsgn==1)
3686  {
3687  rO_Align(j, j_bits);
3688  rO_LexVars(j, j_bits, 0,0, prev_ordsgn,tmp_ordsgn,v,BITS_PER_LONG, -1);
3689  }
3690  else
3691  {
3692  rO_Align(j, j_bits);
3693  rO_LexVars_neg(j, j_bits, 0,0, prev_ordsgn,tmp_ordsgn,v,BITS_PER_LONG, -1);
3694  }
3695  }
3696  // the variables
3697  for(i=1 ; i<=r->N ; i++)
3698  {
3699  if(v[i]==(-1))
3700  {
3701  if (prev_ordsgn==1)
3702  {
3703  rO_LexVars(j, j_bits, i,i, prev_ordsgn,tmp_ordsgn,v,bits, -1);
3704  }
3705  else
3706  {
3707  rO_LexVars_neg(j,j_bits,i,i, prev_ordsgn,tmp_ordsgn,v,bits, -1);
3708  }
3709  }
3710  }
3711 
3712  rO_Align(j,j_bits);
3713  // ----------------------------
3714  // finished with constructing the monomial, computing sizes:
3715 
3716  r->ExpL_Size=j;
3717  r->PolyBin = omGetSpecBin(POLYSIZE + (r->ExpL_Size)*sizeof(long));
3718  assume(r->PolyBin != NULL);
3719 
3720  // ----------------------------
3721  // indices and ordsgn vector for comparison
3722  //
3723  // r->pCompHighIndex already set
3724  r->ordsgn=(long *)omAlloc0(r->ExpL_Size*sizeof(long));
3725 
3726  for(j=0;j<r->CmpL_Size;j++)
3727  {
3728  r->ordsgn[j] = tmp_ordsgn[j];
3729  }
3730 
3731  omFreeSize((ADDRESS)tmp_ordsgn,(3*(n+r->N)*sizeof(long)));
3732 
3733  // ----------------------------
3734  // description of orderings for setm:
3735  //
3736  r->OrdSize=typ_i;
3737  if (typ_i==0) r->typ=NULL;
3738  else
3739  {
3740  r->typ=(sro_ord*)omAlloc(typ_i*sizeof(sro_ord));
3741  memcpy(r->typ,tmp_typ,typ_i*sizeof(sro_ord));
3742  }
3743  omFreeSize((ADDRESS)tmp_typ,(3*(n+r->N)*sizeof(sro_ord)));
3744 
3745  // ----------------------------
3746  // indices for (first copy of ) variable entries in exp.e vector (VarOffset):
3747  r->VarOffset=v;
3748 
3749  // ----------------------------
3750  // other indicies
3751  r->pCompIndex=(r->VarOffset[0] & 0xffff); //r->VarOffset[0];
3752  i=0; // position
3753  j=0; // index in r->typ
3754  if (i==r->pCompIndex) i++; // IS???
3755  while ((j < r->OrdSize)
3756  && ((r->typ[j].ord_typ==ro_syzcomp) ||
3757  (r->typ[j].ord_typ==ro_syz) || (r->typ[j].ord_typ==ro_isTemp) || (r->typ[j].ord_typ==ro_is) ||
3758  (r->order[r->typ[j].order_index] == ringorder_aa)))
3759  {
3760  i++; j++;
3761  }
3762 
3763  if (i==r->pCompIndex) i++;
3764  r->pOrdIndex=i;
3765 
3766  // ----------------------------
3767  rSetDegStuff(r); // OrdSgn etc already set
3768  rSetOption(r);
3769  // ----------------------------
3770  // r->p_Setm
3771  r->p_Setm = p_GetSetmProc(r);
3772 
3773  // ----------------------------
3774  // set VarL_*
3775  rSetVarL(r);
3776 
3777  // ----------------------------
3778  // right-adjust VarOffset
3780 
3781  // ----------------------------
3782  // set NegWeightL*
3783  rSetNegWeight(r);
3784 
3785  // ----------------------------
3786  // p_Procs: call AFTER NegWeightL
3787  r->p_Procs = (p_Procs_s*)omAlloc(sizeof(p_Procs_s));
3788  p_ProcsSet(r, r->p_Procs);
3789 
3790  // use totaldegree on crazy oderings:
3791  if ((r->pFDeg==p_WTotaldegree) && rOrd_is_MixedDegree_Ordering(r))
3792  r->pFDeg = p_Totaldegree;
3793  return FALSE;
3794 }
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:91
const CanonicalForm int s
Definition: facAbsFact.cc:55
int j
Definition: facHensel.cc:105
for int64 weights
Definition: ring.h:71
Definition: ring.h:60
static void rO_LexVars(int &place, int &bitplace, int start, int end, int &prev_ord, long *o, int *v, int bits, int opt_var)
Definition: ring.cc:2279
int order_index
Definition: ring.h:221
static void rSetNegWeight(ring r)
Definition: ring.cc:3291
p_SetmProc p_GetSetmProc(const ring r)
Definition: p_polys.cc:550
#define FALSE
Definition: auxiliary.h:94
static void rO_ISSuffix(int &place, int &bitplace, int &prev_ord, long *o, int N, int *v, sro_ord *tmp_typ, int &typ_i, int sgn)
Definition: ring.cc:2414
opposite of ls
Definition: ring.h:92
struct p_Procs_s p_Procs_s
Definition: ring.h:23
BOOLEAN rOrd_is_MixedDegree_Ordering(ring r)
Definition: ring.cc:3372
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
long int64
Definition: auxiliary.h:66
#define TRUE
Definition: auxiliary.h:98
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1442
static void rO_ISPrefix(int &place, int &bitplace, int &prev_ord, long *o, int, int *v, sro_ord &ord_struct)
Definition: ring.cc:2396
void * ADDRESS
Definition: auxiliary.h:133
#define POLYSIZE
Definition: monomials.h:233
static void rO_Syz(int &place, int &bitplace, int &prev_ord, int syz_comp, long *o, sro_ord &ord_struct)
Definition: ring.cc:2370
int k
Definition: cfEzgcd.cc:92
#define omAlloc(size)
Definition: omAllocDecl.h:210
static void rSetOption(ring r)
Definition: ring.cc:3328
static void rSetDegStuff(ring r)
Definition: ring.cc:3121
static void rO_LexVars_neg(int &place, int &bitplace, int start, int end, int &prev_ord, long *o, int *v, int bits, int opt_var)
Definition: ring.cc:2316
static void rO_Align(int &place, int &bitplace)
Definition: ring.cc:2134
static int rBlocks(ring r)
Definition: ring.h:562
static void rO_WMDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
Definition: ring.cc:2213
static void rO_WDegree_neg(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
Definition: ring.cc:2253
#define assume(x)
Definition: mod2.h:390
static void rO_TDegree_neg(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct)
Definition: ring.cc:2159
Definition: ring.h:218
static void rO_WDegree64(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int64 *weights)
Definition: ring.cc:2235
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
static void rO_Syzcomp(int &place, int &bitplace, int &prev_ord, long *o, sro_ord &ord_struct)
Definition: ring.cc:2355
S?
Definition: ring.h:75
static void rSetVarL(ring r)
set r->VarL_Size, r->VarL_Offset, r->VarL_LowIndex
Definition: ring.cc:3946
static void rSetOutParams(ring r)
Definition: ring.cc:3019
static unsigned long rGetExpSize(unsigned long bitmask, int &bits)
Definition: ring.cc:2505
Definition: ring.h:61
Definition: ring.h:61
#define omGetSpecBin(size)
Definition: omBin.h:11
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static unsigned long rGetDivMask(int bits)
get r->divmask depending on bits per exponent
Definition: ring.cc:4027
static void rO_TDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct)
Definition: ring.cc:2145
#define NULL
Definition: omList.c:12
void p_ProcsSet(ring r, p_Procs_s *p_Procs)
Definition: p_Procs_Set.h:141
static void rO_WDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
Definition: ring.cc:2173
static void rRightAdjustVarOffset(ring r)
right-adjust r->VarOffset
Definition: ring.cc:4001
#define BITS_PER_LONG
Definition: ring.cc:40
int dReportError(const char *fmt,...)
Definition: dError.cc:43
#define BIT_SIZEOF_LONG
Definition: auxiliary.h:78
long p_WTotaldegree(poly p, const ring r)
Definition: p_polys.cc:603
static void rCheckOrdSgn(ring r, int i)
Definition: ring.cc:3796
s?
Definition: ring.h:76
int BOOLEAN
Definition: auxiliary.h:85
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93

◆ rCopy()

ring rCopy ( ring  r)

Definition at line 1645 of file ring.cc.

1646 {
1647  if (r == NULL) return NULL;
1648  ring res=rCopy0(r,FALSE,TRUE);
1649  rComplete(res, 1); // res is purely commutative so far
1650  if (r->qideal!=NULL) res->qideal=idrCopyR_NoSort(r->qideal, r, res);
1651 
1652 #ifdef HAVE_PLURAL
1653  if (rIsPluralRing(r))
1654  if( nc_rCopy(res, r, true) ) {}
1655 #endif
1656 
1657  return res;
1658 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
bool nc_rCopy(ring res, const ring r, bool bSetupQuotient)
Definition: old.gring.cc:3029
#define NULL
Definition: omList.c:12
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204

◆ rCopy0()

ring rCopy0 ( const ring  r,
BOOLEAN  copy_qideal = TRUE,
BOOLEAN  copy_ordering = TRUE 
)

Definition at line 1365 of file ring.cc.

1366 {
1367  if (r == NULL) return NULL;
1368  int i,j;
1369  ring res=(ring)omAlloc0Bin(sip_sring_bin);
1370  //memset: res->idroot=NULL; /* local objects */
1371  //ideal minideal;
1372  res->options=r->options; /* ring dependent options */
1373 
1374  //memset: res->ordsgn=NULL;
1375  //memset: res->typ=NULL;
1376  //memset: res->VarOffset=NULL;
1377  //memset: res->firstwv=NULL;
1378 
1379  //struct omBin PolyBin; /* Bin from where monoms are allocated */
1380  //memset: res->PolyBin=NULL; // rComplete
1381  res->cf=nCopyCoeff(r->cf); /* coeffs */
1382 
1383  //memset: res->ref=0; /* reference counter to the ring */
1384 
1385  res->N=rVar(r); /* number of vars */
1386 
1387  res->firstBlockEnds=r->firstBlockEnds;
1388 #ifdef HAVE_PLURAL
1389  res->real_var_start=r->real_var_start;
1390  res->real_var_end=r->real_var_end;
1391 #endif
1392 
1393 #ifdef HAVE_SHIFTBBA
1394  res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
1395 #endif
1396 
1397  res->VectorOut=r->VectorOut;
1398  res->ShortOut=r->ShortOut;
1399  res->CanShortOut=r->CanShortOut;
1400 
1401  //memset: res->ExpL_Size=0;
1402  //memset: res->CmpL_Size=0;
1403  //memset: res->VarL_Size=0;
1404  //memset: res->pCompIndex=0;
1405  //memset: res->pOrdIndex=0;
1406  //memset: res->OrdSize=0;
1407  //memset: res->VarL_LowIndex=0;
1408  //memset: res->NegWeightL_Size=0;
1409  //memset: res->NegWeightL_Offset=NULL;
1410  //memset: res->VarL_Offset=NULL;
1411 
1412  // the following are set by rComplete unless predefined
1413  // therefore, we copy these values: maybe they are non-standard
1414  /* mask for getting single exponents */
1415  res->bitmask=r->bitmask;
1416  res->divmask=r->divmask;
1417  res->BitsPerExp = r->BitsPerExp;
1418  res->ExpPerLong = r->ExpPerLong;
1419 
1420  //memset: res->p_Procs=NULL;
1421  //memset: res->pFDeg=NULL;
1422  //memset: res->pLDeg=NULL;
1423  //memset: res->pFDegOrig=NULL;
1424  //memset: res->pLDegOrig=NULL;
1425  //memset: res->p_Setm=NULL;
1426  //memset: res->cf=NULL;
1427 
1428 /*
1429  if (r->extRing!=NULL)
1430  r->extRing->ref++;
1431 
1432  res->extRing=r->extRing;
1433  //memset: res->qideal=NULL;
1434 */
1435 
1436 
1437  if (copy_ordering == TRUE)
1438  {
1439  res->LexOrder=r->LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
1440  res->MixedOrder=r->MixedOrder; // TRUE for mixed (global/local) ordering, FALSE otherwise,
1441  i=rBlocks(r);
1442  res->wvhdl = (int **)omAlloc(i * sizeof(int *));
1443  res->order = (rRingOrder_t *) omAlloc(i * sizeof(rRingOrder_t));
1444  res->block0 = (int *) omAlloc(i * sizeof(int));
1445  res->block1 = (int *) omAlloc(i * sizeof(int));
1446  for (j=0; j<i; j++)
1447  {
1448  if (r->wvhdl[j]!=NULL)
1449  {
1450  res->wvhdl[j] = (int*) omMemDup(r->wvhdl[j]);
1451  }
1452  else
1453  res->wvhdl[j]=NULL;
1454  }
1455  memcpy(res->order,r->order,i * sizeof(rRingOrder_t));
1456  memcpy(res->block0,r->block0,i * sizeof(int));
1457  memcpy(res->block1,r->block1,i * sizeof(int));
1458  }
1459  //memset: else
1460  //memset: {
1461  //memset: res->wvhdl = NULL;
1462  //memset: res->order = NULL;
1463  //memset: res->block0 = NULL;
1464  //memset: res->block1 = NULL;
1465  //memset: }
1466 
1467  res->names = (char **)omAlloc0(rVar(r) * sizeof(char *));
1468  for (i=0; i<rVar(res); i++)
1469  {
1470  res->names[i] = omStrDup(r->names[i]);
1471  }
1472  if (r->qideal!=NULL)
1473  {
1474  if (copy_qideal)
1475  {
1476  assume(copy_ordering);
1477  rComplete(res);
1478  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
1479  rUnComplete(res);
1480  }
1481  //memset: else res->qideal = NULL;
1482  }
1483  //memset: else res->qideal = NULL;
1484  //memset: res->GetNC() = NULL; // copy is purely commutative!!!
1485  return res;
1486 }
int j
Definition: facHensel.cc:105
#define omMemDup(s)
Definition: omAllocDecl.h:264
void rUnComplete(ring r)
Definition: ring.cc:3889
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
#define TRUE
Definition: auxiliary.h:98
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int rBlocks(ring r)
Definition: ring.h:562
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
#define assume(x)
Definition: mod2.h:390
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
int i
Definition: cfEzgcd.cc:125
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:429
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:12
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rCopy0AndAddA()

ring rCopy0AndAddA ( ring  r,
int64vec wv64,
BOOLEAN  copy_qideal = TRUE,
BOOLEAN  copy_ordering = TRUE 
)

Definition at line 1493 of file ring.cc.

1494 {
1495  if (r == NULL) return NULL;
1496  int i,j;
1497  ring res=(ring)omAlloc0Bin(sip_sring_bin);
1498  //memcpy(res,r,sizeof(ip_sring));
1499  //memset: res->idroot=NULL; /* local objects */
1500  //ideal minideal;
1501  res->options=r->options; /* ring dependent options */
1502 
1503  //memset: res->ordsgn=NULL;
1504  //memset: res->typ=NULL;
1505  //memset: res->VarOffset=NULL;
1506  //memset: res->firstwv=NULL;
1507 
1508  //struct omBin PolyBin; /* Bin from where monoms are allocated */
1509  //memset: res->PolyBin=NULL; // rComplete
1510  res->cf=nCopyCoeff(r->cf); /* coeffs */
1511 
1512  //memset: res->ref=0; /* reference counter to the ring */
1513 
1514  res->N=rVar(r); /* number of vars */
1515 
1516  res->firstBlockEnds=r->firstBlockEnds;
1517 #ifdef HAVE_PLURAL
1518  res->real_var_start=r->real_var_start;
1519  res->real_var_end=r->real_var_end;
1520 #endif
1521 
1522 #ifdef HAVE_SHIFTBBA
1523  res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
1524 #endif
1525 
1526  res->VectorOut=r->VectorOut;
1527  res->ShortOut=r->ShortOut;
1528  res->CanShortOut=r->CanShortOut;
1529  res->LexOrder=r->LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
1530  res->MixedOrder=r->MixedOrder; // TRUE for mixed (global/local) ordering, FALSE otherwise,
1531 
1532  //memset: res->ExpL_Size=0;
1533  //memset: res->CmpL_Size=0;
1534  //memset: res->VarL_Size=0;
1535  //memset: res->pCompIndex=0;
1536  //memset: res->pOrdIndex=0;
1537  //memset: res->OrdSize=0;
1538  //memset: res->VarL_LowIndex=0;
1539  //memset: res->NegWeightL_Size=0;
1540  //memset: res->NegWeightL_Offset=NULL;
1541  //memset: res->VarL_Offset=NULL;
1542 
1543  // the following are set by rComplete unless predefined
1544  // therefore, we copy these values: maybe they are non-standard
1545  /* mask for getting single exponents */
1546  res->bitmask=r->bitmask;
1547  res->divmask=r->divmask;
1548  res->BitsPerExp = r->BitsPerExp;
1549  res->ExpPerLong = r->ExpPerLong;
1550 
1551  //memset: res->p_Procs=NULL;
1552  //memset: res->pFDeg=NULL;
1553  //memset: res->pLDeg=NULL;
1554  //memset: res->pFDegOrig=NULL;
1555  //memset: res->pLDegOrig=NULL;
1556  //memset: res->p_Setm=NULL;
1557  //memset: res->cf=NULL;
1558 
1559 /*
1560  if (r->extRing!=NULL)
1561  r->extRing->ref++;
1562 
1563  res->extRing=r->extRing;
1564  //memset: res->qideal=NULL;
1565 */
1566 
1567 
1568  if (copy_ordering == TRUE)
1569  {
1570  i=rBlocks(r)+1; // DIFF to rCopy0
1571  res->wvhdl = (int **)omAlloc(i * sizeof(int *));
1572  res->order = (rRingOrder_t *) omAlloc(i * sizeof(rRingOrder_t));
1573  res->block0 = (int *) omAlloc(i * sizeof(int));
1574  res->block1 = (int *) omAlloc(i * sizeof(int));
1575  for (j=0; j<i-1; j++)
1576  {
1577  if (r->wvhdl[j]!=NULL)
1578  {
1579  res->wvhdl[j+1] = (int*) omMemDup(r->wvhdl[j]); //DIFF
1580  }
1581  else
1582  res->wvhdl[j+1]=NULL; //DIFF
1583  }
1584  memcpy(&(res->order[1]),r->order,(i-1) * sizeof(rRingOrder_t)); //DIFF
1585  memcpy(&(res->block0[1]),r->block0,(i-1) * sizeof(int)); //DIFF
1586  memcpy(&(res->block1[1]),r->block1,(i-1) * sizeof(int)); //DIFF
1587  }
1588  //memset: else
1589  //memset: {
1590  //memset: res->wvhdl = NULL;
1591  //memset: res->order = NULL;
1592  //memset: res->block0 = NULL;
1593  //memset: res->block1 = NULL;
1594  //memset: }
1595 
1596  //the added A
1597  res->order[0]=ringorder_a64;
1598  int length=wv64->rows();
1599  int64 *A=(int64 *)omAlloc(length*sizeof(int64));
1600  for(j=length-1;j>=0;j--)
1601  {
1602  A[j]=(*wv64)[j];
1603  }
1604  res->wvhdl[0]=(int *)A;
1605  res->block0[0]=1;
1606  res->block1[0]=length;
1607  //
1608 
1609  res->names = (char **)omAlloc0(rVar(r) * sizeof(char *));
1610  for (i=0; i<rVar(res); i++)
1611  {
1612  res->names[i] = omStrDup(r->names[i]);
1613  }
1614  if (r->qideal!=NULL)
1615  {
1616  if (copy_qideal)
1617  {
1618  #ifndef SING_NDEBUG
1619  if (!copy_ordering)
1620  WerrorS("internal error: rCopy0(Q,TRUE,FALSE)");
1621  else
1622  #endif
1623  {
1624  #ifndef SING_NDEBUG
1625  WarnS("internal bad stuff: rCopy0(Q,TRUE,TRUE)");
1626  #endif
1627  rComplete(res);
1628  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
1629  rUnComplete(res);
1630  }
1631  }
1632  //memset: else res->qideal = NULL;
1633  }
1634  //memset: else res->qideal = NULL;
1635  //memset: res->GetNC() = NULL; // copy is purely commutative!!!
1636  return res;
1637 }
int j
Definition: facHensel.cc:105
for int64 weights
Definition: ring.h:71
#define omMemDup(s)
Definition: omAllocDecl.h:264
void rUnComplete(ring r)
Definition: ring.cc:3889
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
long int64
Definition: auxiliary.h:66
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int rBlocks(ring r)
Definition: ring.h:562
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
int rows() const
Definition: int64vec.h:66
#define A
Definition: sirandom.c:23
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
int i
Definition: cfEzgcd.cc:125
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:429
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:12
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:204
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rDBTest()

BOOLEAN rDBTest ( ring  r,
const char *  fn,
const int  l 
)

Definition at line 1984 of file ring.cc.

1985 {
1986  int i,j;
1987 
1988  if (r == NULL)
1989  {
1990  dReportError("Null ring in %s:%d", fn, l);
1991  return FALSE;
1992  }
1993 
1994 
1995  if (r->N == 0) return TRUE;
1996 
1997  if ((r->OrdSgn!=1) && (r->OrdSgn!= -1))
1998  {
1999  dReportError("missing OrdSgn in %s:%d", fn, l);
2000  return FALSE;
2001  }
2002 
2003 // omCheckAddrSize(r,sizeof(ip_sring));
2004 #if OM_CHECK > 0
2005  i=rBlocks(r);
2006  omCheckAddrSize(r->order,i*sizeof(int));
2007  omCheckAddrSize(r->block0,i*sizeof(int));
2008  omCheckAddrSize(r->block1,i*sizeof(int));
2009  for(int j=0;j<=i;j++)
2010  {
2011  if((r->order[j]<0)||(r->order[j]>ringorder_unspec))
2012  dError("wrong order in r->order");
2013  }
2014  if (r->wvhdl!=NULL)
2015  {
2016  omCheckAddrSize(r->wvhdl,i*sizeof(int *));
2017  for (j=0;j<i; j++)
2018  {
2019  if (r->wvhdl[j] != NULL) omCheckAddr(r->wvhdl[j]);
2020  }
2021  }
2022 #endif
2023  if (r->VarOffset == NULL)
2024  {
2025  dReportError("Null ring VarOffset -- no rComplete (?) in n %s:%d", fn, l);
2026  return FALSE;
2027  }
2028  omCheckAddrSize(r->VarOffset,(r->N+1)*sizeof(int));
2029 
2030  if ((r->OrdSize==0)!=(r->typ==NULL))
2031  {
2032  dReportError("mismatch OrdSize and typ-pointer in %s:%d");
2033  return FALSE;
2034  }
2035  omcheckAddrSize(r->typ,r->OrdSize*sizeof(*(r->typ)));
2036  omCheckAddrSize(r->VarOffset,(r->N+1)*sizeof(*(r->VarOffset)));
2037  // test assumptions:
2038  for(i=0;i<=r->N;i++) // for all variables (i = 0..N)
2039  {
2040  if(r->typ!=NULL)
2041  {
2042  for(j=0;j<r->OrdSize;j++) // for all ordering blocks (j =0..OrdSize-1)
2043  {
2044  if(r->typ[j].ord_typ == ro_isTemp)
2045  {
2046  const int p = r->typ[j].data.isTemp.suffixpos;
2047 
2048  if(p <= j)
2049  dReportError("ordrec prefix %d is unmatched",j);
2050 
2051  assume( p < r->OrdSize );
2052 
2053  if(r->typ[p].ord_typ != ro_is)
2054  dReportError("ordrec prefix %d is unmatched (suffix: %d is wrong!!!)",j, p);
2055 
2056  // Skip all intermediate blocks for undone variables:
2057  if(r->typ[j].data.isTemp.pVarOffset[i] != -1) // Check i^th variable
2058  {
2059  j = p - 1; // SKIP ALL INTERNAL BLOCKS...???
2060  continue; // To make for check OrdSize bound...
2061  }
2062  }
2063  else if (r->typ[j].ord_typ == ro_is)
2064  {
2065  // Skip all intermediate blocks for undone variables:
2066  if(r->typ[j].data.is.pVarOffset[i] != -1)
2067  {
2068  // TODO???
2069  }
2070 
2071  }
2072  else
2073  {
2074  if (r->typ[j].ord_typ==ro_cp)
2075  {
2076  if(((short)r->VarOffset[i]) == r->typ[j].data.cp.place)
2077  dReportError("ordrec %d conflicts with var %d",j,i);
2078  }
2079  else
2080  if ((r->typ[j].ord_typ!=ro_syzcomp)
2081  && (r->VarOffset[i] == r->typ[j].data.dp.place))
2082  dReportError("ordrec %d conflicts with var %d",j,i);
2083  }
2084  }
2085  }
2086  int tmp;
2087  tmp=r->VarOffset[i] & 0xffffff;
2088  #if SIZEOF_LONG == 8
2089  if ((r->VarOffset[i] >> 24) >63)
2090  #else
2091  if ((r->VarOffset[i] >> 24) >31)
2092  #endif
2093  dReportError("bit_start out of range:%d",r->VarOffset[i] >> 24);
2094  if (i > 0 && ((tmp<0) ||(tmp>r->ExpL_Size-1)))
2095  {
2096  dReportError("varoffset out of range for var %d: %d",i,tmp);
2097  }
2098  }
2099  if(r->typ!=NULL)
2100  {
2101  for(j=0;j<r->OrdSize;j++)
2102  {
2103  if ((r->typ[j].ord_typ==ro_dp)
2104  || (r->typ[j].ord_typ==ro_wp)
2105  || (r->typ[j].ord_typ==ro_wp_neg))
2106  {
2107  if (r->typ[j].data.dp.start > r->typ[j].data.dp.end)
2108  dReportError("in ordrec %d: start(%d) > end(%d)",j,
2109  r->typ[j].data.dp.start, r->typ[j].data.dp.end);
2110  if ((r->typ[j].data.dp.start < 1)
2111  || (r->typ[j].data.dp.end > r->N))
2112  dReportError("in ordrec %d: start(%d)<1 or end(%d)>vars(%d)",j,
2113  r->typ[j].data.dp.start, r->typ[j].data.dp.end,r->N);
2114  }
2115  }
2116  }
2117 
2118  assume(r != NULL);
2119  assume(r->cf != NULL);
2120 
2121  if (nCoeff_is_algExt(r->cf))
2122  {
2123  assume(r->cf->extRing != NULL);
2124  assume(r->cf->extRing->qideal != NULL);
2125  omCheckAddr(r->cf->extRing->qideal->m[0]);
2126  }
2127 
2128  //assume(r->cf!=NULL);
2129 
2130  return TRUE;
2131 }
int j
Definition: facHensel.cc:105
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
#define omcheckAddrSize(addr, size)
Definition: omAllocDecl.h:329
Definition: ring.h:53
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: ring.h:58
Definition: ring.h:56
static int rBlocks(ring r)
Definition: ring.h:562
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:932
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
Definition: ring.h:61
Definition: ring.h:61
#define NULL
Definition: omList.c:12
Definition: ring.h:52
int dReportError(const char *fmt,...)
Definition: dError.cc:43
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328
int p
Definition: cfModGcd.cc:4019
int l
Definition: cfEzgcd.cc:93

◆ rDebugPrint()

void rDebugPrint ( const ring  r)

Definition at line 4041 of file ring.cc.

4042 {
4043  if (r==NULL)
4044  {
4045  PrintS("NULL ?\n");
4046  return;
4047  }
4048  // corresponds to ro_typ from ring.h:
4049  const char *TYP[]={"ro_dp","ro_wp","ro_am","ro_wp64","ro_wp_neg","ro_cp",
4050  "ro_syzcomp", "ro_syz", "ro_isTemp", "ro_is", "ro_none"};
4051  int i,j;
4052 
4053  Print("ExpL_Size:%d ",r->ExpL_Size);
4054  Print("CmpL_Size:%d ",r->CmpL_Size);
4055  Print("VarL_Size:%d\n",r->VarL_Size);
4056  Print("bitmask=0x%lx (expbound=%ld) \n",r->bitmask, r->bitmask);
4057  Print("divmask=%lx\n", r->divmask);
4058  Print("BitsPerExp=%d ExpPerLong=%d at L[%d]\n", r->BitsPerExp, r->ExpPerLong, r->VarL_Offset[0]);
4059 
4060  Print("VarL_LowIndex: %d\n", r->VarL_LowIndex);
4061  PrintS("VarL_Offset:\n");
4062  if (r->VarL_Offset==NULL) PrintS(" NULL");
4063  else
4064  for(j = 0; j < r->VarL_Size; j++)
4065  Print(" VarL_Offset[%d]: %d ", j, r->VarL_Offset[j]);
4066  PrintLn();
4067 
4068 
4069  PrintS("VarOffset:\n");
4070  if (r->VarOffset==NULL) PrintS(" NULL\n");
4071  else
4072  for(j=0;j<=r->N;j++)
4073  Print(" v%d at e-pos %d, bit %d\n",
4074  j,r->VarOffset[j] & 0xffffff, r->VarOffset[j] >>24);
4075  PrintS("ordsgn:\n");
4076  for(j=0;j<r->CmpL_Size;j++)
4077  Print(" ordsgn %ld at pos %d\n",r->ordsgn[j],j);
4078  Print("OrdSgn:%d\n",r->OrdSgn);
4079  PrintS("ordrec:\n");
4080  for(j=0;j<r->OrdSize;j++)
4081  {
4082  Print(" typ %s", TYP[r->typ[j].ord_typ]);
4083  if (r->typ[j].ord_typ==ro_syz)
4084  {
4085  const short place = r->typ[j].data.syz.place;
4086  const int limit = r->typ[j].data.syz.limit;
4087  const int curr_index = r->typ[j].data.syz.curr_index;
4088  const int* syz_index = r->typ[j].data.syz.syz_index;
4089 
4090  Print(" limit %d (place: %d, curr_index: %d), syz_index: ", limit, place, curr_index);
4091 
4092  if( syz_index == NULL )
4093  PrintS("(NULL)");
4094  else
4095  {
4096  PrintS("{");
4097  for( i=0; i <= limit; i++ )
4098  Print("%d ", syz_index[i]);
4099  PrintS("}");
4100  }
4101 
4102  }
4103  else if (r->typ[j].ord_typ==ro_isTemp)
4104  {
4105  Print(" start (level) %d, suffixpos: %d, VO: ",r->typ[j].data.isTemp.start, r->typ[j].data.isTemp.suffixpos);
4106 
4107  }
4108  else if (r->typ[j].ord_typ==ro_is)
4109  {
4110  Print(" start %d, end: %d: ",r->typ[j].data.is.start, r->typ[j].data.is.end);
4111 
4112 // for( int k = 0; k <= r->N; k++) if (r->typ[j].data.is.pVarOffset[k] != -1) Print("[%2d]: %04x; ", k, r->typ[j].data.is.pVarOffset[k]);
4113 
4114  Print(" limit %d",r->typ[j].data.is.limit);
4115 #ifndef SING_NDEBUG
4116  //PrintS(" F: ");idShow(r->typ[j].data.is.F, r, r, 1);
4117 #endif
4118 
4119  PrintLn();
4120  }
4121  else if (r->typ[j].ord_typ==ro_am)
4122  {
4123  Print(" place %d",r->typ[j].data.am.place);
4124  Print(" start %d",r->typ[j].data.am.start);
4125  Print(" end %d",r->typ[j].data.am.end);
4126  Print(" len_gen %d",r->typ[j].data.am.len_gen);
4127  PrintS(" w:");
4128  int l=0;
4129  for(l=r->typ[j].data.am.start;l<=r->typ[j].data.am.end;l++)
4130  Print(" %d",r->typ[j].data.am.weights[l-r->typ[j].data.am.start]);
4131  l=r->typ[j].data.am.end+1;
4132  int ll=r->typ[j].data.am.weights[l-r->typ[j].data.am.start];
4133  PrintS(" m:");
4134  for(int lll=l+1;lll<l+ll+1;lll++)
4135  Print(" %d",r->typ[j].data.am.weights[lll-r->typ[j].data.am.start]);
4136  }
4137  else
4138  {
4139  Print(" place %d",r->typ[j].data.dp.place);
4140 
4141  if (r->typ[j].ord_typ!=ro_syzcomp && r->typ[j].ord_typ!=ro_syz)
4142  {
4143  Print(" start %d",r->typ[j].data.dp.start);
4144  Print(" end %d",r->typ[j].data.dp.end);
4145  if ((r->typ[j].ord_typ==ro_wp)
4146  || (r->typ[j].ord_typ==ro_wp_neg))
4147  {
4148  PrintS(" w:");
4149  for(int l=r->typ[j].data.wp.start;l<=r->typ[j].data.wp.end;l++)
4150  Print(" %d",r->typ[j].data.wp.weights[l-r->typ[j].data.wp.start]);
4151  }
4152  else if (r->typ[j].ord_typ==ro_wp64)
4153  {
4154  PrintS(" w64:");
4155  int l;
4156  for(l=r->typ[j].data.wp64.start;l<=r->typ[j].data.wp64.end;l++)
4157  Print(" %ld",(long)(((int64*)r->typ[j].data.wp64.weights64)+l-r->typ[j].data.wp64.start));
4158  }
4159  }
4160  }
4161  PrintLn();
4162  }
4163  Print("pOrdIndex:%d pCompIndex:%d\n", r->pOrdIndex, r->pCompIndex);
4164  Print("OrdSize:%d\n",r->OrdSize);
4165  PrintS("--------------------\n");
4166  for(j=0;j<r->ExpL_Size;j++)
4167  {
4168  Print("L[%d]: ",j);
4169  if (j< r->CmpL_Size)
4170  Print("ordsgn %ld ", r->ordsgn[j]);
4171  else
4172  PrintS("no comp ");
4173  i=1;
4174  for(;i<=r->N;i++)
4175  {
4176  if( (r->VarOffset[i] & 0xffffff) == j )
4177  { Print("v%d at e[%d], bit %d; ", i,r->VarOffset[i] & 0xffffff,
4178  r->VarOffset[i] >>24 ); }
4179  }
4180  if( r->pCompIndex==j ) PrintS("v0; ");
4181  for(i=0;i<r->OrdSize;i++)
4182  {
4183  if (r->typ[i].data.dp.place == j)
4184  {
4185  Print("ordrec:%s (start:%d, end:%d) ",TYP[r->typ[i].ord_typ],
4186  r->typ[i].data.dp.start, r->typ[i].data.dp.end);
4187  }
4188  }
4189 
4190  if (j==r->pOrdIndex)
4191  PrintS("pOrdIndex\n");
4192  else
4193  PrintLn();
4194  }
4195  Print("LexOrder:%d, MixedOrder:%d\n",r->LexOrder, r->MixedOrder);
4196 
4197  Print("NegWeightL_Size: %d, NegWeightL_Offset: ", r->NegWeightL_Size);
4198  if (r->NegWeightL_Offset==NULL) PrintS(" NULL");
4199  else
4200  for(j = 0; j < r->NegWeightL_Size; j++)
4201  Print(" [%d]: %d ", j, r->NegWeightL_Offset[j]);
4202  PrintLn();
4203 
4204  // p_Procs stuff
4205  p_Procs_s proc_names;
4206  const char* field;
4207  const char* length;
4208  const char* ord;
4209  p_Debug_GetProcNames(r, &proc_names); // changes p_Procs!!!
4210  p_Debug_GetSpecNames(r, field, length, ord);
4211 
4212  Print("p_Spec : %s, %s, %s\n", field, length, ord);
4213  PrintS("p_Procs :\n");
4214  for (i=0; i<(int) (sizeof(p_Procs_s)/sizeof(void*)); i++)
4215  {
4216  Print(" %s,\n", ((char**) &proc_names)[i]);
4217  }
4218 
4219  {
4220  PrintLn();
4221  PrintS("pFDeg : ");
4222 #define pFDeg_CASE(A) if(r->pFDeg == A) PrintS( "" #A "" )
4223  pFDeg_CASE(p_Totaldegree); else
4225  pFDeg_CASE(p_WTotaldegree); else
4226  pFDeg_CASE(p_Deg); else
4227 #undef pFDeg_CASE
4228  Print("(%p)", r->pFDeg); // default case
4229 
4230  PrintLn();
4231  Print("pLDeg : (%p)", r->pLDeg);
4232  PrintLn();
4233  }
4234  PrintS("pSetm:");
4235  void p_Setm_Dummy(poly p, const ring r);
4236  void p_Setm_TotalDegree(poly p, const ring r);
4237  void p_Setm_WFirstTotalDegree(poly p, const ring r);
4238  void p_Setm_General(poly p, const ring r);
4239  if (r->p_Setm==p_Setm_General) PrintS("p_Setm_General\n");
4240  else if (r->p_Setm==p_Setm_Dummy) PrintS("p_Setm_Dummy\n");
4241  else if (r->p_Setm==p_Setm_TotalDegree) PrintS("p_Setm_Totaldegree\n");
4242  else if (r->p_Setm==p_Setm_WFirstTotalDegree) PrintS("p_Setm_WFirstTotalDegree\n");
4243  else Print("%p\n",r->p_Setm);
4244 }
void p_Debug_GetSpecNames(const ring r, const char *&field, const char *&length, const char *&ord)
Definition: p_Procs_Set.h:222
void p_Setm_General(poly p, const ring r)
Definition: p_polys.cc:152
int j
Definition: facHensel.cc:105
Definition: ring.h:60
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
Definition: ring.h:53
void p_Setm_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:544
struct p_Procs_s p_Procs_s
Definition: ring.h:23
long int64
Definition: auxiliary.h:66
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1442
void p_Setm_TotalDegree(poly p, const ring r)
Definition: p_polys.cc:537
Definition: ring.h:56
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:577
void p_Debug_GetProcNames(const ring r, p_Procs_s *p_Procs)
Definition: p_Procs_Set.h:233
long p_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:586
void p_Setm_Dummy(poly p, const ring r)
Definition: p_polys.cc:531
#define pFDeg_CASE(A)
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: ring.h:61
Definition: ring.h:61
#define NULL
Definition: omList.c:12
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
Definition: ring.h:55
Definition: ring.h:54
long p_WTotaldegree(poly p, const ring r)
Definition: p_polys.cc:603
int p
Definition: cfModGcd.cc:4019
int l
Definition: cfEzgcd.cc:93

◆ rDefault() [1/4]

ring rDefault ( int  ch,
int  N,
char **  n 
)

Definition at line 155 of file ring.cc.

156 {
157  coeffs cf;
158  if (ch==0) cf=nInitChar(n_Q,NULL);
159  else cf=nInitChar(n_Zp,(void*)(long)ch);
160  assume( cf != NULL);
161  return rDefault(cf,N,n);
162 }
rational (GMP) numbers
Definition: coeffs.h:31
{p < 2^31}
Definition: coeffs.h:30
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition: ring.cc:102
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:12
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:349

◆ rDefault() [2/4]

ring rDefault ( const coeffs  cf,
int  N,
char **  n,
const rRingOrder_t  o = ringorder_lp 
)

Definition at line 138 of file ring.cc.

139 {
140  assume( cf != NULL);
141  /*order: o=lp,0*/
142  rRingOrder_t *order = (rRingOrder_t *) omAlloc(2* sizeof(rRingOrder_t));
143  int *block0 = (int *)omAlloc0(2 * sizeof(int));
144  int *block1 = (int *)omAlloc0(2 * sizeof(int));
145  /* ringorder o=lp for the first block: var 1..N */
146  order[0] = o;
147  block0[0] = 1;
148  block1[0] = N;
149  /* the last block: everything is 0 */
150  order[1] = (rRingOrder_t)0;
151 
152  return rDefault(cf,N,n,2,order,block0,block1);
153 }
#define omAlloc(size)
Definition: omAllocDecl.h:210
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
#define assume(x)
Definition: mod2.h:390
rRingOrder_t
order stuff
Definition: ring.h:67
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition: ring.cc:102
#define NULL
Definition: omList.c:12
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rDefault() [3/4]

ring rDefault ( int  ch,
int  N,
char **  n,
int  ord_size,
rRingOrder_t ord,
int *  block0,
int *  block1,
int **  wvhdl = NULL 
)

Definition at line 130 of file ring.cc.

131 {
132  coeffs cf;
133  if (ch==0) cf=nInitChar(n_Q,NULL);
134  else cf=nInitChar(n_Zp,(void*)(long)ch);
135  assume( cf != NULL);
136  return rDefault(cf,N,n,ord_size,ord,block0,block1,wvhdl);
137 }
rational (GMP) numbers
Definition: coeffs.h:31
{p < 2^31}
Definition: coeffs.h:30
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition: ring.cc:102
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:12
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:349

◆ rDefault() [4/4]

ring rDefault ( const coeffs  cf,
int  N,
char **  n,
int  ord_size,
rRingOrder_t ord,
int *  block0,
int *  block1,
int **  wvhdl = NULL,
unsigned long  bitmask = 0 
)

Definition at line 102 of file ring.cc.

103 {
104  assume( cf != NULL);
105  ring r=(ring) omAlloc0Bin(sip_sring_bin);
106  r->N = N;
107  r->cf = cf;
108  /*rPar(r) = 0; Alloc0 */
109  /*names*/
110  r->names = (char **) omAlloc0(N * sizeof(char *));
111  int i;
112  for(i=0;i<N;i++)
113  {
114  r->names[i] = omStrDup(n[i]);
115  }
116  /*weights: entries for 2 blocks: NULL*/
117  if (wvhdl==NULL)
118  r->wvhdl = (int **)omAlloc0((ord_size+1) * sizeof(int *));
119  else
120  r->wvhdl=wvhdl;
121  r->order = ord;
122  r->block0 = block0;
123  r->block1 = block1;
124  r->bitmask = bitmask;
125 
126  /* complete ring intializations */
127  rComplete(r);
128  return r;
129 }
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
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:3394
#define assume(x)
Definition: mod2.h:390
omBin sip_sring_bin
Definition: ring.cc:43
int i
Definition: cfEzgcd.cc:125
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:12
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rDelete()

void rDelete ( ring  r)

unconditionally deletes fields in r

Definition at line 448 of file ring.cc.

449 {
450  int i, j;
451 
452  if (r == NULL) return;
453 
454  assume( r->ref <= 0 );
455 
456  if( r->ref > 0 ) // ->ref means the number of Interpreter objects referring to the ring...
457  return; // this should never happen.
458 
459  if( r->qideal != NULL )
460  {
461  ideal q = r->qideal;
462  r->qideal = NULL;
463  id_Delete(&q, r);
464  }
465 
466 #ifdef HAVE_PLURAL
467  if (rIsPluralRing(r))
468  nc_rKill(r);
469 #endif
470 
471  rUnComplete(r); // may need r->cf for p_Delete
472  nKillChar(r->cf); r->cf = NULL;
473  // delete order stuff
474  if (r->order != NULL)
475  {
476  i=rBlocks(r);
477  assume(r->block0 != NULL && r->block1 != NULL && r->wvhdl != NULL);
478  // delete order
479  omFreeSize((ADDRESS)r->order,i*sizeof(rRingOrder_t));
480  omFreeSize((ADDRESS)r->block0,i*sizeof(int));
481  omFreeSize((ADDRESS)r->block1,i*sizeof(int));
482  // delete weights
483  for (j=0; j<i; j++)
484  {
485  if (r->wvhdl[j]!=NULL)
486  omFree(r->wvhdl[j]);
487  }
488  omFreeSize((ADDRESS)r->wvhdl,i*sizeof(int *));
489  }
490  else
491  {
492  assume(r->block0 == NULL && r->block1 == NULL && r->wvhdl == NULL);
493  }
494 
495  // delete varnames
496  if(r->names!=NULL)
497  {
498  for (i=0; i<r->N; i++)
499  {
500  if (r->names[i] != NULL) omFree((ADDRESS)r->names[i]);
501  }
502  omFreeSize((ADDRESS)r->names,r->N*sizeof(char *));
503  }
504 
506 }
int j
Definition: facHensel.cc:105
void rUnComplete(ring r)
Definition: ring.cc:3889
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void nc_rKill(ring r)
complete destructor
Definition: old.gring.cc:2475
void * ADDRESS
Definition: auxiliary.h:133
static int rBlocks(ring r)
Definition: ring.h:562
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:510

◆ rEnvelope()

ring rEnvelope ( ring  r)

Definition at line 5549 of file ring.cc.

5552 {
5553  ring Ropp = rOpposite(R);
5554  ring Renv = NULL;
5555  int stat = rSum(R, Ropp, Renv); /* takes care of qideals */
5556  if ( stat <=0 )
5557  WarnS("Error in rEnvelope at rSum");
5558  rTest(Renv);
5559  return Renv;
5560 }
ring rOpposite(ring src)
Definition: ring.cc:5219
#define WarnS
Definition: emacs.cc:78
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1346
#define rTest(r)
Definition: ring.h:780
#define NULL
Definition: omList.c:12
#define R
Definition: sirandom.c:26

◆ rEqual()

BOOLEAN rEqual ( ring  r1,
ring  r2,
BOOLEAN  qr = TRUE 
)

returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well

Definition at line 1660 of file ring.cc.

1661 {
1662  if (r1 == r2) return TRUE;
1663  if (r1 == NULL || r2 == NULL) return FALSE;
1664  if (r1->cf!=r2->cf) return FALSE;
1665  if (rVar(r1)!=rVar(r2)) return FALSE;
1666 
1667  if( !rSamePolyRep(r1, r2) )
1668  return FALSE;
1669 
1670  int i/*, j*/;
1671 
1672  for (i=0; i<rVar(r1); i++)
1673  {
1674  if ((r1->names[i] != NULL) && (r2->names[i] != NULL))
1675  {
1676  if (strcmp(r1->names[i], r2->names[i])) return FALSE;
1677  }
1678  else if ((r1->names[i] != NULL) ^ (r2->names[i] != NULL))
1679  {
1680  return FALSE;
1681  }
1682  }
1683 
1684  if (qr)
1685  {
1686  if (r1->qideal != NULL)
1687  {
1688  ideal id1 = r1->qideal, id2 = r2->qideal;
1689  int i, n;
1690  poly *m1, *m2;
1691 
1692  if (id2 == NULL) return FALSE;
1693  if ((n = IDELEMS(id1)) != IDELEMS(id2)) return FALSE;
1694 
1695  {
1696  m1 = id1->m;
1697  m2 = id2->m;
1698  for (i=0; i<n; i++)
1699  if (! p_EqualPolys(m1[i],m2[i], r1, r2)) return FALSE;
1700  }
1701  }
1702  else if (r2->qideal != NULL) return FALSE;
1703  }
1704 
1705  return TRUE;
1706 }
#define FALSE
Definition: auxiliary.h:94
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
#define TRUE
Definition: auxiliary.h:98
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:1708
int i
Definition: cfEzgcd.cc:125
Definition: qr.h:45
#define IDELEMS(i)
Definition: simpleideals.h:23
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4418
#define NULL
Definition: omList.c:12

◆ rField_has_simple_Alloc()

static BOOLEAN rField_has_simple_Alloc ( const ring  r)
inlinestatic

Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies.

Definition at line 547 of file ring.h.

548 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_Alloc(r->cf); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete/n_New are empty operations.
Definition: coeffs.h:928
#define NULL
Definition: omList.c:12

◆ rField_has_simple_inverse()

static BOOLEAN rField_has_simple_inverse ( const ring  r)
inlinestatic

Definition at line 543 of file ring.h.

544 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_inverse(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_has_simple_inverse(const coeffs r)
TRUE, if the computation of the inverse is fast, i.e. prefer leading coeff. 1 over content...
Definition: coeffs.h:924
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_has_Units()

static BOOLEAN rField_has_Units ( const ring  r)
inlinestatic

Definition at line 485 of file ring.h.

486 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_Units(r->cf); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
returns TRUE, if r is not a field and r has non-trivial units
Definition: coeffs.h:819
#define NULL
Definition: omList.c:12

◆ rField_is_Domain()

static BOOLEAN rField_is_Domain ( const ring  r)
inlinestatic

Definition at line 482 of file ring.h.

483 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Domain(r->cf); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_is_Domain(const coeffs r)
returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
Definition: coeffs.h:761
#define NULL
Definition: omList.c:12

◆ rField_is_GF() [1/2]

static BOOLEAN rField_is_GF ( const ring  r)
inlinestatic

Definition at line 516 of file ring.h.

517 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:861
#define NULL
Definition: omList.c:12

◆ rField_is_GF() [2/2]

static BOOLEAN rField_is_GF ( const ring  r,
int  q 
)
inlinestatic

Definition at line 519 of file ring.h.

520 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf, q); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:861
#define NULL
Definition: omList.c:12

◆ rField_is_long_C()

static BOOLEAN rField_is_long_C ( const ring  r)
inlinestatic

Definition at line 540 of file ring.h.

541 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_C(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
Definition: coeffs.h:916
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_long_R()

static BOOLEAN rField_is_long_R ( const ring  r)
inlinestatic

Definition at line 537 of file ring.h.

538 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_R(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
Definition: coeffs.h:913
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_numeric()

static BOOLEAN rField_is_numeric ( const ring  r)
inlinestatic

Definition at line 510 of file ring.h.

511 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_numeric(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition: coeffs.h:854
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Q()

static BOOLEAN rField_is_Q ( const ring  r)
inlinestatic

Definition at line 501 of file ring.h.

502 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:828
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Q_a()

static BOOLEAN rField_is_Q_a ( const ring  r)
inlinestatic

Definition at line 534 of file ring.h.

535 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q_a(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
Definition: coeffs.h:907
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_R()

static BOOLEAN rField_is_R ( const ring  r)
inlinestatic

Definition at line 513 of file ring.h.

514 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_R(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
Definition: coeffs.h:858
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Ring()

static BOOLEAN rField_is_Ring ( const ring  r)
inlinestatic

Definition at line 479 of file ring.h.

480 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Ring(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:752
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Ring_2toM()

static BOOLEAN rField_is_Ring_2toM ( const ring  r)
inlinestatic

Definition at line 473 of file ring.h.

474 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_2toM(r->cf) ); }
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
Definition: coeffs.h:746
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Ring_PtoM()

static BOOLEAN rField_is_Ring_PtoM ( const ring  r)
inlinestatic

Definition at line 476 of file ring.h.

477 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_PtoM(r->cf) ); }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
Definition: coeffs.h:749
#define NULL
Definition: omList.c:12

◆ rField_is_Z()

static BOOLEAN rField_is_Z ( const ring  r)
inlinestatic

Definition at line 504 of file ring.h.

505 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Z(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition: coeffs.h:838
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Zn()

static BOOLEAN rField_is_Zn ( const ring  r)
inlinestatic

Definition at line 507 of file ring.h.

508 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zn(r->cf); }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:848

◆ rField_is_Zp() [1/2]

static BOOLEAN rField_is_Zp ( const ring  r)
inlinestatic

Definition at line 495 of file ring.h.

496 { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp); }
{p < 2^31}
Definition: coeffs.h:30
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:12

◆ rField_is_Zp() [2/2]

static BOOLEAN rField_is_Zp ( const ring  r,
int  p 
)
inlinestatic

Definition at line 498 of file ring.h.

499 { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp) && (r->cf->ch == p); }
{p < 2^31}
Definition: coeffs.h:30
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:12
int p
Definition: cfModGcd.cc:4019

◆ rField_is_Zp_a() [1/2]

static BOOLEAN rField_is_Zp_a ( const ring  r)
inlinestatic

Definition at line 524 of file ring.h.

525 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf); }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition: coeffs.h:881
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rField_is_Zp_a() [2/2]

static BOOLEAN rField_is_Zp_a ( const ring  r,
int  p 
)
inlinestatic

Definition at line 529 of file ring.h.

530 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf, p); }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition: coeffs.h:881
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
int p
Definition: cfModGcd.cc:4019

◆ rFieldType()

n_coeffType rFieldType ( const ring  r)

Definition at line 5144 of file ring.cc.

5145 {
5146  return (r->cf->type);
5147  if (rField_is_Zp(r)) return n_Zp;
5148  if (rField_is_Q(r)) return n_Q;
5149  if (rField_is_R(r)) return n_R;
5150  if (rField_is_GF(r)) return n_GF;
5151  if (rField_is_long_R(r)) return n_long_R;
5152  if (rField_is_Zp_a(r)) return getCoeffType(r->cf);
5153  if (rField_is_Q_a(r)) return getCoeffType(r->cf);
5154  if (rField_is_long_C(r)) return n_long_C;
5155  if (rField_is_Z(r)) return n_Z;
5156  if (rField_is_Zn(r)) return n_Zn;
5157  if (rField_is_Ring_PtoM(r)) return n_Znm;
5158  if (rField_is_Ring_2toM(r)) return n_Z2m;
5159 
5160  return n_unknown;
5161 }
only used if HAVE_RINGS is defined
Definition: coeffs.h:45
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:524
only used if HAVE_RINGS is defined
Definition: coeffs.h:47
static BOOLEAN rField_is_Ring_PtoM(const ring r)
Definition: ring.h:476
static BOOLEAN rField_is_R(const ring r)
Definition: ring.h:513
rational (GMP) numbers
Definition: coeffs.h:31
{p < 2^31}
Definition: coeffs.h:30
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:534
static BOOLEAN rField_is_Zn(const ring r)
Definition: ring.h:507
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:516
static BOOLEAN rField_is_Z(const ring r)
Definition: ring.h:504
real floating point (GMP) numbers
Definition: coeffs.h:34
single prescision (6,6) real numbers
Definition: coeffs.h:32
only used if HAVE_RINGS is defined
Definition: coeffs.h:46
complex floating point (GMP) numbers
Definition: coeffs.h:42
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
static BOOLEAN rField_is_long_C(const ring r)
Definition: ring.h:540
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
static BOOLEAN rField_is_Ring_2toM(const ring r)
Definition: ring.h:473
{p^n < 2^16}
Definition: coeffs.h:33
static BOOLEAN rField_is_long_R(const ring r)
Definition: ring.h:537

◆ rGetCurrSyzLimit()

static int rGetCurrSyzLimit ( const ring  r)
inlinestatic

Definition at line 717 of file ring.h.

718 { assume(r != NULL); assume(r->cf != NULL); return (rIsSyzIndexRing(r)? r->typ[0].data.syz.limit : 0);}
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rGetExpSize()

unsigned long rGetExpSize ( unsigned long  bitmask,
int &  bits,
int  N 
)

Definition at line 2598 of file ring.cc.

2599 {
2600 #if SIZEOF_LONG == 8
2601  if (N<4) N=4;
2602 #else
2603  if (N<2) N=2;
2604 #endif
2605  bitmask =rGetExpSize(bitmask, bits);
2606  int vars_per_long=BIT_SIZEOF_LONG/bits;
2607  int bits1;
2608  loop
2609  {
2610  if (bits == BIT_SIZEOF_LONG-1)
2611  {
2612  bits = BIT_SIZEOF_LONG - 1;
2613  return LONG_MAX;
2614  }
2615  unsigned long bitmask1 =rGetExpSize(bitmask+1, bits1);
2616  int vars_per_long1=BIT_SIZEOF_LONG/bits1;
2617  if ((((N+vars_per_long-1)/vars_per_long) ==
2618  ((N+vars_per_long1-1)/vars_per_long1)))
2619  {
2620  vars_per_long=vars_per_long1;
2621  bits=bits1;
2622  bitmask=bitmask1;
2623  }
2624  else
2625  {
2626  return bitmask; /* and bits */
2627  }
2628  }
2629 }
#define loop
Definition: structs.h:80
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
static unsigned long rGetExpSize(unsigned long bitmask, int &bits)
Definition: ring.cc:2505
#define BIT_SIZEOF_LONG
Definition: auxiliary.h:78

◆ rGetISPos()

int rGetISPos ( const int  p,
const ring  r 
)

return the position of the p^th IS block order block in r->typ[]...

return the position of the p^th IS block order block in r->typ[]...

Definition at line 4930 of file ring.cc.

4931 {
4932  // Put the reference set F into the ring -ordering -recor
4933 #if MYTEST
4934  Print("rIsIS(p: %d)\nF:", p);
4935  PrintLn();
4936 #endif
4937 
4938  if (r->typ==NULL)
4939  {
4940 // dReportError("'rIsIS:' Error: wrong ring! (typ == NULL)");
4941  return -1;
4942  }
4943 
4944  int j = p; // Which IS record to use...
4945  for( int pos = 0; pos < r->OrdSize; pos++ )
4946  if( r->typ[pos].ord_typ == ro_is)
4947  if( j-- == 0 )
4948  return pos;
4949 
4950  return -1;
4951 }
int j
Definition: facHensel.cc:105
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
Definition: ring.h:61
#define NULL
Definition: omList.c:12
int p
Definition: cfModGcd.cc:4019

◆ rGetMaxSyzComp()

int rGetMaxSyzComp ( int  i,
const ring  r 
)

return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit

Definition at line 5088 of file ring.cc.

5089 {
5090  if ((r->typ!=NULL) && (r->typ[0].ord_typ==ro_syz) &&
5091  r->typ[0].data.syz.limit > 0 && i > 0)
5092  {
5093  assume(i <= r->typ[0].data.syz.limit);
5094  int j;
5095  for (j=0; j<r->typ[0].data.syz.limit; j++)
5096  {
5097  if (r->typ[0].data.syz.syz_index[j] == i &&
5098  r->typ[0].data.syz.syz_index[j+1] != i)
5099  {
5100  assume(r->typ[0].data.syz.syz_index[j+1] == i+1);
5101  return j;
5102  }
5103  }
5104  return r->typ[0].data.syz.limit;
5105  }
5106  else
5107  {
5108  #ifndef SING_NDEBUG
5109  WarnS("rGetMaxSyzComp: order c");
5110  #endif
5111  return 0;
5112  }
5113 }
int j
Definition: facHensel.cc:105
Definition: ring.h:60
#define WarnS
Definition: emacs.cc:78
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12

◆ rGetOrderType()

rOrderType_t rGetOrderType ( ring  r)

Definition at line 1749 of file ring.cc.

1750 {
1751  // check for simple ordering
1752  if (rHasSimpleOrder(r))
1753  {
1754  if ((r->order[1] == ringorder_c)
1755  || (r->order[1] == ringorder_C))
1756  {
1757  switch(r->order[0])
1758  {
1759  case ringorder_dp:
1760  case ringorder_wp:
1761  case ringorder_ds:
1762  case ringorder_ws:
1763  case ringorder_ls:
1764  case ringorder_unspec:
1765  if (r->order[1] == ringorder_C
1766  || r->order[0] == ringorder_unspec)
1767  return rOrderType_ExpComp;
1768  return rOrderType_Exp;
1769 
1770  default:
1771  assume(r->order[0] == ringorder_lp ||
1772  r->order[0] == ringorder_rs ||
1773  r->order[0] == ringorder_Dp ||
1774  r->order[0] == ringorder_Wp ||
1775  r->order[0] == ringorder_Ds ||
1776  r->order[0] == ringorder_Ws);
1777 
1778  if (r->order[1] == ringorder_c) return rOrderType_ExpComp;
1779  return rOrderType_Exp;
1780  }
1781  }
1782  else
1783  {
1784  assume((r->order[0]==ringorder_c)||(r->order[0]==ringorder_C));
1785  return rOrderType_CompExp;
1786  }
1787  }
1788  else
1789  return rOrderType_General;
1790 }
non-simple ordering as specified by currRing
Definition: ring.h:99
simple ordering, exponent vector has priority component is compatible with exp-vector order ...
Definition: ring.h:103
opposite of ls
Definition: ring.h:92
simple ordering, component has priority
Definition: ring.h:100
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1796
simple ordering, exponent vector has priority component not compatible with exp-vector order ...
Definition: ring.h:101
#define assume(x)
Definition: mod2.h:390

◆ rGetSComps()

void rGetSComps ( int **  currComponents,
long **  currShiftedComponents,
int *  length,
ring  r 
)

Definition at line 4371 of file ring.cc.

4372 {
4373 #ifdef PDEBUG
4374  rDBGetSComps(currComponents, currShiftedComponents, length, r);
4375 #else
4376  rNGetSComps(currComponents, currShiftedComponents, r);
4377 #endif
4378 }
static void rNGetSComps(int **currComponents, long **currShiftedComponents, ring r)
Definition: ring.cc:4332
long * currShiftedComponents
Definition: syz1.cc:34
static void rDBGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4350
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263

◆ rGetVar()

poly rGetVar ( const int  varIndex,
const ring  r 
)

Definition at line 5664 of file ring.cc.

5665 {
5666  poly p = p_ISet(1, r);
5667  p_SetExp(p, varIndex, 1, r);
5668  p_Setm(p, r);
5669  return p;
5670 }
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:487
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:232
int p
Definition: cfModGcd.cc:4019
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1287

◆ rGetWeightVec()

int64* rGetWeightVec ( const ring  r)

Definition at line 5163 of file ring.cc.

5164 {
5165  assume(r!=NULL);
5166  assume(r->OrdSize>0);
5167  int i=0;
5168  while((r->typ[i].ord_typ!=ro_wp64) && (r->typ[i].ord_typ>0)) i++;
5169  assume(r->typ[i].ord_typ==ro_wp64);
5170  return (int64*)(r->typ[i].data.wp64.weights64);
5171 }
long int64
Definition: auxiliary.h:66
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
Definition: ring.h:55

◆ rHas_c_Ordering()

BOOLEAN rHas_c_Ordering ( const ring  r)

Definition at line 1792 of file ring.cc.

1793 {
1794  return (r->order[0] == ringorder_c);
1795 }

◆ rHasGlobalOrdering()

BOOLEAN rHasGlobalOrdering ( const ring  r)
inline

Definition at line 754 of file ring.h.

754 { return (r->OrdSgn==1); }

◆ rHasLocalOrMixedOrdering()

BOOLEAN rHasLocalOrMixedOrdering ( const ring  r)
inline

Definition at line 755 of file ring.h.

755 { return (r->OrdSgn==-1); }

◆ rHasMixedOrdering()

BOOLEAN rHasMixedOrdering ( const ring  r)
inline

Definition at line 756 of file ring.h.

756 { return (r->MixedOrder); }

◆ rHasSimpleLexOrder()

BOOLEAN rHasSimpleLexOrder ( const ring  r)

returns TRUE, if simple lp or ls ordering

Definition at line 1828 of file ring.cc.

1829 {
1830  return rHasSimpleOrder(r) &&
1831  (r->order[0] == ringorder_ls ||
1832  r->order[0] == ringorder_lp ||
1833  r->order[1] == ringorder_ls ||
1834  r->order[1] == ringorder_lp);
1835 }
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1796

◆ rHasSimpleOrder()

BOOLEAN rHasSimpleOrder ( const ring  r)

Definition at line 1796 of file ring.cc.

1797 {
1798  if (r->order[0] == ringorder_unspec) return TRUE;
1799  int blocks = rBlocks(r) - 1;
1800  assume(blocks >= 1);
1801  if (blocks == 1) return TRUE;
1802 
1803  int s = 0;
1804  while( (s < blocks) && (r->order[s] == ringorder_IS) && (r->order[blocks-1] == ringorder_IS) )
1805  {
1806  s++;
1807  blocks--;
1808  }
1809 
1810  if ((blocks - s) > 2) return FALSE;
1811 
1812  assume( blocks == s + 2 );
1813 
1814  if (
1815  (r->order[s] != ringorder_c)
1816  && (r->order[s] != ringorder_C)
1817  && (r->order[s+1] != ringorder_c)
1818  && (r->order[s+1] != ringorder_C)
1819  )
1820  return FALSE;
1821  if ((r->order[s+1] == ringorder_M)
1822  || (r->order[s] == ringorder_M))
1823  return FALSE;
1824  return TRUE;
1825 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
static int rBlocks(ring r)
Definition: ring.h:562
#define assume(x)
Definition: mod2.h:390
Induced (Schreyer) ordering.
Definition: ring.h:93

◆ rHasTDeg()

BOOLEAN rHasTDeg ( const ring  r)

Definition at line 4470 of file ring.cc.

4471 {
4472  int i;
4473  if (r->typ!=NULL)
4474  {
4475  for(i=r->OrdSize-1;i>=0;i--)
4476  {
4477  if ((r->typ[i].ord_typ==ro_dp)
4478  && (r->typ[i].data.dp.start==1)
4479  && (r->typ[i].data.dp.end==r->N))
4480  {
4481  return TRUE;
4482  }
4483  }
4484  }
4485  return FALSE;
4486 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
Definition: ring.h:52

◆ rInternalChar()

static int rInternalChar ( const ring  r)
inlinestatic

Definition at line 683 of file ring.h.

684 {
685  assume(r != NULL);
686  const coeffs C = r->cf;
687  assume(C != NULL);
688  return C->ch;
689 }
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12

◆ rIsLPRing()

static BOOLEAN rIsLPRing ( const ring  r)
inlinestatic

Definition at line 408 of file ring.h.

409 {
410  assume(r != NULL);
411 #ifdef HAVE_SHIFTBBA
412  return (r->isLPring!=0);
413 #else
414  return FALSE;
415 #endif
416 }
#define FALSE
Definition: auxiliary.h:94
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rIsNCRing()

static BOOLEAN rIsNCRing ( const ring  r)
inlinestatic

Definition at line 418 of file ring.h.

419 {
420  return rIsLPRing(r) || rIsPluralRing(r);
421 }
static BOOLEAN rIsLPRing(const ring r)
Definition: ring.h:408
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397

◆ rIsPluralRing()

static BOOLEAN rIsPluralRing ( const ring  r)
inlinestatic

we must always have this test!

Definition at line 397 of file ring.h.

398 {
399  assume(r != NULL);
400 #ifdef HAVE_PLURAL
401  nc_struct *n;
402  return ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/;
403 #else
404  return FALSE;
405 #endif
406 }
#define FALSE
Definition: auxiliary.h:94
Definition: nc.h:67
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rIsPolyVar()

BOOLEAN rIsPolyVar ( int  i,
const ring  r 
)

returns TRUE if var(i) belongs to p-block

Definition at line 1945 of file ring.cc.

1946 {
1947  int i=0;
1948  while(r->order[i]!=0)
1949  {
1950  if((r->block0[i]<=v)
1951  && (r->block1[i]>=v))
1952  {
1953  switch(r->order[i])
1954  {
1955  case ringorder_a:
1956  return (r->wvhdl[i][v-r->block0[i]]>0);
1957  case ringorder_M:
1958  return 2; /*don't know*/
1959  case ringorder_a64: /* assume: all weight are non-negative!*/
1960  case ringorder_lp:
1961  case ringorder_rs:
1962  case ringorder_dp:
1963  case ringorder_Dp:
1964  case ringorder_wp:
1965  case ringorder_Wp:
1966  return TRUE;
1967  case ringorder_ls:
1968  case ringorder_ds:
1969  case ringorder_Ds:
1970  case ringorder_ws:
1971  case ringorder_Ws:
1972  return FALSE;
1973  default:
1974  break;
1975  }
1976  }
1977  i++;
1978  }
1979  return 3; /* could not find var v*/
1980 }
for int64 weights
Definition: ring.h:71
#define FALSE
Definition: auxiliary.h:94
opposite of ls
Definition: ring.h:92
#define TRUE
Definition: auxiliary.h:98
int i
Definition: cfEzgcd.cc:125
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37

◆ rIsRatGRing()

static BOOLEAN rIsRatGRing ( const ring  r)
inlinestatic

Definition at line 423 of file ring.h.

424 {
425  assume(r != NULL);
426 #ifdef HAVE_PLURAL
427  /* nc_struct *n; */
428  return (r != NULL) /* && ((n=r->GetNC()) != NULL) */
429  && (r->real_var_start>1);
430 #else
431  return FALSE;
432 #endif
433 }
#define FALSE
Definition: auxiliary.h:94
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rIsSyzIndexRing()

static BOOLEAN rIsSyzIndexRing ( const ring  r)
inlinestatic

Definition at line 714 of file ring.h.

715 { assume(r != NULL); assume(r->cf != NULL); return r->order[0] == ringorder_s;}
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
s?
Definition: ring.h:76

◆ rKillModified_Wp_Ring()

void rKillModified_Wp_Ring ( ring  r)

Definition at line 3008 of file ring.cc.

3009 {
3010  rUnComplete(r);
3011  omFree(r->order);
3012  omFree(r->block0);
3013  omFree(r->block1);
3014  omFree(r->wvhdl[0]);
3015  omFree(r->wvhdl);
3017 }
void rUnComplete(ring r)
Definition: ring.cc:3889
#define omFree(addr)
Definition: omAllocDecl.h:261
omBin sip_sring_bin
Definition: ring.cc:43
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

◆ rKillModifiedRing()

void rKillModifiedRing ( ring  r)

Definition at line 2998 of file ring.cc.

2999 {
3000  rUnComplete(r);
3001  omFree(r->order);
3002  omFree(r->block0);
3003  omFree(r->block1);
3004  omFree(r->wvhdl);
3006 }
void rUnComplete(ring r)
Definition: ring.cc:3889
#define omFree(addr)
Definition: omAllocDecl.h:261
omBin sip_sring_bin
Definition: ring.cc:43
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

◆ rMinpolyIsNULL()

static BOOLEAN rMinpolyIsNULL ( const ring  r)
inlinestatic

Tests whether '(r->cf->minpoly) == NULL'.

Definition at line 693 of file ring.h.

694 {
695  assume(r != NULL);
696  const coeffs C = r->cf;
697  assume(C != NULL);
698 
699  const BOOLEAN ret = nCoeff_is_algExt(C); // || nCoeff_is_GF(C) || nCoeff_is_long_C(C);
700 
701  if( ret )
702  {
703  assume( (C->extRing) != NULL );
704  BOOLEAN idIs0 (ideal h);
705  assume((!((C->extRing)->qideal==NULL)) && (!idIs0((C->extRing)->qideal)));
706  }
707 
708  // TODO: this leads to test fails (due to rDecompose?)
709  return !ret;
710 }
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:932
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12
static Poly * h
Definition: janet.cc:971
int BOOLEAN
Definition: auxiliary.h:85
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal

◆ rMinusVar()

ring rMinusVar ( const ring  r,
char *  v 
)

undo rPlusVar

Definition at line 5777 of file ring.cc.

5778 {
5779  if (r->order[2]!=0)
5780  {
5781  WerrorS("only for rings with an ordering of one block");
5782  return NULL;
5783  }
5784  int p;
5785  if((r->order[0]==ringorder_C)
5786  ||(r->order[0]==ringorder_c))
5787  p=1;
5788  else
5789  p=0;
5790  if((r->order[p]!=ringorder_dp)
5791  && (r->order[p]!=ringorder_Dp)
5792  && (r->order[p]!=ringorder_lp)
5793  && (r->order[p]!=ringorder_rp)
5794  && (r->order[p]!=ringorder_ds)
5795  && (r->order[p]!=ringorder_Ds)
5796  && (r->order[p]!=ringorder_ls))
5797  {
5798  WerrorS("ordering must be dp,Dp,lp,rp,ds,Ds or ls");
5799  return NULL;
5800  }
5801  ring R=rCopy0(r);
5802  int i=R->N;
5803  while(i>0)
5804  {
5805  if (strcmp(R->names[i],v)==0)
5806  {
5807  R->N--;
5808  omFree(R->names[i]);
5809  for(int j=i;j<R->N;j++) R->names[j]=R->names[j+1];
5810  R->names=(char**)omReallocSize(R->names,r->N*sizeof(char_ptr),R->N*sizeof(char_ptr));
5811  }
5812  else i--;
5813  }
5814  R->block1[p]=R->N;
5815  rComplete(R);
5816  return R;
5817 }
int j
Definition: facHensel.cc:105
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:220
char * char_ptr
Definition: structs.h:58
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:3394
#define omFree(addr)
Definition: omAllocDecl.h:261
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
int i
Definition: cfEzgcd.cc:125
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:12
#define R
Definition: sirandom.c:26
int p
Definition: cfModGcd.cc:4019

◆ rModify_a_to_A()

void rModify_a_to_A ( ring  r)

Definition at line 5641 of file ring.cc.

5644 {
5645  int i=0;
5646  int j;
5647  while(r->order[i]!=0)
5648  {
5649  if (r->order[i]==ringorder_a)
5650  {
5651  r->order[i]=ringorder_a64;
5652  int *w=r->wvhdl[i];
5653  int64 *w64=(int64 *)omAlloc((r->block1[i]-r->block0[i]+1)*sizeof(int64));
5654  for(j=r->block1[i]-r->block0[i];j>=0;j--)
5655  w64[j]=(int64)w[j];
5656  r->wvhdl[i]=(int*)w64;
5657  omFreeSize(w,(r->block1[i]-r->block0[i]+1)*sizeof(int));
5658  }
5659  i++;
5660  }
5661 }
int j
Definition: facHensel.cc:105
for int64 weights
Definition: ring.h:71
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
long int64
Definition: auxiliary.h:66
#define omAlloc(size)
Definition: omAllocDecl.h:210
int i
Definition: cfEzgcd.cc:125
const CanonicalForm & w
Definition: facAbsFact.cc:55

◆ rModifyRing()

ring rModifyRing ( ring  r,
BOOLEAN  omit_degree,
BOOLEAN  omit_comp,
unsigned long  exp_limit 
)

< How many induced ordering block do we have?

Definition at line 2638 of file ring.cc.

2641 {
2642  assume (r != NULL );
2643  assume (exp_limit > 1);
2644  BOOLEAN need_other_ring;
2645  BOOLEAN omitted_degree = FALSE;
2646 
2647  int iNeedInducedOrderingSetup = 0; ///< How many induced ordering block do we have?
2648  int bits;
2649 
2650  exp_limit=rGetExpSize(exp_limit, bits, r->N);
2651  need_other_ring = (exp_limit != r->bitmask);
2652 
2653  int nblocks=rBlocks(r);
2654  rRingOrder_t *order=(rRingOrder_t*)omAlloc0((nblocks+1)*sizeof(rRingOrder_t));
2655  int *block0=(int*)omAlloc0((nblocks+1)*sizeof(int));
2656  int *block1=(int*)omAlloc0((nblocks+1)*sizeof(int));
2657  int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int *));
2658 
2659  int i=0;
2660  int j=0; /* i index in r, j index in res */
2661 
2662  for( rRingOrder_t r_ord=r->order[i]; (r_ord != (rRingOrder_t)0) && (i < nblocks); j++, r_ord=r->order[++i])
2663  {
2664  BOOLEAN copy_block_index=TRUE;
2665 
2666  if (r->block0[i]==r->block1[i])
2667  {
2668  switch(r_ord)
2669  {
2670  case ringorder_wp:
2671  case ringorder_dp:
2672  case ringorder_Wp:
2673  case ringorder_Dp:
2674  r_ord=ringorder_lp;
2675  break;
2676  case ringorder_Ws:
2677  case ringorder_Ds:
2678  case ringorder_ws:
2679  case ringorder_ds:
2680  r_ord=ringorder_ls;
2681  break;
2682  default:
2683  break;
2684  }
2685  }
2686  switch(r_ord)
2687  {
2688  case ringorder_S:
2689  {
2690 #ifndef SING_NDEBUG
2691  Warn("Error: unhandled ordering in rModifyRing: ringorder_S = [%d]", r_ord);
2692 #endif
2693  order[j]=r_ord; /*r->order[i];*/
2694  break;
2695  }
2696  case ringorder_C:
2697  case ringorder_c:
2698  if (!try_omit_comp)
2699  {
2700  order[j]=r_ord; /*r->order[i]*/;
2701  }
2702  else
2703  {
2704  j--;
2705  need_other_ring=TRUE;
2706  try_omit_comp=FALSE;
2707  copy_block_index=FALSE;
2708  }
2709  break;
2710  case ringorder_wp:
2711  case ringorder_dp:
2712  case ringorder_ws:
2713  case ringorder_ds:
2714  if(!omit_degree)
2715  {
2716  order[j]=r_ord; /*r->order[i]*/;
2717  }
2718  else
2719  {
2720  order[j]=ringorder_rs;
2721  need_other_ring=TRUE;
2722  omit_degree=FALSE;
2723  omitted_degree = TRUE;
2724  }
2725  break;
2726  case ringorder_Wp:
2727  case ringorder_Dp:
2728  case ringorder_Ws:
2729  case ringorder_Ds:
2730  if(!omit_degree)
2731  {
2732  order[j]=r_ord; /*r->order[i];*/
2733  }
2734  else
2735  {
2736  order[j]=ringorder_lp;
2737  need_other_ring=TRUE;
2738  omit_degree=FALSE;
2739  omitted_degree = TRUE;
2740  }
2741  break;
2742  case ringorder_IS:
2743  {
2744  if (try_omit_comp)
2745  {
2746  // tried, but cannot omit component due to the ordering block [%d]: %d (ringorder_IS)", i, r_ord
2747  try_omit_comp = FALSE;
2748  }
2749  order[j]=r_ord; /*r->order[i];*/
2750  iNeedInducedOrderingSetup++;
2751  break;
2752  }
2753  case ringorder_s:
2754  {
2755  assume((i == 0) && (j == 0));
2756  if (try_omit_comp)
2757  {
2758  // tried, but cannot omit component due to the ordering block [%d]: %d (ringorder_s)", i, r_ord
2759  try_omit_comp = FALSE;
2760  }
2761  order[j]=r_ord; /*r->order[i];*/
2762  break;
2763  }
2764  default:
2765  order[j]=r_ord; /*r->order[i];*/
2766  break;
2767  }
2768  if (copy_block_index)
2769  {
2770  block0[j]=r->block0[i];
2771  block1[j]=r->block1[i];
2772  wvhdl[j]=r->wvhdl[i];
2773  }
2774 
2775  // order[j]=ringorder_no; // done by omAlloc0
2776  }
2777  if(!need_other_ring)
2778  {
2779  omFreeSize(order,(nblocks+1)*sizeof(rRingOrder_t));
2780  omFreeSize(block0,(nblocks+1)*sizeof(int));
2781  omFreeSize(block1,(nblocks+1)*sizeof(int));
2782  omFreeSize(wvhdl,(nblocks+1)*sizeof(int *));
2783  return r;
2784  }
2785  ring res=(ring)omAlloc0Bin(sip_sring_bin);
2786  *res = *r;
2787 
2788 #ifdef HAVE_PLURAL
2789  res->GetNC() = NULL;
2790 #endif
2791 
2792  // res->qideal, res->idroot ???
2793  res->wvhdl=wvhdl;
2794  res->order=order;
2795  res->block0=block0;
2796  res->block1=block1;
2797  res->bitmask=exp_limit;
2798  //int tmpref=r->cf->ref0;
2799  rComplete(res, 1);
2800  //r->cf->ref=tmpref;
2801 
2802  // adjust res->pFDeg: if it was changed globally, then
2803  // it must also be changed for new ring
2804  if (r->pFDegOrig != res->pFDegOrig &&
2806  {
2807  // still might need adjustment for weighted orderings
2808  // and omit_degree
2809  res->firstwv = r->firstwv;
2810  res->firstBlockEnds = r->firstBlockEnds;
2811  res->pFDeg = res->pFDegOrig = p_WFirstTotalDegree;
2812  }
2813  if (omitted_degree)
2814  res->pLDeg = r->pLDegOrig;
2815 
2816  rOptimizeLDeg(res); // also sets res->pLDegOrig
2817 
2818  // set syzcomp
2819  if (res->typ != NULL)
2820  {
2821  if( res->typ[0].ord_typ == ro_syz) // "s" Always on [0] place!
2822  {
2823  res->typ[0] = r->typ[0]; // Copy struct!? + setup the same limit!
2824 
2825  if (r->typ[0].data.syz.limit > 0)
2826  {
2827  res->typ[0].data.syz.syz_index
2828  = (int*) omAlloc((r->typ[0].data.syz.limit +1)*sizeof(int));
2829  memcpy(res->typ[0].data.syz.syz_index, r->typ[0].data.syz.syz_index,
2830  (r->typ[0].data.syz.limit +1)*sizeof(int));
2831  }
2832  }
2833 
2834  if( iNeedInducedOrderingSetup > 0 )
2835  {
2836  for(j = 0, i = 0; (i < nblocks) && (iNeedInducedOrderingSetup > 0); i++)
2837  if( res->typ[i].ord_typ == ro_is ) // Search for suffixes!
2838  {
2839  ideal F = idrHeadR(r->typ[i].data.is.F, r, res); // Copy F from r into res!
2840  assume(
2841  rSetISReference( res,
2842  F, // WILL BE COPIED!
2843  r->typ[i].data.is.limit,
2844  j++
2845  )
2846  );
2847  id_Delete(&F, res);
2848  iNeedInducedOrderingSetup--;
2849  }
2850  } // Process all induced Ordering blocks! ...
2851  }
2852  // the special case: homog (omit_degree) and 1 block rs: that is global:
2853  // it comes from dp
2854  res->OrdSgn=r->OrdSgn;
2855 
2856 
2857 #ifdef HAVE_PLURAL
2858  if (rIsPluralRing(r))
2859  {
2860  if ( nc_rComplete(r, res, false) ) // no qideal!
2861  {
2862 #ifndef SING_NDEBUG
2863  WarnS("error in nc_rComplete");
2864 #endif
2865  // cleanup?
2866 
2867 // rDelete(res);
2868 // return r;
2869 
2870  // just go on..
2871  }
2872 
2873  if( rIsSCA(r) )
2874  {
2875  if( !sca_Force(res, scaFirstAltVar(r), scaLastAltVar(r)) )
2876  WarnS("error in sca_Force!");
2877  }
2878  }
2879 #endif
2880 
2881  return res;
2882 }
int j
Definition: facHensel.cc:105
static void rOptimizeLDeg(ring r)
Definition: ring.cc:3094
Definition: ring.h:60
#define FALSE
Definition: auxiliary.h:94
opposite of ls
Definition: ring.h:92
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
BOOLEAN rOrd_is_WeightedDegree_Ordering(const ring r)
Definition: ring.cc:1936
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
ideal idrHeadR(ideal id, ring r, ring dest_r)
Copy leading terms of id[i] via prHeeadR into dest_r.
Definition: prCopy.cc:155
bool sca_Force(ring rGR, int b, int e)
Definition: sca.cc:1161
static int rBlocks(ring r)
Definition: ring.h:562
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
long p_WFirstTotalDegree(poly p, const ring r)
Definition: p_polys.cc:586
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
S?
Definition: ring.h:75
static unsigned long rGetExpSize(unsigned long bitmask, int &bits)
Definition: ring.cc:2505
static short scaFirstAltVar(ring r)
Definition: sca.h:18
Definition: ring.h:61
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:12
static short scaLastAltVar(ring r)
Definition: sca.h:25
BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p)
Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r...
Definition: ring.cc:4962
static bool rIsSCA(const ring r)
Definition: nc.h:190
s?
Definition: ring.h:76
int BOOLEAN
Definition: auxiliary.h:85
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define Warn
Definition: emacs.cc:77

◆ rModifyRing_Simple()

ring rModifyRing_Simple ( ring  r,
BOOLEAN  omit_degree,
BOOLEAN  omit_comp,
unsigned long  exp_limit,
BOOLEAN simple 
)

Definition at line 2933 of file ring.cc.

2934 {
2935  simple=TRUE;
2936  if (!rHasSimpleOrder(r))
2937  {
2938  simple=FALSE; // sorting needed
2939  assume (r != NULL );
2940  assume (exp_limit > 1);
2941  int bits;
2942 
2943  exp_limit=rGetExpSize(exp_limit, bits, r->N);
2944 
2945  int nblocks=1+(ommit_comp!=0);
2946  rRingOrder_t *order=(rRingOrder_t*)omAlloc0((nblocks+1)*sizeof(rRingOrder_t));
2947  int *block0=(int*)omAlloc0((nblocks+1)*sizeof(int));
2948  int *block1=(int*)omAlloc0((nblocks+1)*sizeof(int));
2949  int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int *));
2950 
2951  order[0]=ringorder_lp;
2952  block0[0]=1;
2953  block1[0]=r->N;
2954  if (!ommit_comp)
2955  {
2956  order[1]=ringorder_C;
2957  }
2958  ring res=(ring)omAlloc0Bin(sip_sring_bin);
2959  *res = *r;
2960 #ifdef HAVE_PLURAL
2961  res->GetNC() = NULL;
2962 #endif
2963  // res->qideal, res->idroot ???
2964  res->wvhdl=wvhdl;
2965  res->order=order;
2966  res->block0=block0;
2967  res->block1=block1;
2968  res->bitmask=exp_limit;
2969  //int tmpref=r->cf->ref;
2970  rComplete(res, 1);
2971  //r->cf->ref=tmpref;
2972 
2973 #ifdef HAVE_PLURAL
2974  if (rIsPluralRing(r))
2975  {
2976  if ( nc_rComplete(r, res, false) ) // no qideal!
2977  {
2978 #ifndef SING_NDEBUG
2979  WarnS("error in nc_rComplete");
2980 #endif
2981  // cleanup?
2982 
2983 // rDelete(res);
2984 // return r;
2985 
2986  // just go on..
2987  }
2988  }
2989 #endif
2990 
2991  rOptimizeLDeg(res);
2992 
2993  return res;
2994  }
2995  return rModifyRing(r, ommit_degree, ommit_comp, exp_limit);
2996 }
static void rOptimizeLDeg(ring r)
Definition: ring.cc:3094
#define FALSE
Definition: auxiliary.h:94
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
Definition: ring.cc:2638
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:78
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1796
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
static unsigned long rGetExpSize(unsigned long bitmask, int &bits)
Definition: ring.cc:2505
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:12
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rModifyRing_Wp()

ring rModifyRing_Wp ( ring  r,
int *  weights 
)

construct Wp, C ring

Definition at line 2885 of file ring.cc.

2886 {
2887  ring res=(ring)omAlloc0Bin(sip_sring_bin);
2888  *res = *r;
2889 #ifdef HAVE_PLURAL
2890  res->GetNC() = NULL;
2891 #endif
2892 
2893  /*weights: entries for 3 blocks: NULL*/
2894  res->wvhdl = (int **)omAlloc0(3 * sizeof(int *));
2895  /*order: Wp,C,0*/
2896  res->order = (rRingOrder_t *) omAlloc(3 * sizeof(rRingOrder_t *));
2897  res->block0 = (int *)omAlloc0(3 * sizeof(int *));
2898  res->block1 = (int *)omAlloc0(3 * sizeof(int *));
2899  /* ringorder Wp for the first block: var 1..r->N */
2900  res->order[0] = ringorder_Wp;
2901  res->block0[0] = 1;
2902  res->block1[0] = r->N;
2903  res->wvhdl[0] = weights;
2904  /* ringorder C for the second block: no vars */
2905  res->order[1] = ringorder_C;
2906  /* the last block: everything is 0 */
2907  res->order[2] = (rRingOrder_t)0;
2908 
2909  //int tmpref=r->cf->ref;
2910  rComplete(res, 1);
2911  //r->cf->ref=tmpref;
2912 #ifdef HAVE_PLURAL
2913  if (rIsPluralRing(r))
2914  {
2915  if ( nc_rComplete(r, res, false) ) // no qideal!
2916  {
2917 #ifndef SING_NDEBUG
2918  WarnS("error in nc_rComplete");
2919 #endif
2920  // cleanup?
2921 
2922 // rDelete(res);
2923 // return r;
2924 
2925  // just go on..
2926  }
2927  }
2928 #endif
2929  return res;
2930 }
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5563
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
CanonicalForm res
Definition: facAbsFact.cc:64
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:3394
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:12
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ rOpposite()

ring rOpposite ( ring  r)

Definition at line 5219 of file ring.cc.

5223 {
5224  if (src == NULL) return(NULL);
5225 
5226 #ifdef RDEBUG
5227  rTest(src);
5228 #endif
5229 
5230  //rChangeCurrRing(src);
5231 
5232 #ifdef RDEBUG
5233  rTest(src);
5234 // rWrite(src);
5235 // rDebugPrint(src);
5236 #endif
5237 
5238 
5239  ring r = rCopy0(src,FALSE); /* qideal will be deleted later on!!! */
5240 
5241  // change vars v1..vN -> vN..v1
5242  int i;
5243  int i2 = (rVar(r)-1)/2;
5244  for(i=i2; i>=0; i--)
5245  {
5246  // index: 0..N-1
5247  //Print("ex var names: %d <-> %d\n",i,rOppVar(r,i));
5248  // exchange names
5249  char *p;
5250  p = r->names[rVar(r)-1-i];
5251  r->names[rVar(r)-1-i] = r->names[i];
5252  r->names[i] = p;
5253  }
5254 // i2=(rVar(r)+1)/2;
5255 // for(int i=i2; i>0; i--)
5256 // {
5257 // // index: 1..N
5258 // //Print("ex var places: %d <-> %d\n",i,rVar(r)+1-i);
5259 // // exchange VarOffset
5260 // int t;
5261 // t=r->VarOffset[i];
5262 // r->VarOffset[i]=r->VarOffset[rOppVar(r,i)];
5263 // r->VarOffset[rOppVar(r,i)]=t;
5264 // }
5265  // change names:
5266  for (i=rVar(r)-1; i>=0; i--)
5267  {
5268  char *p=r->names[i];
5269  if(isupper(*p)) *p = tolower(*p);
5270  else *p = toupper(*p);
5271  }
5272  // change ordering: listing
5273  // change ordering: compare
5274 // for(i=0; i<r->OrdSize; i++)
5275 // {
5276 // int t,tt;
5277 // switch(r->typ[i].ord_typ)
5278 // {
5279 // case ro_dp:
5280 // //
5281 // t=r->typ[i].data.dp.start;
5282 // r->typ[i].data.dp.start=rOppVar(r,r->typ[i].data.dp.end);
5283 // r->typ[i].data.dp.end=rOppVar(r,t);
5284 // break;
5285 // case ro_wp:
5286 // case ro_wp_neg:
5287 // {
5288 // t=r->typ[i].data.wp.start;
5289 // r->typ[i].data.wp.start=rOppVar(r,r->typ[i].data.wp.end);
5290 // r->typ[i].data.wp.end=rOppVar(r,t);
5291 // // invert r->typ[i].data.wp.weights
5292 // rOppWeight(r->typ[i].data.wp.weights,
5293 // r->typ[i].data.wp.end-r->typ[i].data.wp.start);
5294 // break;
5295 // }
5296 // //case ro_wp64:
5297 // case ro_syzcomp:
5298 // case ro_syz:
5299 // WerrorS("not implemented in rOpposite");
5300 // // should not happen
5301 // break;
5302 //
5303 // case ro_cp:
5304 // t=r->typ[i].data.cp.start;
5305 // r->typ[i].data.cp.start=rOppVar(r,r->typ[i].data.cp.end);
5306 // r->typ[i].data.cp.end=rOppVar(r,t);
5307 // break;
5308 // case ro_none:
5309 // default:
5310 // Werror("unknown type in rOpposite(%d)",r->typ[i].ord_typ);
5311 // break;
5312 // }
5313 // }
5314  // Change order/block structures (needed for rPrint, rAdd etc.)
5315  int j=0;
5316  int l=rBlocks(src);
5317  for(i=0; src->order[i]!=0; i++)
5318  {
5319  switch (src->order[i])
5320  {
5321  case ringorder_c: /* c-> c */
5322  case ringorder_C: /* C-> C */
5323  case ringorder_no /*=0*/: /* end-of-block */
5324  r->order[j]=src->order[i];
5325  j++; break;
5326  case ringorder_lp: /* lp -> rp */
5327  r->order[j]=ringorder_rp;
5328  r->block0[j]=rOppVar(r, src->block1[i]);
5329  r->block1[j]=rOppVar(r, src->block0[i]);
5330  break;
5331  case ringorder_rp: /* rp -> lp */
5332  r->order[j]=ringorder_lp;
5333  r->block0[j]=rOppVar(r, src->block1[i]);
5334  r->block1[j]=rOppVar(r, src->block0[i]);
5335  break;
5336  case ringorder_dp: /* dp -> a(1..1),ls */
5337  {
5338  l=rRealloc1(r,l,j);
5339  r->order[j]=ringorder_a;
5340  r->block0[j]=rOppVar(r, src->block1[i]);
5341  r->block1[j]=rOppVar(r, src->block0[i]);
5342  r->wvhdl[j]=(int*)omAlloc((r->block1[j]-r->block0[j]+1)*sizeof(int));
5343  for(int k=r->block0[j]; k<=r->block1[j]; k++)
5344  r->wvhdl[j][k-r->block0[j]]=1;
5345  j++;
5346  r->order[j]=ringorder_ls;
5347  r->block0[j]=rOppVar(r, src->block1[i]);
5348  r->block1[j]=rOppVar(r, src->block0[i]);
5349  j++;
5350  break;
5351  }
5352  case ringorder_Dp: /* Dp -> a(1..1),rp */
5353  {
5354  l=rRealloc1(r,l,j);
5355  r->order[j]=ringorder_a;
5356  r->block0[j]=rOppVar(r, src->block1[i]);
5357  r->block1[j]=rOppVar(r, src->block0[i]);
5358  r->wvhdl[j]=(int*)omAlloc((r->block1[j]-r->block0[j]+1)*sizeof(int));
5359  for(int k=r->block0[j]; k<=r->block1[j]; k++)
5360  r->wvhdl[j][k-r->block0[j]]=1;
5361  j++;
5362  r->order[j]=ringorder_rp;
5363  r->block0[j]=rOppVar(r, src->block1[i]);
5364  r->block1[j]=rOppVar(r, src->block0[i]);
5365  j++;
5366  break;
5367  }
5368  case ringorder_wp: /* wp -> a(...),ls */
5369  {
5370  l=rRealloc1(r,l,j);
5371  r->order[j]=ringorder_a;
5372  r->block0[j]=rOppVar(r, src->block1[i]);
5373  r->block1[j]=rOppVar(r, src->block0[i]);
5374  r->wvhdl[j]=r->wvhdl[j+1]; r->wvhdl[j+1]=NULL;
5375  rOppWeight(r->wvhdl[j], r->block1[j]-r->block0[j]);
5376  j++;
5377  r->order[j]=ringorder_ls;
5378  r->block0[j]=rOppVar(r, src->block1[i]);
5379  r->block1[j]=rOppVar(r, src->block0[i]);
5380  j++;
5381  break;
5382  }
5383  case ringorder_Wp: /* Wp -> a(...),rp */
5384  {
5385  l=rRealloc1(r,l,j);
5386  r->order[j]=ringorder_a;
5387  r->block0[j]=rOppVar(r, src->block1[i]);
5388  r->block1[j]=rOppVar(r, src->block0[i]);
5389  r->wvhdl[j]=r->wvhdl[j+1]; r->wvhdl[j+1]=NULL;
5390  rOppWeight(r->wvhdl[j], r->block1[j]-r->block0[j]);
5391  j++;
5392  r->order[j]=ringorder_rp;
5393  r->block0[j]=rOppVar(r, src->block1[i]);
5394  r->block1[j]=rOppVar(r, src->block0[i]);
5395  j++;
5396  break;
5397  }
5398  case ringorder_M: /* M -> M */
5399  {
5400  r->order[j]=ringorder_M;
5401  r->block0[j]=rOppVar(r, src->block1[i]);
5402  r->block1[j]=rOppVar(r, src->block0[i]);
5403  int n=r->block1[j]-r->block0[j];
5404  /* M is a (n+1)x(n+1) matrix */
5405  for (int nn=0; nn<=n; nn++)
5406  {
5407  rOppWeight(&(r->wvhdl[j][nn*(n+1)]), n /*r->block1[j]-r->block0[j]*/);
5408  }
5409  j++;
5410  break;
5411  }
5412  case ringorder_a: /* a(...),ls -> wp/dp */
5413  {
5414  r->block0[j]=rOppVar(r, src->block1[i]);
5415  r->block1[j]=rOppVar(r, src->block0[i]);
5416  rOppWeight(r->wvhdl[j], r->block1[j]-r->block0[j]);
5417  if (src->order[i+1]==ringorder_ls)
5418  {
5419  r->order[j]=ringorder_wp;
5420  i++;
5421  //l=rReallocM1(r,l,j);
5422  }
5423  else
5424  {
5425  r->order[j]=ringorder_a;
5426  }
5427  j++;
5428  break;
5429  }
5430  // not yet done:
5431  case ringorder_ls:
5432  case ringorder_rs:
5433  case ringorder_ds:
5434  case ringorder_Ds:
5435  case ringorder_ws:
5436  case ringorder_Ws:
5437  case ringorder_am:
5438  case ringorder_a64:
5439  // should not occur:
5440  case ringorder_S:
5441  case ringorder_IS:
5442  case ringorder_s:
5443  case ringorder_aa:
5444  case ringorder_L:
5445  case ringorder_unspec:
5446  Werror("order %s not (yet) supported", rSimpleOrdStr(src->order[i]));
5447  break;
5448  }
5449  }
5450  rComplete(r);
5451 
5452 
5453 #ifdef RDEBUG
5454  rTest(r);
5455 #endif
5456 
5457  //rChangeCurrRing(r);
5458 
5459 #ifdef RDEBUG
5460  rTest(r);
5461 // rWrite(r);
5462 // rDebugPrint(r);
5463 #endif
5464 
5465 
5466 #ifdef HAVE_PLURAL
5467  // now, we initialize a non-comm structure on r
5468  if (rIsPluralRing(src))
5469  {
5470 // assume( currRing == r);
5471 
5472  int *perm = (int *)omAlloc0((rVar(r)+1)*sizeof(int));
5473  int *par_perm = NULL;
5474  nMapFunc nMap = n_SetMap(src->cf,r->cf);
5475  int ni,nj;
5476  for(i=1; i<=r->N; i++)
5477  {
5478  perm[i] = rOppVar(r,i);
5479  }
5480 
5481  matrix C = mpNew(rVar(r),rVar(r));
5482  matrix D = mpNew(rVar(r),rVar(r));
5483 
5484  for (i=1; i< rVar(r); i++)
5485  {
5486  for (j=i+1; j<=rVar(r); j++)
5487  {
5488  ni = r->N +1 - i;
5489  nj = r->N +1 - j; /* i<j ==> nj < ni */
5490 
5491  assume(MATELEM(src->GetNC()->C,i,j) != NULL);
5492  MATELEM(C,nj,ni) = p_PermPoly(MATELEM(src->GetNC()->C,i,j),perm,src,r, nMap,par_perm,rPar(src));
5493 
5494  if(MATELEM(src->GetNC()->D,i,j) != NULL)
5495  MATELEM(D,nj,ni) = p_PermPoly(MATELEM(src->GetNC()->D,i,j),perm,src,r, nMap,par_perm,rPar(src));
5496  }
5497  }
5498 
5499  id_Test((ideal)C, r);
5500  id_Test((ideal)D, r);
5501 
5502  if (nc_CallPlural(C, D, NULL, NULL, r, false, false, true, r)) // no qring setup!
5503  WarnS("Error initializing non-commutative multiplication!");
5504 
5505 #ifdef RDEBUG
5506  rTest(r);
5507 // rWrite(r);
5508 // rDebugPrint(r);
5509 #endif
5510 
5511  assume( r->GetNC()->IsSkewConstant == src->GetNC()->IsSkewConstant);
5512 
5513  omFreeSize((ADDRESS)perm,(rVar(r)+1)*sizeof(int));
5514  }
5515 #endif /* HAVE_PLURAL */
5516 
5517  /* now oppose the qideal for qrings */
5518  if (src->qideal != NULL)
5519  {
5520  id_Delete(&(r->qideal), r);
5521 
5522 #ifdef HAVE_PLURAL
5523  r->qideal = idOppose(src, src->qideal, r); // into the currRing: r
5524 #else
5525  r->qideal = id_Copy(src->qideal, r); // ?
5526 #endif
5527 
5528 #ifdef HAVE_PLURAL
5529  if( rIsPluralRing(r) )
5530  {
5531  nc_SetupQuotient(r);
5532 #ifdef RDEBUG
5533  rTest(r);
5534 // rWrite(r);
5535 // rDebugPrint(r);
5536 #endif
5537  }
5538 #endif
5539  }
5540 #ifdef HAVE_PLURAL
5541  if( rIsPluralRing(r) )
5542  assume( ncRingType(r) == ncRingType(src) );
5543 #endif
5544  rTest(r);
5545 
5546  return r;
5547 }
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:91
int j
Definition: facHensel.cc:105
#define D(A)
Definition: gentable.cc:131
for int64 weights
Definition: ring.h:71
#define FALSE
Definition: auxiliary.h:94
opposite of ls
Definition: ring.h:92
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:593
#define id_Test(A, lR)
Definition: simpleideals.h:79
static int rRealloc1(ring r, int size, int pos)
Definition: ring.cc:5183
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static void rOppWeight(int *w, int l)
Definition: ring.cc:5206
void * ADDRESS
Definition: auxiliary.h:133
int k
Definition: cfEzgcd.cc:92
#define rOppVar(R, I)
Definition: ring.cc:5217
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst)
opposes a module I from Rop to currRing(dst)
Definition: old.gring.cc:3407
static int rBlocks(ring r)
Definition: ring.h:562
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:4036
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:3394
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:77
#define rTest(r)
Definition: ring.h:780
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
S?
Definition: ring.h:75
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:721
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
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:2682
#define NULL
Definition: omList.c:12
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
int p
Definition: cfModGcd.cc:4019
s?
Definition: ring.h:76
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93
#define MATELEM(mat, i, j)
1-based access to matrix
Definition: matpol.h:29

◆ rOrd_is_Comp_dp()

static BOOLEAN rOrd_is_Comp_dp ( const ring  r)
inlinestatic

Definition at line 770 of file ring.h.

771 {
772  assume(r != NULL);
773  assume(r->cf != NULL);
774  return ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) &&
775  r->order[1] == ringorder_dp &&
776  r->order[2] == 0);
777 }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rOrd_is_Totaldegree_Ordering()

BOOLEAN rOrd_is_Totaldegree_Ordering ( const ring  r)

Definition at line 1922 of file ring.cc.

1923 {
1924  // Hmm.... what about Syz orderings?
1925  return (rVar(r) > 1 &&
1926  ((rHasSimpleOrder(r) &&
1927  (rOrder_is_DegOrdering((rRingOrder_t)r->order[0]) ||
1928  rOrder_is_DegOrdering(( rRingOrder_t)r->order[1]))) ||
1929  (rHasSimpleOrderAA(r) &&
1930  (rOrder_is_DegOrdering((rRingOrder_t)r->order[1]) ||
1931  ((r->order[1]!=0) &&
1932  rOrder_is_DegOrdering((rRingOrder_t)r->order[2]))))));
1933 }
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
BOOLEAN rOrder_is_DegOrdering(const rRingOrder_t order)
Definition: ring.cc:1837
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1796
BOOLEAN rHasSimpleOrderAA(ring r)
Definition: ring.cc:1871
rRingOrder_t
order stuff
Definition: ring.h:67

◆ rOrd_SetCompRequiresSetm()

BOOLEAN rOrd_SetCompRequiresSetm ( const ring  r)

return TRUE if p_SetComp requires p_Setm

Definition at line 1902 of file ring.cc.

1903 {
1904  if (r->typ != NULL)
1905  {
1906  int pos;
1907  for (pos=0;pos<r->OrdSize;pos++)
1908  {
1909  sro_ord* o=&(r->typ[pos]);
1910  if ( (o->ord_typ == ro_syzcomp)
1911  || (o->ord_typ == ro_syz)
1912  || (o->ord_typ == ro_is)
1913  || (o->ord_typ == ro_am)
1914  || (o->ord_typ == ro_isTemp))
1915  return TRUE;
1916  }
1917  }
1918  return FALSE;
1919 }
Definition: ring.h:60
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
ro_typ ord_typ
Definition: ring.h:220
Definition: ring.h:218
Definition: ring.h:61
Definition: ring.h:61
#define NULL
Definition: omList.c:12
Definition: ring.h:54

◆ rOrderName()

rRingOrder_t rOrderName ( char *  ordername)

Definition at line 508 of file ring.cc.

509 {
510  int order=ringorder_unspec;
511  while (order!= 0)
512  {
513  if (strcmp(ordername,rSimpleOrdStr(order))==0)
514  break;
515  order--;
516  }
517  if (order==0) Werror("wrong ring order `%s`",ordername);
518  omFree((ADDRESS)ordername);
519  return (rRingOrder_t)order;
520 }
void * ADDRESS
Definition: auxiliary.h:133
#define omFree(addr)
Definition: omAllocDecl.h:261
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:77
rRingOrder_t
order stuff
Definition: ring.h:67
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ rOrdStr()

char* rOrdStr ( ring  r)

Definition at line 522 of file ring.cc.

523 {
524  if ((r==NULL)||(r->order==NULL)) return omStrDup("");
525  int nblocks,l,i;
526 
527  for (nblocks=0; r->order[nblocks]; nblocks++);
528  nblocks--;
529 
530  StringSetS("");
531  for (l=0; ; l++)
532  {
533  StringAppendS((char *)rSimpleOrdStr(r->order[l]));
534  if (r->order[l] == ringorder_s)
535  {
536  StringAppend("(%d)",r->block0[l]);
537  }
538  else if (
539  (r->order[l] != ringorder_c)
540  && (r->order[l] != ringorder_C)
541  && (r->order[l] != ringorder_s)
542  && (r->order[l] != ringorder_S)
543  && (r->order[l] != ringorder_IS)
544  )
545  {
546  if (r->wvhdl[l]!=NULL)
547  {
548  #ifndef SING_NDEBUG
549  if((r->order[l] != ringorder_wp)
550  &&(r->order[l] != ringorder_Wp)
551  &&(r->order[l] != ringorder_ws)
552  &&(r->order[l] != ringorder_Ws)
553  &&(r->order[l] != ringorder_a)
554  &&(r->order[l] != ringorder_am)
555  &&(r->order[l] != ringorder_M))
556  {
557  Warn("should not have wvhdl entry at pos. %d",l);
558  StringAppend("(%d)",r->block1[l]-r->block0[l]+1);
559  }
560  else
561  #endif
562  {
563  StringAppendS("(");
564  for (int j= 0;
565  j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
566  j+=i+1)
567  {
568  char c=',';
569  if(r->order[l]==ringorder_a64)
570  {
571  int64 * w=(int64 *)r->wvhdl[l];
572  for (i = 0; i<r->block1[l]-r->block0[l]; i++)
573  {
574  StringAppend("%lld," ,w[i]);
575  }
576  StringAppend("%lld)" ,w[i]);
577  break;
578  }
579  else
580  {
581  for (i = 0; i<r->block1[l]-r->block0[l]; i++)
582  {
583  StringAppend("%d," ,r->wvhdl[l][i+j]);
584  }
585  }
586  if (r->order[l]!=ringorder_M)
587  {
588  StringAppend("%d)" ,r->wvhdl[l][i+j]);
589  break;
590  }
591  if (j+i+1==(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1))
592  c=')';
593  StringAppend("%d%c" ,r->wvhdl[l][i+j],c);
594  }
595  }
596  }
597  else
598  StringAppend("(%d)",r->block1[l]-r->block0[l]+1);
599  }
600  else if (r->order[l] == ringorder_IS)
601  {
602  assume( r->block0[l] == r->block1[l] );
603  const int s = r->block0[l];
604  assume( (-2 < s) && (s < 2) );
605 
606  StringAppend("(%d)", s);
607  }
608 
609  if (l==nblocks)
610  {
611  if (r->bitmask!=0xffff)
612  {
613  long mm=r->bitmask;
614  if (mm>MAX_INT_VAL) mm=MAX_INT_VAL;
615  StringAppend(",L(%ld)",mm);
616  }
617  return StringEndS();
618  }
619  StringAppendS(",");
620  }
621 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int j
Definition: facHensel.cc:105
for int64 weights
Definition: ring.h:71
long int64
Definition: auxiliary.h:66
const int MAX_INT_VAL
Definition: mylimits.h:12
char * StringEndS()
Definition: reporter.cc:151
#define assume(x)
Definition: mod2.h:390
void StringSetS(const char *st)
Definition: reporter.cc:128
for(int i=0;i<=n;i++) degsf[i]
Definition: cfEzgcd.cc:65
void StringAppendS(const char *st)
Definition: reporter.cc:107
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:77
#define StringAppend
Definition: emacs.cc:79
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
S?
Definition: ring.h:75
#define NULL
Definition: omList.c:12
const CanonicalForm & w
Definition: facAbsFact.cc:55
s?
Definition: ring.h:76
int l
Definition: cfEzgcd.cc:93
#define Warn
Definition: emacs.cc:77
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rPar()

static int rPar ( const ring  r)
inlinestatic

(r->cf->P)

Definition at line 593 of file ring.h.

594 {
595  assume(r != NULL);
596  const coeffs C = r->cf;
597  assume(C != NULL);
598 
599  return n_NumberOfParameters(C);
600 // if( nCoeff_is_Extension(C) )
601 // {
602 // const ring R = C->extRing;
603 // assume( R != NULL );
604 // return rVar( R );
605 // }
606 // else if (nCoeff_is_GF(C))
607 // {
608 // return 1;
609 // }
610 // else if (nCoeff_is_long_C(C))
611 // {
612 // return 1;
613 // }
614 // return 0;
615 }
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:796
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12

◆ rParameter()

static char const** rParameter ( const ring  r)
inlinestatic

(r->cf->parameter)

Definition at line 619 of file ring.h.

620 {
621  assume(r != NULL);
622  const coeffs C = r->cf;
623  assume(C != NULL);
624 
625  return n_ParameterNames(C);
626 // if( nCoeff_is_Extension(C) ) // only alg / trans. exts...
627 // {
628 // const ring R = C->extRing;
629 // assume( R != NULL );
630 // return R->names;
631 // }
632 // else if (nCoeff_is_GF(C))
633 // {
634 // return &(C->m_nfParameter);
635 // }
636 // else if (nCoeff_is_long_C(C))
637 // {
638 // return &(C->complex_parameter);
639 // }
640 // return NULL;
641 }
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:800
#define assume(x)
Definition: mod2.h:390
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12

◆ rParStr()

char* rParStr ( ring  r)

Definition at line 649 of file ring.cc.

650 {
651  if ((r==NULL)||(rParameter(r)==NULL)) return omStrDup("");
652 
653  char const * const * const params = rParameter(r);
654 
655  int i;
656  int l=2;
657 
658  for (i=0; i<rPar(r); i++)
659  {
660  l+=strlen(params[i])+1;
661  }
662  char *s=(char *)omAlloc((long)l);
663  s[0]='\0';
664  for (i=0; i<rPar(r)-1; i++)
665  {
666  strcat(s, params[i]);
667  strcat(s,",");
668  }
669  strcat(s, params[i]);
670  return s;
671 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:593
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:619
#define omAlloc(size)
Definition: omAllocDecl.h:210
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
int l
Definition: cfEzgcd.cc:93
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rPlusVar()

ring rPlusVar ( const ring  r,
char *  v,
int  left 
)

K[x],"y" -> K[x,y] resp. K[y,x].

Definition at line 5695 of file ring.cc.

5696 {
5697  if (r->order[2]!=0)
5698  {
5699  WerrorS("only for rings with an ordering of one block");
5700  return NULL;
5701  }
5702  int p;
5703  if((r->order[0]==ringorder_C)
5704  ||(r->order[0]==ringorder_c))
5705  p=1;
5706  else
5707  p=0;
5708  if((r->order[p]!=ringorder_dp)
5709  && (r->order[p]!=ringorder_Dp)
5710  && (r->order[p]!=ringorder_lp)
5711  && (r->order[p]!=ringorder_rp)
5712  && (r->order[p]!=ringorder_ds)
5713  && (r->order[p]!=ringorder_Ds)
5714  && (r->order[p]!=ringorder_ls))
5715  {
5716  WerrorS("ordering must be dp,Dp,lp,rp,ds,Ds or ls");
5717  return NULL;
5718  }
5719  for(int i=r->N-1;i>=0;i--)
5720  {
5721  if (strcmp(r->names[i],v)==0)
5722  {
5723  Werror("duplicate variable name >>%s<<",v);
5724  return NULL;
5725  }
5726  }
5727  ring R=rCopy0(r);
5728  char **names;
5729  #ifdef HAVE_SHIFTBBA
5730  if (rIsLPRing(r))
5731  {
5732  R->isLPring=r->isLPring+1;
5733  R->N=((r->N)/r->isLPring)+r->N;
5734  names=(char**)omAlloc(R->N*sizeof(char_ptr));
5735  if (left)
5736  {
5737  for(int b=0;b<((r->N)/r->isLPring);b++)
5738  {
5739  names[b*R->isLPring]=omStrDup(v);
5740  for(int i=R->isLPring-1;i>0;i--)
5741  names[i+b*R->isLPring]=R->names[i-1+b*r->isLPring];
5742  }
5743  }
5744  else
5745  {
5746  for(int b=0;b<((r->N)/r->isLPring);b++)
5747  {
5748  names[(b+1)*R->isLPring-1]=omStrDup(v);
5749  for(int i=R->isLPring-2;i>=0;i--)
5750  names[i+b*R->isLPring]=R->names[i+b*r->isLPring];
5751  }
5752  }
5753  }
5754  else
5755  #endif
5756  {
5757  R->N++;
5758  names=(char**)omAlloc(R->N*sizeof(char_ptr));
5759  if (left)
5760  {
5761  names[0]=omStrDup(v);
5762  for(int i=R->N-1;i>0;i--) names[i]=R->names[i-1];
5763  }
5764  else
5765  {
5766  names[R->N-1]=omStrDup(v);
5767  for(int i=R->N-2;i>=0;i--) names[i]=R->names[i];
5768  }
5769  }
5770  omFreeSize(R->names,r->N*sizeof(char_ptr));
5771  R->names=names;
5772  R->block1[p]=R->N;
5773  rComplete(R);
5774  return R;
5775 }
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void WerrorS(const char *s)
Definition: feFopen.cc:24
static BOOLEAN rIsLPRing(const ring r)
Definition: ring.h:408
#define omAlloc(size)
Definition: omAllocDecl.h:210
char * char_ptr
Definition: structs.h:58
CanonicalForm b
Definition: cfModGcd.cc:4044
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:3394
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1365
int i
Definition: cfEzgcd.cc:125
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:12
#define R
Definition: sirandom.c:26
int p
Definition: cfModGcd.cc:4019
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rRing_has_CompLastBlock()

BOOLEAN rRing_has_CompLastBlock ( ring  r)

Definition at line 5137 of file ring.cc.

5138 {
5139  assume(r != NULL);
5140  int lb = rBlocks(r) - 2;
5141  return (r->order[lb] == ringorder_c || r->order[lb] == ringorder_C);
5142 }
static int rBlocks(ring r)
Definition: ring.h:562
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rRing_is_Homog()

BOOLEAN rRing_is_Homog ( ring  r)

Definition at line 5115 of file ring.cc.

5116 {
5117  if (r == NULL) return FALSE;
5118  int i, j, nb = rBlocks(r);
5119  for (i=0; i<nb; i++)
5120  {
5121  if (r->wvhdl[i] != NULL)
5122  {
5123  int length = r->block1[i] - r->block0[i];
5124  int* wvhdl = r->wvhdl[i];
5125  if (r->order[i] == ringorder_M) length *= length;
5126  assume(omSizeOfAddr(wvhdl) >= length*sizeof(int));
5127 
5128  for (j=0; j< length; j++)
5129  {
5130  if (wvhdl[j] != 0 && wvhdl[j] != 1) return FALSE;
5131  }
5132  }
5133  }
5134  return TRUE;
5135 }
int j
Definition: facHensel.cc:105
#define FALSE
Definition: auxiliary.h:94
size_t omSizeOfAddr(const void *addr)
#define TRUE
Definition: auxiliary.h:98
static int rBlocks(ring r)
Definition: ring.h:562
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263

◆ rRingVar()

static char* rRingVar ( short  i,
const ring  r 
)
inlinestatic

Definition at line 571 of file ring.h.

572 {
573  assume(r != NULL); assume(r->cf != NULL); return r->names[i];
574 }
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12

◆ rSamePolyRep()

BOOLEAN rSamePolyRep ( ring  r1,
ring  r2 
)

returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analogue to rEqual but not so strict

Definition at line 1708 of file ring.cc.

1709 {
1710  int i, j;
1711 
1712  if (r1 == r2) return TRUE;
1713 
1714  if (r1 == NULL || r2 == NULL) return FALSE;
1715 
1716  if ((r1->cf != r2->cf)
1717  || (rVar(r1) != rVar(r2))
1718  || (r1->OrdSgn != r2->OrdSgn))
1719  return FALSE;
1720 
1721  i=0;
1722  while (r1->order[i] != 0)
1723  {
1724  if (r2->order[i] == 0) return FALSE;
1725  if ((r1->order[i] != r2->order[i])
1726  || (r1->block0[i] != r2->block0[i])
1727  || (r1->block1[i] != r2->block1[i]))
1728  return FALSE;
1729  if (r1->wvhdl[i] != NULL)
1730  {
1731  if (r2->wvhdl[i] == NULL)
1732  return FALSE;
1733  for (j=0; j<r1->block1[i]-r1->block0[i]+1; j++)
1734  if (r2->wvhdl[i][j] != r1->wvhdl[i][j])
1735  return FALSE;
1736  }
1737  else if (r2->wvhdl[i] != NULL) return FALSE;
1738  i++;
1739  }
1740  if (r2->order[i] != 0) return FALSE;
1741 
1742  // we do not check variable names
1743  // we do not check minpoly/minideal
1744  // we do not check qideal
1745 
1746  return TRUE;
1747 }
int j
Definition: facHensel.cc:105
#define FALSE
Definition: auxiliary.h:94
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
#define TRUE
Definition: auxiliary.h:98
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12

◆ rSetISReference()

BOOLEAN rSetISReference ( const ring  r,
const ideal  F,
const int  i = 0,
const int  p = 0 
)

Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r, we will DO a copy! We will use it AS IS! returns true is everything was allright!

Definition at line 4962 of file ring.cc.

4963 {
4964  // Put the reference set F into the ring -ordering -recor
4965 
4966  if (r->typ==NULL)
4967  {
4968  dReportError("Error: WRONG USE of rSetISReference: wrong ring! (typ == NULL)");
4969  return FALSE;
4970  }
4971 
4972 
4973  int pos = rGetISPos(p, r);
4974 
4975  if( pos == -1 )
4976  {
4977  dReportError("Error: WRONG USE of rSetISReference: specified ordering block was not found!!!" );
4978  return FALSE;
4979  }
4980 
4981 #if MYTEST
4982  if( i != r->typ[pos].data.is.limit )
4983  Print("Changing record on pos: %d\nOld limit: %d --->> New Limit: %d\n", pos, r->typ[pos].data.is.limit, i);
4984 #endif
4985 
4986  const ideal FF = idrHeadR(F, r, r); // id_Copy(F, r); // ???
4987 
4988 
4989  if( r->typ[pos].data.is.F != NULL)
4990  {
4991 #if MYTEST
4992  PrintS("Deleting old reference set F... \n"); // idShow(r->typ[pos].data.is.F, r); PrintLn();
4993 #endif
4994  id_Delete(&r->typ[pos].data.is.F, r);
4995  r->typ[pos].data.is.F = NULL;
4996  }
4997 
4998  assume(r->typ[pos].data.is.F == NULL);
4999 
5000  r->typ[pos].data.is.F = FF; // F is owened by ring now! TODO: delete at the end!
5001 
5002  r->typ[pos].data.is.limit = i; // First induced component
5003 
5004 #if MYTEST
5005  PrintS("New reference set FF : \n"); idShow(FF, r, r, 1); PrintLn();
5006 #endif
5007 
5008  return TRUE;
5009 }
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
#define FALSE
Definition: auxiliary.h:94
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
int rGetISPos(const int p, const ring r)
Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - ...
Definition: ring.cc:4930
ideal idrHeadR(ideal id, ring r, ring dest_r)
Copy leading terms of id[i] via prHeeadR into dest_r.
Definition: prCopy.cc:155
void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint)
Definition: simpleideals.cc:57
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
#define NULL
Definition: omList.c:12
int dReportError(const char *fmt,...)
Definition: dError.cc:43
int p
Definition: cfModGcd.cc:4019

◆ rSetSyzComp()

void rSetSyzComp ( int  k,
const ring  r 
)

Definition at line 5016 of file ring.cc.

5017 {
5018  if(k < 0)
5019  {
5020  dReportError("rSetSyzComp with negative limit!");
5021  return;
5022  }
5023 
5024  assume( k >= 0 );
5025  if (TEST_OPT_PROT) Print("{%d}", k);
5026  if ((r->typ!=NULL) && (r->typ[0].ord_typ==ro_syz))
5027  {
5028  r->block0[0]=r->block1[0] = k;
5029  if( k == r->typ[0].data.syz.limit )
5030  return; // nothing to do
5031 
5032  int i;
5033  if (r->typ[0].data.syz.limit == 0)
5034  {
5035  r->typ[0].data.syz.syz_index = (int*) omAlloc0((k+1)*sizeof(int));
5036  r->typ[0].data.syz.syz_index[0] = 0;
5037  r->typ[0].data.syz.curr_index = 1;
5038  }
5039  else
5040  {
5041  r->typ[0].data.syz.syz_index = (int*)
5042  omReallocSize(r->typ[0].data.syz.syz_index,
5043  (r->typ[0].data.syz.limit+1)*sizeof(int),
5044  (k+1)*sizeof(int));
5045  }
5046  for (i=r->typ[0].data.syz.limit + 1; i<= k; i++)
5047  {
5048  r->typ[0].data.syz.syz_index[i] =
5049  r->typ[0].data.syz.curr_index;
5050  }
5051  if(k < r->typ[0].data.syz.limit) // ?
5052  {
5053 #ifndef SING_NDEBUG
5054  Warn("rSetSyzComp called with smaller limit (%d) as before (%d)", k, r->typ[0].data.syz.limit);
5055 #endif
5056  r->typ[0].data.syz.curr_index = 1 + r->typ[0].data.syz.syz_index[k];
5057  }
5058 
5059 
5060  r->typ[0].data.syz.limit = k;
5061  r->typ[0].data.syz.curr_index++;
5062  }
5063  else if(
5064  (r->typ!=NULL) &&
5065  (r->typ[0].ord_typ==ro_isTemp)
5066  )
5067  {
5068 // (r->typ[currRing->typ[0].data.isTemp.suffixpos].data.is.limit == k)
5069 #ifndef SING_NDEBUG
5070  Warn("rSetSyzComp(%d) in an IS ring! Be careful!", k);
5071 #endif
5072  }
5073  else if (r->order[0]==ringorder_s)
5074  {
5075  r->block0[0] = r->block1[0] = k;
5076  }
5077  else if (r->order[0]!=ringorder_c)
5078  {
5079  dReportError("syzcomp in incompatible ring");
5080  }
5081 #ifdef PDEBUG
5082  extern int pDBsyzComp;
5083  pDBsyzComp=k;
5084 #endif
5085 }
int pDBsyzComp
Definition: ring.cc:5012
Definition: ring.h:60
#define Print
Definition: emacs.cc:80
#define TEST_OPT_PROT
Definition: options.h:102
int k
Definition: cfEzgcd.cc:92
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:220
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
Definition: ring.h:61
#define NULL
Definition: omList.c:12
int dReportError(const char *fmt,...)
Definition: dError.cc:43
s?
Definition: ring.h:76
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define Warn
Definition: emacs.cc:77

◆ rSetWeightVec()

void rSetWeightVec ( ring  r,
int64 wv 
)

Definition at line 5173 of file ring.cc.

5174 {
5175  assume(r!=NULL);
5176  assume(r->OrdSize>0);
5177  assume(r->typ[0].ord_typ==ro_wp64);
5178  memcpy(r->typ[0].data.wp64.weights64,wv,r->N*sizeof(int64));
5179 }
long int64
Definition: auxiliary.h:66
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
Definition: ring.h:55

◆ rShortOut()

static BOOLEAN rShortOut ( const ring  r)
inlinestatic

Definition at line 575 of file ring.h.

576 {
577  assume(r != NULL); return (r->ShortOut);
578 }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rSimpleOrdStr()

const char* rSimpleOrdStr ( int  ord)

Definition at line 77 of file ring.cc.

78 {
79  return ringorder_name[ord];
80 }
static const char *const ringorder_name[]
Definition: ring.cc:47

◆ rString()

char* rString ( ring  r)

Definition at line 673 of file ring.cc.

674 {
675  if ((r!=NULL)&&(r->cf!=NULL))
676  {
677  char *ch=rCharStr(r);
678  char *var=rVarStr(r);
679  char *ord=rOrdStr(r);
680  char *res=(char *)omAlloc(strlen(ch)+strlen(var)+strlen(ord)+9);
681  sprintf(res,"(%s),(%s),(%s)",ch,var,ord);
682  omFree((ADDRESS)ch);
683  omFree((ADDRESS)var);
684  omFree((ADDRESS)ord);
685  return res;
686  }
687  else
688  return omStrDup("undefined");
689 }
char * rVarStr(ring r)
Definition: ring.cc:623
void * ADDRESS
Definition: auxiliary.h:133
#define omAlloc(size)
Definition: omAllocDecl.h:210
CanonicalForm res
Definition: facAbsFact.cc:64
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:12
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
Definition: ring.cc:647
char * rOrdStr(ring r)
Definition: ring.cc:522
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rSum()

int rSum ( ring  r1,
ring  r2,
ring &  sum 
)

Definition at line 1346 of file ring.cc.

1347 {
1348  if ((r1==NULL)||(r2==NULL)
1349  ||(r1->cf==NULL)||(r2->cf==NULL))
1350  return -1;
1351  if (r1==r2)
1352  {
1353  sum=r1;
1354  r1->ref++;
1355  return 0;
1356  }
1357  return rSumInternal(r1,r2,sum,TRUE,FALSE);
1358 }
int rSumInternal(ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp)
returns -1 for not compatible, 1 for compatible (and sum) dp_dp:0: block ordering, 1: dp,dp, 2: aa(...),dp vartest: check for name conflicts
Definition: ring.cc:749
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
#define NULL
Definition: omList.c:12

◆ rSumInternal()

int rSumInternal ( ring  r1,
ring  r2,
ring &  sum,
BOOLEAN  vartest,
BOOLEAN  dp_dp 
)

returns -1 for not compatible, 1 for compatible (and sum) dp_dp:0: block ordering, 1: dp,dp, 2: aa(...),dp vartest: check for name conflicts

Definition at line 749 of file ring.cc.

750 {
751 
752  ip_sring tmpR;
753  memset(&tmpR,0,sizeof(tmpR));
754  /* check coeff. field =====================================================*/
755 
756  if (r1->cf==r2->cf)
757  {
758  tmpR.cf=nCopyCoeff(r1->cf);
759  }
760  else /* different type */
761  {
762  if (getCoeffType(r1->cf)==n_Zp)
763  {
764  if (getCoeffType(r2->cf)==n_Q)
765  {
766  tmpR.cf=nCopyCoeff(r1->cf);
767  }
768  else if (nCoeff_is_Extension(r2->cf) && rChar(r2) == rChar(r1))
769  {
770  /*AlgExtInfo extParam;
771  extParam.r = r2->cf->extRing;
772  extParam.i = r2->cf->extRing->qideal;*/
773  tmpR.cf=nCopyCoeff(r2->cf);
774  }
775  else
776  {
777  WerrorS("Z/p+...");
778  return -1;
779  }
780  }
781  else if ((getCoeffType(r1->cf)==n_Zn)||(getCoeffType(r1->cf)==n_Znm))
782  {
783  if (getCoeffType(r2->cf)==n_Q)
784  {
785  tmpR.cf=nCopyCoeff(r1->cf);
786  }
787  else if (nCoeff_is_Extension(r2->cf)
788  && (mpz_cmp(r1->cf->modNumber,r2->cf->extRing->cf->modNumber)==0))
789  { // covers transext.cc and algext.cc
790  tmpR.cf=nCopyCoeff(r2->cf);
791  }
792  else
793  {
794  WerrorS("Z/n+...");
795  return -1;
796  }
797  }
798  else if (getCoeffType(r1->cf)==n_R)
799  {
800  WerrorS("R+..");
801  return -1;
802  }
803  else if (getCoeffType(r1->cf)==n_Q)
804  {
805  if (getCoeffType(r2->cf)==n_Zp)
806  {
807  tmpR.cf=nCopyCoeff(r2->cf);
808  }
809  else if (nCoeff_is_Extension(r2->cf))
810  {
811  tmpR.cf=nCopyCoeff(r2->cf);
812  }
813  else
814  {
815  WerrorS("Q+...");
816  return -1;
817  }
818  }
819  else if (nCoeff_is_Extension(r1->cf))
820  {
821  if (r1->cf->extRing->cf==r2->cf)
822  {
823  tmpR.cf=nCopyCoeff(r1->cf);
824  }
825  else if (getCoeffType(r1->cf->extRing->cf)==n_Zp && getCoeffType(r2->cf)==n_Q) //r2->cf == n_Zp should have been handled above
826  {
827  tmpR.cf=nCopyCoeff(r1->cf);
828  }
829  else
830  {
831  WerrorS ("coeff sum of two extension fields not implemented");
832  return -1;
833  }
834  }
835  else
836  {
837  WerrorS("coeff sum not yet implemented");
838  return -1;
839  }
840  }
841  /* variable names ========================================================*/
842  int i,j,k;
843  int l=r1->N+r2->N;
844  char **names=(char **)omAlloc0(l*sizeof(char *));
845  k=0;
846 
847  // collect all varnames from r1, except those which are parameters
848  // of r2, or those which are the empty string
849  for (i=0;i<r1->N;i++)
850  {
851  BOOLEAN b=TRUE;
852 
853  if (*(r1->names[i]) == '\0')
854  b = FALSE;
855  else if ((rParameter(r2)!=NULL) && (strlen(r1->names[i])==1))
856  {
857  if (vartest)
858  {
859  for(j=0;j<rPar(r2);j++)
860  {
861  if (strcmp(r1->names[i],rParameter(r2)[j])==0)
862  {
863  b=FALSE;
864  break;
865  }
866  }
867  }
868  }
869 
870  if (b)
871  {
872  //Print("name : %d: %s\n",k,r1->names[i]);
873  names[k]=omStrDup(r1->names[i]);
874  k++;
875  }
876  //else
877  // Print("no name (par1) %s\n",r1->names[i]);
878  }
879  // Add variables from r2, except those which are parameters of r1
880  // those which are empty strings, and those which equal a var of r1
881  for(i=0;i<r2->N;i++)
882  {
883  BOOLEAN b=TRUE;
884 
885  if (*(r2->names[i]) == '\0')
886  b = FALSE;
887  else if ((rParameter(r1)!=NULL) && (strlen(r2->names[i])==1))
888  {
889  if (vartest)
890  {
891  for(j=0;j<rPar(r1);j++)
892  {
893  if (strcmp(r2->names[i],rParameter(r1)[j])==0)
894  {
895  b=FALSE;
896  break;
897  }
898  }
899  }
900  }
901 
902  if (b)
903  {
904  if (vartest)
905  {
906  for(j=0;j<r1->N;j++)
907  {
908  if (strcmp(r1->names[j],r2->names[i])==0)
909  {
910  b=FALSE;
911  break;
912  }
913  }
914  }
915  if (b)
916  {
917  //Print("name : %d : %s\n",k,r2->names[i]);
918  names[k]=omStrDup(r2->names[i]);
919  k++;
920  }
921  //else
922  // Print("no name (var): %s\n",r2->names[i]);
923  }
924  //else
925  // Print("no name (par): %s\n",r2->names[i]);
926  }
927  // check whether we found any vars at all
928  if (k == 0)
929  {
930  names[k]=omStrDup("");
931  k=1;
932  }
933  tmpR.N=k;
934  tmpR.names=names;
935  /* ordering *======================================================== */
936  tmpR.OrdSgn=0;
937  if ((dp_dp==2)
938  && (r1->OrdSgn==1)
939  && (r2->OrdSgn==1)
940 #ifdef HAVE_PLURAL
941  && !rIsPluralRing(r1) && !rIsPluralRing(r2)
942 #endif
943  )
944  {
945  tmpR.order=(rRingOrder_t*)omAlloc0(4*sizeof(rRingOrder_t));
946  tmpR.block0=(int*)omAlloc0(4*sizeof(int));
947  tmpR.block1=(int*)omAlloc0(4*sizeof(int));
948  tmpR.wvhdl=(int**) omAlloc0(4*sizeof(int**));
949  // ----
950  tmpR.block0[0] = 1;
951  tmpR.block1[0] = rVar(r1)+rVar(r2);
952  tmpR.order[0] = ringorder_aa;
953  tmpR.wvhdl[0]=(int*)omAlloc0((rVar(r1)+rVar(r2) + 1)*sizeof(int));
954  for(int i=0;i<rVar(r1);i++) tmpR.wvhdl[0][i]=1;
955  // ----
956  tmpR.block0[1] = 1;
957  tmpR.block1[1] = rVar(r1)+rVar(r2);
958  tmpR.order[1] = ringorder_dp;
959  // ----
960  tmpR.order[2] = ringorder_C;
961  }
962  else if (dp_dp
963 #ifdef HAVE_PLURAL
964  && !rIsPluralRing(r1) && !rIsPluralRing(r2)
965 #endif
966  )
967  {
968  tmpR.order=(rRingOrder_t*)omAlloc(4*sizeof(rRingOrder_t));
969  tmpR.block0=(int*)omAlloc0(4*sizeof(int));
970  tmpR.block1=(int*)omAlloc0(4*sizeof(int));
971  tmpR.wvhdl=(int**)omAlloc0(4*sizeof(int *));
972  tmpR.order[0]=ringorder_dp;
973  tmpR.block0[0]=1;
974  tmpR.block1[0]=rVar(r1);
975  if (r2->OrdSgn==1)
976  {
977  if ((r2->block0[0]==1)
978  && (r2->block1[0]==rVar(r2))
979  && ((r2->order[0]==ringorder_wp)
980  || (r2->order[0]==ringorder_Wp)
981  || (r2->order[0]==ringorder_Dp))
982  )
983  {
984  tmpR.order[1]=r2->order[0];
985  if (r2->wvhdl[0]!=NULL)
986  tmpR.wvhdl[1]=(int *)omMemDup(r2->wvhdl[0]);
987  }
988  else
989  tmpR.order[1]=ringorder_dp;
990  }
991  else
992  {
993  tmpR.order[1]=ringorder_ds;
994  tmpR.OrdSgn=-1;
995  }
996  tmpR.block0[1]=rVar(r1)+1;
997  tmpR.block1[1]=rVar(r1)+rVar(r2);
998  tmpR.order[2]=ringorder_C;
999  tmpR.order[3]=(rRingOrder_t)0;
1000  }
1001  else
1002  {
1003  if ((r1->order[0]==ringorder_unspec)
1004  && (r2->order[0]==ringorder_unspec))
1005  {
1006  tmpR.order=(rRingOrder_t*)omAlloc(3*sizeof(rRingOrder_t));
1007  tmpR.block0=(int*)omAlloc(3*sizeof(int));
1008  tmpR.block1=(int*)omAlloc(3*sizeof(int));
1009  tmpR.wvhdl=(int**)omAlloc0(3*sizeof(int *));
1010  tmpR.order[0]=ringorder_unspec;
1011  tmpR.order[1]=ringorder_C;
1012  tmpR.order[2]=(rRingOrder_t)0;
1013  tmpR.block0[0]=1;
1014  tmpR.block1[0]=tmpR.N;
1015  }
1016  else if (l==k) /* r3=r1+r2 */
1017  {
1018  int b;
1019  ring rb;
1020  if (r1->order[0]==ringorder_unspec)
1021  {
1022  /* extend order of r2 to r3 */
1023  b=rBlocks(r2);
1024  rb=r2;
1025  tmpR.OrdSgn=r2->OrdSgn;
1026  }
1027  else if (r2->order[0]==ringorder_unspec)
1028  {
1029  /* extend order of r1 to r3 */
1030  b=rBlocks(r1);
1031  rb=r1;
1032  tmpR.OrdSgn=r1->OrdSgn;
1033  }
1034  else
1035  {
1036  b=rBlocks(r1)+rBlocks(r2)-2; /* for only one order C, only one 0 */
1037  rb=NULL;
1038  }
1039  tmpR.order=(rRingOrder_t*)omAlloc0(b*sizeof(rRingOrder_t));
1040  tmpR.block0=(int*)omAlloc0(b*sizeof(int));
1041  tmpR.block1=(int*)omAlloc0(b*sizeof(int));
1042  tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int *));
1043  /* weights not implemented yet ...*/
1044  if (rb!=NULL)
1045  {
1046  for (i=0;i<b;i++)
1047  {
1048  tmpR.order[i]=rb->order[i];
1049  tmpR.block0[i]=rb->block0[i];
1050  tmpR.block1[i]=rb->block1[i];
1051  if (rb->wvhdl[i]!=NULL)
1052  WarnS("rSum: weights not implemented");
1053  }
1054  tmpR.block0[0]=1;
1055  }
1056  else /* ring sum for complete rings */
1057  {
1058  for (i=0;r1->order[i]!=0;i++)
1059  {
1060  tmpR.order[i]=r1->order[i];
1061  tmpR.block0[i]=r1->block0[i];
1062  tmpR.block1[i]=r1->block1[i];
1063  if (r1->wvhdl[i]!=NULL)
1064  tmpR.wvhdl[i] = (int*) omMemDup(r1->wvhdl[i]);
1065  }
1066  j=i;
1067  i--;
1068  if ((r1->order[i]==ringorder_c)
1069  ||(r1->order[i]==ringorder_C))
1070  {
1071  j--;
1072  tmpR.order[b-2]=r1->order[i];
1073  }
1074  for (i=0;r2->order[i]!=0;i++)
1075  {
1076  if ((r2->order[i]!=ringorder_c)
1077  &&(r2->order[i]!=ringorder_C))
1078  {
1079  tmpR.order[j]=r2->order[i];
1080  tmpR.block0[j]=r2->block0[i]+rVar(r1);
1081  tmpR.block1[j]=r2->block1[i]+rVar(r1);
1082  if (r2->wvhdl[i]!=NULL)
1083  {
1084  tmpR.wvhdl[j] = (int*) omMemDup(r2->wvhdl[i]);
1085  }
1086  j++;
1087  }
1088  }
1089  if((r1->OrdSgn==-1)||(r2->OrdSgn==-1))
1090  tmpR.OrdSgn=-1;
1091  }
1092  }
1093  else if ((k==rVar(r1)) && (k==rVar(r2))) /* r1 and r2 are "quite"
1094  the same ring */
1095  /* copy r1, because we have the variables from r1 */
1096  {
1097  int b=rBlocks(r1);
1098 
1099  tmpR.order=(rRingOrder_t*)omAlloc0(b*sizeof(rRingOrder_t));
1100  tmpR.block0=(int*)omAlloc0(b*sizeof(int));
1101  tmpR.block1=(int*)omAlloc0(b*sizeof(int));
1102  tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int *));
1103  /* weights not implemented yet ...*/
1104  for (i=0;i<b;i++)
1105  {
1106  tmpR.order[i]=r1->order[i];
1107  tmpR.block0[i]=r1->block0[i];
1108  tmpR.block1[i]=r1->block1[i];
1109  if (r1->wvhdl[i]!=NULL)
1110  {
1111  tmpR.wvhdl[i] = (int*) omMemDup(r1->wvhdl[i]);
1112  }
1113  }
1114  tmpR.OrdSgn=r1->OrdSgn;
1115  }
1116  else
1117  {
1118  for(i=0;i<k;i++) omFree((ADDRESS)tmpR.names[i]);
1119  omFreeSize((ADDRESS)names,tmpR.N*sizeof(char *));
1120  Werror("variables must not overlap (# of vars: %d,%d -> %d)",rVar(r1),rVar(r2),k);
1121  return -1;
1122  }
1123  }
1124  tmpR.bitmask=si_max(r1->bitmask,r2->bitmask);
1125  sum=(ring)omAllocBin(sip_sring_bin);
1126  memcpy(sum,&tmpR,sizeof(ip_sring));
1127  rComplete(sum);
1128 
1129 //#ifdef RDEBUG
1130 // rDebugPrint(sum);
1131 //#endif
1132 
1133 
1134 
1135 #ifdef HAVE_PLURAL
1136  if(1)
1137  {
1138 // ring old_ring = currRing;
1139 
1140  BOOLEAN R1_is_nc = rIsPluralRing(r1);
1141  BOOLEAN R2_is_nc = rIsPluralRing(r2);
1142 
1143  if ( (R1_is_nc) || (R2_is_nc))
1144  {
1145  ring R1 = nc_rCreateNCcomm_rCopy(r1);
1146  assume( rIsPluralRing(R1) );
1147 
1148 #if 0
1149 #ifdef RDEBUG
1150  rWrite(R1);
1151  rDebugPrint(R1);
1152 #endif
1153 #endif
1154  ring R2 = nc_rCreateNCcomm_rCopy(r2);
1155 #if 0
1156 #ifdef RDEBUG
1157  rWrite(R2);
1158  rDebugPrint(R2);
1159 #endif
1160 #endif
1161 
1162 // rChangeCurrRing(sum); // ?
1163 
1164  // Projections from R_i into Sum:
1165  /* multiplication matrices business: */
1166  /* find permutations of vars and pars */
1167  int *perm1 = (int *)omAlloc0((rVar(R1)+1)*sizeof(int));
1168  int *par_perm1 = NULL;
1169  if (rPar(R1)!=0) par_perm1=(int *)omAlloc0((rPar(R1)+1)*sizeof(int));
1170 
1171  int *perm2 = (int *)omAlloc0((rVar(R2)+1)*sizeof(int));
1172  int *par_perm2 = NULL;
1173  if (rPar(R2)!=0) par_perm2=(int *)omAlloc0((rPar(R2)+1)*sizeof(int));
1174 
1175  maFindPerm(R1->names, rVar(R1), rParameter(R1), rPar(R1),
1176  sum->names, rVar(sum), rParameter(sum), rPar(sum),
1177  perm1, par_perm1, sum->cf->type);
1178 
1179  maFindPerm(R2->names, rVar(R2), rParameter(R2), rPar(R2),
1180  sum->names, rVar(sum), rParameter(sum), rPar(sum),
1181  perm2, par_perm2, sum->cf->type);
1182 
1183 
1184  matrix C1 = R1->GetNC()->C, C2 = R2->GetNC()->C;
1185  matrix D1 = R1->GetNC()->D, D2 = R2->GetNC()->D;
1186 
1187  // !!!! BUG? C1 and C2 might live in different baserings!!!
1188 
1189  int l = rVar(R1) + rVar(R2);
1190 
1191  matrix C = mpNew(l,l);
1192  matrix D = mpNew(l,l);
1193 
1194  for (i = 1; i <= rVar(R1); i++)
1195  for (j= rVar(R1)+1; j <= l; j++)
1196  MATELEM(C,i,j) = p_One(sum); // in 'sum'
1197 
1198  id_Test((ideal)C, sum);
1199 
1200  nMapFunc nMap1 = n_SetMap(R1->cf,sum->cf); /* can change something global: not usable
1201  after the next nSetMap call :( */
1202  // Create blocked C and D matrices:
1203  for (i=1; i<= rVar(R1); i++)
1204  for (j=i+1; j<=rVar(R1); j++)
1205  {
1206  assume(MATELEM(C1,i,j) != NULL);
1207  MATELEM(C,i,j) = p_PermPoly(MATELEM(C1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1)); // need ADD + CMP ops.
1208 
1209  if (MATELEM(D1,i,j) != NULL)
1210  MATELEM(D,i,j) = p_PermPoly(MATELEM(D1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1));
1211  }
1212 
1213  id_Test((ideal)C, sum);
1214  id_Test((ideal)D, sum);
1215 
1216 
1217  nMapFunc nMap2 = n_SetMap(R2->cf,sum->cf); /* can change something global: not usable
1218  after the next nSetMap call :( */
1219  for (i=1; i<= rVar(R2); i++)
1220  for (j=i+1; j<=rVar(R2); j++)
1221  {
1222  assume(MATELEM(C2,i,j) != NULL);
1223  MATELEM(C,rVar(R1)+i,rVar(R1)+j) = p_PermPoly(MATELEM(C2,i,j),perm2,R2,sum, nMap2,par_perm2,rPar(R2));
1224 
1225  if (MATELEM(D2,i,j) != NULL)
1226  MATELEM(D,rVar(R1)+i,rVar(R1)+j) = p_PermPoly(MATELEM(D2,i,j),perm2,R2,sum, nMap2,par_perm2,rPar(R2));
1227  }
1228 
1229  id_Test((ideal)C, sum);
1230  id_Test((ideal)D, sum);
1231 
1232  // Now sum is non-commutative with blocked structure constants!
1233  if (nc_CallPlural(C, D, NULL, NULL, sum, false, false, true, sum))
1234  WarnS("Error initializing non-commutative multiplication!");
1235 
1236  /* delete R1, R2*/
1237 
1238 #if 0
1239 #ifdef RDEBUG
1240  rWrite(sum);
1241  rDebugPrint(sum);
1242 
1243  Print("\nRefs: R1: %d, R2: %d\n", R1->GetNC()->ref, R2->GetNC()->ref);
1244 
1245 #endif
1246 #endif
1247 
1248 
1249  rDelete(R1);
1250  rDelete(R2);
1251 
1252  /* delete perm arrays */
1253  if (perm1!=NULL) omFree((ADDRESS)perm1);
1254  if (perm2!=NULL) omFree((ADDRESS)perm2);
1255  if (par_perm1!=NULL) omFree((ADDRESS)par_perm1);
1256  if (par_perm2!=NULL) omFree((ADDRESS)par_perm2);
1257 
1258 // rChangeCurrRing(old_ring);
1259  }
1260 
1261  }
1262 #endif
1263 
1264  ideal Q=NULL;
1265  ideal Q1=NULL, Q2=NULL;
1266  if (r1->qideal!=NULL)
1267  {
1268 // rChangeCurrRing(sum);
1269 // if (r2->qideal!=NULL)
1270 // {
1271 // WerrorS("todo: qring+qring");
1272 // return -1;
1273 // }
1274 // else
1275 // {}
1276  /* these were defined in the Plural Part above... */
1277  int *perm1 = (int *)omAlloc0((rVar(r1)+1)*sizeof(int));
1278  int *par_perm1 = NULL;
1279  if (rPar(r1)!=0) par_perm1=(int *)omAlloc0((rPar(r1)+1)*sizeof(int));
1280  maFindPerm(r1->names, rVar(r1), rParameter(r1), rPar(r1),
1281  sum->names, rVar(sum), rParameter(sum), rPar(sum),
1282  perm1, par_perm1, sum->cf->type);
1283  nMapFunc nMap1 = n_SetMap(r1->cf,sum->cf);
1284  Q1 = idInit(IDELEMS(r1->qideal),1);
1285 
1286  for (int for_i=0;for_i<IDELEMS(r1->qideal);for_i++)
1287  Q1->m[for_i] = p_PermPoly(
1288  r1->qideal->m[for_i], perm1,
1289  r1, sum,
1290  nMap1,
1291  par_perm1, rPar(r1));
1292 
1293  omFree((ADDRESS)perm1);
1294  }
1295 
1296  if (r2->qideal!=NULL)
1297  {
1298  //if (currRing!=sum)
1299  // rChangeCurrRing(sum);
1300  int *perm2 = (int *)omAlloc0((rVar(r2)+1)*sizeof(int));
1301  int *par_perm2 = NULL;
1302  if (rPar(r2)!=0) par_perm2=(int *)omAlloc0((rPar(r2)+1)*sizeof(int));
1303  maFindPerm(r2->names, rVar(r2), rParameter(r2), rPar(r2),
1304  sum->names, rVar(sum), rParameter(sum), rPar(sum),
1305  perm2, par_perm2, sum->cf->type);
1306  nMapFunc nMap2 = n_SetMap(r2->cf,sum->cf);
1307  Q2 = idInit(IDELEMS(r2->qideal),1);
1308 
1309  for (int for_i=0;for_i<IDELEMS(r2->qideal);for_i++)
1310  Q2->m[for_i] = p_PermPoly(
1311  r2->qideal->m[for_i], perm2,
1312  r2, sum,
1313  nMap2,
1314  par_perm2, rPar(r2));
1315 
1316  omFree((ADDRESS)perm2);
1317  }
1318  if (Q1!=NULL)
1319  {
1320  if ( Q2!=NULL)
1321  Q = id_SimpleAdd(Q1,Q2,sum);
1322  else
1323  Q=id_Copy(Q1,sum);
1324  }
1325  else
1326  {
1327  if ( Q2!=NULL)
1328  Q = id_Copy(Q2,sum);
1329  else
1330  Q=NULL;
1331  }
1332  sum->qideal = Q;
1333 
1334 #ifdef HAVE_PLURAL
1335  if( rIsPluralRing(sum) )
1336  nc_SetupQuotient( sum );
1337 #endif
1338  return 1;
1339 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:91
unsigned long bitmask
Definition: ring.h:349
int j
Definition: facHensel.cc:105
int ** wvhdl
Definition: ring.h:257
#define D(A)
Definition: gentable.cc:131
#define omMemDup(s)
Definition: omAllocDecl.h:264
#define Print
Definition: emacs.cc:80
only used if HAVE_RINGS is defined
Definition: coeffs.h:45
short OrdSgn
Definition: ring.h:305
char ** names
Definition: ring.h:258
#define FALSE
Definition: auxiliary.h:94
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:593
#define id_Test(A, lR)
Definition: simpleideals.h:79
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3429
rational (GMP) numbers
Definition: coeffs.h:31
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
{p < 2^31}
Definition: coeffs.h:30
int rChar(ring r)
Definition: ring.cc:713
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
Definition: ring.h:247
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:133
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:92
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:619
#define Q
Definition: sirandom.c:25
#define WarnS
Definition: emacs.cc:78
#define omAlloc(size)
Definition: omAllocDecl.h:210
rRingOrder_t * order
Definition: ring.h:253
single prescision (6,6) real numbers
Definition: coeffs.h:32
CanonicalForm b
Definition: cfModGcd.cc:4044
static int rBlocks(ring r)
Definition: ring.h:562
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:4036
poly p_One(const ring r)
Definition: p_polys.cc:1303
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:3394
only used if HAVE_RINGS is defined
Definition: coeffs.h:46
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
n_Procs_s * cf
Definition: ring.h:365
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int * block0
Definition: ring.h:254
rRingOrder_t
order stuff
Definition: ring.h:67
omBin sip_sring_bin
Definition: ring.cc:43
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
void rDebugPrint(const ring r)
Definition: ring.cc:4041
int i
Definition: cfEzgcd.cc:125
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:226
#define IDELEMS(i)
Definition: simpleideals.h:23
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:721
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:429
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
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:2682
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition: maps.cc:163
#define NULL
Definition: omList.c:12
short N
Definition: ring.h:303
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
ring nc_rCreateNCcomm_rCopy(ring r)
Definition: ring.cc:719
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:868
int BOOLEAN
Definition: auxiliary.h:85
ideal id_SimpleAdd(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93
int * block1
Definition: ring.h:255
#define MATELEM(mat, i, j)
1-based access to matrix
Definition: matpol.h:29
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rTypeOfMatrixOrder()

int rTypeOfMatrixOrder ( const intvec order)

Definition at line 185 of file ring.cc.

186 {
187  int i=0,j,typ=1;
188  int sz = (int)sqrt((double)(order->length()-2));
189  if ((sz*sz)!=(order->length()-2))
190  {
191  WerrorS("Matrix order is not a square matrix");
192  typ=0;
193  }
194  while ((i<sz) && (typ==1))
195  {
196  j=0;
197  while ((j<sz) && ((*order)[j*sz+i+2]==0)) j++;
198  if (j>=sz)
199  {
200  typ = 0;
201  WerrorS("Matrix order not complete");
202  }
203  else if ((*order)[j*sz+i+2]<0)
204  typ = -1;
205  else
206  i++;
207  }
208  return typ;
209 }
int j
Definition: facHensel.cc:105
void WerrorS(const char *s)
Definition: feFopen.cc:24
gmp_float sqrt(const gmp_float &a)
Definition: mpr_complex.cc:327
int i
Definition: cfEzgcd.cc:125
int length() const
Definition: intvec.h:94

◆ rUnComplete()

void rUnComplete ( ring  r)

Definition at line 3889 of file ring.cc.

3890 {
3891  if (r == NULL) return;
3892  if (r->VarOffset != NULL)
3893  {
3894  if (r->OrdSize!=0 && r->typ != NULL)
3895  {
3896  for(int i = 0; i < r->OrdSize; i++)
3897  if( r->typ[i].ord_typ == ro_is) // Search for suffixes! (prefix have the same VarOffset)
3898  {
3899  id_Delete(&r->typ[i].data.is.F, r);
3900  r->typ[i].data.is.F = NULL; // ?
3901 
3902  if( r->typ[i].data.is.pVarOffset != NULL )
3903  {
3904  omFreeSize((ADDRESS)r->typ[i].data.is.pVarOffset, (r->N +1)*sizeof(int));
3905  r->typ[i].data.is.pVarOffset = NULL; // ?
3906  }
3907  }
3908  else if (r->typ[i].ord_typ == ro_syz)
3909  {
3910  if(r->typ[i].data.syz.limit > 0)
3911  omFreeSize(r->typ[i].data.syz.syz_index, ((r->typ[i].data.syz.limit) +1)*sizeof(int));
3912  r->typ[i].data.syz.syz_index = NULL;
3913  }
3914  else if (r->typ[i].ord_typ == ro_syzcomp)
3915  {
3916  assume( r->typ[i].data.syzcomp.ShiftedComponents == NULL );
3917  assume( r->typ[i].data.syzcomp.Components == NULL );
3918 // WarnS( "rUnComplete : ord_typ == ro_syzcomp was unhandled!!! Possibly memory leak!!!" );
3919 #ifndef SING_NDEBUG
3920 // assume(0);
3921 #endif
3922  }
3923 
3924  omFreeSize((ADDRESS)r->typ,r->OrdSize*sizeof(sro_ord)); r->typ = NULL;
3925  }
3926 
3927  if (r->PolyBin != NULL)
3928  omUnGetSpecBin(&(r->PolyBin));
3929 
3930  omFreeSize((ADDRESS)r->VarOffset, (r->N +1)*sizeof(int));
3931 
3932  if (r->ordsgn != NULL && r->CmpL_Size != 0)
3933  omFreeSize((ADDRESS)r->ordsgn,r->ExpL_Size*sizeof(long));
3934  if (r->p_Procs != NULL)
3935  omFreeSize(r->p_Procs, sizeof(p_Procs_s));
3936  omfreeSize(r->VarL_Offset, r->VarL_Size*sizeof(int));
3937  }
3938  if (r->NegWeightL_Offset!=NULL)
3939  {
3940  omFreeSize(r->NegWeightL_Offset, r->NegWeightL_Size*sizeof(int));
3941  r->NegWeightL_Offset=NULL;
3942  }
3943 }
Definition: ring.h:60
struct p_Procs_s p_Procs_s
Definition: ring.h:23
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define omfreeSize(addr, size)
Definition: omAllocDecl.h:236
#define omUnGetSpecBin(bin_ptr)
Definition: omBin.h:14
void * ADDRESS
Definition: auxiliary.h:133
#define assume(x)
Definition: mod2.h:390
Definition: ring.h:218
int i
Definition: cfEzgcd.cc:125
Definition: ring.h:61
#define NULL
Definition: omList.c:12

◆ rVar()

static short rVar ( const ring  r)
inlinestatic

#define rVar(r) (r->N)

Definition at line 586 of file ring.h.

587 {
588  assume(r != NULL);
589  return r->N;
590 }
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ rVarStr()

char* rVarStr ( ring  r)

Definition at line 623 of file ring.cc.

624 {
625  if ((r==NULL)||(r->names==NULL)) return omStrDup("");
626  int i;
627  int l=2;
628  char *s;
629 
630  for (i=0; i<r->N; i++)
631  {
632  l+=strlen(r->names[i])+1;
633  }
634  s=(char *)omAlloc((long)l);
635  s[0]='\0';
636  for (i=0; i<r->N-1; i++)
637  {
638  strcat(s,r->names[i]);
639  strcat(s,",");
640  }
641  strcat(s,r->names[i]);
642  return s;
643 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define omAlloc(size)
Definition: omAllocDecl.h:210
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
int l
Definition: cfEzgcd.cc:93
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ rWrite()

void rWrite ( ring  r,
BOOLEAN  details = FALSE 
)

Definition at line 226 of file ring.cc.

227 {
228  if ((r==NULL)||(r->order==NULL))
229  return; /*to avoid printing after errors....*/
230 
231  assume(r != NULL);
232  const coeffs C = r->cf;
233  assume(C != NULL);
234 
235  int nblocks=rBlocks(r);
236 
237  // omCheckAddrSize(r,sizeof(ip_sring));
238  omCheckAddrSize(r->order,nblocks*sizeof(int));
239  omCheckAddrSize(r->block0,nblocks*sizeof(int));
240  omCheckAddrSize(r->block1,nblocks*sizeof(int));
241  omCheckAddrSize(r->wvhdl,nblocks*sizeof(int *));
242  omCheckAddrSize(r->names,r->N*sizeof(char *));
243 
244  nblocks--;
245 
246 
247  PrintS("// coefficients: ");
248  if( nCoeff_is_algExt(C) )
249  {
250  // NOTE: the following (non-thread-safe!) UGLYNESS
251  // (changing naRing->ShortOut for a while) is due to Hans!
252  // Just think of other ring using the VERY SAME naRing and possible
253  // side-effects...
254  ring R = C->extRing;
255  const BOOLEAN bSaveShortOut = rShortOut(R); R->ShortOut = rShortOut(r) & rCanShortOut(R);
256 
257  n_CoeffWrite(C, details); // for correct printing of minpoly... WHAT AN UGLYNESS!!!
258 
259  R->ShortOut = bSaveShortOut;
260  }
261  else
262  n_CoeffWrite(C, details);
263  PrintLn();
264 // {
265 // PrintS("// characteristic : ");
266 //
267 // char const * const * const params = rParameter(r);
268 //
269 // if (params!=NULL)
270 // {
271 // Print ("// %d parameter : ",rPar(r));
272 //
273 // char const * const * sp= params;
274 // int nop=0;
275 // while (nop<rPar(r))
276 // {
277 // PrintS(*sp);
278 // PrintS(" ");
279 // sp++; nop++;
280 // }
281 // PrintS("\n// minpoly : ");
282 // if ( rField_is_long_C(r) )
283 // {
284 // // i^2+1:
285 // Print("(%s^2+1)\n", params[0]);
286 // }
287 // else if (rMinpolyIsNULL(r))
288 // {
289 // PrintS("0\n");
290 // }
291 // else
292 // {
293 // StringSetS(""); n_Write(r->cf->minpoly, r); PrintS(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
294 // }
295 // //if (r->qideal!=NULL)
296 // //{
297 // // iiWriteMatrix((matrix)r->qideal,"// minpolys",1,r,0);
298 // // PrintLn();
299 // //}
300 // }
301 // }
302  Print("// number of vars : %d",r->N);
303 
304  //for (nblocks=0; r->order[nblocks]; nblocks++);
305  nblocks=rBlocks(r)-1;
306 
307  for (int l=0, nlen=0 ; l<nblocks; l++)
308  {
309  int i;
310  Print("\n// block %3d : ",l+1);
311 
312  Print("ordering %s", rSimpleOrdStr(r->order[l]));
313 
314 
315  if (r->order[l] == ringorder_IS)
316  {
317  assume( r->block0[l] == r->block1[l] );
318  const int s = r->block0[l];
319  assume( (-2 < s) && (s < 2) );
320  Print("(%d)", s); // 0 => prefix! +/-1 => suffix!
321  continue;
322  }
323  else if (r->order[l]==ringorder_s)
324  {
325  assume( l == 0 );
326  Print(" syz_comp: %d",r->block0[l]);
327  continue;
328  }
329  else if (
330  ( (r->order[l] >= ringorder_lp)
331  ||(r->order[l] == ringorder_M)
332  ||(r->order[l] == ringorder_a)
333  ||(r->order[l] == ringorder_am)
334  ||(r->order[l] == ringorder_a64)
335  ||(r->order[l] == ringorder_aa) ) && (r->order[l] < ringorder_IS) )
336  {
337  PrintS("\n// : names ");
338  for (i = r->block0[l]-1; i<r->block1[l]; i++)
339  {
340  nlen = strlen(r->names[i]);
341  Print(" %s",r->names[i]);
342  }
343  }
344 
345  if (r->wvhdl[l]!=NULL)
346  {
347  #ifndef SING_NDEBUG
348  if((r->order[l] != ringorder_wp)
349  &&(r->order[l] != ringorder_Wp)
350  &&(r->order[l] != ringorder_ws)
351  &&(r->order[l] != ringorder_Ws)
352  &&(r->order[l] != ringorder_a)
353  &&(r->order[l] != ringorder_am)
354  &&(r->order[l] != ringorder_M))
355  {
356  Warn("should not have wvhdl entry at pos. %d",l);
357  }
358  #endif
359  for (int j= 0;
360  j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
361  j+=i)
362  {
363  PrintS("\n// : weights ");
364  for (i = 0; i<=r->block1[l]-r->block0[l]; i++)
365  {
366  if (r->order[l] == ringorder_a64)
367  {
368  int64 *w=(int64 *)r->wvhdl[l];
369  #if SIZEOF_LONG == 4
370  Print("%*lld " ,nlen,w[i+j]);
371  #else
372  Print(" %*ld" ,nlen,w[i+j]);
373  #endif
374  }
375  else
376  Print(" %*d" ,nlen,r->wvhdl[l][i+j]);
377  }
378  if (r->order[l]!=ringorder_M) break;
379  }
380  if (r->order[l]==ringorder_am)
381  {
382  int m=r->wvhdl[l][i];
383  Print("\n// : %d module weights ",m);
384  m+=i;i++;
385  for(;i<=m;i++) Print(" %*d" ,nlen,r->wvhdl[l][i]);
386  }
387  }
388  }
389 #ifdef HAVE_PLURAL
390  if(rIsPluralRing(r))
391  {
392  PrintS("\n// noncommutative relations:");
393  if( details )
394  {
395  poly pl=NULL;
396  int nl;
397  int i,j;
398  for (i = 1; i<r->N; i++)
399  {
400  for (j = i+1; j<=r->N; j++)
401  {
402  nl = n_IsOne(p_GetCoeff(MATELEM(r->GetNC()->C,i,j),r), r->cf);
403  if ( (MATELEM(r->GetNC()->D,i,j)!=NULL) || (!nl) )
404  {
405  Print("\n// %s%s=",r->names[j-1],r->names[i-1]);
406  pl = MATELEM(r->GetNC()->MT[UPMATELEM(i,j,r->N)],1,1);
407  p_Write0(pl, r, r);
408  }
409  }
410  }
411  } else
412  PrintS(" ...");
413 
414 #if MYTEST /*Singularg should not differ from Singular except in error case*/
415  Print("\n// noncommutative type:%d", (int)ncRingType(r));
416  Print("\n// is skew constant:%d",r->GetNC()->IsSkewConstant);
417  if( rIsSCA(r) )
418  {
419  Print("\n// alternating variables: [%d, %d]", scaFirstAltVar(r), scaLastAltVar(r));
420  const ideal Q = SCAQuotient(r); // resides within r!
421  PrintS("\n// quotient of sca by ideal");
422 
423  if (Q!=NULL)
424  {
425  iiWriteMatrix((matrix)Q,"scaQ",1,r,0);
426  }
427  else
428  PrintS(" (NULL)");
429  }
430 #endif
431  }
432  if (rIsLPRing(r))
433  {
434  Print("\n// letterplace ring (block size %d)",r->isLPring);
435  }
436 #endif
437  if (r->qideal!=NULL)
438  {
439  PrintS("\n// quotient ring from ideal");
440  if( details )
441  {
442  PrintLn();
443  iiWriteMatrix((matrix)r->qideal,"_",1,r,0);
444  } else PrintS(" ...");
445  }
446 }
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:91
ideal SCAQuotient(const ring r)
Definition: sca.h:10
const CanonicalForm int s
Definition: facAbsFact.cc:55
int j
Definition: facHensel.cc:105
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
for int64 weights
Definition: ring.h:71
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:468
static BOOLEAN rShortOut(const ring r)
Definition: ring.h:575
long int64
Definition: auxiliary.h:66
#define Q
Definition: sirandom.c:25
static BOOLEAN rIsLPRing(const ring r)
Definition: ring.h:408
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:580
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition: matpol.cc:834
static int rBlocks(ring r)
Definition: ring.h:562
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:932
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
The main handler for Singular numbers which are suitable for Singular polynomials.
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:77
int m
Definition: cfEzgcd.cc:121
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:93
void PrintS(const char *s)
Definition: reporter.cc:284
static short scaFirstAltVar(ring r)
Definition: sca.h:18
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:239
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
Definition: coeffs.h:741
#define NULL
Definition: omList.c:12
#define R
Definition: sirandom.c:26
const CanonicalForm & w
Definition: facAbsFact.cc:55
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:190
#define p_GetCoeff(p, r)
Definition: monomials.h:50
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
s?
Definition: ring.h:76
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:93
#define UPMATELEM(i, j, nVar)
Definition: nc.h:36
#define MATELEM(mat, i, j)
1-based access to matrix
Definition: matpol.h:29
#define Warn
Definition: emacs.cc:77

Variable Documentation

◆ sip_sring_bin

omBin sip_sring_bin

Definition at line 43 of file ring.cc.