A class which reads-in and provides a convenient interface to the \(p_{m,s}\) coefficients. More...
#include <EccentricityExpansionCoefficients.h>
Collaboration diagram for Evolve::EccentricityExpansionCoefficients:Public Member Functions | |
| EccentricityExpansionCoefficients () | |
| Create an uninitialized object. More... | |
| void | prepare (const std::string &tabulated_pms_fname, double precision, bool pre_load, bool disable_precision_fail=false) |
| Reads in tabulated expansion coefficients, making this object useable. More... | |
| double | get_expansion_precision () const |
| Return the expansion precision set by the last call to prepare() More... | |
| double | interp_precision (int m, int s) const |
| The guaranteed interpolation precision for a given \(p_{m,s}\). More... | |
| int | required_expansion_order (double e, int m) const |
| Return the smallest s value such that all \(p_{m,s'}\) for. More... | |
| int | max_expansion_order () const |
| The largest s for which \(p_{m,s'}\) is known. More... | |
| std::pair< double, double > | get_expansion_range (int m, int max_s) const |
| Return the range of eccentricities (min, max) over which an expansion going up to given max s is valid and required. More... | |
| double | operator() (int m, int s, double e, bool deriv) const |
| Approximate the value of \(p_{m,s}(e)\). More... | |
Private Member Functions | |
| std::vector< double > | load_coefficient (sqlite3 *db, int m, int s) |
| void | set_max_s (sqlite3 *db) |
| TODO: use smallest max s over m=+-2 and m=0. More... | |
| void | load_metadata (sqlite3 *db) |
| Read the metadata for the available \(p_{m,s}\) coefficients from the databate. More... | |
| void | load_max_ignore_eccentricity (sqlite3 *db, double precision) |
| Fill the __max_ignore_eccentricity member per the database. More... | |
| double | load_specific_e (int m, int s, int e_step) const |
| void | get_interp_data (sqlite3 *db) |
| The callback SQL function that updates the above values (__pms_interp_data) More... | |
| double | get_specific_e (int m, int s, int e_step) const |
| Return a single tabulated value of \(p_{m,s}\). More... | |
| std::vector< double > | find_pms_boundary_values (int m, int s, double e) const |
| double | return_known_e (int m, int s, double e) const |
| bool | check_known_e (int m, int s, double e) const |
| int | e_to_nearest_step (int m, int s, double e, bool flr) const |
| double | step_to_e (int m, int s, int step) const |
| int | current_largest_s (int m) |
| int | local_index (int m, int s) const |
| std::vector< double > * | which_list (int m) |
| int * | which_order (int m) |
Private Attributes | |
| bool | __useable |
| bool | __allow_precision_fail |
| See do_not_fail argument to prepare(). More... | |
| std::vector< std::vector< double > > | __pms_interp_data |
| The expansion coefficients for all \(p_{m,s}\). More... | |
| int | __max_s |
| The largest s (second) index at which all three \(p_{m,s}\) coefficients are tabulated. More... | |
| double | __expansion_precision |
| The currently defined expansion precision (see prepare()) More... | |
| bool | __load_all |
| Whether we load the whole database at the start (true) or part of it as needed (false) More... | |
| std::vector< int > | __db_pms_id |
| The identifiers of particular \(p_{m,s}\) coefficients in the database. More... | |
| std::vector< double > | __min_e |
| std::vector< int > | __num_steps |
| The number of e values at which each \(p_{m,s}\) coefficient is tabulated. More... | |
| std::vector< double > | __max_e |
| The maximum eccentricity at which each \(p_{m,s}\) coefficient can be reliably interpolated. More... | |
| std::vector< double > | __interp_precision |
| The guaranteed interpolation precision for each \(p_{m,s}\) u coefficient. More... | |
| std::string | __file_name |
| The name of the file contanining the interpolatiod sqlite database. More... | |
| std::vector< double > | __max_ignore_eccentricity |
| The maximum eccentricity at which a given \(p_{m,s}\) can be ignored. More... | |
A class which reads-in and provides a convenient interface to the \(p_{m,s}\) coefficients.
Definition at line 29 of file EccentricityExpansionCoefficients.h.
|
inline |
Create an uninitialized object.
Definition at line 135 of file EccentricityExpansionCoefficients.h.
|
inline |
Return the expansion precision set by the last call to prepare()
Definition at line 159 of file EccentricityExpansionCoefficients.h.
| std::pair< double, double > Evolve::EccentricityExpansionCoefficients::get_expansion_range | ( | int | m, |
| int | max_s | ||
| ) | const |
Return the range of eccentricities (min, max) over which an expansion going up to given max s is valid and required.
For eccentricities below the minimum (first value of returned pair) at least \(p_{m,max_s}\) can be excluded from the expansion without violating the precision requirement. For eccentricities at or above maximum (second value of returned pair) at least \(p_{m,max_s+1}\) must be included in the series in order to satisfy the precision requirement.
Definition at line 483 of file EccentricityExpansionCoefficients.cpp.
|
private |
The callback SQL function that updates the above values (__pms_interp_data)
Definition at line 270 of file EccentricityExpansionCoefficients.cpp.
|
private |
Return a single tabulated value of \(p_{m,s}\).
| m | The m (first) index of the expansion coefficient to get. |
| s | The s (second) index of the expansion coefficient to get. |
| e_step | The index within the tabulated values to get |
Definition at line 280 of file EccentricityExpansionCoefficients.cpp.
| double Evolve::EccentricityExpansionCoefficients::interp_precision | ( | int | m, |
| int | s | ||
| ) | const |
The guaranteed interpolation precision for a given \(p_{m,s}\).
Definition at line 441 of file EccentricityExpansionCoefficients.cpp.
|
private |
Fill the __max_ignore_eccentricity member per the database.
Definition at line 129 of file EccentricityExpansionCoefficients.cpp.
|
private |
Read the metadata for the available \(p_{m,s}\) coefficients from the databate.
Definition at line 84 of file EccentricityExpansionCoefficients.cpp.
|
inline |
The largest s for which \(p_{m,s'}\) is known.
Definition at line 171 of file EccentricityExpansionCoefficients.h.
| double Evolve::EccentricityExpansionCoefficients::operator() | ( | int | m, |
| int | s, | ||
| double | e, | ||
| bool | deriv | ||
| ) | const |
Approximate the value of \(p_{m,s}(e)\).
| m | The first index (0 or +-2). |
| s | The second index. |
| e | The value of the eccentricity to use. |
| deriv | If true the result is differentiated w.r.t. to eccentricity. |
Definition at line 515 of file EccentricityExpansionCoefficients.cpp.
| void Evolve::EccentricityExpansionCoefficients::prepare | ( | const std::string & | tabulated_pms_fname, |
| double | precision, | ||
| bool | pre_load, | ||
| bool | disable_precision_fail = false |
||
| ) |
Reads in tabulated expansion coefficients, making this object useable.
| tabulated_pms_fname | The name of the file to read pre-tabulated coefficients from. |
| precision | Only reads the coefficients of the expansion which most closely achieves the indicated precision, erring on the side of being more precise. |
| pre_load | Should all data from the database be pre-loaded to avoid query each time a coefficient is evaluated. Setting to true means we keep a 9 GB database in memory. |
| disable_precision_fail | Do not throw exception if specified precision is unattainable with given tabulated coefficients, just use highest availabre order. |
Definition at line 396 of file EccentricityExpansionCoefficients.cpp.
| int Evolve::EccentricityExpansionCoefficients::required_expansion_order | ( | double | e, |
| int | m | ||
| ) | const |
Return the smallest s value such that all \(p_{m,s'}\) for.
precision requirements.
Definition at line 456 of file EccentricityExpansionCoefficients.cpp.
|
private |
TODO: use smallest max s over m=+-2 and m=0.
Return the highest s available for requested precision. TODO: what is this? It is possible for file to accommodate precision but only for s=0
Definition at line 54 of file EccentricityExpansionCoefficients.cpp.
|
private |
See do_not_fail argument to prepare().
Definition at line 36 of file EccentricityExpansionCoefficients.h.
|
private |
The identifiers of particular \(p_{m,s}\) coefficients in the database.
Definition at line 63 of file EccentricityExpansionCoefficients.h.
|
private |
The currently defined expansion precision (see prepare())
Definition at line 55 of file EccentricityExpansionCoefficients.h.
|
private |
The name of the file contanining the interpolatiod sqlite database.
Definition at line 83 of file EccentricityExpansionCoefficients.h.
|
private |
The guaranteed interpolation precision for each \(p_{m,s}\) u coefficient.
Definition at line 80 of file EccentricityExpansionCoefficients.h.
|
private |
Whether we load the whole database at the start (true) or part of it as needed (false)
Definition at line 59 of file EccentricityExpansionCoefficients.h.
|
private |
The maximum eccentricity at which each \(p_{m,s}\) coefficient can be reliably interpolated.
Definition at line 75 of file EccentricityExpansionCoefficients.h.
|
private |
The maximum eccentricity at which a given \(p_{m,s}\) can be ignored.
The order is the same as __pms_interp_data.
Definition at line 89 of file EccentricityExpansionCoefficients.h.
|
private |
The largest s (second) index at which all three \(p_{m,s}\) coefficients are tabulated.
If you're seeing this, it means I haven't properly sorted out new documentation stuff or moved new variables/functions into a better place
Definition at line 52 of file EccentricityExpansionCoefficients.h.
|
private |
The smallest value of e for which each \(p_{m,s}\) coefficient has tabulated values.
Definition at line 67 of file EccentricityExpansionCoefficients.h.
|
private |
The number of e values at which each \(p_{m,s}\) coefficient is tabulated.
Definition at line 71 of file EccentricityExpansionCoefficients.h.
|
private |
The expansion coefficients for all \(p_{m,s}\).
Stored in the order m=-2,0,+2 for increasing s (m changes faster).
Definition at line 43 of file EccentricityExpansionCoefficients.h.
|
private |
Has this class been properly linked to a database with interpolation data?
Definition at line 33 of file EccentricityExpansionCoefficients.h.