PowerSeries Class Reference

A one dimensional real polynomial. More...

#include <PowerSeries.h>

Inheritance diagram for PowerSeries:

Polynomial FunctionR1toR1

List of all members.

Public Member Functions

 PowerSeries (int size)
 Constructs and initializes an intance of this class.
void initialize (int size)
 Initializes this object.
Array1D< double > getCoefficients ()
 This gives us access to the coefficients that this polynomial uses.
void operator= (PowerSeries rhs)
 Sets this polynomial equal to another one.
int getNumberCoefficients ()
 Gets the number of coefficients in the polynomial.
double getCoefficient (int i)
 Gets the ith coefficient of the polynomial.
void print (ostream &strm)
 Write out a string that represents the polynomial.
void initialize (Array1D< double > &coeffs)
 Initializes this object.
void evaluate (double x)
 Evaluates the function at $x$.
double getFunctionValue ()
 Gets the function value at the last evaluated point.
double getFunctionValue (double x)
 This call doesn't calculate derivatives, only the function.
double getFirstDerivativeValue ()
 Gets the function's first deriviate at the last evaluated point.
double getSecondDerivativeValue ()
 Gets the function's second deriviative at the last evaluated point.
double getThirdDerivativeValue ()
double get_p_a (int ai)
double get_p2_xa (int ai)
double get_p3_xxa (int ai)
Array1D< ComplexgetRoots ()
 Gets the roots of the polynomial.
double Brent_fmin (double ax, double bx, double tol)
double function (double x)
double minimum (double left, double right)

Private Member Functions

void initialize ()
 Initialize all of the member variables of this object.
void evaluateAll (double x, Array1D< double > &coeffs)
 Evaluates a polynomial at $x$ defined by the entered coefficients.

Private Attributes

int size


Detailed Description

A one dimensional real polynomial.

This is just a Polynomial, except all the coefficients are 1.0.

\[ P(x) = \sum^{n}_{i=0}x^{i} \]

Definition at line 15 of file PowerSeries.h.


Constructor & Destructor Documentation

PowerSeries::PowerSeries ( int  size  ) 

Constructs and initializes an intance of this class.

Parameters:
coeffs set of polynomial coefficients to use for the polynomial.


Member Function Documentation

void PowerSeries::initialize ( int  size  ) 

Initializes this object.

Parameters:
coeffs set of polynomial coefficients to use for the polynomial.

Array1D<double> PowerSeries::getCoefficients (  ) 

This gives us access to the coefficients that this polynomial uses.

Reimplemented from Polynomial.

void PowerSeries::operator= ( PowerSeries  rhs  ) 

Sets this polynomial equal to another one.

Parameters:
rhs polynomial to set this one equal to

int PowerSeries::getNumberCoefficients (  ) 

Gets the number of coefficients in the polynomial.

This is one larger than the order of the polynomial.

Returns:
number of coefficients in the polynomial.

Reimplemented from Polynomial.

double PowerSeries::getCoefficient ( int  i  ) 

Gets the ith coefficient of the polynomial.

Where the polynomial is defined such that

\[ P(x) = \sum^{n}_{i=0}c_{i}x^{i} \]

where $n$ is the order of the polynomial and $c_{i}$ is the ith coefficient.

Parameters:
i index of the coefficient to return.
Returns:
ith coefficient of the polynomial.

Reimplemented from Polynomial.

void PowerSeries::print ( ostream &  strm  ) 

Write out a string that represents the polynomial.

Reimplemented from Polynomial.

void PowerSeries::initialize (  )  [private]

Initialize all of the member variables of this object.

Reimplemented from Polynomial.

void PowerSeries::evaluateAll ( double  x,
Array1D< double > &  coeffs 
) [private]

Evaluates a polynomial at $x$ defined by the entered coefficients.

In addition, it evaluates the 1st two derivatives of that polynomial. It stores the results in f, df, and d2f from this class.

Parameters:
x point to evaluate the polynomial at.
coeffs coefficients describing the polynomial being evaluated. These are ordered from smallest to largest powers of $x$.

Reimplemented from Polynomial.

void Polynomial::initialize ( Array1D< double > &  coeffs  )  [inherited]

void Polynomial::evaluate ( double  x  )  [virtual, inherited]

double Polynomial::getFunctionValue (  )  [virtual, inherited]

double Polynomial::getFunctionValue ( double  x  )  [inherited]

This call doesn't calculate derivatives, only the function.

It's supposed to be faster than calling evaluate, which does calculate the first 2 derivatives.

Definition at line 157 of file Polynomial.cpp.

References Polynomial::coefficients, and Polynomial::evaluate().

double Polynomial::getFirstDerivativeValue (  )  [virtual, inherited]

double Polynomial::getSecondDerivativeValue (  )  [virtual, inherited]

double Polynomial::getThirdDerivativeValue (  )  [inherited]

double Polynomial::get_p_a ( int  ai  )  [inherited]

double Polynomial::get_p2_xa ( int  ai  )  [inherited]

double Polynomial::get_p3_xxa ( int  ai  )  [inherited]

Array1D< Complex > Polynomial::getRoots (  )  [inherited]

Gets the roots of the polynomial.

Returns:
roots of the polynomial.
Exceptions:
Exception if problems were encounted during the root calculation.

If the highest order terms have 0 for a coefficient, then we have fewer roots.

Definition at line 243 of file Polynomial.cpp.

References Polynomial::coefficients, Array1D< T >::dim1(), and Polynomial::zroots().

Referenced by QMCElectronNucleusCuspParameters::calculateSigmaSq(), PadeCorrelationFunction::getPoles(), FixedCuspPadeCorrelationFunction::getPoles(), and QMCPolynomial::hasNonNegativeZeroes().

double FunctionR1toR1::Brent_fmin ( double  ax,
double  bx,
double  tol 
) [inherited]

Definition at line 81 of file FunctionR1toR1.cpp.

References FunctionR1toR1::function().

Referenced by FunctionR1toR1::minimum().

double FunctionR1toR1::function ( double  x  )  [inherited]

double FunctionR1toR1::minimum ( double  left,
double  right 
) [inherited]

Definition at line 215 of file FunctionR1toR1.cpp.

References FunctionR1toR1::Brent_fmin().

Referenced by QMCEigenSearch::get_a_diag().


Member Data Documentation

int PowerSeries::size [private]

Definition at line 18 of file PowerSeries.h.


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

Generated on Sat Jul 5 16:14:02 2008 for QMcBeaver by  doxygen 1.5.6