Contains the AMPTracker type, and necessary functions.
More...
Go to the source code of this file.
|
| double | bertini::tracking::ArithmeticCost (unsigned precision) |
| | Compute the cost function for arithmetic versus precision.
|
| |
| template<typename T> |
| T | bertini::tracking::max (T const &a, T const &b, T const &c) |
| | Three-argument form of max.
|
| |
| unsigned | bertini::tracking::MinDigitsForLogOfStepsize (mpfr_float const &log_of_stepsize, mpfr_float const &time_to_go, unsigned safety_digits=3) |
| | The minimum number of digits based on a log10 of a stepsize.
|
| |
| unsigned | bertini::tracking::MinDigitsForStepsizeInterval (mpfr_float const &min_stepsize, mpfr_float const &max_stepsize, mpfr_float const &time_to_go) |
| | For a given range of stepsizes under consideration, gives the minimum number of digits.
|
| |
| template<typename RealT> |
| void | bertini::tracking::MinimizeTrackingCost (unsigned &new_precision, RealT &new_stepsize, unsigned min_precision, RealT const &min_stepsize, unsigned max_precision, RealT const &max_stepsize, unsigned digits_B, unsigned num_newton_iterations, unsigned predictor_order=0) |
| | Compute precision and stepsize minimizing the ArithmeticCost() of tracking.
|
| |
| mpfr_float | bertini::tracking::MinStepSizeForPrecision (unsigned precision, mpfr_float const &time_to_go, int safety_digits=3) |
| | Just another name for MinTimeForCurrentPrecision.
|
| |
| mpfr_float | bertini::tracking::MinTimeForCurrentPrecision (unsigned precision, mpfr_float const &time_to_go, int safety_digits=3) |
| |
| mpfr_float | bertini::tracking::StepsizeSatisfyingCriterionB (unsigned precision, unsigned digits_B, unsigned num_newton_iterations, unsigned predictor_order=0) |
| | Compute a stepsize satisfying AMP Criterion B with a given precision.
|
| |
Contains the AMPTracker type, and necessary functions.
◆ ArithmeticCost()
| double bertini::tracking::ArithmeticCost |
( |
unsigned | precision | ) |
|
|
inline |
Compute the cost function for arithmetic versus precision.
From [2], \(C(P)\). As currently implemented, this is \( 10.35 + 0.13 P \), where P is the precision. These numbers are stale, and need to be recomputed. Badly. Please do this.
This function tells you the relative cost of arithmetic at a given precision.
- Todo
- Recompute this cost function for boost::multiprecision::mpfr_float
- Parameters
-
| precision | An integral number of digits – then this gives the cost for arithmetic |
- Returns
- A double indicating how expensive arithmetic at a given precision is. 1 is the base-line for double-precision.
◆ max()
template<typename T>
| T bertini::max |
( |
T const & | a, |
|
|
T const & | b, |
|
|
T const & | c ) |
Three-argument form of max.
- Parameters
-
| a | Input one |
| b | Input two |
| c | Input three |
◆ MinDigitsForLogOfStepsize()
| unsigned bertini::tracking::MinDigitsForLogOfStepsize |
( |
mpfr_float const & | log_of_stepsize, |
|
|
mpfr_float const & | time_to_go, |
|
|
unsigned | safety_digits = 3 ) |
|
inline |
The minimum number of digits based on a log10 of a stepsize.
- Parameters
-
| log_of_stepsize | log10 of a stepsize |
| time_to_go | How much time you have left to track. |
| safety_digits | A buffer of extra digits to use, over the computed min. Yes, this is added in, in this function. |
- Returns
- An integral number of necessary digits to use
◆ MinDigitsForStepsizeInterval()
| unsigned bertini::tracking::MinDigitsForStepsizeInterval |
( |
mpfr_float const & | min_stepsize, |
|
|
mpfr_float const & | max_stepsize, |
|
|
mpfr_float const & | time_to_go ) |
|
inline |
For a given range of stepsizes under consideration, gives the minimum number of digits.
- Parameters
-
| min_stepsize | The smallest stepsize under consideration |
| max_stepsize | The largest stepsize under consideration |
| time_to_go | How much time is left to track. |
- Returns
- The min number of digits.
This function assumes you are going to time=0, or that you have taken care of that difference. That is, time_to_go should be a duration, not the current time, unless you are tracking to t=0, in which case current time is the duration left to go. Dig it?
◆ MinimizeTrackingCost()
template<typename RealT>
| void bertini::tracking::MinimizeTrackingCost |
( |
unsigned & | new_precision, |
|
|
RealT & | new_stepsize, |
|
|
unsigned | min_precision, |
|
|
RealT const & | min_stepsize, |
|
|
unsigned | max_precision, |
|
|
RealT const & | max_stepsize, |
|
|
unsigned | digits_B, |
|
|
unsigned | num_newton_iterations, |
|
|
unsigned | predictor_order = 0 ) |
Compute precision and stepsize minimizing the ArithmeticCost() of tracking.
For a given range of precisions, an old stepsize, and a maximum stepsize, the Cost of tracking is computed, and a minimizer found.
This function is used in the AMPTracker tracking loop, both in case of successful steps and in Criterion errors.
- Parameters
-
| [out] | new_precision | The minimizing precision. |
| [out] | new_stepsize | The minimizing stepsize. |
| [in] | min_precision | The minimum considered precision. |
| [in] | min_stepsize | The minimum permitted stepsize. |
| [in] | max_precision | The maximum considered precision. |
| [in] | max_stepsize | The maximum permitted stepsize.
|
| [in] | digits_B | The number of digits required, according to CriterionB from [1], [2] |
| [in] | num_newton_iterations | The number of allowed Newton corrector iterations. |
| [in] | predictor_order | The order of the predictor being used. This is the order itself, not the order of the error estimate. |
- See also
- ArithmeticCost
◆ MinStepSizeForPrecision()
| mpfr_float bertini::tracking::MinStepSizeForPrecision |
( |
unsigned | precision, |
|
|
mpfr_float const & | time_to_go, |
|
|
int | safety_digits = 3 ) |
|
inline |
Just another name for MinTimeForCurrentPrecision.
- Parameters
-
| precision | The number of digits you want to use |
| time_to_go | The duration of remaining time to track |
| safety_digits | A buffer of extra digits to use |
- Returns
- The smallest permissible stepsize
◆ MinTimeForCurrentPrecision()
| mpfr_float bertini::tracking::MinTimeForCurrentPrecision |
( |
unsigned | precision, |
|
|
mpfr_float const & | time_to_go, |
|
|
int | safety_digits = 3 ) |
|
inline |
The minimum time that can be represented effectively using a given precision
- Parameters
-
| precision | The number of digits you want to use |
| time_to_go | The duration of remaining time to track |
| safety_digits | A buffer of extra digits to use |
- Returns
- The smallest permissible stepsize
- Todo
- This function has a hardcoded value which should be replaced
◆ StepsizeSatisfyingCriterionB()
| mpfr_float bertini::tracking::StepsizeSatisfyingCriterionB |
( |
unsigned | precision, |
|
|
unsigned | digits_B, |
|
|
unsigned | num_newton_iterations, |
|
|
unsigned | predictor_order = 0 ) |
|
inline |
Compute a stepsize satisfying AMP Criterion B with a given precision.
- Parameters
-
| precision | The current working precision |
| digits_B | The number of digits from Criterion B |
| num_newton_iterations | The number of remaining newton iterations allowed in the correction |
| predictor_order | The order of the predictor |
- Returns
- The stepsize
- Todo
- Remove the default value of the predictor order, as that seems weird to have