An EvolvingStellar quantity that uses a polynomial instead of interpolating. More...
#include <PolynomialEvolution.h>
Public Member Functions | |
PolynomialEvolutionQuantity (const std::valarray< double > &coefficients, double range_low, double range_high, double derivative_x=NaN) | |
Create an evolving quantity or its derivative. More... | |
void | select_interpolation_region (double) const |
double | operator() (double x) const |
Evaluates the polynomial at the given age. More... | |
double | range_low () const |
The lower end of the range where the function is defined. More... | |
double | range_high () const |
The upper end of the range where the function is defined. More... | |
virtual const std::vector< double > & | discontinuities () const |
The ages at which the quantity may be discontinuous. More... | |
virtual double | previous_discontinuity () const |
See StellarEvolution::EvolvingStellarQuantity::prevous_discontinuity() More... | |
virtual double | next_discontinuity () const |
See StellarEvolution::EvolvingStellarQuantity::next_discontinuity() More... | |
virtual void | enable_next_interpolation_region () const |
Set up the interpolation over the next interpolation region (between consecutive discontinuities.) More... | |
const Core::FunctionDerivatives * | deriv (double x) const |
The derivatives. More... | |
double | order (unsigned deriv_order=1) const |
The order-th derivative. More... | |
std::string | kind () const |
A string identifying the type of quantity this is. More... | |
Public Member Functions inherited from StellarEvolution::EvolvingStellarQuantity | |
EvolvingStellarQuantity () | |
Default constructor (only useful for derived classes which do not use the interpolation). More... | |
EvolvingStellarQuantity (double mass, const std::valarray< double > &track_masses, The(\f$[Fe/H]\f$) for which evolution tracks are given. const std::valarray< double > &track_feh, The evolution tracks of the relevant quantity on the grid defined by \p track_masses and \p track_feh. The const std::vector< const OneArgumentDiffFunction *> &evolution_tracks, Whether the track uses log(age) as the independent argument instead of age. bool log_age=true, Whether the track is uses log(quantity) as the dependent argument instead of quantity. bool log_quantity=true, Whether this is a quantity that is identically zero below some age and turns on afterwards bool starts_zero=false) | |
Create an evolving quantity that interpolates to the given mass. More... | |
brief Prepare the quantity for interpolation around the given age After calling this requesting values or derivatives outside the range of the continuous region containing this | age (see ::discontinuities) fails an assert. virtual void select_interpolation_region(double age) const |
An iterator over the | ages (in Gyr) where the quantity takes the given y value. InterpSolutionIterator crossings(double=0) const |
Public Member Functions inherited from Core::OneArgumentFunction< double, double > | |
virtual InterpSolutionIterator | crossings (double y=0) const=0 |
An iterator over the abscissas where the function takes the given y value. More... | |
virtual | ~OneArgumentFunction () |
Provide a virtual destructor for a virtual class. More... | |
Private Attributes | |
std::valarray< double > | __poly_coef |
The coefficients of the polynomial giving the evolution. More... | |
double | __xmin |
The lower limit of the age at which this quantity can be evaluated. More... | |
double | __xmax |
The upper limit of the age at which this quantity can be evaluated. More... | |
double | __deriv_x |
The location at which the derivative has been requested. More... | |
std::vector< double > | __empty_vector |
An empty vector to serve as the list of discontinuities. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const PolynomialEvolutionQuantity &track) |
Prints an expression of the polynomial that this track represents. More... | |
Additional Inherited Members | |
Public Attributes inherited from StellarEvolution::EvolvingStellarQuantity | |
brief Prepare the quantity for interpolation around the given age After calling this | method |
Protected Member Functions inherited from StellarEvolution::EvolvingStellarQuantity | |
virtual double | age_to_interp_param (double age, double mass, double feh) const |
Return the interpoltaion parameter given age, mass and [Fe/H]. More... | |
virtual double | interp_param_to_age (double interp_param, double mass, double feh) const |
Return the age in Gyrs given an interpolation parameter, mass, and [Fe/H]. More... | |
Private Member Functions inherited from Core::FunctionDerivatives | |
virtual | ~FunctionDerivatives () |
Clean up. More... | |
An EvolvingStellar quantity that uses a polynomial instead of interpolating.
It also serves as its own derivative.
Definition at line 28 of file PolynomialEvolution.h.
|
inline |
Create an evolving quantity or its derivative.
coefficients | The coefficients defining the polynomial that gives the evolution of the quantity. |
range_low | The lower end of the range for which the quantity is defined. |
range_high | The upper end of the range for which the quantity is defined. |
derivative_x | The abscissa at which the derivatives are to be evaluated. |
Definition at line 51 of file PolynomialEvolution.h.
|
inlinevirtual |
The derivatives.
Reimplemented from StellarEvolution::EvolvingStellarQuantity.
Definition at line 103 of file PolynomialEvolution.h.
|
inlinevirtual |
The ages at which the quantity may be discontinuous.
Reimplemented from StellarEvolution::EvolvingStellarQuantity.
Definition at line 86 of file PolynomialEvolution.h.
|
inlinevirtual |
Set up the interpolation over the next interpolation region (between consecutive discontinuities.)
Definition at line 99 of file PolynomialEvolution.h.
|
inline |
A string identifying the type of quantity this is.
Definition at line 119 of file PolynomialEvolution.h.
|
inlinevirtual |
See StellarEvolution::EvolvingStellarQuantity::next_discontinuity()
Definition at line 95 of file PolynomialEvolution.h.
|
inlinevirtual |
Evaluates the polynomial at the given age.
Throws an exception if age is outside the range over which the quantity is defined.
Reimplemented from StellarEvolution::EvolvingStellarQuantity.
Definition at line 77 of file PolynomialEvolution.h.
|
virtual |
The order-th derivative.
Implements Core::FunctionDerivatives.
Definition at line 5 of file PolynomialEvolution.cpp.
|
inlinevirtual |
See StellarEvolution::EvolvingStellarQuantity::prevous_discontinuity()
Definition at line 91 of file PolynomialEvolution.h.
|
inlinevirtual |
The upper end of the range where the function is defined.
Reimplemented from StellarEvolution::EvolvingStellarQuantity.
Definition at line 83 of file PolynomialEvolution.h.
|
inlinevirtual |
The lower end of the range where the function is defined.
Reimplemented from StellarEvolution::EvolvingStellarQuantity.
Definition at line 80 of file PolynomialEvolution.h.
|
friend |
Prints an expression of the polynomial that this track represents.
|
mutableprivate |
The location at which the derivative has been requested.
Definition at line 44 of file PolynomialEvolution.h.
|
private |
An empty vector to serve as the list of discontinuities.
Definition at line 47 of file PolynomialEvolution.h.
|
private |
The coefficients of the polynomial giving the evolution.
Definition at line 32 of file PolynomialEvolution.h.
|
private |
The upper limit of the age at which this quantity can be evaluated.
Definition at line 37 of file PolynomialEvolution.h.
|
private |
The lower limit of the age at which this quantity can be evaluated.
Definition at line 37 of file PolynomialEvolution.h.