Macros | Functions
sparsmat.h File Reference

Go to the source code of this file.

Macros

#define SM_MULT   sm_MultDiv
 
#define SM_DIV   sm_SpecialPolyDiv
 

Functions

poly sm_Mult (poly, poly, const ring)
 
void sm_PolyDiv (poly, poly, const ring)
 
poly sm_MultDiv (poly, poly, const poly, const ring)
 
void sm_SpecialPolyDiv (poly, poly, const ring)
 
poly sm_CallDet (ideal I, const ring)
 
void sm_CallBareiss (ideal smat, int x, int y, ideal &M, intvec **iv, const ring)
 
ideal sm_CallSolv (ideal I, const ring)
 
ring sm_RingChange (const ring, long)
 
void sm_KillModifiedRing (ring r)
 
long sm_ExpBound (ideal, int, int, int, const ring)
 
BOOLEAN sm_CheckDet (ideal, int, BOOLEAN, const ring)
 

Macro Definition Documentation

◆ SM_DIV

#define SM_DIV   sm_SpecialPolyDiv

Definition at line 24 of file sparsmat.h.

◆ SM_MULT

#define SM_MULT   sm_MultDiv

Definition at line 23 of file sparsmat.h.

Function Documentation

◆ sm_CallBareiss()

void sm_CallBareiss ( ideal  smat,
int  x,
int  y,
ideal &  M,
intvec **  iv,
const ring   
)

Definition at line 403 of file sparsmat.cc.

404 {
405  int r=id_RankFreeModule(I,R),t=r;
406  int c=IDELEMS(I),s=c;
407  long bound;
408  ring tmpR;
409  sparse_mat *bareiss;
410 
411  if ((x>0) && (x<t))
412  t-=x;
413  if ((y>1) && (y<s))
414  s-=y;
415  if (t>s) t=s;
416  bound=sm_ExpBound(I,c,r,t,R);
417  tmpR=sm_RingChange(R,bound);
418  ideal II = idrCopyR(I, R, tmpR);
419  bareiss = new sparse_mat(II,tmpR);
420  if (bareiss->smGetAct() == NULL)
421  {
422  delete bareiss;
423  *iv=new intvec(1,rVar(tmpR));
424  }
425  else
426  {
427  id_Delete(&II,tmpR);
428  bareiss->smNewBareiss(x, y);
429  II = bareiss->smRes2Mod();
430  *iv = new intvec(bareiss->smGetRed());
431  bareiss->smToIntvec(*iv);
432  delete bareiss;
433  II = idrMoveR(II,tmpR,R);
434  }
435  sm_KillModifiedRing(tmpR);
436  M=II;
437 }
int smGetRed()
Definition: sparsmat.cc:178
const CanonicalForm int s
Definition: facAbsFact.cc:55
ring sm_RingChange(const ring origR, long bound)
Definition: sparsmat.cc:262
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:57
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
long sm_ExpBound(ideal m, int di, int ra, int t, const ring currRing)
Definition: sparsmat.cc:193
#define M
Definition: sirandom.c:24
void smNewBareiss(int, int)
Definition: sparsmat.cc:605
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
const ring R
Definition: DebugPrint.cc:36
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:249
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
ideal smRes2Mod()
Definition: sparsmat.cc:504
void sm_KillModifiedRing(ring r)
Definition: sparsmat.cc:293
Variable x
Definition: cfModGcd.cc:4023
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
void smToIntvec(intvec *)
Definition: sparsmat.cc:520
smpoly * smGetAct()
Definition: sparsmat.cc:177

◆ sm_CallDet()

poly sm_CallDet ( ideal  I,
const ring   
)

Definition at line 358 of file sparsmat.cc.

