 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
typedef idrec * | idhdl |
|
typedef struct p_Procs_s | p_Procs_s |
|
typedef kBucket * | kBucket_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 skStrategy * | kStrategy |
|
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) |
|
|
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
} |
|
|
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 | 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_ModN (const ring r) |
|
static BOOLEAN | rField_is_Ring_PtoM (const ring r) |
|
static BOOLEAN | rField_is_Ring_Z (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_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) |
|
int64 * | rGetWeightVec (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...
|
|
◆ sro_dp
Definition at line 120 of file ring.h.
Data Fields |
short |
end |
|
short |
place |
|
short |
start |
|
◆ sro_wp
Definition at line 129 of file ring.h.
Data Fields |
short |
end |
|
short |
place |
|
short |
start |
|
int * |
weights |
|
◆ sro_am
Definition at line 139 of file ring.h.
Data Fields |
short |
end |
|
short |
len_gen |
|
short |
place |
|
short |
start |
|
int * |
weights |
|
int * |
weights_m |
|
◆ sro_wp64
Definition at line 154 of file ring.h.
Data Fields |
short |
end |
|
short |
place |
|
short |
start |
|
int64 * |
weights64 |
|
◆ sro_cp
Definition at line 164 of file ring.h.
Data Fields |
short |
end |
|
short |
place |
|
short |
start |
|
◆ sro_syzcomp
Definition at line 173 of file ring.h.
Data Fields |
int * |
Components |
|
long |
length |
|
short |
place |
|
long * |
ShiftedComponents |
|
◆ sro_syz
Definition at line 185 of file ring.h.
Data Fields |
int |
curr_index |
|
int |
limit |
|
short |
place |
|
int * |
syz_index |
|
◆ sro_ISTemp
Definition at line 201 of file ring.h.
Data Fields |
int * |
pVarOffset |
|
short |
start |
|
int |
suffixpos |
|
◆ sro_IS
Definition at line 211 of file ring.h.
Data Fields |
short |
end |
|
ideal |
F |
|
int |
limit |
|
int * |
pVarOffset |
|
short |
start |
|
◆ sro_ord
◆ sro_ord.data
◆ rTest
#define rTest |
( |
|
r | ) |
rDBTest(r, __FILE__, __LINE__) |
◆ BBA_Proc
◆ idhdl
◆ kBucket_pt
◆ kStrategy
◆ NF_Proc
typedef poly(* NF_Proc) (ideal, ideal, poly, int, int, const ring _currRing) |
◆ p_Procs_s
◆ p_SetmProc
typedef void(* p_SetmProc) (poly p, const ring r) |
◆ pFDegProc
typedef long(* pFDegProc) (poly p, ring r) |
◆ pLDegProc
typedef long(* pLDegProc) (poly p, int *length, ring r) |
◆ 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 51 of file ring.h.
◆ 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 57 of file ring.h.
◆ 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 104 of file ring.h.
◆ 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 74 of file ring.h.
◆ n_IsParam()
if m == var(i)/1 => return i,
if m == var(i)/1 => return i,
Definition at line 5631 of file ring.cc.
5647 Werror(
"n_IsParam: IsParam is not to be used for (coeff_type = %d)",
getCoeffType(C));
◆ 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 643 of file ring.h.
◆ p_DebugPrint()
void p_DebugPrint |
( |
poly |
p, |
|
|
const ring |
r |
|
) |
| |
Definition at line 4203 of file ring.cc.
4210 Print(
"\nexp[0..%d]\n",r->ExpL_Size-1);
4211 for(
i=0;
i<r->ExpL_Size;
i++)
4219 if (
j==0) {
PrintS(
"...\n");
break; }
◆ p_SetGlobals()
set all properties of a new ring - also called by rComplete
Definition at line 3316 of file ring.cc.
3320 r->pLexOrder=r->LexOrder;
◆ pISUpdateComponents()
Definition at line 4240 of file ring.cc.
4248 for(
int j = (F->ncols*F->nrows) - 1;
j >= 0;
j-- )
4262 Print(
"gen[%d] -> gen(%d)\n", c,
MIN + (*V)[ c -
MIN - 1 ]);
◆ r_IsRingVar()
int r_IsRingVar |
( |
const char * |
n, |
|
|
char ** |
names, |
|
|
int |
N |
|
) |
| |
Definition at line 213 of file ring.cc.
217 for (
int i=0;
i<
N;
i++)
219 if (names[
i]==
NULL)
return -1;
220 if (strcmp(n,names[
i]) == 0)
return (
int)
i;
◆ rAssure_C_dp()
ring rAssure_C_dp |
( |
const ring |
r | ) |
|
◆ rAssure_c_dp()
ring rAssure_c_dp |
( |
const ring |
r | ) |
|
◆ rAssure_CompLastBlock()
makes sure that c/C ordering is last ordering
Definition at line 4595 of file ring.cc.
4597 int last_block =
rBlocks(r) - 2;
4604 for (
i=0;
i< last_block;
i++)
4615 for (
i=c_pos+1;
i<=last_block;
i++)
4617 new_r->order[
i-1] = new_r->order[
i];
4618 new_r->block0[
i-1] = new_r->block0[
i];
4619 new_r->block1[
i-1] = new_r->block1[
i];
4620 new_r->wvhdl[
i-1] = new_r->wvhdl[
i];
4622 new_r->order[last_block] = r->order[c_pos];
4623 new_r->block0[last_block] = r->block0[c_pos];
4624 new_r->block1[last_block] = r->block1[c_pos];
4625 new_r->wvhdl[last_block] = r->wvhdl[c_pos];
4636 WarnS(
"error in nc_rComplete");
◆ rAssure_dp_C()
ring rAssure_dp_C |
( |
const ring |
r | ) |
|
◆ rAssure_dp_S()
ring rAssure_dp_S |
( |
const ring |
r | ) |
|
◆ rAssure_HasComp()
ring rAssure_HasComp |
( |
const ring |
r | ) |
|
Definition at line 4540 of file ring.cc.
4548 if (r->order[
i] == 0)
4557 new_r->wvhdl=(
int **)
omAlloc0(
i *
sizeof(
int *));
4559 new_r->block0 = (
int *)
omAlloc0(
i *
sizeof(
int));
4560 new_r->block1 = (
int *)
omAlloc0(
i *
sizeof(
int));
4562 memcpy(new_r->block0,r->block0,(
i-1) *
sizeof(
int));
4563 memcpy(new_r->block1,r->block1,(
i-1) *
sizeof(
int));
4564 for (
int j=0;
j<=last_block;
j++)
4566 if (r->wvhdl[
j]!=
NULL)
4568 new_r->wvhdl[
j] = (
int*)
omMemDup(r->wvhdl[
j]);
4585 WarnS(
"error in nc_rComplete");
◆ rAssure_InducedSchreyerOrdering()
ring rAssure_InducedSchreyerOrdering |
( |
const ring |
r, |
|
|
BOOLEAN |
complete = TRUE , |
|
|
int |
sgn = 1 |
|
) |
| |
Definition at line 4751 of file ring.cc.
4755 Print(
"rAssure_InducedSchreyerOrdering(r, complete = %d, sgn = %d): r: \n", complete,
sgn);
4772 int ** wvhdl =(
int **)
omAlloc0((n+2)*
sizeof(
int**));
4780 res->block0[
j] =
res->block1[
j] = 0;
4784 for(
int i = 0; (
i <= n) && (r->order[
i] != 0);
i++,
j++)
4786 res->order [
j] = r->order [
i];
4787 res->block0[
j] = r->block0[
i];
4788 res->block1[
j] = r->block1[
i];
4790 if (r->wvhdl[
i] !=
NULL)
4822 WarnS(
"error in nc_rComplete");
4834 if (r->qideal!=
NULL)
◆ rAssure_SyzComp()
Definition at line 4349 of file ring.cc.
4356 WarnS(
"rAssure_SyzComp: input ring has an IS-ordering!");
4367 int ** wvhdl =(
int **)
omAlloc0((
i+1)*
sizeof(
int**));
4370 res->order[
j]=r->order[
j-1];
4371 res->block0[
j]=r->block0[
j-1];
4372 res->block1[
j]=r->block1[
j-1];
4373 if (r->wvhdl[
j-1] !=
NULL)
4391 WarnS(
"error in nc_rComplete");
4401 if (r->qideal!=
NULL)
◆ 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 4650 of file ring.cc.
4661 if (new_r_1 != new_r && new_r_1 != old_r)
rDelete(new_r_1);
4669 # ifndef SING_NDEBUG
4670 WarnS(
"error in nc_rComplete");
4677 if (old_r->qideal !=
NULL)
4679 new_r->qideal =
idrCopyR(old_r->qideal, old_r, new_r);
4687 WarnS(
"error in nc_SetupQuotient");
◆ rAssure_SyzOrder()
◆ rAssure_TDeg()
ring rAssure_TDeg |
( |
const ring |
r, |
|
|
int & |
pos |
|
) |
| |
Definition at line 4445 of file ring.cc.
4450 for(
i=r->OrdSize-1;
i>=0;
i--)
4452 if ((r->typ[
i].ord_typ==
ro_dp)
4453 && (r->typ[
i].data.dp.start==1)
4454 && (r->typ[
i].data.dp.end==r->N))
4456 pos=r->typ[
i].data.dp.place;
4476 res->ExpL_Size=r->ExpL_Size+1;
4480 for(
j=0;
j<r->CmpL_Size;
j++)
4482 res->ordsgn[
j] = r->ordsgn[
j];
4484 res->OrdSize=r->OrdSize+1;
4489 memcpy(
res->typ,r->typ,r->OrdSize*
sizeof(
sro_ord));
4493 res->typ[
res->OrdSize-1].data.dp.start=1;
4494 res->typ[
res->OrdSize-1].data.dp.end=
res->N;
4495 res->typ[
res->OrdSize-1].data.dp.place=
res->ExpL_Size-1;
4496 pos=
res->ExpL_Size-1;
4512 WarnS(
"error in nc_rComplete");
4518 if (r->qideal!=
NULL)
◆ rBlocks()
static int rBlocks |
( |
ring |
r | ) |
|
|
inlinestatic |
Definition at line 559 of file ring.h.
563 while (r->order[
i]!=0)
i++;
◆ rCanShortOut()
◆ rChangeSComps()
void rChangeSComps |
( |
int * |
currComponents, |
|
|
long * |
currShiftedComponents, |
|
|
int |
length, |
|
|
ring |
r |
|
) |
| |
◆ rChar()
Definition at line 688 of file ring.cc.
688 {
return r->cf->ch; }
◆ rCharStr()
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
Definition at line 622 of file ring.cc.
◆ rCheckIV()
Definition at line 176 of file ring.cc.
180 WerrorS(
"weights only for orderings wp,ws,Wp,Ws,a,M");
◆ 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 3351 of file ring.cc.
3353 if (r->VarOffset!=
NULL && force == 0)
return FALSE;
3359 r->BitsPerExp = bits;
3364 long *tmp_ordsgn=(
long *)
omAlloc0(3*(n+r->N)*
sizeof(long));
3366 int *
v=(
int *)
omAlloc((r->N+1)*
sizeof(int));
3367 for(
i=r->N;
i>=0 ;
i--)
3384 switch (r->order[
i])
3388 rO_WDegree(
j,j_bits,r->block0[
i],r->block1[
i],tmp_ordsgn,tmp_typ[typ_i],
3394 rO_WMDegree(
j,j_bits,r->block0[
i],r->block1[
i],tmp_ordsgn,tmp_typ[typ_i],
3401 tmp_typ[typ_i], (
int64 *)(r->wvhdl[
i]));
3408 r->ComponentOrder=1;
3414 r->ComponentOrder=-1;
3420 k=r->block1[
i]-r->block0[
i]+1;
3425 r->wvhdl[
i]+(r->block1[
i]-r->block0[
i]+1)*
l);
3432 rO_LexVars(
j, j_bits, r->block0[
i],r->block1[
i], prev_ordsgn,
3433 tmp_ordsgn,
v,bits, -1);
3438 tmp_ordsgn,
v, bits, -1);
3443 tmp_ordsgn,
v, bits, -1);
3447 rO_LexVars(
j, j_bits, r->block1[
i],r->block0[
i], prev_ordsgn,
3448 tmp_ordsgn,
v, bits, -1);
3452 if (r->block0[
i]==r->block1[
i])
3454 rO_LexVars(
j, j_bits, r->block0[
i],r->block0[
i], prev_ordsgn,
3455 tmp_ordsgn,
v, bits, -1);
3463 prev_ordsgn,tmp_ordsgn,
v,bits, r->block0[
i]);
3468 if (r->block0[
i]==r->block1[
i])
3470 rO_LexVars(
j, j_bits, r->block0[
i],r->block0[
i], prev_ordsgn,
3471 tmp_ordsgn,
v, bits, -1);
3478 rO_LexVars(
j, j_bits, r->block0[
i],r->block1[
i]-1, prev_ordsgn,
3479 tmp_ordsgn,
v, bits, r->block1[
i]);
3484 if (r->block0[
i]==r->block1[
i])
3487 tmp_ordsgn,
v,bits, -1);
3495 prev_ordsgn,tmp_ordsgn,
v,bits, r->block0[
i]);
3500 if (r->block0[
i]==r->block1[
i])
3503 tmp_ordsgn,
v, bits, -1);
3510 rO_LexVars(
j, j_bits, r->block0[
i],r->block1[
i]-1, prev_ordsgn,
3511 tmp_ordsgn,
v, bits, r->block1[
i]);
3517 tmp_typ[typ_i], r->wvhdl[
i]);
3522 for(jj=r->block1[
i]-r->block0[
i];jj>=0; jj--)
3524 if (r->wvhdl[
i][jj]<=0) have_bad_weights=
TRUE;
3526 if (have_bad_weights)
3533 if (r->block1[
i]!=r->block0[
i])
3536 tmp_ordsgn,
v,bits, r->block0[
i]);
3542 tmp_typ[typ_i], r->wvhdl[
i]);
3547 for(jj=r->block1[
i]-r->block0[
i];jj>=0; jj--)
3549 if (r->wvhdl[
i][jj]<=0) have_bad_weights=
TRUE;
3551 if (have_bad_weights)
3558 if (r->block1[
i]!=r->block0[
i])
3560 rO_LexVars(
j, j_bits,r->block0[
i],r->block1[
i]-1, prev_ordsgn,
3561 tmp_ordsgn,
v, bits, r->block1[
i]);
3567 tmp_typ[typ_i], r->wvhdl[
i]);
3569 if (r->block1[
i]!=r->block0[
i])
3572 tmp_ordsgn,
v,bits, r->block0[
i]);
3578 tmp_typ[typ_i], r->wvhdl[
i]);
3580 if (r->block1[
i]!=r->block0[
i])
3582 rO_LexVars(
j, j_bits,r->block0[
i],r->block1[
i]-1, prev_ordsgn,
3583 tmp_ordsgn,
v, bits, r->block1[
i]);
3590 rO_Syzcomp(
j, j_bits,prev_ordsgn, tmp_ordsgn,tmp_typ[typ_i]);
3591 need_to_add_comp=
TRUE;
3592 r->ComponentOrder=-1;
3598 rO_Syz(
j, j_bits, prev_ordsgn, r->block0[
i], tmp_ordsgn, tmp_typ[typ_i]);
3599 need_to_add_comp=
TRUE;
3600 r->ComponentOrder=-1;
3607 assume( r->block0[
i] == r->block1[
i] );
3608 const int s = r->block0[
i];
3612 rO_ISPrefix(
j, j_bits, prev_ordsgn, tmp_ordsgn, r->N,
v, tmp_typ[typ_i++]);
3615 rO_ISSuffix(
j, j_bits, prev_ordsgn, tmp_ordsgn, r->N,
v, tmp_typ, typ_i,
s);
3616 need_to_add_comp=
FALSE;
3635 j_bits=j_bits0;
j=j0;
3640 if((need_to_add_comp) && (
v[0]== -1))
3654 for(
i=1 ;
i<=r->N ;
i++)
3681 r->ordsgn=(
long *)
omAlloc0(r->ExpL_Size*
sizeof(
long));
3683 for(
j=0;
j<r->CmpL_Size;
j++)
3685 r->ordsgn[
j] = tmp_ordsgn[
j];
3694 if (typ_i==0) r->typ=
NULL;
3698 memcpy(r->typ,tmp_typ,typ_i*
sizeof(
sro_ord));
3708 r->pCompIndex=(r->VarOffset[0] & 0xffff);
3711 if (
i==r->pCompIndex)
i++;
3712 while ((j < r->OrdSize)
3720 if (
i==r->pCompIndex)
i++;
◆ rCopy()
◆ rCopy0()
Definition at line 1325 of file ring.cc.
1332 res->options=r->options;
1347 res->firstBlockEnds=r->firstBlockEnds;
1349 res->real_var_start=r->real_var_start;
1350 res->real_var_end=r->real_var_end;
1353 #ifdef HAVE_SHIFTBBA
1354 res->isLPring=r->isLPring;
1357 res->VectorOut=r->VectorOut;
1358 res->ShortOut=r->ShortOut;
1359 res->CanShortOut=r->CanShortOut;
1375 res->bitmask=r->bitmask;
1376 res->divmask=r->divmask;
1377 res->BitsPerExp = r->BitsPerExp;
1378 res->ExpPerLong = r->ExpPerLong;
1397 if (copy_ordering ==
TRUE)
1399 res->LexOrder=r->LexOrder;
1400 res->MixedOrder=r->MixedOrder;
1408 if (r->wvhdl[
j]!=
NULL)
1416 memcpy(
res->block0,r->block0,
i *
sizeof(
int));
1417 memcpy(
res->block1,r->block1,
i *
sizeof(
int));
1432 if (r->qideal!=
NULL)
◆ rCopy0AndAddA()
Definition at line 1453 of file ring.cc.
1461 res->options=r->options;
1476 res->firstBlockEnds=r->firstBlockEnds;
1478 res->real_var_start=r->real_var_start;
1479 res->real_var_end=r->real_var_end;
1482 #ifdef HAVE_SHIFTBBA
1483 res->isLPring=r->isLPring;
1486 res->VectorOut=r->VectorOut;
1487 res->ShortOut=r->ShortOut;
1488 res->CanShortOut=r->CanShortOut;
1489 res->LexOrder=r->LexOrder;
1490 res->MixedOrder=r->MixedOrder;
1506 res->bitmask=r->bitmask;
1507 res->divmask=r->divmask;
1508 res->BitsPerExp = r->BitsPerExp;
1509 res->ExpPerLong = r->ExpPerLong;
1528 if (copy_ordering ==
TRUE)
1535 for (
j=0;
j<
i-1;
j++)
1537 if (r->wvhdl[
j]!=
NULL)
1545 memcpy(&(
res->block0[1]),r->block0,(
i-1) *
sizeof(
int));
1546 memcpy(&(
res->block1[1]),r->block1,(
i-1) *
sizeof(
int));
1564 res->wvhdl[0]=(
int *)
A;
1574 if (r->qideal!=
NULL)
1580 WerrorS(
"internal error: rCopy0(Q,TRUE,FALSE)");
1585 WarnS(
"internal bad stuff: rCopy0(Q,TRUE,TRUE)");
◆ rDBTest()
Definition at line 1944 of file ring.cc.
1955 if (r->N == 0)
return TRUE;
1957 if ((r->OrdSgn!=1) && (r->OrdSgn!= -1))
1969 for(
int j=0;
j<=
i;
j++)
1972 dError(
"wrong order in r->order");
1983 if (r->VarOffset ==
NULL)
1985 dReportError(
"Null ring VarOffset -- no rComplete (?) in n %s:%d", fn,
l);
1990 if ((r->OrdSize==0)!=(r->typ==
NULL))
1992 dReportError(
"mismatch OrdSize and typ-pointer in %s:%d");
1998 for(
i=0;
i<=r->N;
i++)
2002 for(
j=0;
j<r->OrdSize;
j++)
2006 const int p = r->typ[
j].data.isTemp.suffixpos;
2011 assume( p < r->OrdSize );
2013 if(r->typ[
p].ord_typ !=
ro_is)
2014 dReportError(
"ordrec prefix %d is unmatched (suffix: %d is wrong!!!)",
j,
p);
2017 if(r->typ[
j].data.isTemp.pVarOffset[
i] != -1)
2023 else if (r->typ[
j].ord_typ ==
ro_is)
2026 if(r->typ[
j].data.is.pVarOffset[
i] != -1)
2034 if (r->typ[
j].ord_typ==
ro_cp)
2036 if(((
short)r->VarOffset[
i]) == r->typ[
j].data.cp.place)
2041 && (r->VarOffset[
i] == r->typ[
j].data.dp.place))
2047 tmp=r->VarOffset[
i] & 0xffffff;
2048 #if SIZEOF_LONG == 8
2049 if ((r->VarOffset[
i] >> 24) >63)
2051 if ((r->VarOffset[
i] >> 24) >31)
2053 dReportError(
"bit_start out of range:%d",r->VarOffset[
i] >> 24);
2054 if (
i > 0 && ((tmp<0) ||(tmp>r->ExpL_Size-1)))
2056 dReportError(
"varoffset out of range for var %d: %d",
i,tmp);
2061 for(
j=0;
j<r->OrdSize;
j++)
2063 if ((r->typ[
j].ord_typ==
ro_dp)
2064 || (r->typ[
j].ord_typ==
ro_wp)
2067 if (r->typ[
j].data.dp.start > r->typ[
j].data.dp.end)
2069 r->typ[
j].data.dp.start, r->typ[
j].data.dp.end);
2070 if ((r->typ[
j].data.dp.start < 1)
2071 || (r->typ[
j].data.dp.end > r->N))
2072 dReportError(
"in ordrec %d: start(%d)<1 or end(%d)>vars(%d)",
j,
2073 r->typ[
j].data.dp.start, r->typ[
j].data.dp.end,r->N);
◆ rDebugPrint()
void rDebugPrint |
( |
const ring |
r | ) |
|
Definition at line 3998 of file ring.cc.
4006 const char *TYP[]={
"ro_dp",
"ro_wp",
"ro_am",
"ro_wp64",
"ro_wp_neg",
"ro_cp",
4007 "ro_syzcomp",
"ro_syz",
"ro_isTemp",
"ro_is",
"ro_none"};
4010 Print(
"ExpL_Size:%d ",r->ExpL_Size);
4011 Print(
"CmpL_Size:%d ",r->CmpL_Size);
4012 Print(
"VarL_Size:%d\n",r->VarL_Size);
4013 Print(
"bitmask=0x%lx (expbound=%ld) \n",r->bitmask, r->bitmask);
4014 Print(
"divmask=%lx\n", r->divmask);
4015 Print(
"BitsPerExp=%d ExpPerLong=%d at L[%d]\n", r->BitsPerExp, r->ExpPerLong, r->VarL_Offset[0]);
4017 Print(
"VarL_LowIndex: %d\n", r->VarL_LowIndex);
4018 PrintS(
"VarL_Offset:\n");
4021 for(
j = 0;
j < r->VarL_Size;
j++)
4022 Print(
" VarL_Offset[%d]: %d ",
j, r->VarL_Offset[
j]);
4029 for(
j=0;
j<=r->N;
j++)
4030 Print(
" v%d at e-pos %d, bit %d\n",
4031 j,r->VarOffset[
j] & 0xffffff, r->VarOffset[
j] >>24);
4033 for(
j=0;
j<r->CmpL_Size;
j++)
4034 Print(
" ordsgn %ld at pos %d\n",r->ordsgn[
j],
j);
4035 Print(
"OrdSgn:%d\n",r->OrdSgn);
4037 for(
j=0;
j<r->OrdSize;
j++)
4039 Print(
" typ %s", TYP[r->typ[
j].ord_typ]);
4040 if (r->typ[
j].ord_typ==
ro_syz)
4042 const short place = r->typ[
j].data.syz.place;
4043 const int limit = r->typ[
j].data.syz.limit;
4044 const int curr_index = r->typ[
j].data.syz.curr_index;
4045 const int* syz_index = r->typ[
j].data.syz.syz_index;
4047 Print(
" limit %d (place: %d, curr_index: %d), syz_index: ", limit, place, curr_index);
4049 if( syz_index ==
NULL )
4054 for(
i=0;
i <= limit;
i++ )
4055 Print(
"%d ", syz_index[
i]);
4062 Print(
" start (level) %d, suffixpos: %d, VO: ",r->typ[
j].data.isTemp.start, r->typ[
j].data.isTemp.suffixpos);
4065 else if (r->typ[
j].ord_typ==
ro_is)
4067 Print(
" start %d, end: %d: ",r->typ[
j].data.is.start, r->typ[
j].data.is.end);
4071 Print(
" limit %d",r->typ[
j].data.is.limit);
4078 else if (r->typ[
j].ord_typ==
ro_am)
4080 Print(
" place %d",r->typ[
j].data.am.place);
4081 Print(
" start %d",r->typ[
j].data.am.start);
4082 Print(
" end %d",r->typ[
j].data.am.end);
4083 Print(
" len_gen %d",r->typ[
j].data.am.len_gen);
4086 for(
l=r->typ[
j].data.am.start;l<=r->typ[
j].data.am.end;
l++)
4087 Print(
" %d",r->typ[
j].data.am.weights[
l-r->typ[
j].data.am.start]);
4088 l=r->typ[
j].data.am.end+1;
4089 int ll=r->typ[
j].data.am.weights[
l-r->typ[
j].data.am.start];
4091 for(
int lll=
l+1;lll<
l+ll+1;lll++)
4092 Print(
" %d",r->typ[
j].data.am.weights[lll-r->typ[
j].data.am.start]);
4096 Print(
" place %d",r->typ[
j].data.dp.place);
4100 Print(
" start %d",r->typ[
j].data.dp.start);
4101 Print(
" end %d",r->typ[
j].data.dp.end);
4102 if ((r->typ[
j].ord_typ==
ro_wp)
4106 for(
int l=r->typ[
j].data.wp.start;l<=r->typ[
j].data.wp.end;
l++)
4107 Print(
" %d",r->typ[
j].data.wp.weights[
l-r->typ[
j].data.wp.start]);
4109 else if (r->typ[
j].ord_typ==
ro_wp64)
4113 for(
l=r->typ[
j].data.wp64.start;l<=r->typ[
j].data.wp64.end;
l++)
4114 Print(
" %ld",(
long)(((
int64*)r->typ[
j].data.wp64.weights64)+
l-r->typ[
j].data.wp64.start));
4120 Print(
"pOrdIndex:%d pCompIndex:%d\n", r->pOrdIndex, r->pCompIndex);
4121 Print(
"OrdSize:%d\n",r->OrdSize);
4122 PrintS(
"--------------------\n");
4123 for(
j=0;
j<r->ExpL_Size;
j++)
4126 if (j< r->CmpL_Size)
4127 Print(
"ordsgn %ld ", r->ordsgn[
j]);
4133 if( (r->VarOffset[
i] & 0xffffff) ==
j )
4134 {
Print(
"v%d at e[%d], bit %d; ",
i,r->VarOffset[
i] & 0xffffff,
4135 r->VarOffset[
i] >>24 ); }
4137 if( r->pCompIndex==
j )
PrintS(
"v0; ");
4138 for(
i=0;
i<r->OrdSize;
i++)
4140 if (r->typ[
i].data.dp.place ==
j)
4142 Print(
"ordrec:%s (start:%d, end:%d) ",TYP[r->typ[
i].ord_typ],
4143 r->typ[
i].data.dp.start, r->typ[
i].data.dp.end);
4147 if (
j==r->pOrdIndex)
4152 Print(
"LexOrder:%d, MixedOrder:%d\n",r->LexOrder, r->MixedOrder);
4154 Print(
"NegWeightL_Size: %d, NegWeightL_Offset: ", r->NegWeightL_Size);
4155 if (r->NegWeightL_Offset==
NULL)
PrintS(
" NULL");
4157 for(
j = 0;
j < r->NegWeightL_Size;
j++)
4158 Print(
" [%d]: %d ",
j, r->NegWeightL_Offset[
j]);
4169 Print(
"p_Spec : %s, %s, %s\n", field,
length, ord);
4171 for (
i=0;
i<(int) (
sizeof(
p_Procs_s)/
sizeof(
void*));
i++)
4173 Print(
" %s,\n", ((
char**) &proc_names)[
i]);
4179 #define pFDeg_CASE(A) if(r->pFDeg == A) PrintS( "" #A "" )
4185 Print(
"(%p)", r->pFDeg);
4188 Print(
"pLDeg : (%p)", r->pLDeg);
4200 else Print(
"%p\n",r->p_Setm);
◆ rDefault() [1/4]
Definition at line 139 of file ring.cc.
144 int *block0 = (
int *)
omAlloc0(2 *
sizeof(
int));
145 int *block1 = (
int *)
omAlloc0(2 *
sizeof(
int));
◆ rDefault() [2/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 103 of file ring.cc.
111 r->names = (
char **)
omAlloc0(
N *
sizeof(
char *));
119 r->wvhdl = (
int **)
omAlloc0((ord_size+1) *
sizeof(
int *));
125 r->bitmask = bitmask;
◆ rDefault() [3/4]
ring rDefault |
( |
int |
ch, |
|
|
int |
N, |
|
|
char ** |
n |
|
) |
| |
◆ rDefault() [4/4]
ring rDefault |
( |
int |
ch, |
|
|
int |
N, |
|
|
char ** |
n, |
|
|
int |
ord_size, |
|
|
rRingOrder_t * |
ord, |
|
|
int * |
block0, |
|
|
int * |
block1, |
|
|
int ** |
wvhdl = NULL |
|
) |
| |
◆ rDelete()
unconditionally deletes fields in r
Definition at line 439 of file ring.cc.
443 if (r ==
NULL)
return;
450 if( r->qideal !=
NULL )
465 if (r->order !=
NULL)
476 if (r->wvhdl[
j]!=
NULL)
489 for (
i=0;
i<r->N;
i++)
◆ rEnvelope()
Definition at line 5506 of file ring.cc.
5512 int stat =
rSum(
R, Ropp, Renv);
5514 WarnS(
"Error in rEnvelope at rSum");
◆ rEqual()
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 1620 of file ring.cc.
1622 if (r1 == r2)
return TRUE;
1624 if (r1->cf!=r2->cf)
return FALSE;
1634 if ((r1->names[
i] !=
NULL) && (r2->names[
i] !=
NULL))
1636 if (strcmp(r1->names[
i], r2->names[
i]))
return FALSE;
1638 else if ((r1->names[
i] !=
NULL) ^ (r2->names[
i] !=
NULL))
1646 if (r1->qideal !=
NULL)
1648 ideal id1 = r1->qideal, id2 = r2->qideal;
1662 else if (r2->qideal !=
NULL)
return FALSE;
◆ rField_has_simple_Alloc()
Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies.
Definition at line 544 of file ring.h.
◆ rField_has_simple_inverse()
◆ rField_has_Units()
◆ rField_is_Domain()
◆ rField_is_GF() [1/2]
◆ rField_is_GF() [2/2]
◆ rField_is_long_C()
◆ rField_is_long_R()
◆ rField_is_numeric()
◆ rField_is_Q()
◆ rField_is_Q_a()
◆ rField_is_R()
◆ rField_is_Ring()
◆ rField_is_Ring_2toM()
◆ rField_is_Ring_ModN()
◆ rField_is_Ring_PtoM()
◆ rField_is_Ring_Z()
◆ rField_is_Z()
◆ rField_is_Zp() [1/2]
◆ rField_is_Zp() [2/2]
◆ rField_is_Zp_a() [1/2]
◆ rField_is_Zp_a() [2/2]
◆ rFieldType()
Definition at line 5101 of file ring.cc.
5103 return (r->cf->type);
◆ rGetCurrSyzLimit()
static int rGetCurrSyzLimit |
( |
const ring |
r | ) |
|
|
inlinestatic |
◆ rGetExpSize()
unsigned long rGetExpSize |
( |
unsigned long |
bitmask, |
|
|
int & |
bits, |
|
|
int |
N |
|
) |
| |
Definition at line 2558 of file ring.cc.
2560 #if SIZEOF_LONG == 8
2575 unsigned long bitmask1 =
rGetExpSize(bitmask+1, bits1);
2577 if ((((
N+vars_per_long-1)/vars_per_long) ==
2578 ((
N+vars_per_long1-1)/vars_per_long1)))
2580 vars_per_long=vars_per_long1;
◆ rGetISPos()
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 4887 of file ring.cc.
4891 Print(
"rIsIS(p: %d)\nF:",
p);
4902 for(
int pos = 0; pos < r->OrdSize; pos++ )
4903 if( r->typ[pos].ord_typ ==
ro_is)
◆ rGetMaxSyzComp()
int rGetMaxSyzComp |
( |
int |
i, |
|
|
const ring |
r |
|
) |
| |
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition at line 5045 of file ring.cc.
5047 if ((r->typ!=
NULL) && (r->typ[0].ord_typ==
ro_syz) &&
5048 r->typ[0].data.syz.limit > 0 &&
i > 0)
5050 assume(i <= r->typ[0].data.syz.limit);
5052 for (
j=0;
j<r->typ[0].data.syz.limit;
j++)
5054 if (r->typ[0].data.syz.syz_index[
j] ==
i &&
5055 r->typ[0].data.syz.syz_index[
j+1] !=
i)
5057 assume(r->typ[0].data.syz.syz_index[
j+1] ==
i+1);
5061 return r->typ[0].data.syz.limit;
5066 WarnS(
"rGetMaxSyzComp: order c");
◆ rGetOrderType()
◆ rGetSComps()
void rGetSComps |
( |
int ** |
currComponents, |
|
|
long ** |
currShiftedComponents, |
|
|
int * |
length, |
|
|
ring |
r |
|
) |
| |
◆ rGetVar()
◆ rGetWeightVec()
Definition at line 5120 of file ring.cc.
5125 while((r->typ[
i].ord_typ!=
ro_wp64) && (r->typ[
i].ord_typ>0))
i++;
5127 return (
int64*)(r->typ[
i].data.wp64.weights64);
◆ rHas_c_Ordering()
◆ rHasGlobalOrdering()
Definition at line 751 of file ring.h.
751 {
return (r->OrdSgn==1); }
◆ rHasLocalOrMixedOrdering()
Definition at line 752 of file ring.h.
752 {
return (r->OrdSgn==-1); }
◆ rHasMixedOrdering()
Definition at line 753 of file ring.h.
753 {
return (r->MixedOrder); }
◆ rHasSimpleLexOrder()
returns TRUE, if simple lp or ls ordering
Definition at line 1788 of file ring.cc.
◆ rHasSimpleOrder()
Definition at line 1756 of file ring.cc.
1761 if (blocks == 1)
return TRUE;
1770 if ((blocks -
s) > 2)
return FALSE;
◆ rHasTDeg()
Definition at line 4427 of file ring.cc.
4432 for(
i=r->OrdSize-1;
i>=0;
i--)
4434 if ((r->typ[
i].ord_typ==
ro_dp)
4435 && (r->typ[
i].data.dp.start==1)
4436 && (r->typ[
i].data.dp.end==r->N))
◆ rInternalChar()
static int rInternalChar |
( |
const ring |
r | ) |
|
|
inlinestatic |
◆ rIsPluralRing()
we must always have this test!
Definition at line 404 of file ring.h.
409 return (r !=
NULL) && ((n=r->GetNC()) !=
NULL) ;
◆ rIsPolyVar()
returns TRUE if var(i) belongs to p-block
Definition at line 1905 of file ring.cc.
1908 while(r->order[
i]!=0)
1910 if((r->block0[
i]<=
v)
1911 && (r->block1[
i]>=
v))
1916 return (r->wvhdl[
i][
v-r->block0[
i]]>0);
◆ rIsRatGRing()
Definition at line 415 of file ring.h.
421 && (r->real_var_start>1);
◆ rIsSyzIndexRing()
◆ rKillModified_Wp_Ring()
void rKillModified_Wp_Ring |
( |
ring |
r | ) |
|
◆ rKillModifiedRing()
void rKillModifiedRing |
( |
ring |
r | ) |
|
◆ rMinpolyIsNULL()
Tests whether '(r->cf->minpoly) == NULL'.
Definition at line 690 of file ring.h.
702 assume((!((C->extRing)->qideal==
NULL)) && (!
idIs0((C->extRing)->qideal)));
◆ rModify_a_to_A()
void rModify_a_to_A |
( |
ring |
r | ) |
|
Definition at line 5598 of file ring.cc.
5604 while(r->order[
i]!=0)
5611 for(
j=r->block1[
i]-r->block0[
i];
j>=0;
j--)
5613 r->wvhdl[
i]=(
int*)w64;
◆ 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 2598 of file ring.cc.
2607 int iNeedInducedOrderingSetup = 0;
2611 need_other_ring = (exp_limit != r->bitmask);
2615 int *block0=(
int*)
omAlloc0((nblocks+1)*
sizeof(int));
2616 int *block1=(
int*)
omAlloc0((nblocks+1)*
sizeof(int));
2617 int **wvhdl=(
int**)
omAlloc0((nblocks+1)*
sizeof(
int *));
2626 if (r->block0[
i]==r->block1[
i])
2651 Warn(
"Error: unhandled ordering in rModifyRing: ringorder_S = [%d]", r_ord);
2665 need_other_ring=
TRUE;
2666 try_omit_comp=
FALSE;
2667 copy_block_index=
FALSE;
2681 need_other_ring=
TRUE;
2683 omitted_degree =
TRUE;
2697 need_other_ring=
TRUE;
2699 omitted_degree =
TRUE;
2707 try_omit_comp =
FALSE;
2710 iNeedInducedOrderingSetup++;
2719 try_omit_comp =
FALSE;
2728 if (copy_block_index)
2730 block0[
j]=r->block0[
i];
2731 block1[
j]=r->block1[
i];
2732 wvhdl[
j]=r->wvhdl[
i];
2737 if(!need_other_ring)
2757 res->bitmask=exp_limit;
2764 if (r->pFDegOrig !=
res->pFDegOrig &&
2769 res->firstwv = r->firstwv;
2770 res->firstBlockEnds = r->firstBlockEnds;
2774 res->pLDeg = r->pLDegOrig;
2783 res->typ[0] = r->typ[0];
2785 if (r->typ[0].data.syz.limit > 0)
2787 res->typ[0].data.syz.syz_index
2788 = (
int*)
omAlloc((r->typ[0].data.syz.limit +1)*
sizeof(int));
2789 memcpy(
res->typ[0].data.syz.syz_index, r->typ[0].data.syz.syz_index,
2790 (r->typ[0].data.syz.limit +1)*
sizeof(
int));
2794 if( iNeedInducedOrderingSetup > 0 )
2796 for(
j = 0,
i = 0; (
i < nblocks) && (iNeedInducedOrderingSetup > 0);
i++)
2803 r->typ[
i].data.is.limit,
2808 iNeedInducedOrderingSetup--;
2814 res->OrdSgn=r->OrdSgn;
2823 WarnS(
"error in nc_rComplete");
2836 WarnS(
"error in sca_Force!");
◆ rModifyRing_Simple()
ring rModifyRing_Simple |
( |
ring |
r, |
|
|
BOOLEAN |
omit_degree, |
|
|
BOOLEAN |
omit_comp, |
|
|
unsigned long |
exp_limit, |
|
|
BOOLEAN & |
simple |
|
) |
| |
Definition at line 2893 of file ring.cc.
2905 int nblocks=1+(ommit_comp!=0);
2907 int *block0=(
int*)
omAlloc0((nblocks+1)*
sizeof(int));
2908 int *block1=(
int*)
omAlloc0((nblocks+1)*
sizeof(int));
2909 int **wvhdl=(
int**)
omAlloc0((nblocks+1)*
sizeof(
int *));
2928 res->bitmask=exp_limit;
2939 WarnS(
"error in nc_rComplete");
2955 return rModifyRing(r, ommit_degree, ommit_comp, exp_limit);
◆ rModifyRing_Wp()
ring rModifyRing_Wp |
( |
ring |
r, |
|
|
int * |
weights |
|
) |
| |
construct Wp, C ring
Definition at line 2845 of file ring.cc.
2862 res->block1[0] = r->N;
2863 res->wvhdl[0] = weights;
2878 WarnS(
"error in nc_rComplete");
◆ rOpposite()
Definition at line 5176 of file ring.cc.
5200 int i2 = (
rVar(r)-1)/2;
5201 for(
i=i2;
i>=0;
i--)
5207 p = r->names[
rVar(r)-1-
i];
5208 r->names[
rVar(r)-1-
i] = r->names[
i];
5225 char *
p=r->names[
i];
5226 if(isupper(*
p)) *
p = tolower(*
p);
5227 else *
p = toupper(*
p);
5274 for(
i=0; src->order[
i]!=0;
i++)
5276 switch (src->order[
i])
5281 r->order[
j]=src->order[
i];
5285 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5286 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5290 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5291 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5297 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5298 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5299 r->wvhdl[
j]=(
int*)
omAlloc((r->block1[
j]-r->block0[
j]+1)*
sizeof(int));
5300 for(
int k=r->block0[
j]; k<=r->block1[
j];
k++)
5301 r->wvhdl[
j][
k-r->block0[
j]]=1;
5304 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5305 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5313 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5314 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5315 r->wvhdl[
j]=(
int*)
omAlloc((r->block1[
j]-r->block0[
j]+1)*
sizeof(int));
5316 for(
int k=r->block0[
j]; k<=r->block1[
j];
k++)
5317 r->wvhdl[
j][
k-r->block0[
j]]=1;
5320 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5321 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5329 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5330 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5331 r->wvhdl[
j]=r->wvhdl[
j+1]; r->wvhdl[
j+1]=
NULL;
5335 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5336 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5344 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5345 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5346 r->wvhdl[
j]=r->wvhdl[
j+1]; r->wvhdl[
j+1]=
NULL;
5350 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5351 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5358 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5359 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5360 int n=r->block1[
j]-r->block0[
j];
5362 for (
int nn=0; nn<=n; nn++)
5371 r->block0[
j]=
rOppVar(r, src->block1[
i]);
5372 r->block1[
j]=
rOppVar(r, src->block0[
i]);
5430 int *par_perm =
NULL;
5433 for(
i=1;
i<=r->N;
i++)
5449 MATELEM(C,nj,ni) =
p_PermPoly(
MATELEM(src->GetNC()->C,
i,
j),perm,src,r, nMap,par_perm,
rPar(src));
5452 MATELEM(
D,nj,ni) =
p_PermPoly(
MATELEM(src->GetNC()->D,
i,
j),perm,src,r, nMap,par_perm,
rPar(src));
5460 WarnS(
"Error initializing non-commutative multiplication!");
5468 assume( r->GetNC()->IsSkewConstant == src->GetNC()->IsSkewConstant);
5475 if (src->qideal !=
NULL)
5480 r->qideal =
idOppose(src, src->qideal, r);
5482 r->qideal =
id_Copy(src->qideal, r);
◆ rOrd_is_Comp_dp()
◆ rOrd_is_Totaldegree_Ordering()
Definition at line 1882 of file ring.cc.
1885 return (
rVar(r) > 1 &&
1891 ((r->order[1]!=0) &&
◆ rOrd_SetCompRequiresSetm()
return TRUE if p_SetComp requires p_Setm
Definition at line 1862 of file ring.cc.
1867 for (pos=0;pos<r->OrdSize;pos++)
◆ rOrderName()
Definition at line 499 of file ring.cc.
508 if (order==0)
Werror(
"wrong ring order `%s`",ordername);
◆ rOrdStr()
Definition at line 513 of file ring.cc.
518 for (nblocks=0; r->order[nblocks]; nblocks++);
537 if (r->wvhdl[
l]!=
NULL)
541 j<(r->block1[
l]-r->block0[
l]+1)*(r->block1[
l]-r->block0[
l]+1);
548 for (
i = 0;
i<r->block1[
l]-r->block0[
l];
i++)
557 for (
i = 0;
i<r->block1[
l]-r->block0[
l];
i++)
567 if (
j+
i+1==(r->block1[
l]-r->block0[
l]+1)*(r->block1[
l]-r->block0[
l]+1))
577 assume( r->block0[
l] == r->block1[
l] );
578 const int s = r->block0[
l];
586 if (r->bitmask!=0xffff)
◆ rPar()
static int rPar |
( |
const ring |
r | ) |
|
|
inlinestatic |
(r->cf->P)
Definition at line 590 of file ring.h.
◆ rParameter()
(r->cf->parameter)
Definition at line 616 of file ring.h.
◆ rParStr()
Definition at line 624 of file ring.cc.
628 char const *
const *
const params =
rParameter(r);
635 l+=strlen(params[
i])+1;
641 strcat(
s, params[
i]);
644 strcat(
s, params[
i]);
◆ rRing_has_CompLastBlock()
BOOLEAN rRing_has_CompLastBlock |
( |
ring |
r | ) |
|
◆ rRing_is_Homog()
Definition at line 5072 of file ring.cc.
5076 for (
i=0;
i<nb;
i++)
5078 if (r->wvhdl[
i] !=
NULL)
5080 int length = r->block1[
i] - r->block0[
i];
5081 int* wvhdl = r->wvhdl[
i];
5087 if (wvhdl[
j] != 0 && wvhdl[
j] != 1)
return FALSE;
◆ rRingVar()
static char* rRingVar |
( |
short |
i, |
|
|
const ring |
r |
|
) |
| |
|
inlinestatic |
◆ 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 1668 of file ring.cc.
1672 if (r1 == r2)
return TRUE;
1676 if ((r1->cf != r2->cf)
1678 || (r1->OrdSgn != r2->OrdSgn))
1682 while (r1->order[
i] != 0)
1684 if (r2->order[
i] == 0)
return FALSE;
1685 if ((r1->order[
i] != r2->order[
i])
1686 || (r1->block0[
i] != r2->block0[
i])
1687 || (r1->block1[
i] != r2->block1[
i]))
1689 if (r1->wvhdl[
i] !=
NULL)
1691 if (r2->wvhdl[
i] ==
NULL)
1693 for (
j=0;
j<r1->block1[
i]-r1->block0[
i]+1;
j++)
1694 if (r2->wvhdl[
i][
j] != r1->wvhdl[
i][
j])
1700 if (r2->order[
i] != 0)
return FALSE;
◆ rSetISReference()
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 4919 of file ring.cc.
4925 dReportError(
"Error: WRONG USE of rSetISReference: wrong ring! (typ == NULL)");
4934 dReportError(
"Error: WRONG USE of rSetISReference: specified ordering block was not found!!!" );
4939 if(
i != r->typ[pos].data.is.limit )
4940 Print(
"Changing record on pos: %d\nOld limit: %d --->> New Limit: %d\n", pos, r->typ[pos].data.is.limit,
i);
4943 const ideal FF =
idrHeadR(F, r, r);
4946 if( r->typ[pos].data.is.F !=
NULL)
4949 PrintS(
"Deleting old reference set F... \n");
4952 r->typ[pos].data.is.F =
NULL;
4957 r->typ[pos].data.is.F = FF;
4959 r->typ[pos].data.is.limit =
i;
◆ rSetSyzComp()
void rSetSyzComp |
( |
int |
k, |
|
|
const ring |
r |
|
) |
| |
Definition at line 4973 of file ring.cc.
4983 if ((r->typ!=
NULL) && (r->typ[0].ord_typ==
ro_syz))
4985 r->block0[0]=r->block1[0] =
k;
4986 if(
k == r->typ[0].data.syz.limit )
4990 if (r->typ[0].data.syz.limit == 0)
4992 r->typ[0].data.syz.syz_index = (
int*)
omAlloc0((
k+1)*
sizeof(int));
4993 r->typ[0].data.syz.syz_index[0] = 0;
4994 r->typ[0].data.syz.curr_index = 1;
4998 r->typ[0].data.syz.syz_index = (
int*)
5000 (r->typ[0].data.syz.limit+1)*
sizeof(int),
5003 for (
i=r->typ[0].data.syz.limit + 1;
i<=
k;
i++)
5005 r->typ[0].data.syz.syz_index[
i] =
5006 r->typ[0].data.syz.curr_index;
5008 if(k < r->typ[0].data.syz.limit)
5011 Warn(
"rSetSyzComp called with smaller limit (%d) as before (%d)",
k, r->typ[0].data.syz.limit);
5013 r->typ[0].data.syz.curr_index = 1 + r->typ[0].data.syz.syz_index[
k];
5017 r->typ[0].data.syz.limit =
k;
5018 r->typ[0].data.syz.curr_index++;
5027 Warn(
"rSetSyzComp(%d) in an IS ring! Be careful!",
k);
5032 r->block0[0] = r->block1[0] =
k;
◆ rSetWeightVec()
void rSetWeightVec |
( |
ring |
r, |
|
|
int64 * |
wv |
|
) |
| |
Definition at line 5130 of file ring.cc.
5135 memcpy(r->typ[0].data.wp64.weights64,wv,r->N*
sizeof(
int64));
◆ rShortOut()
◆ rSimpleOrdStr()
const char* rSimpleOrdStr |
( |
int |
ord | ) |
|
◆ rString()
Definition at line 648 of file ring.cc.
655 char *
res=(
char *)
omAlloc(strlen(ch)+strlen(var)+strlen(ord)+9);
656 sprintf(
res,
"(%s),(%s),(%s)",ch,var,ord);
◆ rSum()
int rSum |
( |
ring |
r1, |
|
|
ring |
r2, |
|
|
ring & |
sum |
|
) |
| |
◆ 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 726 of file ring.cc.
730 memset(&tmpR,0,
sizeof(tmpR));
781 if (r1->cf->extRing->cf==r2->cf)
791 WerrorS (
"coeff sum of two extension fields not implemented");
797 WerrorS(
"coeff sum not yet implemented");
804 char **names=(
char **)
omAlloc0(
l*
sizeof(
char *));
809 for (
i=0;
i<r1->N;
i++)
813 if (*(r1->names[
i]) ==
'\0')
845 if (*(r2->names[
i]) ==
'\0')
868 if (strcmp(r1->names[
j],r2->names[
i])==0)
937 if ((r2->block0[0]==1)
938 && (r2->block1[0]==
rVar(r2))
944 tmpR.
order[1]=r2->order[0];
945 if (r2->wvhdl[0]!=
NULL)
1011 if (rb->wvhdl[
i]!=
NULL)
1012 WarnS(
"rSum: weights not implemented");
1018 for (
i=0;r1->order[
i]!=0;
i++)
1023 if (r1->wvhdl[
i]!=
NULL)
1034 for (
i=0;r2->order[
i]!=0;
i++)
1042 if (r2->wvhdl[
i]!=
NULL)
1049 if((r1->OrdSgn==-1)||(r2->OrdSgn==-1))
1069 if (r1->wvhdl[
i]!=
NULL)
1080 Werror(
"variables must not overlap (# of vars: %d,%d -> %d)",
rVar(r1),
rVar(r2),
k);
1086 memcpy(sum,&tmpR,
sizeof(
ip_sring));
1103 if ( (R1_is_nc) || (R2_is_nc))
1127 int *perm1 = (
int *)
omAlloc0((
rVar(R1)+1)*
sizeof(int));
1128 int *par_perm1 =
NULL;
1131 int *perm2 = (
int *)
omAlloc0((
rVar(R2)+1)*
sizeof(int));
1132 int *par_perm2 =
NULL;
1137 perm1, par_perm1, sum->cf->type);
1141 perm2, par_perm2, sum->cf->type);
1144 matrix C1 = R1->GetNC()->C, C2 = R2->GetNC()->C;
1145 matrix D1 = R1->GetNC()->D, D2 = R2->GetNC()->D;
1154 for (
i = 1;
i <=
rVar(R1);
i++)
1167 MATELEM(C,
i,
j) =
p_PermPoly(
MATELEM(C1,
i,
j), perm1, R1, sum, nMap1, par_perm1,
rPar(R1));
1170 MATELEM(
D,
i,
j) =
p_PermPoly(
MATELEM(D1,
i,
j), perm1, R1, sum, nMap1, par_perm1,
rPar(R1));
1183 MATELEM(C,
rVar(R1)+
i,
rVar(R1)+
j) =
p_PermPoly(
MATELEM(C2,
i,
j),perm2,R2,sum, nMap2,par_perm2,
rPar(R2));
1186 MATELEM(
D,
rVar(R1)+
i,
rVar(R1)+
j) =
p_PermPoly(
MATELEM(D2,
i,
j),perm2,R2,sum, nMap2,par_perm2,
rPar(R2));
1194 WarnS(
"Error initializing non-commutative multiplication!");
1203 Print(
"\nRefs: R1: %d, R2: %d\n", R1->GetNC()->ref, R2->GetNC()->ref);
1226 if (r1->qideal!=
NULL)
1237 int *perm1 = (
int *)
omAlloc0((
rVar(r1)+1)*
sizeof(int));
1238 int *par_perm1 =
NULL;
1242 perm1, par_perm1, sum->cf->type);
1246 for (
int for_i=0;for_i<
IDELEMS(r1->qideal);for_i++)
1248 r1->qideal->m[for_i], perm1,
1251 par_perm1,
rPar(r1));
1256 if (r2->qideal!=
NULL)
1260 int *perm2 = (
int *)
omAlloc0((
rVar(r2)+1)*
sizeof(int));
1261 int *par_perm2 =
NULL;
1265 perm2, par_perm2, sum->cf->type);
1269 for (
int for_i=0;for_i<
IDELEMS(r2->qideal);for_i++)
1271 r2->qideal->m[for_i], perm2,
1274 par_perm2,
rPar(r2));
◆ rTypeOfMatrixOrder()
Definition at line 186 of file ring.cc.
189 int sz = (int)
sqrt((
double)(order->
length()-2));
190 if ((sz*sz)!=(order->
length()-2))
192 WerrorS(
"Matrix order is not a square matrix");
195 while ((
i<sz) && (typ==1))
198 while ((
j<sz) && ((*order)[
j*sz+
i+2]==0))
j++;
202 WerrorS(
"Matrix order not complete");
204 else if ((*order)[
j*sz+
i+2]<0)
◆ rUnComplete()
void rUnComplete |
( |
ring |
r | ) |
|
Definition at line 3846 of file ring.cc.
3848 if (r ==
NULL)
return;
3849 if (r->VarOffset !=
NULL)
3851 if (r->OrdSize!=0 && r->typ !=
NULL)
3853 for(
int i = 0;
i < r->OrdSize;
i++)
3854 if( r->typ[
i].ord_typ ==
ro_is)
3857 r->typ[
i].data.is.F =
NULL;
3859 if( r->typ[
i].data.is.pVarOffset !=
NULL )
3862 r->typ[
i].data.is.pVarOffset =
NULL;
3865 else if (r->typ[
i].ord_typ ==
ro_syz)
3867 if(r->typ[
i].data.syz.limit > 0)
3868 omFreeSize(r->typ[
i].data.syz.syz_index, ((r->typ[
i].data.syz.limit) +1)*
sizeof(
int));
3869 r->typ[
i].data.syz.syz_index =
NULL;
3873 assume( r->typ[
i].data.syzcomp.ShiftedComponents ==
NULL );
3874 assume( r->typ[
i].data.syzcomp.Components ==
NULL );
3884 if (r->PolyBin !=
NULL)
3889 if (r->ordsgn !=
NULL && r->CmpL_Size != 0)
3891 if (r->p_Procs !=
NULL)
3893 omfreeSize(r->VarL_Offset, r->VarL_Size*
sizeof(
int));
3895 if (r->NegWeightL_Offset!=
NULL)
3897 omFreeSize(r->NegWeightL_Offset, r->NegWeightL_Size*
sizeof(
int));
3898 r->NegWeightL_Offset=
NULL;
◆ rVar()
static short rVar |
( |
const ring |
r | ) |
|
|
inlinestatic |
#define rVar(r) (r->N)
Definition at line 583 of file ring.h.
◆ rVarStr()
Definition at line 598 of file ring.cc.
605 for (
i=0;
i<r->N;
i++)
607 l+=strlen(r->names[
i])+1;
611 for (
i=0;
i<r->N-1;
i++)
613 strcat(
s,r->names[
i]);
616 strcat(
s,r->names[
i]);
◆ rWrite()
Definition at line 227 of file ring.cc.
248 PrintS(
"// coefficients: ");
260 R->ShortOut = bSaveShortOut;
303 Print(
"// number of vars : %d",r->N);
308 for (
int l=0, nlen=0 ;
l<nblocks;
l++)
311 Print(
"\n// block %3d : ",
l+1);
318 assume( r->block0[
l] == r->block1[
l] );
319 const int s = r->block0[
l];
327 Print(
" syz_comp: %d",r->block0[
l]);
339 for (
i = r->block0[
l]-1; i<r->block1[
l];
i++)
341 nlen = strlen(r->names[
i]);
346 if (r->wvhdl[
l]!=
NULL)
349 j<(r->block1[
l]-r->block0[
l]+1)*(r->block1[
l]-r->block0[
l]+1);
352 PrintS(
"\n// : weights ");
353 for (
i = 0;
i<=r->block1[
l]-r->block0[
l];
i++)
365 Print(
" %*d" ,nlen,r->wvhdl[
l][
i+
j]);
371 int m=r->wvhdl[
l][
i];
372 Print(
"\n// : %d module weights ",
m);
374 for(;
i<=
m;
i++)
Print(
" %*d" ,nlen,r->wvhdl[
l][
i]);
381 PrintS(
"\n// noncommutative relations:");
387 for (
i = 1;
i<r->N;
i++)
389 for (
j =
i+1;
j<=r->N;
j++)
394 Print(
"\n// %s%s=",r->names[
j-1],r->names[
i-1]);
405 Print(
"\n// is skew constant:%d",r->GetNC()->IsSkewConstant);
410 PrintS(
"\n// quotient of sca by ideal");
430 PrintS(
"\n// quotient ring from ideal");
◆ sip_sring_bin
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
ideal id_SimpleAdd(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros
static int rRealloc1(ring r, int size, int pos)
int dReportError(const char *fmt,...)
#define omCheckAddrSize(addr, size)
@ n_Zn
only used if HAVE_RINGS is defined
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
static BOOLEAN rField_is_long_R(const ring r)
void StringAppendS(const char *st)
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
#define omcheckAddrSize(addr, size)
static void rO_Align(int &place, int &bitplace)
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
size_t omSizeOfAddr(const void *addr)
void p_Write0(poly p, ring lmRing, ring tailRing)
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
BOOLEAN rOrd_is_MixedDegree_Ordering(ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
static BOOLEAN rCanShortOut(const ring r)
static void rO_LexVars(int &place, int &bitplace, int start, int end, int &prev_ord, long *o, int *v, int bits, int opt_var)
void rDebugPrint(const ring r)
#define MATELEM(mat, i, j)
static BOOLEAN rField_is_Ring_2toM(const ring r)
int naIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
#define omGetSpecBin(size)
@ rOrderType_ExpComp
simple ordering, exponent vector has priority component not compatible with exp-vector order
@ n_long_C
complex floating point (GMP) numbers
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
static nc_type & ncRingType(nc_struct *p)
static void rO_ISPrefix(int &place, int &bitplace, int &prev_ord, long *o, int, int *v, sro_ord &ord_struct)
static void rO_TDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct)
@ n_Z2m
only used if HAVE_RINGS is defined
@ rOrderType_Schreyer
Schreyer ordering.
static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r)
static void rSetNegWeight(ring r)
void p_ProcsSet(ring r, p_Procs_s *p_Procs)
static BOOLEAN length(leftv result, leftv arg)
static void rO_TDegree_neg(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void p_wrp(poly p, ring lmRing, ring tailRing)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
@ n_Q
rational (GMP) numbers
gmp_float sqrt(const gmp_float &a)
@ rOrderType_General
non-simple ordering as specified by currRing
static void rNGetSComps(int **currComponents, long **currShiftedComponents, ring r)
static void rOppWeight(int *w, int l)
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...
@ n_Znm
only used if HAVE_RINGS is defined
const CanonicalForm CFMap CFMap & N
static BOOLEAN rField_is_Zp_a(const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
static void rO_Syzcomp(int &place, int &bitplace, int &prev_ord, long *o, sro_ord &ord_struct)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
void p_Debug_GetSpecNames(const ring r, const char *&field, const char *&length, const char *&ord)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
ring nc_rCreateNCcomm_rCopy(ring r)
int rSum(ring r1, ring r2, ring &sum)
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,...
@ n_long_R
real floating point (GMP) numbers
void p_Setm_Dummy(poly p, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void rSetVarL(ring r)
set r->VarL_Size, r->VarL_Offset, r->VarL_LowIndex
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
bool sca_Force(ring rGR, int b, int e)
for(int i=0;i<=n;i++) degsf[i]
@ rOrderType_Exp
simple ordering, exponent vector has priority component is compatible with exp-vector order
long p_WFirstTotalDegree(poly p, const ring r)
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
BOOLEAN rHasSimpleOrder(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
@ n_polyExt
used to represent polys as coeffcients
static BOOLEAN rField_is_Ring_Z(const ring r)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
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)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_ModN(const coeffs r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static BOOLEAN rField_is_Q_a(const ring r)
void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint)
ideal idrHeadR(ideal id, ring r, ring dest_r)
Copy leading terms of id[i] via prHeeadR into dest_r.
void PrintS(const char *s)
#define omFreeSize(addr, size)
static void rOptimizeLDeg(ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
@ rOrderType_CompExp
simple ordering, component has priority
static void rSetOutParams(ring r)
#define omfreeSize(addr, size)
static short scaFirstAltVar(ring r)
static void rSetDegStuff(ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
BOOLEAN rOrd_is_WeightedDegree_Ordering(const ring r)
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete/n_New are empty operations.
bool nc_rCopy(ring res, const ring r, bool bSetupQuotient)
static unsigned long rGetDivMask(int bits)
get r->divmask depending on bits per exponent
void p_Write(poly p, ring lmRing, ring tailRing)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
static BOOLEAN rField_is_Ring_PtoM(const ring r)
static const char *const ringorder_name[]
@ n_Z
only used if HAVE_RINGS is defined
static void rRightAdjustVarOffset(ring r)
right-adjust r->VarOffset
@ rOrderType_Syz
syzygy ordering
static int rPar(const ring r)
(r->cf->P)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
static void rO_WDegree_neg(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
struct p_Procs_s p_Procs_s
static BOOLEAN rField_is_R(const ring r)
static void rCheckOrdSgn(ring r, int i)
void p_Setm_WFirstTotalDegree(poly p, const ring r)
static void rSetOption(ring r)
static int rBlocks(ring r)
void nc_rKill(ring r)
complete destructor
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
void p_Debug_GetProcNames(const ring r, p_Procs_s *p_Procs)
matrix mpNew(int r, int c)
create a r x c zero-matrix
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,...
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
void p_Setm_General(poly p, const ring r)
static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
returns TRUE, if r is not a field and r has non-trivial units
@ n_R
single prescision (6,6) real numbers
#define UPMATELEM(i, j, nVar)
void rDelete(ring r)
unconditionally deletes fields in r
@ rOrderType_ExpNoComp
simple ordering, differences in component are not considered
int ntIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
long p_Deg(poly a, const ring r)
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)
static void rO_WDegree64(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int64 *weights)
static BOOLEAN rField_is_GF(const ring r)
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,...
p_SetmProc p_GetSetmProc(const ring r)
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
static void rO_WMDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
void rWrite(ring r, BOOLEAN details)
void StringSetS(const char *st)
static int si_max(const int a, const int b)
#define omUnGetSpecBin(bin_ptr)
static void rDBGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
@ ringorder_IS
Induced (Schreyer) ordering.
BOOLEAN rOrder_is_DegOrdering(const rRingOrder_t order)
void Werror(const char *fmt,...)
static short scaLastAltVar(ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
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)
const char * rSimpleOrdStr(int ord)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
void WerrorS(const char *s)
char * rCharStr(const ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
ideal SCAQuotient(const ring r)
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)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
ring rAssure_CompLastBlock(ring r, BOOLEAN complete)
makes sure that c/C ordering is last ordering
long p_WTotaldegree(poly p, const ring r)
ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst)
opposes a module I from Rop to currRing(dst)
static void p_Setm(poly p, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
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...
#define omCheckAddr(addr)
static long p_Totaldegree(poly p, const ring r)
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
const CanonicalForm int s
static BOOLEAN rIsSyzIndexRing(const ring r)
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
static void rO_WDegree(int &place, int &bitplace, int start, int end, long *o, sro_ord &ord_struct, int *weights)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
BOOLEAN rHasSimpleOrderAA(ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
void p_Setm_TotalDegree(poly p, const ring r)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
@ ringorder_rs
opposite of ls
@ ringorder_a64
for int64 weights
#define TEST_RINGDEP_OPTS
static char const ** rParameter(const ring r)
(r->cf->parameter)
static BOOLEAN rField_is_Ring_ModN(const ring r)
static bool rIsSCA(const ring r)
static BOOLEAN rField_is_long_C(const ring r)
@ rOrderType_Syz2dpc
syzcomp2dpc
#define omFreeBin(addr, bin)
static BOOLEAN rField_is_Zp(const ring r)
static BOOLEAN rShortOut(const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
static void rDBChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
static void rNChangeSComps(int *currComponents, long *currShiftedComponents, ring r)
static void rO_Syz(int &place, int &bitplace, int &prev_ord, int syz_comp, long *o, sro_ord &ord_struct)
long * currShiftedComponents
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
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!...
void nKillChar(coeffs r)
undo all initialisations
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.
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
int sgn(const Rational &a)
static unsigned long rGetExpSize(unsigned long bitmask, int &bits)
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
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)
static BOOLEAN rField_is_Q(const ring r)
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...
#define omReallocSize(addr, o_size, size)