My Project  UNKNOWN_GIT_VERSION
Public Types | Public Member Functions | Private Member Functions | Private Attributes
rootContainer Class Reference

complex root finder for univariate polynomials based on laguers algorithm More...

#include <mpr_numeric.h>

Public Types

enum  rootType {
  none, cspecial, cspecialmu, det,
  onepoly
}
 

Public Member Functions

 rootContainer ()
 
 ~rootContainer ()
 
void fillContainer (number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
 
bool solver (const int polishmode=PM_NONE)
 
poly getPoly ()
 
gmp_complexoperator[] (const int i)
 
gmp_complexevPointCoord (const int i)
 
gmp_complexgetRoot (const int i)
 
bool swapRoots (const int from, const int to)
 
int getAnzElems ()
 
int getLDim ()
 
int getAnzRoots ()
 

Private Member Functions

 rootContainer (const rootContainer &v)
 
bool laguer_driver (gmp_complex **a, gmp_complex **roots, bool polish=true)
 Given the degree tdg and the tdg+1 complex coefficients ad0..tdg of the polynomial this routine successively calls "laguer" and finds all m complex roots in roots[0..tdg]. More...
 
bool isfloat (gmp_complex **a)
 
void divlin (gmp_complex **a, gmp_complex x, int j)
 
void divquad (gmp_complex **a, gmp_complex x, int j)
 
void solvequad (gmp_complex **a, gmp_complex **r, int &k, int &j)
 
void sortroots (gmp_complex **roots, int r, int c, bool isf)
 
void sortre (gmp_complex **r, int l, int u, int inc)
 
void laguer (gmp_complex **a, int m, gmp_complex *x, int *its, bool type)
 Given the degree m and the m+1 complex coefficients a[0..m] of the polynomial, and given the complex value x, this routine improves x by Laguerre's method until it converges, within the achievable roundoff limit, to a root of the given polynomial. More...
 
void computefx (gmp_complex **a, gmp_complex x, int m, gmp_complex &f0, gmp_complex &f1, gmp_complex &f2, gmp_float &ex, gmp_float &ef)
 
void computegx (gmp_complex **a, gmp_complex x, int m, gmp_complex &f0, gmp_complex &f1, gmp_complex &f2, gmp_float &ex, gmp_float &ef)
 
void checkimag (gmp_complex *x, gmp_float &e)
 

Private Attributes

int var
 
int tdg
 
number * coeffs
 
number * ievpoint
 
rootType rt
 
gmp_complex ** theroots
 
int anz
 
bool found_roots
 

Detailed Description

complex root finder for univariate polynomials based on laguers algorithm

Definition at line 65 of file mpr_numeric.h.

Member Enumeration Documentation

◆ rootType

Enumerator
none 
cspecial 
cspecialmu 
det 
onepoly 

Definition at line 68 of file mpr_numeric.h.

Constructor & Destructor Documentation

◆ rootContainer() [1/2]

rootContainer::rootContainer ( )

Definition at line 269 of file mpr_numeric.cc.

270 {
271  rt=none;
272 
273  coeffs= NULL;
274  ievpoint= NULL;
275  theroots= NULL;
276 
277  found_roots= false;
278 }

◆ ~rootContainer()

rootContainer::~rootContainer ( )

Definition at line 282 of file mpr_numeric.cc.

283 {
284  int i;
285  // free coeffs, ievpoint
286  if ( ievpoint != NULL )
287  {
288  for ( i=0; i < anz+2; i++ ) nDelete( ievpoint + i );
289  omFreeSize( (void *)ievpoint, (anz+2) * sizeof( number ) );
290  }
291 
292  for ( i=0; i <= tdg; i++ ) nDelete( coeffs + i );
293  omFreeSize( (void *)coeffs, (tdg+1) * sizeof( number ) );
294 
295  // theroots löschen
296  for ( i=0; i < tdg; i++ ) delete theroots[i];
297  omFreeSize( (void *) theroots, (tdg)*sizeof(gmp_complex*) );
298 
299  //mprPROTnl("~rootContainer()");
300 }

◆ rootContainer() [2/2]

rootContainer::rootContainer ( const rootContainer v)
private

Member Function Documentation

◆ checkimag()

void rootContainer::checkimag ( gmp_complex x,
gmp_float e 
)
private

Definition at line 621 of file mpr_numeric.cc.

622 {
623  if(abs(x->imag())<abs(x->real())*e)
624  {
625  x->imag(0.0);
626  }
627 }

◆ computefx()

void rootContainer::computefx ( gmp_complex **  a,
gmp_complex  x,
int  m,
gmp_complex f0,
gmp_complex f1,
gmp_complex f2,
gmp_float ex,
gmp_float ef 
)
private

Definition at line 805 of file mpr_numeric.cc.

808 {
809  int k;
810 
811  f0= *a[m];
812  ef= abs(f0);
813  f1= gmp_complex(0.0);
814  f2= f1;
815  ex= abs(x);
816 
817  for ( k= m-1; k >= 0; k-- )
818  {
819  f2 = ( x * f2 ) + f1;
820  f1 = ( x * f1 ) + f0;
821  f0 = ( x * f0 ) + *a[k];
822  ef = abs( f0 ) + ( ex * ef );
823  }
824 }

◆ computegx()

void rootContainer::computegx ( gmp_complex **  a,
gmp_complex  x,
int  m,
gmp_complex f0,
gmp_complex f1,
gmp_complex f2,
gmp_float ex,
gmp_float ef 
)
private

Definition at line 826 of file mpr_numeric.cc.

829 {
830  int k;
831 
832  f0= *a[0];
833  ef= abs(f0);
834  f1= gmp_complex(0.0);
835  f2= f1;
836  ex= abs(x);
837 
838  for ( k= 1; k <= m; k++ )
839  {
840  f2 = ( x * f2 ) + f1;
841  f1 = ( x * f1 ) + f0;
842  f0 = ( x * f0 ) + *a[k];
843  ef = abs( f0 ) + ( ex * ef );
844  }
845 }

◆ divlin()

void rootContainer::divlin ( gmp_complex **  a,
gmp_complex  x,
int  j 
)
private

Definition at line 642 of file mpr_numeric.cc.

643 {
644  int i;
645  gmp_float o(1.0);
646 
647  if (abs(x)<o)
648  {
649  for (i= j-1; i > 0; i-- )
650  *a[i] += (*a[i+1]*x);
651  for (i= 0; i < j; i++ )
652  *a[i] = *a[i+1];
653  }
654  else
655  {
656  gmp_complex y(o/x);
657  for (i= 1; i < j; i++)
658  *a[i] += (*a[i-1]*y);
659  }
660 }

◆ divquad()

void rootContainer::divquad ( gmp_complex **  a,
gmp_complex  x,
int  j 
)
private

Definition at line 662 of file mpr_numeric.cc.

663 {
664  int i;
665  gmp_float o(1.0),p(x.real()+x.real()),
666  q((x.real()*x.real())+(x.imag()*x.imag()));
667 
668  if (abs(x)<o)
669  {
670  *a[j-1] += (*a[j]*p);
671  for (i= j-2; i > 1; i-- )
672  *a[i] += ((*a[i+1]*p)-(*a[i+2]*q));
673  for (i= 0; i < j-1; i++ )
674  *a[i] = *a[i+2];
675  }
676  else
677  {
678  p = p/q;
679  q = o/q;
680  *a[1] += (*a[0]*p);
681  for (i= 2; i < j-1; i++)
682  *a[i] += ((*a[i-1]*p)-(*a[i-2]*q));
683  }
684 }

◆ evPointCoord()

gmp_complex & rootContainer::evPointCoord ( const int  i)

Definition at line 392 of file mpr_numeric.cc.

393 {
394  if (! ((i >= 0) && (i < anz+2) ) )
395  WarnS("rootContainer::evPointCoord: index out of range");
396  if (ievpoint == NULL)
397  WarnS("rootContainer::evPointCoord: ievpoint == NULL");
398 
399  if ( (rt == cspecialmu) && found_roots ) // FIX ME
400  {
401  if ( ievpoint[i] != NULL )
402  {
403  gmp_complex *tmp= new gmp_complex();
404  *tmp= numberToComplex(ievpoint[i], currRing->cf);
405  return *tmp;
406  }
407  else
408  {
409  Warn("rootContainer::evPointCoord: NULL index %d",i);
410  }
411  }
412 
413  // warning
414  Warn("rootContainer::evPointCoord: Wrong index %d, found_roots %s",i,found_roots?"true":"false");
415  gmp_complex *tmp= new gmp_complex();
416  return *tmp;
417 }

◆ fillContainer()

void rootContainer::fillContainer ( number *  _coeffs,
number *  _ievpoint,
const int  _var,
const int  _tdg,
const rootType  _rt,
const int  _anz 
)

Definition at line 304 of file mpr_numeric.cc.

307 {
308  int i;
309  number nn= nInit(0);
310  var=_var;
311  tdg=_tdg;
312  coeffs=_coeffs;
313  rt=_rt;
314  anz=_anz;
315 
316  for ( i=0; i <= tdg; i++ )
317  {
318  if ( nEqual(coeffs[i],nn) )
319  {
320  nDelete( &coeffs[i] );
321  coeffs[i]=NULL;
322  }
323  }
324  nDelete( &nn );
325 
326  if ( rt == cspecialmu && _ievpoint ) // copy ievpoint
327  {
328  ievpoint= (number *)omAlloc( (anz+2) * sizeof( number ) );
329  for (i=0; i < anz+2; i++) ievpoint[i]= nCopy( _ievpoint[i] );
330  }
331 
332  theroots= NULL;
333  found_roots= false;
334 }

◆ getAnzElems()

int rootContainer::getAnzElems ( )
inline

Definition at line 95 of file mpr_numeric.h.

95 { return anz; }

◆ getAnzRoots()

int rootContainer::getAnzRoots ( )
inline

Definition at line 97 of file mpr_numeric.h.

97 { return tdg; }

◆ getLDim()

int rootContainer::getLDim ( )
inline

Definition at line 96 of file mpr_numeric.h.

96 { return anz; }

◆ getPoly()

poly rootContainer::getPoly ( )

Definition at line 338 of file mpr_numeric.cc.

339 {
340  int i;
341 
342  poly result= NULL;
343  poly ppos;
344 
345  if ( (rt == cspecial) || ( rt == cspecialmu ) )
346  {
347  for ( i= tdg; i >= 0; i-- )
348  {
349  if ( coeffs[i] )
350  {
351  poly p= pOne();
352  //pSetExp( p, var+1, i);
353  pSetExp( p, 1, i);
354  pSetCoeff( p, nCopy( coeffs[i] ) );
355  pSetm( p );
356  if (result)
357  {
358  ppos->next=p;
359  ppos=ppos->next;
360  }
361  else
362  {
363  result=p;
364  ppos=p;
365  }
366 
367  }
368  }
369  if (result!=NULL) pSetm( result );
370  }
371 
372  return result;
373 }

◆ getRoot()

gmp_complex* rootContainer::getRoot ( const int  i)
inline

Definition at line 88 of file mpr_numeric.h.

89  {
90  return theroots[i];
91  }

◆ isfloat()

bool rootContainer::isfloat ( gmp_complex **  a)
private

Definition at line 629 of file mpr_numeric.cc.

630 {
631  gmp_float z(0.0);
632  gmp_complex *b;
633  for (int i=tdg; i >= 0; i-- )
634  {
635  b = &(*a[i]);
636  if (!(b->imag()==z))
637  return false;
638  }
639  return true;
640 }

◆ laguer()

void rootContainer::laguer ( gmp_complex **  a,
int  m,
gmp_complex x,
int *  its,
bool  type 
)
private

Given the degree m and the m+1 complex coefficients a[0..m] of the polynomial, and given the complex value x, this routine improves x by Laguerre's method until it converges, within the achievable roundoff limit, to a root of the given polynomial.

The number of iterations taken is returned at its.

Definition at line 554 of file mpr_numeric.cc.

555 {
556  int iter,j;
557  gmp_float zero(0.0),one(1.0),deg(m);
558  gmp_float abx_g, err_g, fabs;
559  gmp_complex dx, x1, b, d, f, g, h, sq, gp, gm, g2;
560  gmp_float frac_g[MR+1] = { 0.0, 0.5, 0.25, 0.75, 0.125, 0.375, 0.625, 0.875, 1.0 };
561 
562  gmp_float epss(0.1);
563  mpf_pow_ui(*epss._mpfp(),*epss.mpfp(),gmp_output_digits);
564 
565  for ( iter= 1; iter <= MAXIT; iter++ )
566  {
568  *its=iter;
569  if (type)
570  computefx(a,*x,m,b,d,f,abx_g,err_g);
571  else
572  computegx(a,*x,m,b,d,f,abx_g,err_g);
573  err_g *= epss; // EPSS;
574 
575  fabs = abs(b);
576  if (fabs <= err_g)
577  {
578  if ((fabs==zero) || (abs(d)==zero)) return;
579  *x -= (b/d); // a last newton-step
580  goto ende;
581  }
582 
583  g= d / b;
584  g2 = g * g;
585  h= g2 - (((f+f) / b ));
586  sq= sqrt(( ( h * deg ) - g2 ) * (deg - one));
587  gp= g + sq;
588  gm= g - sq;
589  if (abs(gp)<abs(gm))
590  {
591  dx = deg/gm;
592  }
593  else
594  {
595  if((gp.real()==zero)&&(gp.imag()==zero))
596  {
597  dx.real(cos((mprfloat)iter));
598  dx.imag(sin((mprfloat)iter));
599  dx = dx*(one+abx_g);
600  }
601  else
602  {
603  dx = deg/gp;
604  }
605  }
606  x1= *x - dx;
607 
608  if (*x == x1) goto ende;
609 
610  j = iter%MMOD;
611  if (j==0) j=MT;
612  if ( j % MT ) *x= x1;
613  else *x -= ( dx * frac_g[ j / MT ] );
614  }
615 
616  *its= MAXIT+1;
617 ende:
618  checkimag(x,epss);
619 }

◆ laguer_driver()

bool rootContainer::laguer_driver ( gmp_complex **  a,
gmp_complex **  roots,
bool  polish = true 
)
private

Given the degree tdg and the tdg+1 complex coefficients ad0..tdg of the polynomial this routine successively calls "laguer" and finds all m complex roots in roots[0..tdg].

The bool var "polish" should be input as "true" if polishing (also by "laguer") is desired, "false" if the roots will be subsequently polished by other means.

Definition at line 471 of file mpr_numeric.cc.

472 {
473  int i,j,k,its;
474  gmp_float zero(0.0);
475  gmp_complex x(0.0),o(1.0);
476  bool ret= true, isf=isfloat(a), type=true;
477 
478  gmp_complex ** ad= (gmp_complex**)omAlloc( (tdg+1)*sizeof(gmp_complex*) );
479  for ( i=0; i <= tdg; i++ ) ad[i]= new gmp_complex( *a[i] );
480 
481  k = 0;
482  i = tdg;
483  j = i-1;
484  while (i>2)
485  {
486  // run laguer alg
487  x = zero;
488  laguer(ad, i, &x, &its, type);
489  if ( its > MAXIT )
490  {
491  type = !type;
492  x = zero;
493  laguer(ad, i, &x, &its, type);
494  }
495 
497  if ( its > MAXIT )
498  { // error
499  WarnS("Laguerre solver: Too many iterations!");
500  ret= false;
501  goto theend;
502  }
503  if ( polish )
504  {
505  laguer( a, tdg, &x, &its , type);
506  if ( its > MAXIT )
507  { // error
508  WarnS("Laguerre solver: Too many iterations in polish!");
509  ret= false;
510  goto theend;
511  }
512  }
513  if ((!type)&&(!((x.real()==zero)&&(x.imag()==zero)))) x = o/x;
514  if (x.imag() == zero)
515  {
516  *roots[k] = x;
517  k++;
518  divlin(ad,x,i);
519  i--;
520  }
521  else
522  {
523  if(isf)
524  {
525  *roots[j] = x;
526  *roots[j-1]= gmp_complex(x.real(),-x.imag());
527  j -= 2;
528  divquad(ad,x,i);
529  i -= 2;
530  }
531  else
532  {
533  *roots[j] = x;
534  j--;
535  divlin(ad,x,i);
536  i--;
537  }
538  }
539  type = !type;
540  }
541  solvequad(ad,roots,k,j);
542  sortroots(roots,k,j,isf);
543 
544 theend:
545  mprSTICKYPROT("\n");
546  for ( i=0; i <= tdg; i++ ) delete ad[i];
547  omFreeSize( (void *) ad, (tdg+1)*sizeof( gmp_complex* ));
548 
549  return ret;
550 }

◆ operator[]()

gmp_complex& rootContainer::operator[] ( const int  i)
inline

Definition at line 82 of file mpr_numeric.h.

83  {
84  return *theroots[i];
85  }

◆ solvequad()

void rootContainer::solvequad ( gmp_complex **  a,
gmp_complex **  r,
int &  k,
int &  j 
)
private

Definition at line 686 of file mpr_numeric.cc.

687 {
688  gmp_float zero(0.0);
689 
690  if ((j>k)
691  &&((!(*a[2]).real().isZero())||(!(*a[2]).imag().isZero())))
692  {
693  gmp_complex sq(zero);
694  gmp_complex h1(*a[1]/(*a[2] + *a[2])), h2(*a[0] / *a[2]);
695  gmp_complex disk((h1 * h1) - h2);
696  if (disk.imag().isZero())
697  {
698  if (disk.real()<zero)
699  {
700  sq.real(zero);
701  sq.imag(sqrt(-disk.real()));
702  }
703  else
704  sq = (gmp_complex)sqrt(disk.real());
705  }
706  else
707  sq = sqrt(disk);
708  *r[k+1] = sq - h1;
709  sq += h1;
710  *r[k] = (gmp_complex)0.0-sq;
711  if(sq.imag().isZero())
712  {
713  k = j;
714  j++;
715  }
716  else
717  {
718  j = k;
719  k--;
720  }
721  }
722  else
723  {
724  if (((*a[1]).real().isZero()) && ((*a[1]).imag().isZero()))
725  {
726  WerrorS("precision lost, try again with higher precision");
727  }
728  else
729  {
730  *r[k]= (gmp_complex)0.0-(*a[0] / *a[1]);
731  if(r[k]->imag().isZero())
732  j++;
733  else
734  k--;
735  }
736  }
737 }

◆ solver()

bool rootContainer::solver ( const int  polishmode = PM_NONE)

Definition at line 441 of file mpr_numeric.cc.

442 {
443  int i;
444 
445  // there are maximal tdg roots, so *roots ranges form 0 to tdg-1.
446  theroots= (gmp_complex**)omAlloc( tdg*sizeof(gmp_complex*) );
447  for ( i=0; i < tdg; i++ ) theroots[i]= new gmp_complex();
448 
449  // copy the coefficients of type number to type gmp_complex
450  gmp_complex **ad= (gmp_complex**)omAlloc( (tdg+1)*sizeof(gmp_complex*) );
451  for ( i=0; i <= tdg; i++ )
452  {
453  ad[i]= new gmp_complex();
454  if ( coeffs[i] ) *ad[i] = numberToComplex( coeffs[i], currRing->cf );
455  }
456 
457  // now solve
458  found_roots= laguer_driver( ad, theroots, polishmode != 0 );
459  if (!found_roots)
460  WarnS("rootContainer::solver: No roots found!");
461 
462  // free memory
463  for ( i=0; i <= tdg; i++ ) delete ad[i];
464  omFreeSize( (void *) ad, (tdg+1)*sizeof(gmp_complex*) );
465 
466  return found_roots;
467 }

◆ sortre()

void rootContainer::sortre ( gmp_complex **  r,
int  l,
int  u,
int  inc 
)
private

Definition at line 758 of file mpr_numeric.cc.

759 {
760  int pos,i;
761  gmp_complex *x,*y;
762 
763  pos = l;
764  x = r[pos];
765  for (i=l+inc; i<=u; i+=inc)
766  {
767  if (r[i]->real()<x->real())
768  {
769  pos = i;
770  x = r[pos];
771  }
772  }
773  if (pos>l)
774  {
775  if (inc==1)
776  {
777  for (i=pos; i>l; i--)
778  r[i] = r[i-1];
779  r[l] = x;
780  }
781  else
782  {
783  y = r[pos+1];
784  for (i=pos+1; i+1>l; i--)
785  r[i] = r[i-2];
786  if (x->imag()>y->imag())
787  {
788  r[l] = x;
789  r[l+1] = y;
790  }
791  else
792  {
793  r[l] = y;
794  r[l+1] = x;
795  }
796  }
797  }
798  else if ((inc==2)&&(x->imag()<r[l+1]->imag()))
799  {
800  r[l] = r[l+1];
801  r[l+1] = x;
802  }
803 }

◆ sortroots()

void rootContainer::sortroots ( gmp_complex **  roots,
int  r,
int  c,
bool  isf 
)
private

Definition at line 739 of file mpr_numeric.cc.

740 {
741  int j;
742 
743  for (j=0; j<r; j++) // the real roots
744  sortre(ro, j, r, 1);
745  if (c>=tdg) return;
746  if (isf)
747  {
748  for (j=c; j+2<tdg; j+=2) // the complex roots for a real poly
749  sortre(ro, j, tdg-1, 2);
750  }
751  else
752  {
753  for (j=c; j+1<tdg; j++) // the complex roots for a general poly
754  sortre(ro, j, tdg-1, 1);
755  }
756 }

◆ swapRoots()

bool rootContainer::swapRoots ( const int  from,
const int  to 
)

Definition at line 421 of file mpr_numeric.cc.

422 {
423  if ( found_roots && ( from >= 0) && ( from < tdg ) && ( to >= 0) && ( to < tdg ) )
424  {
425  if ( to != from )
426  {
427  gmp_complex tmp( *theroots[from] );
428  *theroots[from]= *theroots[to];
429  *theroots[to]= tmp;
430  }
431  return true;
432  }
433 
434  // warning
435  Warn(" rootContainer::changeRoots: Wrong index %d, %d",from,to);
436  return false;
437 }

Field Documentation

◆ anz

int rootContainer::anz
private

Definition at line 141 of file mpr_numeric.h.

◆ coeffs

number* rootContainer::coeffs
private

Definition at line 135 of file mpr_numeric.h.

◆ found_roots

bool rootContainer::found_roots
private

Definition at line 142 of file mpr_numeric.h.

◆ ievpoint

number* rootContainer::ievpoint
private

Definition at line 136 of file mpr_numeric.h.

◆ rt

rootType rootContainer::rt
private

Definition at line 137 of file mpr_numeric.h.

◆ tdg

int rootContainer::tdg
private

Definition at line 133 of file mpr_numeric.h.

◆ theroots

gmp_complex** rootContainer::theroots
private

Definition at line 139 of file mpr_numeric.h.

◆ var

int rootContainer::var
private

Definition at line 132 of file mpr_numeric.h.


The documentation for this class was generated from the following files:
MT
#define MT
Definition: mpr_numeric.cc:263
rootContainer::onepoly
@ onepoly
Definition: mpr_numeric.h:68
isZero
bool isZero(const CFArray &A)
checks if entries of A are zero
Definition: facSparseHensel.h:468
j
int j
Definition: facHensel.cc:105
f
FILE * f
Definition: checklibs.c:9
gmp_output_digits
size_t gmp_output_digits
Definition: mpr_complex.cc:43
k
int k
Definition: cfEzgcd.cc:92
rootContainer::divlin
void divlin(gmp_complex **a, gmp_complex x, int j)
Definition: mpr_numeric.cc:642
x
Variable x
Definition: cfModGcd.cc:4023
y
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:57
result
return result
Definition: facAbsBiFact.cc:76
MAXIT
#define MAXIT
Definition: mpr_numeric.cc:265
rootContainer::isfloat
bool isfloat(gmp_complex **a)
Definition: mpr_numeric.cc:629
nEqual
#define nEqual(n1, n2)
Definition: numbers.h:21
rootContainer::ievpoint
number * ievpoint
Definition: mpr_numeric.h:136
MMOD
#define MMOD
Definition: mpr_numeric.cc:264
g
g
Definition: cfModGcd.cc:4031
rootContainer::found_roots
bool found_roots
Definition: mpr_numeric.h:142
sqrt
gmp_float sqrt(const gmp_float &a)
Definition: mpr_complex.cc:328
rootContainer::rt
rootType rt
Definition: mpr_numeric.h:137
iter
CFFListIterator iter
Definition: facAbsBiFact.cc:54
sin
gmp_float sin(const gmp_float &a)
Definition: mpr_complex.cc:334
gmp_complex::imag
gmp_float imag() const
Definition: mpr_complex.h:235
b
CanonicalForm b
Definition: cfModGcd.cc:4044
mprSTICKYPROT
#define mprSTICKYPROT(msg)
Definition: mpr_global.h:54
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
i
int i
Definition: cfEzgcd.cc:125
abs
Rational abs(const Rational &a)
Definition: GMPrat.cc:439
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
rootContainer::anz
int anz
Definition: mpr_numeric.h:141
rootContainer::theroots
gmp_complex ** theroots
Definition: mpr_numeric.h:139
h
static Poly * h
Definition: janet.cc:972
gp
CanonicalForm gp
Definition: cfModGcd.cc:4043
rootContainer::tdg
int tdg
Definition: mpr_numeric.h:133
coeffs
pOne
#define pOne()
Definition: polys.h:309
rootContainer::laguer
void laguer(gmp_complex **a, int m, gmp_complex *x, int *its, bool type)
Given the degree m and the m+1 complex coefficients a[0..m] of the polynomial, and given the complex ...
Definition: mpr_numeric.cc:554
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:210
rootContainer::checkimag
void checkimag(gmp_complex *x, gmp_float &e)
Definition: mpr_numeric.cc:621
rootContainer::sortre
void sortre(gmp_complex **r, int l, int u, int inc)
Definition: mpr_numeric.cc:758
rootContainer::laguer_driver
bool laguer_driver(gmp_complex **a, gmp_complex **roots, bool polish=true)
Given the degree tdg and the tdg+1 complex coefficients ad0..tdg of the polynomial this routine succe...
Definition: mpr_numeric.cc:471
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31
gmp_complex::real
gmp_float real() const
Definition: mpr_complex.h:234
rootContainer::computegx
void computegx(gmp_complex **a, gmp_complex x, int m, gmp_complex &f0, gmp_complex &f1, gmp_complex &f2, gmp_float &ex, gmp_float &ef)
Definition: mpr_numeric.cc:826
ST_ROOTS_LGSTEP
#define ST_ROOTS_LGSTEP
Definition: mpr_global.h:80
numberToComplex
gmp_complex numberToComplex(number num, const coeffs r)
Definition: mpr_complex.h:312
rootContainer::solvequad
void solvequad(gmp_complex **a, gmp_complex **r, int &k, int &j)
Definition: mpr_numeric.cc:686
mprfloat
double mprfloat
Definition: mpr_global.h:17
rootContainer::cspecialmu
@ cspecialmu
Definition: mpr_numeric.h:68
rootContainer::none
@ none
Definition: mpr_numeric.h:68
rootContainer::divquad
void divquad(gmp_complex **a, gmp_complex x, int j)
Definition: mpr_numeric.cc:662
rootContainer::det
@ det
Definition: mpr_numeric.h:68
rootContainer::computefx
void computefx(gmp_complex **a, gmp_complex x, int m, gmp_complex &f0, gmp_complex &f1, gmp_complex &f2, gmp_float &ex, gmp_float &ef)
Definition: mpr_numeric.cc:805
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
m
int m
Definition: cfEzgcd.cc:121
WarnS
#define WarnS
Definition: emacs.cc:78
ST_ROOTS_LG
#define ST_ROOTS_LG
Definition: mpr_global.h:82
NULL
#define NULL
Definition: omList.c:10
pSetm
#define pSetm(p)
Definition: polys.h:265
l
int l
Definition: cfEzgcd.cc:93
nDelete
#define nDelete(n)
Definition: numbers.h:17
Warn
#define Warn
Definition: emacs.cc:77
pSetExp
#define pSetExp(p, i, v)
Definition: polys.h:42
p
int p
Definition: cfModGcd.cc:4019
rootContainer::cspecial
@ cspecial
Definition: mpr_numeric.h:68
nInit
#define nInit(i)
Definition: numbers.h:25
MR
#define MR
Definition: mpr_numeric.cc:262
rootContainer::var
int var
Definition: mpr_numeric.h:132
rootContainer::sortroots
void sortroots(gmp_complex **roots, int r, int c, bool isf)
Definition: mpr_numeric.cc:739
nCopy
#define nCopy(n)
Definition: numbers.h:16
gmp_float
Definition: mpr_complex.h:31
cos
gmp_float cos(const gmp_float &a)
Definition: mpr_complex.cc:339
gmp_complex
gmp_complex numbers based on
Definition: mpr_complex.h:178