359 {
360  if (I->ncols != I->rank)
361  {
362  Werror("det of %ld x %d module (matrix)",I->rank,I->ncols);
363  return NULL;
364  }
365  int r=id_RankFreeModule(I,R);
366  if (I->ncols != r) // some 0-lines at the end
367  {
368  return NULL;
369  }
370  long bound=sm_ExpBound(I,r,r,r,R);
371  number diag,h=n_Init(1,R->cf);
372  poly res;
373  ring tmpR;
374  sparse_mat *det;
375  ideal II;
376 
377  tmpR=sm_RingChange(R,bound);
378  II = idrCopyR(I, R, tmpR);
379  diag = sm_Cleardenom(II,tmpR);
380  det = new sparse_mat(II,tmpR);
381  id_Delete(&II,tmpR);
382  if (det->smGetAct() == NULL)
383  {
384  delete det;
385  sm_KillModifiedRing(tmpR);
386  return NULL;
387  }
388  res=det->smDet();
389  if(det->smGetSign()<0) res=p_Neg(res,tmpR);
390  delete det;
391  res = prMoveR(res, tmpR, R);
392  sm_KillModifiedRing(tmpR);
393  if (!n_Equal(diag,h,R->cf))
394  {
395  p_Mult_nn(res,diag,R);
396  p_Normalize(res,R);
397  }
398  n_Delete(&diag,R->cf);
399  n_Delete(&h,R->cf);
400  return res;
401 }
ring sm_RingChange(const ring origR, long bound)
Definition: sparsmat.cc:262
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
int smGetSign()
Definition: sparsmat.cc:176
poly prMoveR(poly &p, ring src_r, ring dest_r)
Definition: prCopy.cc:91
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static number sm_Cleardenom(ideal, const ring)
Definition: sparsmat.cc:2278
long sm_ExpBound(ideal m, int di, int ra, int t, const ring currRing)
Definition: sparsmat.cc:193
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
const ring R
Definition: DebugPrint.cc:36
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3672
#define NULL
Definition: omList.c:10
void sm_KillModifiedRing(ring r)
Definition: sparsmat.cc:293
poly smDet()
Definition: sparsmat.cc:531
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff &#39;a&#39; and &#39;b&#39; represent the same number; they may have different representations.
Definition: coeffs.h:464
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189
smpoly * smGetAct()
Definition: sparsmat.cc:177

◆ sm_CallSolv()

ideal sm_CallSolv ( ideal  I,
const ring   
)

Definition at line 2371 of file sparsmat.cc.

2372 {
2373  sparse_number_mat *linsolv;
2374  ring tmpR;
2375  ideal rr;
2376 
2377  if (id_IsConstant(I,R)==FALSE)
2378  {
2379  WerrorS("symbol in equation");
2380  return NULL;
2381  }
2382  I->rank = id_RankFreeModule(I,R);
2383  if (smCheckSolv(I)) return NULL;
2384  tmpR=sm_RingChange(R,1);
2385  rr=idrCopyR(I,R, tmpR);
2386  linsolv = new sparse_number_mat(rr,tmpR);
2387  rr=NULL;
2388  linsolv->smTriangular();
2389  if (linsolv->smIsSing() == 0)
2390  {
2391  linsolv->smSolv();
2392  rr = linsolv->smRes2Ideal();
2393  }
2394  else
2395  WerrorS("singular problem for linsolv");
2396  delete linsolv;
2397  if (rr!=NULL)
2398  rr = idrMoveR(rr,tmpR,R);
2399  sm_KillModifiedRing(tmpR);
2400  return rr;
2401 }
ring sm_RingChange(const ring origR, long bound)
Definition: sparsmat.cc:262
#define FALSE
Definition: auxiliary.h:94
ideal smRes2Ideal()
Definition: sparsmat.cc:2561
BOOLEAN id_IsConstant(ideal id, const ring r)
test if the ideal has only constant polynomials NOTE: zero ideal/module is also constant ...
void WerrorS(const char *s)
Definition: feFopen.cc:24
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static BOOLEAN smCheckSolv(ideal)
Definition: sparsmat.cc:2944
const ring R
Definition: DebugPrint.cc:36
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:249
#define NULL
Definition: omList.c:10
void sm_KillModifiedRing(ring r)
Definition: sparsmat.cc:293
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193

◆ sm_CheckDet()

