My Project
Public Member Functions | Data Fields
sTObject Class Reference

#include <kutil.h>

Public Member Functions

KINLINE void Init (ring r=currRing)
 
KINLINE sTObject (ring tailRing=currRing)
 
KINLINE sTObject (poly p, ring tailRing=currRing)
 
KINLINE sTObject (poly p, ring c_r, ring tailRing)
 
KINLINE sTObject (sTObject *T, int copy)
 
KINLINE void Set (ring r=currRing)
 
KINLINE void Set (poly p_in, ring r=currRing)
 
KINLINE void Set (poly p_in, ring c_r, ring t_r)
 
KINLINE void Delete ()
 
KINLINE void Clear ()
 
KINLINE void Copy ()
 
KINLINE poly GetLmCurrRing ()
 
KINLINE poly GetLmTailRing ()
 
KINLINE poly GetLm (ring r)
 
KINLINE void GetLm (poly &p, ring &r) const
 
KINLINE BOOLEAN IsNull () const
 
KINLINE int GetpLength ()
 
KINLINE void SetLmCurrRing ()
 
KINLINE poly Next ()
 
KINLINE void LmDeleteAndIter ()
 
KINLINE long pTotalDeg () const
 
KINLINE long pFDeg () const
 
KINLINE long SetpFDeg ()
 
KINLINE long GetpFDeg () const
 
KINLINE long pLDeg ()
 
KINLINE long SetDegStuffReturnLDeg ()
 
KINLINE void Mult_nn (number n)
 
