poly.h File Reference


Detailed Description

Classes for solving polynomials.

Warning:
We should be careful about using pow() in functions using complex<double> since pow(((complex<double>)0.0),3.0) returns (nan,nan). Instead, we should use pow(((complex<double>)0.0),3) which takes an integer for the second argument. The sqrt() function, always succeeds i.e. sqrt(((complex<double>)0.0))=0.0

One has to be careful about using e.g. pow(a,1.0/3.0) for complex a since if Re(a)<0 and Im(a)==0 then the function returns NaN.

Definition in file poly.h.

#include <iostream>
#include <complex>
#include <gsl/gsl_math.h>
#include <gsl/gsl_complex_math.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_poly.h>
#include <o2scl/constants.h>
#include <o2scl/err_hnd.h>

Go to the source code of this file.

Data Structures

class  quadratic_real
 Solve a quadratic polynomial with real coefficients and real roots. More...
class  quadratic_real_coeff
 Solve a quadratic polynomial with real coefficients and complex roots. More...
class  quadratic_complex
 Solve a quadratic polynomial with complex coefficients and complex roots. More...
class  cubic_real
 Solve a cubic polynomial with real coefficients and real roots. More...
class  cubic_real_coeff
 Solve a cubic polynomial with real coefficients and complex roots. More...
class  cubic_complex
 Solve a cubic polynomial with complex coefficients and complex roots. More...
class  quartic_real
 Solve a quartic polynomial with real coefficients and real roots. More...
class  quartic_real_coeff
 Solve a quartic polynomial with real coefficients and complex roots. More...
class  quartic_complex
 Solve a quartic polynomial with complex coefficients and complex roots. More...
class  poly_real_coeff
 Base class for solving a general polynomial with real coefficients and complex roots. More...
class  poly_complex
 Base class for solving a general polynomial with complex coefficients. More...
class  cern_cubic_real_coeff
 Solve a cubic with real coefficients and complex roots (CERNLIB). More...
class  cern_quartic_real_coeff
 Solve a quartic with real coefficients and complex roots (CERNLIB). More...
class  gsl_quadratic_real_coeff
 Solve a quadratic with real coefficients and complex roots (GSL). More...
class  gsl_cubic_real_coeff
 Solve a cubic with real coefficients and complex roots (GSL). More...
class  gsl_quartic_real
 Solve a quartic with real coefficients and real roots (GSL). More...
class  gsl_quartic_real2
 Solve a quartic with real coefficients and real roots (GSL). More...
class  gsl_poly_real_coeff
 Solve a general polynomial with real coefficients (GSL). More...
class  quadratic_std_complex
 Solve a quadratic with complex coefficients and complex roots. More...
class  cubic_std_complex
 Solve a cubic with complex coefficients and complex roots. More...
class  naive_quartic_real
 Solve a quartic with real coefficients and real roots. More...
class  naive_quartic_complex
 Solve a quartic with complex coefficients and complex roots. More...


Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page