BOOLEAN sm_CheckDet ( ideal  ,
int  ,
BOOLEAN  ,
const ring   
)

Definition at line 307 of file sparsmat.cc.

308 {
309  int s,t,i;
310  poly p;
311 
312  if (d>100)
313  return sw;
314  if (!rField_is_Q(r))
315  return sw;
316  s = t = 0;
317  if (sw)
318  {
319  for(i=IDELEMS(I)-1;i>=0;i--)
320  {
321  p=I->m[i];
322  if (p!=NULL)
323  {
324  if(!p_IsConstant(p,r))
325  return sw;
326  s++;
327  t+=n_Size(pGetCoeff(p),r->cf);
328  }
329  }
330  }
331  else
332  {
333  for(i=IDELEMS(I)-1;i>=0;i--)
334  {
335  p=I->m[i];
336  if (!p_IsConstantPoly(p,r))
337  return sw;
338  while (p!=NULL)
339  {
340  s++;
341  t+=n_Size(pGetCoeff(p),r->cf);
342  pIter(p);
343  }
344  }
345  }
346  s*=15;
347  if (t>s)
348  return !sw;
349  else
350  return sw;
351 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1876
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
Definition: p_polys.h:1890
polyrec * poly
Definition: hilb.h:10
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition: coeffs.h:574

◆ sm_ExpBound()

long sm_ExpBound ( ideal  ,
int  ,
int  ,
int  ,
const ring   
)

Definition at line 193 of file sparsmat.cc.

194 {
195  poly p;
196  long kr, kc;
197  long *r, *c;
198  int al, bl, i, j, k;
199 
200  if (ra==0) ra=1;
201  al = di*sizeof(long);
202  c = (long *)omAlloc(al);
203  bl = ra*sizeof(long);
204  r = (long *)omAlloc0(bl);
205  for (i=di-1;i>=0;i--)
206  {
207  kc = 0;
208  p = m->m[i];
209  while(p!=NULL)
210  {
211  k = p_GetComp(p, currRing)-1;
212  kr = r[k];
213  for (j=rVar(currRing);j>0;j--)
214  {
215  if(p_GetExp(p,j, currRing)>kc)
216  kc=p_GetExp(p,j, currRing);
217  if(p_GetExp(p,j, currRing)>kr)
218  kr=p_GetExp(p,j, currRing);
219  }
220  r[k] = kr;
221  pIter(p);
222  }
223  c[i] = kc;
224  }
225  if (t<di) smMinSelect(c, t, di);
226  if (t<ra) smMinSelect(r, t, ra);
227  kr = kc = 0;
228  for (j=t-1;j>=0;j--)
229  {
230  kr += r[j];
231  kc += c[j];
232  }
233  omFreeSize((ADDRESS)c, al);
234  omFreeSize((ADDRESS)r, bl);
235  if (kr<kc) kc = kr;
236  if (kr<1) kr = 1;
237  return kr;
238 }
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void * ADDRESS
Definition: auxiliary.h:115
int k
Definition: cfEzgcd.cc:93
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define pIter(p)
Definition: monomials.h:44
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
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:464
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static void smMinSelect(long *, int, int)
Definition: sparsmat.cc:240
polyrec * poly
Definition: hilb.h:10
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ sm_KillModifiedRing()

void sm_KillModifiedRing ( ring  r)

Definition at line 293 of file sparsmat.cc.

294 {
295  if (r->qideal!=NULL) id_Delete(&(r->qideal),r);
297 }
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
void rKillModifiedRing(ring r)
Definition: ring.cc:2967

◆ sm_Mult()

poly sm_Mult ( poly  ,
poly  ,
const ring   
)

◆ sm_MultDiv()

poly sm_MultDiv ( poly  ,
poly  ,
const poly  ,
const ring   
)

Definition at line 1814 of file sparsmat.cc.

1815 {
1816  poly pa, e, res, r;
1817  BOOLEAN lead;
1818 
1819  if ((c == NULL) || p_LmIsConstantComp(c,R))
1820  {
1821  return pp_Mult_qq(a, b, R);
1822  }
1823  if (smSmaller(a, b))
1824  {
1825  r = a;
1826  a = b;
1827  b = r;
1828  }
1829  res = NULL;
1830  e = p_Init(R);
1831  lead = FALSE;
1832  while (!lead)
1833  {
1834  pSetCoeff0(e,pGetCoeff(b));
1835  if (sm_IsNegQuot(e, b, c, R))
1836  {
1837  lead = p_LmDivisibleByNoComp(e, a, R);
1838  r = sm_SelectCopy_ExpMultDiv(a, e, b, c, R);
1839  }
1840  else
1841  {
1842  lead = TRUE;
1843  r = pp_Mult_mm(a, e,R);
1844  }
1845  if (lead)
1846  {
1847  if (res != NULL)
1848  {
1849  sm_FindRef(&pa, &res, r, R);
1850  if (pa == NULL)
1851  lead = FALSE;
1852  }
1853  else
1854  {
1855  pa = res = r;
1856  }
1857  }
1858  else
1859  res = p_Add_q(res, r, R);
1860  pIter(b);
1861  if (b == NULL)
1862  {
1863  p_LmFree(e, R);
1864  return res;
1865  }
1866  }
1867  do
1868  {
1869  pSetCoeff0(e,pGetCoeff(b));
1870  if (sm_IsNegQuot(e, b, c, R))
1871  {
1872  r = sm_SelectCopy_ExpMultDiv(a, e, b, c, R);
1873  if (p_LmDivisibleByNoComp(e, a,R))
1874  sm_CombineChain(&pa, r, R);
1875  else
1876  pa = p_Add_q(pa,r,R);
1877  }
1878  else
1879  {
1880  r = pp_Mult_mm(a, e, R);
1881  sm_CombineChain(&pa, r, R);
1882  }
1883  pIter(b);
1884  } while (b != NULL);
1885  p_LmFree(e, R);
1886  return res;
1887 }
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:932
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition: p_polys.h:1754
static BOOLEAN smSmaller(poly, poly)
Definition: sparsmat.cc:2017
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:957
#define TRUE
Definition: auxiliary.h:98
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static void p_LmFree(poly p, ring)
Definition: p_polys.h:678
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
static void sm_FindRef(poly *, poly *, poly, const ring)
Definition: sparsmat.cc:2075
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1070
const ring R
Definition: DebugPrint.cc:36
#define NULL
Definition: omList.c:10
static void sm_CombineChain(poly *, poly, const ring)
Definition: sparsmat.cc:2028
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
static poly sm_SelectCopy_ExpMultDiv(poly p, poly m, poly a, poly b, const ring currRing)
Definition: sparsmat.cc:103
int BOOLEAN
Definition: auxiliary.h:85
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1243
const poly b
Definition: syzextra.cc:213
static BOOLEAN sm_IsNegQuot(poly, const poly, const poly, const ring)
Definition: sparsmat.cc:1961

◆ sm_PolyDiv()

void sm_PolyDiv ( poly  ,
poly  ,
const ring   
)

Definition at line 1615 of file sparsmat.cc.

1616 {
1617  const number x = pGetCoeff(b);
1618  number y, yn;
1619  poly t, h, dummy;
1620  int i;
1621 
1622  if (pNext(b) == NULL)
1623  {
1624  do
1625  {
1626  if (!p_LmIsConstantComp(b,R))
1627  {
1628  for (i=rVar(R); i; i--)
1629  p_SubExp(a,i,p_GetExp(b,i,R),R);
1630  p_Setm(a,R);
1631  }
1632  y = n_Div(pGetCoeff(a),x,R->cf);
1633  n_Normalize(y,R->cf);
1634  p_SetCoeff(a,y,R);
1635  pIter(a);
1636  } while (a != NULL);
1637  return;
1638  }
1639  dummy = p_Init(R);
1640  do
1641  {
1642  for (i=rVar(R); i; i--)
1643  p_SubExp(a,i,p_GetExp(b,i,R),R);
1644  p_Setm(a,R);
1645  y = n_Div(pGetCoeff(a),x,R->cf);
1646  n_Normalize(y,R->cf);
1647  p_SetCoeff(a,y,R);
1648  yn = n_InpNeg(n_Copy(y,R->cf),R->cf);
1649  t = pNext(b);
1650  h = dummy;
1651  do
1652  {
1653  h = pNext(h) = p_Init(R);
1654  //pSetComp(h,0);
1655  for (i=rVar(R); i; i--)
1656  p_SetExp(h,i,p_GetExp(a,i,R)+p_GetExp(t,i,R),R);
1657  p_Setm(h,R);
1658  pSetCoeff0(h,n_Mult(yn, pGetCoeff(t),R->cf));
1659  pIter(t);
1660  } while (t != NULL);
1661  n_Delete(&yn,R->cf);
1662  pNext(h) = NULL;
1663  a = pNext(a) = p_Add_q(pNext(a), pNext(dummy),R);
1664  } while (a!=NULL);
1665  p_LmFree(dummy, R);
1666 }
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:57
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:932
const poly a
Definition: syzextra.cc:212
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:582
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
static void p_LmFree(poly p, ring)
Definition: p_polys.h:678
static long p_SubExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:608
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:640
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:464
const ring R
Definition: DebugPrint.cc:36
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
Definition: coeffs.h:561
int i
Definition: cfEzgcd.cc:123
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:483
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:619
Variable x
Definition: cfModGcd.cc:4023
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
#define pSetCoeff0(p, n)
Definition: monomials.h:67
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
static Poly * h
Definition: janet.cc:978
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1243
const poly b
Definition: syzextra.cc:213

◆ sm_RingChange()

ring sm_RingChange ( const ring  ,
long   
)

Definition at line 262 of file sparsmat.cc.

263 {
264 // *origR =currRing;
265  ring tmpR=rCopy0(origR,FALSE,FALSE);
267  int *block0=(int*)omAlloc(3*sizeof(int));
268  int *block1=(int*)omAlloc(3*sizeof(int));
269  ord[0]=ringorder_c;
270  ord[1]=ringorder_dp;
271  tmpR->order=ord;
272  tmpR->OrdSgn=1;
273  block0[1]=1;
274  tmpR->block0=block0;
275  block1[1]=tmpR->N;
276  tmpR->block1=block1;
277  tmpR->bitmask = 2*bound;
278  tmpR->wvhdl = (int **)omAlloc0((3) * sizeof(int*));
279 
280 // ???
281 // if (tmpR->bitmask > currRing->bitmask) tmpR->bitmask = currRing->bitmask;
282 
283  rComplete(tmpR,1);
284  if (origR->qideal!=NULL)
285  {
286  tmpR->qideal= idrCopyR_NoSort(origR->qideal, origR, tmpR);
287  }
288  if (TEST_OPT_PROT)
289  Print("[%ld:%d]", (long) tmpR->bitmask, tmpR->ExpL_Size);
290  return tmpR;
291 }
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
#define Print
Definition: emacs.cc:83
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:94
#define omAlloc(size)
Definition: omAllocDecl.h:210
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:3356
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1323
rRingOrder_t
order stuff
Definition: ring.h:75
#define NULL
Definition: omList.c:10
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:206
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ sm_SpecialPolyDiv()

void sm_SpecialPolyDiv ( poly  ,
poly  ,
const ring   
)

Definition at line 1894 of file sparsmat.cc.

1895 {
1896  if (pNext(b) == NULL)
1897  {
1898  sm_PolyDivN(a, pGetCoeff(b),R);
1899  return;
1900  }
1901  sm_ExactPolyDiv(a, b, R);
1902 }
const poly a
Definition: syzextra.cc:212
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
const ring R
Definition: DebugPrint.cc:36
static void sm_PolyDivN(poly, const number, const ring)
Definition: sparsmat.cc:2004
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void sm_ExactPolyDiv(poly, poly, const ring)
Definition: sparsmat.cc:1906
const poly b
Definition: syzextra.cc:213