TODO: there might be extreme cases where this doesn't hold...
58{
59 ring sourcering = dst_r;
60
61#ifdef HAVE_PLURAL
63 {
65 {
66 WerrorS(
"Sorry, not yet implemented for noncomm. rings");
68 }
69 }
70#endif
71
74 ideal temp1;
75 ideal temp2;
76
77 int imagepvariables =
rVar(theImageRing);
78 int N =
rVar(dst_r)+imagepvariables;
79
80 ring tmpR;
82 {
83 WerrorS(
"error in rSumInternal");
85 }
86
87 if (theImageRing->cf != dst_r->cf)
88 {
89
90 WerrorS(
"Coefficient fields/rings must be equal");
92 }
93
95
98 else
101 if (theImageRing->qideal!=
NULL)
j+=
IDELEMS(theImageRing->qideal);
102 temp1 =
idInit(sourcering->N+
j,1);
103 for (
i=0;
i<sourcering->N;
i++)
104 {
109 {
112 tmpR);
114 }
115 else
116 {
118 }
120 }
122 for (
i=sourcering->N;i<sourcering->
N+j0;
i++)
123 {
126 tmpR);
127 }
128 for (
i=sourcering->N+j0;i<sourcering->
N+
j;
i++)
129 {
131 pChangeSizeOfPoly(theImageRing, theImageRing->qideal->m[
i-sourcering->N-j0], 1, imagepvariables, tmpR),
132 tmpR);
133 }
134
135
137
140 {
142 }
143
144
145
149 {
152 {
155 sourcering);
157 {
160 }
163 }
164 }
167
169
171 return temp1;
172}
const CanonicalForm CFMap CFMap & N
void WerrorS(const char *s)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
static nc_type & ncRingType(nc_struct *p)
int p_LowVar(poly p, const ring r)
the minimal index of used variables - 1
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
void pEnlargeSet(poly **p, int l, int increment)
static poly p_Add_q(poly p, poly q, 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 p_Setm(poly p, const ring r)
static poly p_SortMerge(poly p, const ring r, BOOLEAN revert=FALSE)
static void p_Delete(poly *p, const ring r)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static poly pChangeSizeOfPoly(ring p_ring, poly p, int minvar, int maxvar, const ring dst_r)
void rDelete(ring r)
unconditionally deletes fields in r
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,...
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static short rVar(const ring r)
#define rVar(r) (r->N)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size