|
Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
|
Base tracker class for trackers offered in Bertini2. More...
#include <base_tracker.hpp>
Public Member Functions | |
| Predictor | GetPredictor () const |
| Query the currently set predictor. | |
| const System & | GetSystem () const |
| get a const reference to the system. | |
| unsigned | NumTotalStepsTaken () const |
| See how many steps have been taken. | |
| template<typename C> | |
| SuccessCode | Refine (Vec< C > &new_space, Vec< C > const &start_point, C const ¤t_time) const |
| Refine a point to tolerance implicitly internally set. | |
| template<typename C> | |
| SuccessCode | Refine (Vec< C > &new_space, Vec< C > const &start_point, C const ¤t_time, double const &tolerance, unsigned max_iterations) const |
| Refine a point to a given tolerance. | |
| void | ReinitializeInitialStepSize (bool should_reinitialize_stepsize) |
| Switch resetting of initial step size to that of the stepping settings. | |
| void | SetPredictor (Predictor new_predictor_choice) |
| Change tracker to use a predictor. | |
| void | SetStepSize (RT const &new_stepsize) const |
| Set how large the stepsize should be. | |
| void | SetSystem (const System &new_sys) |
| get a const reference to the system. | |
| void | SetTrackingTolerance (double const &tracking_tolerance) |
| Set how tightly to track the path. | |
| void | Setup (Predictor new_predictor_choice, double const &tracking_tolerance, double const &path_truncation_threshold, SteppingConfig const &stepping, NewtonConfig const &newton) |
| Get the tracker set up for tracking. | |
| SuccessCode | TrackPath (Vec< CT > &solution_at_endtime, CT const &start_time, CT const &endtime, Vec< CT > const &start_point) const |
| Track a start point through time, from a start time to a target time. | |
Public Member Functions inherited from bertini::Observable | |
| void | AddObserver (AnyObserver &new_observer) const |
| Add an observer, to observe this observable. | |
| void | RemoveObserver (AnyObserver &observer) const |
| Remove an observer from this observable. | |
Protected Member Functions | |
| virtual SuccessCode | CheckGoingToInfinity () const =0 |
| Check whether the path is going to infinity, as it tracks. | |
| void | IncrementBaseCountersFail () const |
| Increment and reset counters after a failed TrackerIteration() | |
| void | IncrementBaseCountersSuccess () const |
| Increment and reset counters after a successful TrackerIteration() | |
| virtual void | PostTrackCleanup () const |
| Function to be called before exiting the tracker loop. | |
| virtual void | ResetCounters () const =0 |
| Reset counters used during tracking. | |
Protected Member Functions inherited from bertini::Observable | |
| void | NotifyObservers (AnyEvent const &e) const |
| Sends an Event (more particularly, AnyEvent) to all watching observers of this object. | |
Protected Attributes | |
| NumErrorT | condition_number_estimate_ |
| An estimate on the condition number of the Jacobian. | |
| TupOfVec | current_space_ |
| The current space value. | |
| RT | current_stepsize_ |
| The current stepsize. | |
| CT | current_time_ |
| The current time. | |
| CT | delta_t_ |
| The current delta_t. | |
| unsigned | digits_final_ = 0 |
| The number of digits to track to, due to being in endgame zone. | |
| unsigned | digits_tracking_tolerance_ = 5 |
| The number of digits required for tracking to given tolerance, condition number notwithstanding. | |
| CT | endtime_ |
| The time we are tracking to. | |
| NumErrorT | error_estimate_ |
| An estimate on the error of a step. | |
| NumErrorT | norm_delta_z_ |
| The norm of the change in space resulting from a step. | |
| NumErrorT | norm_J_ |
| An estimate on the norm of the Jacobian. | |
| NumErrorT | norm_J_inverse_ |
| An estimate on the norm of the inverse of the Jacobian. | |
| unsigned | num_consecutive_failed_steps_ |
| The number of CONSECUTIVE failed steps taken in a row. | |
| unsigned | num_consecutive_successful_steps_ |
| The number of CONSECUTIVE successful steps taken in a row. | |
| unsigned | num_failed_steps_taken_ |
| The total number of failed steps taken. | |
| unsigned | num_steps_since_last_condition_number_computation_ |
| How many steps have passed since the most recent condition number estimate. | |
| unsigned | num_successful_steps_since_precision_decrease_ |
| The number of successful steps since decreased precision. | |
| unsigned | num_successful_steps_since_stepsize_increase_ |
| How many successful steps have been taken since increased stepsize. | |
| unsigned | num_successful_steps_taken_ |
| The number of successful steps taken so far. | |
| unsigned | num_total_steps_taken_ |
| The number of steps taken, including failures and successes. | |
| NumErrorT | path_truncation_threshold_ = 1e5 |
| The threshold for path truncation. | |
| unsigned | predictor_order_ |
| The order of the predictor – one less than the error estimate order. | |
| bool | reinitialize_stepsize_ = true |
| Whether should check if the path is going to infinity while tracking. On by default. | |
| NumErrorT | size_proportion_ |
| The proportion of the space step size, taking into account the order of the predictor. | |
| SuccessCode | step_success_code_ |
| The next stepsize. | |
| TupOfVec | temporary_space_ |
| After prediction, the tentative next space value. | |
| TupOfVec | tentative_space_ |
| After correction, the tentative next space value. | |
| std::reference_wrapper< const System > | tracked_system_ |
| Reference to the system being tracked. | |
| NumErrorT | tracking_tolerance_ = 1e-5 |
| The tracking tolerance. | |
Base tracker class for trackers offered in Bertini2.
Trackers in Bertini2 are the engine for tracking a path from one space-time pair to another. The path is implicitly described by the system being tracked.
Specific examples are given with the implemented tracker types. So far, these types are avaiable:
Please see their detailed documentation for description of how to use them correctly.
Since the Bertini trackers have common functionality, and we want to be able to call arbitrary algorithms using and tracker type, we use inheritance. That is, there is common functionality in all trackers, such as
Setup TrackPath Refine
which we want all Trackers to be able to do. However, the internal behaviour of a particular tracker varies – which is why it is a different type. In particular, the fixed precision trackers produce and work in a fixed precision, whereas the AMPTracker varies precision to get around or near branch points while tracking.
Hence, the use of trackers in Bertini2 is through pointers or references to Trackers, enabling the use of any kind of tracking in any algorithm, and further allowing the development of new tracker types as the theory and practice advance.
To create a new Tracker type, inherit from this, and override the following functions:
and optionally override the following functions
where you probably want to call this base function, which is why it is protected, not private.
|
protectedpure virtual |
Check whether the path is going to infinity, as it tracks.
This check is necessary because a homotopy may be malformed, or may have encountered a probability-0 event. That it is a 0 probability event is why this check is disable-able via a toggle.
|
inline |
Query the currently set predictor.
|
inline |
get a const reference to the system.
|
inlineprotected |
Increment and reset counters after a failed TrackerIteration()
Your custom override, if provided, should almost certainly call this function.
|
inlineprotected |
Increment and reset counters after a successful TrackerIteration()
Your custom override, if provided, should almost certainly call this function.
|
inline |
See how many steps have been taken.
|
inlineprotectedvirtual |
|
inline |
Refine a point to tolerance implicitly internally set.
Runs Newton's method using the current settings for tracking, including the min and max number of iterations allowed, the tracking tolerance, precision, etc. YOU must ensure that the input point has the correct precision.
| [out] | new_space | The result of refinement. |
| start_point | The seed for Newton's method for refinement. | |
| current_time | The current time value for refinement. |
|
inline |
Refine a point to a given tolerance.
Runs Newton's method using the current settings for tracking, including the min and max number of iterations allowed, precision, etc, EXCEPT for the tracking tolerance and max number of iterations, which you feed in here. YOU must ensure that the input point has the correct precision.
| [out] | new_space | The result of refinement. |
| start_point | The seed for Newton's method for refinement. | |
| current_time | The current time value for refinement. | |
| tolerance | The tolerance to which to refine. | |
| max_iterations | The maximum number of iterations to use to refine. |
|
inline |
Switch resetting of initial step size to that of the stepping settings.
By default, initial step size is retrieved from the stepping settings at the start of each path track. To turn this off, and re-use the previous step size from the previously tracked path, turn off by calling this function with false.
|
protectedpure virtual |
Reset counters used during tracking.
Your custom tracker type should almost certainly call this function.
|
inline |
Change tracker to use a predictor.
| new_predictor_choice | The new predictor to be used. |
|
inline |
Set how large the stepsize should be.
| new_stepsize | The new value. |
|
inline |
get a const reference to the system.
|
inline |
Set how tightly to track the path.
Smaller values tracks the path more tightly, at the expense of higher computational time.
| tracking_tolerance | The new value. Newton iterations are performed until the step length is less than this number, or the max number of iterations has been reached, in which case the overall predict-correct step is viewed as a failure, and the step is undone. This number must be positive. |
|
inline |
Get the tracker set up for tracking.
Pass the tracker the configuration for tracking, to get it set up.
|
inline |
Track a start point through time, from a start time to a target time.
| [out] | solution_at_endtime | The value of the solution at the end time. |
| start_time | The time at which to start tracking. | |
| endtime | The time to track to. | |
| start_point | The intial space values for tracking. |
The is the fundamental method for the tracker. First, you create and set up the tracker, telling it what system you will solve, and the settings to use. Then, you actually do the tracking.
|
mutableprotected |
An estimate on the condition number of the Jacobian.
|
mutableprotected |
The current space value.
|
mutableprotected |
The current stepsize.
|
mutableprotected |
The current time.
|
mutableprotected |
The current delta_t.
|
protected |
The number of digits to track to, due to being in endgame zone.
|
protected |
The number of digits required for tracking to given tolerance, condition number notwithstanding.
|
mutableprotected |
The time we are tracking to.
|
mutableprotected |
An estimate on the error of a step.
|
mutableprotected |
The norm of the change in space resulting from a step.
|
mutableprotected |
An estimate on the norm of the Jacobian.
|
mutableprotected |
An estimate on the norm of the inverse of the Jacobian.
|
mutableprotected |
The number of CONSECUTIVE failed steps taken in a row.
|
mutableprotected |
The number of CONSECUTIVE successful steps taken in a row.
|
mutableprotected |
The total number of failed steps taken.
|
mutableprotected |
How many steps have passed since the most recent condition number estimate.
|
mutableprotected |
The number of successful steps since decreased precision.
|
mutableprotected |
How many successful steps have been taken since increased stepsize.
|
mutableprotected |
The number of successful steps taken so far.
|
mutableprotected |
The number of steps taken, including failures and successes.
|
protected |
The threshold for path truncation.
|
protected |
The order of the predictor – one less than the error estimate order.
|
protected |
Whether should check if the path is going to infinity while tracking. On by default.
Whether should re-initialize the stepsize with each call to Trackpath. On by default.
|
mutableprotected |
The proportion of the space step size, taking into account the order of the predictor.
|
mutableprotected |
The next stepsize.
The code for step success.
|
mutableprotected |
After prediction, the tentative next space value.
|
mutableprotected |
After correction, the tentative next space value.
|
protected |
Reference to the system being tracked.
|
protected |
The tracking tolerance.