My Project  debian-1:4.1.2-p1+ds-2
Macros | Functions | Variables
fast_maps.cc File Reference
#include "kernel/mod2.h"
#include "misc/options.h"
#include "polys/monomials/p_polys.h"
#include "polys/prCopy.h"
#include "kernel/ideals.h"
#include "polys/monomials/ring.h"
#include "polys/sbuckets.h"
#include "kernel/maps/fast_maps.h"

Go to the source code of this file.

Macros

#define HAVE_DEST_R   1
 
#define HAVE_SRC_R   1
 
#define HAVE_MAP_OPTIMIZE   1
 

Functions

static poly maGetMaxExpP (poly *max_map_monomials, int n_max_map_monomials, ring map_r, poly pi_m, ring pi_r)
 
static unsigned long maGetMaxExp (ideal pi_id, ring pi_r, ideal map_id, ring map_r)
 
mapoly maMonomial_Create (poly p, ring, sBucket_pt bucket)
 
void maMonomial_Destroy (mapoly mp, ring src_r, ring dest_r)
 
mapoly maPoly_InsertMonomial (mapoly &into, mapoly what, ring src_r)
 
mapoly maPoly_InsertMonomial (mapoly &into, poly p, ring src_r, sBucket_pt bucket)
 
static void maPoly_InsertPoly (mapoly &into, poly what, ring src_r, sBucket_pt bucket)
 
void maMap_CreatePolyIdeal (ideal map_id, ring map_r, ring src_r, ring dest_r, mapoly &mp, maideal &mideal)
 
void maMap_CreateRings (ideal map_id, ring map_r, ideal image_id, ring image_r, ring &src_r, ring &dest_r, BOOLEAN &simple)
 
static void maMap_KillRings (ring map_r, ring image_r, ring src_r, ring dest_r)
 
ideal maIdeal_2_Ideal (maideal m_id, ring)
 
void maPoly_GetLength (mapoly mp, int &length)
 
ideal fast_map_common_subexp (const ideal map_id, const ring map_r, const ideal image_id, const ring image_r)
 
static int maPoly_Substitute (macoeff c, poly p, ring dest_r)
 
static poly maPoly_EvalMon (poly src, ring src_r, poly *dest_id, ring dest_r)
 
void maPoly_Eval (mapoly root, ring src_r, ideal dest_id, ring dest_r, int total_cost)
 
static poly maEggT (const poly m1, const poly m2, poly &q1, poly &q2, const ring r)
 
static mapoly maFindBestggT (mapoly mp, mapoly &choice, mapoly &fp, mapoly &fq, const ring r)
 
void maPoly_Optimize (mapoly mpoly, ring src_r)
 

Variables

STATIC_VAR omBin mapolyBin = omGetSpecBin(sizeof(mapoly_s))
 
STATIC_VAR omBin macoeffBin = omGetSpecBin(sizeof(macoeff_s))
 

Macro Definition Documentation

◆ HAVE_DEST_R

#define HAVE_DEST_R   1

Definition at line 23 of file fast_maps.cc.

◆ HAVE_MAP_OPTIMIZE

#define HAVE_MAP_OPTIMIZE   1

Definition at line 27 of file fast_maps.cc.

◆ HAVE_SRC_R

#define HAVE_SRC_R   1

Definition at line 25 of file fast_maps.cc.

Function Documentation

◆ fast_map_common_subexp()

ideal fast_map_common_subexp ( const ideal  map_id,
const ring  map_r,
const ideal  image_id,
const ring  image_r 
)

Definition at line 346 of file fast_maps.cc.

354 {
355  ring src_r, dest_r;
356  ideal dest_id/*, res_id*/;
357  int length = 0;
358  BOOLEAN no_sort;
359 
360  // construct rings we work in:
361  // src_r: Wp with Weights set to length of poly in image_id
362  // dest_r: Simple ring without degree ordering and short exponents
363  maMap_CreateRings(map_id, map_r, image_id, image_r, src_r, dest_r, no_sort);
364 
365  // construct dest_id
366  if (dest_r != image_r)
367  {
368  dest_id = idrShallowCopyR(image_id, image_r, dest_r);
369  }
370  else
371  dest_id = image_id;
372 
373  // construct mpoly and mideal
374  mapoly mp;
375  maideal mideal;
376  maMap_CreatePolyIdeal(map_id, map_r, src_r, dest_r, mp, mideal);
377 
378  if (TEST_OPT_PROT)
379  {
381  Print("map[%ld:%d]{%d:", dest_r->bitmask, dest_r->ExpL_Size, length);
382  }
383 
384  // do the optimization step
385 #if HAVE_MAP_OPTIMIZE > 0
386  if (mp!=NULL) maPoly_Optimize(mp, src_r);
387 #endif
388  if (TEST_OPT_PROT)
389  {
391  Print("%d}", length);
392  }
393 
394  // do the actual evaluation
395  maPoly_Eval(mp, src_r, dest_id, dest_r, length);
396  if (TEST_OPT_PROT) PrintS(".");
397 
398  // collect the results back into an ideal
399  ideal res_dest_id = maIdeal_2_Ideal(mideal, dest_r);
400  if (TEST_OPT_PROT) PrintS(".");
401 
402  // convert result back to image_r
403  ideal res_image_id;
404  if (dest_r != image_r)
405  {
406  //if (no_sort) see Old/m134si.tst
407  // res_image_id = idrShallowCopyR_NoSort(res_dest_id, dest_r, image_r);
408  //else
409  res_image_id = idrShallowCopyR(res_dest_id, dest_r, image_r);
410  id_ShallowDelete(&res_dest_id, dest_r);
411  id_ShallowDelete(&dest_id,dest_r);
412  }
413  else
414  res_image_id = res_dest_id;
415 
416  if (TEST_OPT_PROT) PrintS(".");
417 
418  // clean-up the rings
419  maMap_KillRings(map_r, image_r, src_r, dest_r);

◆ maEggT()

static poly maEggT ( const poly  m1,
const poly  m2,
poly &  q1,
poly &  q2,
const ring  r 
)
static

Definition at line 576 of file fast_maps.cc.

586 {
587 
588  int i;
589  int dg = 0;
590  poly ggt = p_Init(r);
591  q1 = p_Init(r);
592  q2 = p_Init(r);
593 
594  for (i=1;i<=r->N;i++)
595  {
596  unsigned long e1 = p_GetExp(m1, i, r);
597  unsigned long e2 = p_GetExp(m2, i, r);
598  if (e1 > 0 && e2 > 0)
599  {
600  unsigned long em = (e1 > e2 ? e2 : e1);
601  dg += em;
602  p_SetExp(ggt, i, em, r);
603  p_SetExp(q1, i, e1 - em, r);
604  p_SetExp(q2, i, e2 - em, r);
605  }
606  else
607  {
608  p_SetExp(q1, i, e1, r);
609  p_SetExp(q2, i, e2, r);
610  }
611  }
612  if (dg>1)
613  {
614  p_Setm(ggt, r);
615  p_Setm(q1, r);
616  p_Setm(q2, r);
617  }

◆ maFindBestggT()

static mapoly maFindBestggT ( mapoly  mp,
mapoly choice,
mapoly fp,
mapoly fq,
const ring  r 
)
static

Definition at line 624 of file fast_maps.cc.

635 {
636  int ggt_deg = 0;
637  poly p = mp->src;
638  mapoly iter = choice;
639  poly ggT = NULL;
640  fp = NULL;
641  fq = NULL;
642  poly fp_p=NULL;
643  poly fq_p=NULL;
644  choice=NULL;
645  while ((iter != NULL) && (p_Deg(iter->src, r) > ggt_deg))
646  {
647  // maMonomial_Out(iter, r, NULL);
648  poly q1, q2, q;
649 
650  q = maEggT(p, iter->src, q1, q2,r);
651  if (q != NULL)
652  {
653  int tmp_deg;
654  assume((q1!=NULL)&&(q2!=NULL));
655  if ((tmp_deg=p_Deg(q,r)) > ggt_deg)
656  {
657  choice=iter;
658  if (ggT != NULL)
659  {
660  p_LmFree(ggT, r);
661  p_LmFree(fp_p, r);
662  p_LmFree(fq_p, r);
663  }
664  ggt_deg = tmp_deg ; /*p_Deg(q, r);*/
665  ggT = q;
666  fp_p = q1;
667  fq_p = q2;
668  }
669  else
670  {
671  p_LmFree(q, r);
672  p_LmFree(q1, r);
673  p_LmFree(q2, r);
674  }
675  }
676  iter=iter->next;
677  }
678  if(ggT!=NULL)
679  {
680  int dq =p_Totaldegree(fq_p,r);
681  if (dq!=0)
682  {
683  fq=maPoly_InsertMonomial(mp, fq_p, r, NULL);
684  fp=maPoly_InsertMonomial(mp, fp_p, r, NULL);
685  return maPoly_InsertMonomial(mp, ggT, r, NULL);
686  }
687  else
688  {
689  fq=NULL;
690  p_LmFree(fq_p, r);
691  p_LmFree(ggT, r);

◆ maGetMaxExp()

static unsigned long maGetMaxExp ( ideal  pi_id,
ring  pi_r,
ideal  map_id,
ring  map_r 
)
static

Definition at line 62 of file fast_maps.cc.

64 {
65  unsigned long max=0;
66  poly* max_map_monomials = (poly*) omAlloc(IDELEMS(map_id)*sizeof(poly));
67  poly max_pi_i, max_map_i;
68 
69  int i;
70  for (i=0; i<IDELEMS(map_id); i++)
71  {
72  max_map_monomials[i] = p_GetMaxExpP(map_id->m[i], map_r);
73  }
74 
75  for (i=0; i<IDELEMS(pi_id); i++)
76  {
77  max_pi_i = p_GetMaxExpP(pi_id->m[i], pi_r);
78  max_map_i = maGetMaxExpP(max_map_monomials, IDELEMS(map_id), map_r,
79  max_pi_i, pi_r);
80  unsigned long temp = p_GetMaxExp(max_map_i, map_r);
81  if (temp > max){ max=temp; }
82 
83  p_LmFree(max_pi_i, pi_r);
84  p_LmFree(max_map_i, map_r);
85  }
86  for (i=0; i<IDELEMS(map_id); i++)
87  {
88  p_Delete(&max_map_monomials[i], map_r);
89  }
90  omFreeSize(max_map_monomials,IDELEMS(map_id)*sizeof(poly));
91 
92  return max;

◆ maGetMaxExpP()

static poly maGetMaxExpP ( poly *  max_map_monomials,
int  n_max_map_monomials,
ring  map_r,
poly  pi_m,
ring  pi_r 
)
static

Definition at line 33 of file fast_maps.cc.

37 {
38  int n = si_min(pi_r->N, n_max_map_monomials);
39  int i, j;
40  unsigned long e_i, e_j;
41  poly m_i=NULL;
42  poly map_j = p_Init(map_r);
43 
44  for (i=1; i <= n; i++)
45  {
46  e_i = p_GetExp(pi_m, i, pi_r);
47  if (e_i==0) e_i=1;
48  m_i = max_map_monomials[i-1];
49  if (m_i != NULL && ! p_IsConstantComp(m_i, map_r))
50  {
51  for (j = 1; j<= map_r->N; j++)
52  {
53  e_j = p_GetExp(m_i, j, map_r);
54  if (e_j == 0) e_j=1;
55  p_AddExp(map_j, j, e_j*e_i, map_r);
56  }
57  }
58  }
59  return map_j;

◆ maIdeal_2_Ideal()

ideal maIdeal_2_Ideal ( maideal  m_id,
ring   
)

Definition at line 316 of file fast_maps.cc.

323 {
324  ideal res = idInit(m_id->n, 1);
325  int l;
326 
327  for (int i= 0; i < m_id->n; i++)
328  {
329  if (m_id->buckets[i]!=NULL)

◆ maMap_CreatePolyIdeal()

void maMap_CreatePolyIdeal ( ideal  map_id,
ring  map_r,
ring  src_r,
ring  dest_r,
mapoly mp,
maideal mideal 
)

Definition at line 249 of file fast_maps.cc.

256 {
257  mideal = (maideal) omAlloc0(sizeof(maideal_s));
258  mideal->n = IDELEMS(map_id);
259  mideal->buckets = (sBucket_pt*) omAlloc0(mideal->n*sizeof(sBucket_pt));
260  int i;
261  mp = NULL;
262 
263  for (i=0; i<mideal->n; i++)
264  {
265  if (map_id->m[i] != NULL)
266  {
267  mideal->buckets[i] = sBucketCreate(dest_r);
269 #ifdef PDEBUG
270  prShallowCopyR(map_id->m[i], map_r, src_r),
271 #else
272  prShallowCopyR_NoSort(map_id->m[i], map_r, src_r),
273 #endif

◆ maMap_CreateRings()

void maMap_CreateRings ( ideal  map_id,
ring  map_r,
ideal  image_id,
ring  image_r,
ring &  src_r,
ring &  dest_r,
BOOLEAN simple 
)

Definition at line 275 of file fast_maps.cc.

283 {
284 #if HAVE_SRC_R > 0
285  int* weights = (int*) omAlloc0(map_r->N*sizeof(int));
286  int i;
287  int n = si_min(map_r->N, IDELEMS(image_id));
288 
289  for (i=0; i<n; i++)
290  {
291  weights[i] = pLength(image_id->m[i])+1;
292  }
293  src_r = rModifyRing_Wp(map_r, weights);
294 #else
295  src_r = map_r;
296 #endif
297 
298 #if HAVE_DEST_R > 0
299  unsigned long maxExp = maGetMaxExp(map_id, map_r, image_id, image_r);
300  if (maxExp <= 1) maxExp = 2;
301  else if (maxExp > (unsigned long) image_r->bitmask)
302  maxExp = (unsigned long) image_r->bitmask;

◆ maMap_KillRings()

static void maMap_KillRings ( ring  map_r,
ring  image_r,
ring  src_r,
ring  dest_r 
)
static

Definition at line 304 of file fast_maps.cc.

310 {

◆ maMonomial_Create()

mapoly maMonomial_Create ( poly  p,
ring  ,
sBucket_pt  bucket 
)

Definition at line 134 of file fast_maps.cc.

138 {
140  //p_wrp(p,r_p);printf(" (%x) created\n",mp);
141  mp->src = p;
142  p->next = NULL;
143 
144  if (bucket != NULL)
145  {
146  mp->coeff = (macoeff) omAlloc0Bin(macoeffBin);
147  mp->coeff->bucket = bucket;
148  mp->coeff->n = pGetCoeff(p);
149  }

◆ maMonomial_Destroy()

void maMonomial_Destroy ( mapoly  mp,
ring  src_r,
ring  dest_r 
)

Definition at line 151 of file fast_maps.cc.

155 {
156  if (mp != NULL)
157  {
158  p_LmFree(mp->src, src_r);
159  if (mp->coeff != NULL)
160  {
161  macoeff coeff, next = mp->coeff;
162  do
163  {
164  coeff = next;
165  next = coeff->next;
166  omFreeBin(coeff, macoeffBin);
167  }
168  while (next != NULL);
169  if (mp->dest != NULL)
170  {
171  assume(dest_r != NULL);
172  p_Delete(&(mp->dest), dest_r);
173  }
174  }

◆ maPoly_Eval()

void maPoly_Eval ( mapoly  root,
ring  src_r,
ideal  dest_id,
ring  dest_r,
int  total_cost 
)

Definition at line 486 of file fast_maps.cc.

487  {
488  assume(p==NULL);
489  p=p_ISet(1,dest_r);
490  }
491  return p;
492 }
493 
494 void maPoly_Eval(mapoly root, ring src_r, ideal dest_id, ring dest_r, int total_cost)
495 {
496  // invert the list rooted at root:
497  if ((root!=NULL) && (root->next!=NULL))
498  {
499  mapoly q=root->next;
500  mapoly qn;
501  root->next=NULL;
502  do
503  {
504  qn=q->next;
505  q->next=root;
506  root=q;
507  q=qn;
508  }
509  while (qn !=NULL);
510  }
511 
512  total_cost /= 10;
513  int next_print_cost = total_cost;
514 
515  // the evaluation -----------------------------------------
516  mapoly p=root;
517  int cost = 0;
518 
519  while (p!=NULL)
520  {
521  // look at each mapoly: compute its value in ->dest
522  assume (p->dest==NULL);
523  {
524  if ((p->f1!=NULL)&&(p->f2!=NULL))
525  {
526  poly f1=p->f1->dest;
527  poly f2=p->f2->dest;
528  if (p->f1->ref>0) f1=p_Copy(f1,dest_r);
529  else
530  {
531  // we own p->f1->dest now (in f1)
532  p->f1->dest=NULL;
533  }
534  if (p->f2->ref>0) f2=p_Copy(f2,dest_r);
535  else
536  {
537  // we own p->f2->dest now (in f2)
538  p->f2->dest=NULL;
539  }
540  maMonomial_Free(p->f1,src_r, dest_r);
541  maMonomial_Free(p->f2,src_r, dest_r);
542  p->dest=p_Mult_q(f1,f2,dest_r);
543  } /* factors : 2 */
544  else
545  {
546  assume((p->f1==NULL) && (p->f2==NULL));
547  // no factorization provided, use the classical method:
548  p->dest=maPoly_EvalMon(p->src,src_r,dest_id->m,dest_r);
549  }
550  } /* p->dest==NULL */
551  // substitute the monomial: go through macoeff
552  p->ref -= maPoly_Substitute(p->coeff, p->dest, dest_r);
553  //printf("subst done\n");
554  if (total_cost)
555  {
557  cost++;
558  if (cost > next_print_cost)
559  {
560  PrintS("-");
561  next_print_cost += total_cost;
562  }
563  }
564 
565  mapoly pp=p;
566  p=p->next;
567  //p_wrp(pp->src, src_r);
568  if (pp->ref<=0)

◆ maPoly_EvalMon()

static poly maPoly_EvalMon ( poly  src,
ring  src_r,
poly *  dest_id,
ring  dest_r 
)
static

Definition at line 447 of file fast_maps.cc.

456 {
457  int i;
458  int e;
459  poly p=NULL;
460  poly pp;
461  BOOLEAN is_const=TRUE; // to check for zero-div in p_Mult_q
462  for(i=1;i<=src_r->N;i++)
463  {
464  e=p_GetExp(src,i,src_r);
465  if (e>0)
466  {
467  is_const=FALSE;
468  pp=dest_id[i-1];
469  if (pp==NULL)
470  {
471  p_Delete(&p,dest_r);
472  return NULL;
473  }
474  if (/*(*/ p==NULL /*)*/) /* && (e>0)*/
475  {
476  p=p_Copy(pp /*dest_id[i-1]*/,dest_r);
477  e--;
478  }
479  while (e>0)
480  {
481  p=p_Mult_q(p,p_Copy(pp /*dest_id[i-1]*/,dest_r),dest_r);
482  e--;
483  }
484  }

◆ maPoly_GetLength()

void maPoly_GetLength ( mapoly  mp,
int &  length 
)

Definition at line 331 of file fast_maps.cc.

338 {
339  length = 0;

◆ maPoly_InsertMonomial() [1/2]

mapoly maPoly_InsertMonomial ( mapoly into,
mapoly  what,
ring  src_r 
)

Definition at line 179 of file fast_maps.cc.

184 {
185  if (into == NULL)
186  {
187  into = what;
188  return what;
189  }
190 
191  mapoly iter = into;
192  mapoly prev = NULL;
193 
194  Top:
195  p_LmCmpAction(iter->src, what->src, src_r, goto Equal, goto Greater, goto Smaller);
196 
197  Greater:
198  if (iter->next == NULL)
199  {
200  iter->next = what;
201  return what;
202  }
203  prev = iter;
204  iter = iter->next;
205  goto Top;
206 
207  Smaller:
208  if (prev == NULL)
209  {
210  into = what;
211  what->next = iter;
212  return what;
213  }
214  prev->next = what;
215  what->next = iter;
216  return what;
217 
218  Equal:
219  iter->ref += what->ref;
220  macoeff coeff = what->coeff;
221  if (coeff != NULL)
222  {
223  while (coeff->next != NULL) coeff = coeff->next;
224  coeff->next = iter->coeff;
225  iter->coeff = what->coeff;
226  what->coeff = NULL;

◆ maPoly_InsertMonomial() [2/2]

mapoly maPoly_InsertMonomial ( mapoly into,
poly  p,
ring  src_r,
sBucket_pt  bucket 
)

Definition at line 228 of file fast_maps.cc.

233 {

◆ maPoly_InsertPoly()

static void maPoly_InsertPoly ( mapoly into,
poly  what,
ring  src_r,
sBucket_pt  bucket 
)
static

Definition at line 233 of file fast_maps.cc.

233 {
234  return maPoly_InsertMonomial(into, maMonomial_Create(p, src_r, bucket), src_r);
235 }
236 
237 static void maPoly_InsertPoly(mapoly &into, poly what, ring src_r, sBucket_pt bucket)
238 {
239  poly next;
240 
241  while (what != NULL)
242  {
243  next = what->next;

◆ maPoly_Optimize()

void maPoly_Optimize ( mapoly  mpoly,
ring  src_r 
)

Definition at line 698 of file fast_maps.cc.

698  {
699  return NULL;
700  }
701 }
702 
703 /********************************************************************
704  ** *
705  * maPoly_Optimize *
706  * adds and integrates subexpressions *
707  *******************************************************************/
708 
709 void maPoly_Optimize(mapoly mpoly, ring src_r)
710 {
711  assume(mpoly!=NULL && mpoly->src!=NULL);
712  mapoly iter = mpoly;
713  mapoly choice;
714  mapoly ggT=NULL;
715  mapoly fp=NULL;
716  mapoly fq=NULL;
717  while (iter->next!=NULL)
718  {
719  choice=iter->next;
720  if ( /*(*/ iter->f1==NULL /*)*/ )
721  {
722  ggT=maFindBestggT(iter, choice, fp, fq,src_r);
723  if (choice!=NULL)
724  {
725  assume(iter->f1==NULL);
726  assume(iter->f2==NULL);
727  iter->f1=fp;
728  iter->f2=ggT;
729  if (fq!=NULL)

◆ maPoly_Substitute()

static int maPoly_Substitute ( macoeff  c,
poly  p,
ring  dest_r 
)
static

Definition at line 427 of file fast_maps.cc.

436 {
437  // substitute the monomial: go through macoeff
438  int len;
439  BOOLEAN zero_div= (rField_is_Ring(dest_r) && !rField_is_Domain(dest_r));
440  if (!zero_div) len=pLength(p);
441  int done=0;
442  while (c!=NULL)
443  {
444  done++;
445  poly t=__pp_Mult_nn(p,c->n,dest_r);

Variable Documentation

◆ macoeffBin

STATIC_VAR omBin macoeffBin = omGetSpecBin(sizeof(macoeff_s))

Definition at line 132 of file fast_maps.cc.

◆ mapolyBin

STATIC_VAR omBin mapolyBin = omGetSpecBin(sizeof(mapoly_s))

Definition at line 131 of file fast_maps.cc.

mapolyBin
STATIC_VAR omBin mapolyBin
Definition: fast_maps.cc:131
si_min
static int si_min(const int a, const int b)
Definition: auxiliary.h:141
FALSE
#define FALSE
Definition: auxiliary.h:96
Equal
static BOOLEAN Equal(number a, number b, const coeffs r)
Definition: flintcf_Q.cc:321
maPoly_EvalMon
static poly maPoly_EvalMon(poly src, ring src_r, poly *dest_id, ring dest_r)
Definition: fast_maps.cc:447
maEggT
static poly maEggT(const poly m1, const poly m2, poly &q1, poly &q2, const ring r)
Definition: fast_maps.cc:576
maideal_s
Definition: fast_maps.h:41
maideal
class maideal_s * maideal
Definition: fast_maps.h:20
maIdeal_2_Ideal
ideal maIdeal_2_Ideal(maideal m_id, ring)
Definition: fast_maps.cc:316
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:456
j
int j
Definition: facHensel.cc:105
maMap_CreateRings
void maMap_CreateRings(ideal map_id, ring map_r, ideal image_id, ring image_r, ring &src_r, ring &dest_r, BOOLEAN &simple)
Definition: fast_maps.cc:275
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition: options.h:100
rField_is_Domain
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:481
maGetMaxExp
static unsigned long maGetMaxExp(ideal pi_id, ring pi_r, ideal map_id, ring map_r)
Definition: fast_maps.cc:62
idrShallowCopyR
ideal idrShallowCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:219
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
mapoly
class mapoly_s * mapoly
Definition: fast_maps.h:18
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
iter
CFFListIterator iter
Definition: facAbsBiFact.cc:54
maPoly_Optimize
void maPoly_Optimize(mapoly mpoly, ring src_r)
Definition: fast_maps.cc:698
id_ShallowDelete
void id_ShallowDelete(ideal *h, ring r)
Shallowdeletes an ideal/matrix.
Definition: simpleideals.cc:156
maFindBestggT
static mapoly maFindBestggT(mapoly mp, mapoly &choice, mapoly &fp, mapoly &fq, const ring r)
Definition: fast_maps.cc:624
p_SetExp
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
Definition: p_polys.h:475
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:182
next
ListNode * next
Definition: janet.h:31
Greater
static bool Greater(mono_type m1, mono_type m2)
Definition: interpolation.cc:285
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:796
rModifyRing_Wp
ring rModifyRing_Wp(ring r, int *weights)
construct Wp, C ring
Definition: ring.cc:2888
maMap_KillRings
static void maMap_KillRings(ring map_r, ring image_r, ring src_r, ring dest_r)
Definition: fast_maps.cc:304
TRUE
#define TRUE
Definition: auxiliary.h:100
i
int i
Definition: cfEzgcd.cc:125
p_IsConstantComp
static BOOLEAN p_IsConstantComp(const poly p, const ring r)
like the respective p_LmIs* routines, except that p might be empty
Definition: p_polys.h:1903
res
CanonicalForm res
Definition: facAbsFact.cc:64
fp
CanonicalForm fp
Definition: cfModGcd.cc:4043
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:87
maPoly_Substitute
static int maPoly_Substitute(macoeff c, poly p, ring dest_r)
Definition: fast_maps.cc:427
maMonomial_Create
mapoly maMonomial_Create(poly p, ring, sBucket_pt bucket)
Definition: fast_maps.cc:134
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:478
sBucketCreate
sBucket_pt sBucketCreate(const ring r)
Definition: sbuckets.cc:94
max
static int max(int a, int b)
Definition: fast_mult.cc:264
prShallowCopyR_NoSort
poly prShallowCopyR_NoSort(poly p, ring r, ring dest_r)
Definition: prCopy.cc:111
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
p_Init
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1242
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
p_GetMaxExpP
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:1126
__pp_Mult_nn
#define __pp_Mult_nn(p, n, r)
Definition: p_polys.h:946
sBucket
Definition: sbuckets.cc:27
p_LmFree
static void p_LmFree(poly p, ring)
Definition: p_polys.h:669
p_LmCmpAction
#define p_LmCmpAction(p, q, r, actionE, actionG, actionS)
Definition: p_polys.h:1627
p_Deg
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:576
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:845
maPoly_InsertMonomial
mapoly maPoly_InsertMonomial(mapoly &into, mapoly what, ring src_r)
Definition: fast_maps.cc:179
maPoly_GetLength
void maPoly_GetLength(mapoly mp, int &length)
Definition: fast_maps.cc:331
maMonomial_Free
mapoly maMonomial_Free(mapoly monomial, ring src_r, ring dest_r=NULL)
Definition: fast_maps.h:63
maPoly_Eval
void maPoly_Eval(mapoly root, ring src_r, ideal dest_id, ring dest_r, int total_cost)
Definition: fast_maps.cc:486
Print
#define Print
Definition: emacs.cc:79
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:34
maPoly_InsertPoly
static void maPoly_InsertPoly(mapoly &into, poly what, ring src_r, sBucket_pt bucket)
Definition: fast_maps.cc:233
macoeff
class macoeff_s * macoeff
Definition: fast_maps.h:19
p_AddExp
static long p_AddExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:593
macoeffBin
STATIC_VAR omBin macoeffBin
Definition: fast_maps.cc:132
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:11
l
int l
Definition: cfEzgcd.cc:93
maGetMaxExpP
static poly maGetMaxExpP(poly *max_map_monomials, int n_max_map_monomials, ring map_r, poly pi_m, ring pi_r)
Definition: fast_maps.cc:33
PDEBUG
#define PDEBUG
Definition: auxiliary.h:185
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:223
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1428
p
int p
Definition: cfModGcd.cc:4019
p_GetMaxExp
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
Definition: p_polys.h:732
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:23
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1284
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1038
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:41
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
maMap_CreatePolyIdeal
void maMap_CreatePolyIdeal(ideal map_id, ring map_r, ring src_r, ring dest_r, mapoly &mp, maideal &mideal)
Definition: fast_maps.cc:249
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
prShallowCopyR
poly prShallowCopyR(poly p, ring r, ring dest_r)
Definition: prCopy.cc:116