KINLINE void ShallowCopyDelete (ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
 
KINLINE void pNorm ()
 
KINLINE void pCleardenom ()
 
KINLINE void pContent ()
 
void wrp ()
 

Data Fields

unsigned long sevSig
 
poly sig
 
poly p
 
poly t_p
 
poly max_exp
 
ring tailRing
 
long FDeg
 
int ecart
 
int length
 
int pLength
 
int i_r
 
int shift
 
char is_normalized
 
char is_redundant
 
char is_sigsafe
 
char is_special
 

Detailed Description

Definition at line 68 of file kutil.h.

Constructor & Destructor Documentation

◆ sTObject() [1/4]

KINLINE sTObject::sTObject ( ring  tailRing = currRing)

Definition at line 116 of file kInline.h.

117 {
118  Init(r);
119 }
KINLINE void Init(ring r=currRing)
Definition: kInline.h:110

◆ sTObject() [2/4]

KINLINE sTObject::sTObject ( poly  p,
ring  tailRing = currRing 
)

Definition at line 156 of file kInline.h.

157 {
158  Init(r);
159  Set(p_in, r);
160 }
KINLINE void Set(ring r=currRing)
Definition: kInline.h:106

◆ sTObject() [3/4]

KINLINE sTObject::sTObject ( poly  p,
ring  c_r,
ring  tailRing 
)

Definition at line 187 of file kInline.h.

188 {
189  Init(t_r);
190  Set(p_in, c_r, t_r);
191 }

◆ sTObject() [4/4]

KINLINE sTObject::sTObject ( sTObject T,
int  copy 
)

Definition at line 193 of file kInline.h.

194 {
195  *this = *T;
196  if (copy)
197  {
198  if (t_p != NULL)
199  {
200  t_p = p_Copy(t_p, tailRing);
202  }
203  else
204  {
205  p = p_Copy(p, currRing);
206  }
207  }
208 }
poly p
Definition: kutil.h:73
poly t_p
Definition: kutil.h:74
ring tailRing
Definition: kutil.h:76
CFArray copy(const CFList &list)
write elements of list into an array
STATIC_VAR jList * T
Definition: janet.cc:30
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition: kInline.h:979
#define NULL
Definition: omList.c:12
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:848
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13

Member Function Documentation

◆ Clear()

KINLINE void sTObject::Clear ( )

Definition at line 224 of file kInline.h.

225 {
226  p = NULL;
227  t_p = NULL;
228  ecart = 0;
229  length = 0;
230  pLength = 0;
231  FDeg = 0;
233 }
#define FALSE
Definition: auxiliary.h:96
int length
Definition: kutil.h:79
int ecart
Definition: kutil.h:78
char is_normalized
Definition: kutil.h:87
int pLength
Definition: kutil.h:80
long FDeg
Definition: kutil.h:77

◆ Copy()

KINLINE void sTObject::Copy ( )

Definition at line 235 of file kInline.h.

236 {
237  if (t_p != NULL)
238  {
239  t_p = p_Copy(t_p, tailRing);
240  if (p != NULL) /* and t_p!=NULL*/
241  {
242  p = p_LmInit(p, currRing);
244  pNext(p) = pNext(t_p);
245  }
246  }
247  else
248  {
249  p = p_Copy(p, currRing);
250  }
251 }
#define pNext(p)
Definition: monomials.h:36
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1337

◆ Delete()

KINLINE void sTObject::Delete ( )

Definition at line 210 of file kInline.h.

211 {
212  if (t_p != NULL)
213  {
214  p_Delete(&t_p, tailRing);
215  if (p != NULL)
216  p_LmFree(p, currRing);
217  }
218  else
219  {
220  p_Delete(&p, currRing);
221  }
222 }
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:903
static void p_LmFree(poly p, ring)
Definition: p_polys.h:685

◆ GetLm() [1/2]

KINLINE void sTObject::GetLm ( poly &  p,
ring &  r 
) const

Definition at line 285 of file kInline.h.

286 {
287  if (t_p != NULL)
288  {
289  p_r = t_p;
290  r_r = tailRing;
291  }
292  else
293  {
294  p_r = p;
295  r_r = currRing;
296  }
297 }

◆ GetLm() [2/2]

KINLINE poly sTObject::GetLm ( ring  r)

Definition at line 273 of file kInline.h.

274 {
275  assume(r == tailRing || r == currRing);
276  if (r == currRing)
277  return GetLmCurrRing();
278 
279  if (t_p == NULL && p != NULL)
281 
282  return t_p;
283 }
KINLINE poly GetLmCurrRing()
Definition: kInline.h:253
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:970
#define assume(x)
Definition: mod2.h:389

◆ GetLmCurrRing()

KINLINE poly sTObject::GetLmCurrRing ( )

Definition at line 253 of file kInline.h.

254 {
255  if (p == NULL && t_p != NULL)
257 
258  return p;
259 }

◆ GetLmTailRing()

KINLINE poly sTObject::GetLmTailRing ( )

Definition at line 260 of file kInline.h.

261 {
262  if (t_p == NULL)
263  {
264  if (p != NULL && tailRing != currRing)
265  {
267  return t_p;
268  }
269  return p;
270  }
271  return t_p;
272 }

◆ GetpFDeg()

KINLINE long sTObject::GetpFDeg ( ) const

Definition at line 448 of file kInline.h.

449 {
450  assume(FDeg == this->pFDeg());
451  return FDeg;
452 }
KINLINE long pFDeg() const
Definition: kInline.h:433

◆ GetpLength()

KINLINE int sTObject::GetpLength ( )

Definition at line 304 of file kInline.h.

305 {
306  if (pLength <= 0) pLength = ::pLength(p != NULL ? p : t_p);
307  return pLength;
308 }

◆ Init()

KINLINE void sTObject::Init ( ring  r = currRing)

Definition at line 110 of file kInline.h.

111 {
112  memset(this, 0, sizeof(sTObject));
113  i_r = -1;
114  Set(r);
115 }
Definition: kutil.h:69
int i_r
Definition: kutil.h:81

◆ IsNull()

KINLINE BOOLEAN sTObject::IsNull ( ) const

Definition at line 299 of file kInline.h.

300 {
301  return (p == NULL && t_p == NULL);
302 }

◆ LmDeleteAndIter()

KINLINE void sTObject::LmDeleteAndIter ( )

Definition at line 324 of file kInline.h.

325 {
326  assume(p != NULL || t_p != NULL);
327  if (t_p != NULL)
328  {
330  if (p != NULL)
331  {
332  p_LmFree(p, currRing);
333  p = NULL;
334  }
335  }
336  else
337  {
339  }
341 }
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:757

◆ Mult_nn()

KINLINE void sTObject::Mult_nn ( number  n)

Definition at line 345 of file kInline.h.

346 {
347  if (t_p != NULL)
348  {
349  t_p = p_Mult_nn(t_p, n, tailRing);
350  if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
351  }
352  else
353  {
354  p = p_Mult_nn(p, n, currRing, tailRing);
355  }
356 }
#define pSetCoeff0(p, n)
Definition: monomials.h:59
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:960

◆ Next()

KINLINE poly sTObject::Next ( )

Definition at line 316 of file kInline.h.

317 {
318  assume(p != NULL || t_p != NULL);
319  if (t_p != NULL) return pNext(t_p);
320  return pNext(p);
321 }

◆ pCleardenom()

KINLINE void sTObject::pCleardenom ( )

Definition at line 469 of file kInline.h.

470 {
471  assume(p != NULL);
473  if ((TEST_OPT_CONTENTSB) && (!is_ring))
474  {
475  number n;
476  if (t_p != NULL)
477  {
480  }
481  else
482  {
484  }
485  if (!nIsOne(n))
486  {
488  denom->n=nInvers(n);
489  denom->next=DENOMINATOR_LIST;
490  DENOMINATOR_LIST=denom;
491  }
492  nDelete(&n);
493  }
494  #ifdef HAVE_RINGS
495  else if (is_ring)
496  {
497  number c;
498  if (t_p != NULL)
499  c=pGetCoeff(t_p);
500  else
501  c=pGetCoeff(p);
502  const coeffs C=tailRing->cf;
503  number u=n_GetUnit(c,C);
504 
505  if (t_p != NULL)
506  {
507  if (!n_IsOne(u,C))
508  {
509  number uInv = n_Invers(u, C);
510  t_p=p_Mult_nn(t_p,uInv,tailRing);
511  n_Delete(&uInv,C);
512  }
514  {
515  t_p = p_Neg(t_p,tailRing);
516  }
518  }
519  else
520  {
521  if (!n_IsOne(u,C))
522  {
523  number uInv = n_Invers(u, C);
524  p=p_Mult_nn(p,uInv,tailRing);
525  n_Delete(&uInv,C);
526  }
527  if(!n_GreaterZero(pGetCoeff(p),tailRing->cf))
528  {
529  p = p_Neg(p,tailRing);
530  }
531  }
532  n_Delete(&u,C);
533  }
534  #endif
535  else
536  {
537  if (t_p != NULL)
538  {
541  }
542  else
543  {
545  }
546  }
547 }
int BOOLEAN
Definition: auxiliary.h:87
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
Definition: coeffs.h:564
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition: coeffs.h:494
static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
in Z: 1 in Z/kZ (where k is not a prime): largest divisor of n (taken in Z) that is co-prime with k i...
Definition: coeffs.h:532
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
VAR denominator_list DENOMINATOR_LIST
Definition: kutil.cc:84
denominator_list_s * denominator_list
Definition: kutil.h:63
denominator_list next
Definition: kutil.h:65
The main handler for Singular numbers which are suitable for Singular polynomials.
#define nDelete(n)
Definition: numbers.h:16
#define nInvers(a)
Definition: numbers.h:33
#define nIsOne(n)
Definition: numbers.h:25
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define TEST_OPT_CONTENTSB
Definition: options.h:128
void p_Cleardenom_n(poly ph, const ring r, number &c)
Definition: p_polys.cc:3019
void p_ProjectiveUnique(poly ph, const ring r)
Definition: p_polys.cc:3208
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1109
#define rField_is_Ring(R)
Definition: ring.h:486

◆ pContent()

KINLINE void sTObject::pContent ( )

Definition at line 549 of file kInline.h.

550 {
551  assume(p != NULL);
552  if (t_p != NULL)
553  {
555  if (!n_GreaterZero(pGetCoeff(t_p),tailRing->cf))
556  {
557  t_p=p_Neg (t_p,tailRing);
558  }
560  }
561  else
562  {
564  if (!n_GreaterZero(pGetCoeff(p),currRing->cf))
565  {
566  p=p_Neg (p,currRing);
567  }
568  }
569 }
void p_SimpleContent(poly ph, int smax, const ring r)
Definition: p_polys.cc:2629

◆ pFDeg()

KINLINE long sTObject::pFDeg ( ) const

Definition at line 433 of file kInline.h.

434 {
435  if (p != NULL) return p_FDeg(p, currRing);
436  return tailRing->pFDeg(t_p, tailRing);
437 }
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:382

◆ pLDeg()

KINLINE long sTObject::pLDeg ( )

Definition at line 453 of file kInline.h.

454 {
455  return tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
456 }
KINLINE poly GetLmTailRing()
Definition: kInline.h:260

◆ pNorm()

KINLINE void sTObject::pNorm ( )

Definition at line 571 of file kInline.h.

572 {
573  assume(p != NULL);
574  if (! is_normalized)
575  {
576  p_Norm(p, currRing);
577  if (t_p != NULL)
580  }
581 }
#define TRUE
Definition: auxiliary.h:100
void p_Norm(poly p1, const ring r)
Definition: p_polys.cc:3835

◆ pTotalDeg()

KINLINE long sTObject::pTotalDeg ( ) const

Definition at line 438 of file kInline.h.

439 {
440  if (p != NULL) return p_Totaldegree(p, currRing);
441  return p_Totaldegree(t_p,tailRing);
442 }
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1509

◆ Set() [1/3]

KINLINE void sTObject::Set ( poly  p_in,
ring  c_r,
ring  t_r 
)

Definition at line 162 of file kInline.h.

163 {
164  if (c_r != t_r)
165  {
166  assume(c_r == currRing && t_r == tailRing);
167 #ifdef HAVE_SHIFTBBA
168  if (c_r->isLPring)
169  {
170  shift = si_max(p_mFirstVblock(p_in, c_r) - 1, 0);
171  if (!shift) p_Test(p_in, currRing);
172  }
173  else
174 #endif
175  {
176  p_Test(p_in, currRing);
177  }
178  p = p_in;
179  pLength=::pLength(p_in);
180  }
181  else
182  {
183  Set(p_in, c_r);
184  }
185 }
static int si_max(const int a, const int b)
Definition: auxiliary.h:124
int shift
Definition: kutil.h:84
#define p_Test(p, r)
Definition: p_polys.h:162
int p_mFirstVblock(poly p, const ring ri)
Definition: shiftop.cc:478

◆ Set() [2/3]

KINLINE void sTObject::Set ( poly  p_in,
ring  r = currRing 
)

Definition at line 120 of file kInline.h.

121 {
122  if (r != currRing)
123  {
124  assume(r == tailRing);
125 #ifdef HAVE_SHIFTBBA
126  if (r->isLPring)
127  {
128  shift = si_max(p_mFirstVblock(p_in, r) - 1, 0);
129  if (!shift) p_Test(p_in, r);
130  }
131  else
132 #endif
133  {
134  p_Test(p_in, r);
135  }
136  t_p = p_in;
137  }
138  else
139  {
140 #ifdef HAVE_SHIFTBBA
141  if (currRing->isLPring)
142  {
143  shift = si_max(p_mFirstVblock(p_in, currRing) - 1, 0);
144  if (!shift) p_Test(p_in, currRing);
145  }
146  else
147 #endif
148  {
149  p_Test(p_in, currRing);
150  }
151  p = p_in;
152  }
153  pLength=::pLength(p_in);
154 }

◆ Set() [3/3]

KINLINE void sTObject::Set ( ring  r = currRing)

Definition at line 106 of file kInline.h.

107 {
108  tailRing = r;
109 }

◆ SetDegStuffReturnLDeg()

KINLINE long sTObject::SetDegStuffReturnLDeg ( )

Definition at line 457 of file kInline.h.

458 {
459  FDeg = this->pFDeg();
460  long d = this->pLDeg();
461  ecart = d - FDeg;
462  return d;
463 }
KINLINE long pLDeg()
Definition: kInline.h:453

◆ SetLmCurrRing()

KINLINE void sTObject::SetLmCurrRing ( )

Definition at line 310 of file kInline.h.

311 {
312  if (p == NULL && t_p != NULL)
314 }

◆ SetpFDeg()

KINLINE long sTObject::SetpFDeg ( )

Definition at line 443 of file kInline.h.

444 {
445  FDeg = this->pFDeg();
446  return FDeg;
447 }

◆ ShallowCopyDelete()

KINLINE void sTObject::ShallowCopyDelete ( ring  new_tailRing,
omBin  new_tailBin,
pShallowCopyDeleteProc  p_shallow_copy_delete,
BOOLEAN  set_max = TRUE 
)

Definition at line 392 of file kInline.h.

395 {
396  if (new_tailBin == NULL) new_tailBin = new_tailRing->PolyBin;
397  if (t_p != NULL)
398  {
399  t_p = p_shallow_copy_delete(t_p, tailRing, new_tailRing, new_tailBin);
400  if (p != NULL)
401  pNext(p) = pNext(t_p);
402  if (new_tailRing == currRing)
403  {
404  if (p == NULL) p = t_p;
405  else p_LmFree(t_p, tailRing);
406  t_p = NULL;
407  }
408  }
409  else if (p != NULL) /* && t_p==NULL */
410  {
411  if (pNext(p) != NULL)
412  {
413  pNext(p) = p_shallow_copy_delete(pNext(p),
414  tailRing, new_tailRing, new_tailBin);
415  }
416  if (new_tailRing != currRing)
417  {
418  t_p = k_LmInit_currRing_2_tailRing(p, new_tailRing);
419  pNext(t_p) = pNext(p);
420  }
421  }
422  if (max_exp != NULL)
423  {
424  max_exp = p_shallow_copy_delete(max_exp,tailRing,new_tailRing,new_tailBin);
425  }
426  else if (set_max && pNext(t_p) != NULL)
427  {
428  max_exp = p_GetMaxExpP(pNext(t_p), new_tailRing);
429  }
430  tailRing = new_tailRing;
431 }
poly max_exp
Definition: kutil.h:75
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0,...
Definition: p_polys.cc:1138

◆ wrp()

void sTObject::wrp ( )

Definition at line 797 of file kutil.cc.

798 {
799  if (t_p != NULL) p_wrp(t_p, tailRing);
800  else if (p != NULL) p_wrp(p, currRing, tailRing);
801  else ::wrp(NULL);
802 }
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:373
void wrp(poly p)
Definition: polys.h:310

Field Documentation

◆ ecart

int sTObject::ecart

Definition at line 78 of file kutil.h.

◆ FDeg

long sTObject::FDeg

Definition at line 77 of file kutil.h.

◆ i_r

int sTObject::i_r

Definition at line 81 of file kutil.h.

◆ is_normalized

char sTObject::is_normalized

Definition at line 87 of file kutil.h.

◆ is_redundant

char sTObject::is_redundant

Definition at line 93 of file kutil.h.

◆ is_sigsafe

char sTObject::is_sigsafe

Definition at line 98 of file kutil.h.

◆ is_special

char sTObject::is_special

Definition at line 102 of file kutil.h.

◆ length

int sTObject::length

Definition at line 79 of file kutil.h.

◆ max_exp

poly sTObject::max_exp

Definition at line 75 of file kutil.h.

◆ p

poly sTObject::p

Definition at line 73 of file kutil.h.

◆ pLength

int sTObject::pLength

Definition at line 80 of file kutil.h.

◆ sevSig

unsigned long sTObject::sevSig

Definition at line 71 of file kutil.h.

◆ shift

int sTObject::shift

Definition at line 84 of file kutil.h.

◆ sig

poly sTObject::sig

Definition at line 72 of file kutil.h.

◆ t_p

poly sTObject::t_p

Definition at line 74 of file kutil.h.

◆ tailRing

ring sTObject::tailRing

Definition at line 76 of file kutil.h.


The documentation for this class was generated from the following files: