|
Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
|
The fundamental polynomial system class for Bertini2. More...
#include <system.hpp>
Public Member Functions | |
| void | AddConstant (Fn const &C) |
| void | AddConstants (std::vector< Fn > const &C) |
| void | AddFunction (Fn const &F) |
| void | AddFunction (Nd const &F, std::string const &name="unnamed_function") |
| void | AddFunctions (std::vector< Fn > const &F) |
| void | AddHomVariableGroup (VariableGroup const &v) |
| void | AddImplicitParameter (Var const &v) |
| void | AddImplicitParameters (VariableGroup const &v) |
| void | AddParameter (Fn const &F) |
| void | AddParameters (std::vector< Fn > const &F) |
| void | AddPathVariable (Var const &v) |
| void | AddSubfunction (Fn const &F) |
| void | AddSubfunctions (std::vector< Fn > const &F) |
| void | AddUngroupedVariable (Var const &v) |
| void | AddUngroupedVariables (VariableGroup const &v) |
| void | AddVariableGroup (VariableGroup const &v) |
| VariableGroup const & | AffineVariableGroup (size_t index) const |
| Get an affine variable group the class has defined. | |
| template<typename T> | |
| Vec< T > | DehomogenizePoint (Vec< T > const &x) const |
| Dehomogenize a point, using the variable grouping / structure of the system. | |
| void | Differentiate () const |
| Compute and internally store the symbolic Jacobian of the system. | |
| template<typename T> | |
| Vec< T > | Eval () const |
| Evaluate the system using the previously set variable (and time) values, creating vector of function values. | |
| template<typename Derived> | |
| Derived::PlainObject | Eval (const Eigen::MatrixBase< Derived > &variable_values) const |
| Evaluate the system, provided the system has no path variable defined. | |
| template<typename Derived, typename T> | |
| Vec< T > | Eval (const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| template<typename T> | |
| void | EvalInPlace (Vec< T > &function_values) const |
| Evaluate the system using the previously set variable (and time) values, in place. | |
| template<typename T, typename Derived> | |
| void | EvalInPlace (Vec< T > &function_values, const Eigen::MatrixBase< Derived > &variable_values) const |
| Evaluate the system, provided the system has no path variable defined, in place. | |
| template<typename Derived, typename T> | |
| void | EvalInPlace (Vec< T > &function_values, const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| auto | Function (unsigned index) const |
| Get a function by its index. | |
| auto | GetNaturalFunctions () const |
| Get the functions. | |
| bool | HavePathVariable () const |
| void | Homogenize () |
| auto | HomVariableGroups () const |
| bool | IsHomogeneous () const |
| bool | IsPolynomial () const |
| template<typename T> | |
| Mat< T > | Jacobian () const |
| template<typename Derived, typename T> | |
| Mat< T > | Jacobian (const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| template<typename T> | |
| Mat< T > | Jacobian (const Vec< T > &variable_values) const |
| template<typename T> | |
| void | JacobianInPlace (Mat< T > &J) const |
| Evaluate the Jacobian matrix of the system, using the previous space and time values, in place. | |
| template<typename Derived, typename T> | |
| void | JacobianInPlace (Mat< T > &J, const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| template<typename T> | |
| void | JacobianInPlace (Mat< T > &J, const Vec< T > &variable_values) const |
| size_t | NumConstants () const |
| size_t | NumHomVariableGroups () const |
| size_t | NumHomVariables () const |
| size_t | NumImplicitParameters () const |
| size_t | NumNaturalFunctions () const |
| size_t | NumNaturalVariables () const |
| size_t | NumParameters () const |
| size_t | NumPatches () const |
| size_t | NumTotalFunctions () const |
| size_t | NumTotalVariableGroups () const |
| size_t | NumUngroupedVariables () const |
| size_t | NumVariableGroups () const |
| size_t | NumVariables () const |
| System & | operator= (const System &other) |
| The assignment operator. | |
| System & | operator= (System &&other)=default |
| The move assignment operator. | |
| unsigned | precision () const |
| Get the current precision of a system. | |
| void | precision (unsigned new_precision) const |
| void | Reset () const |
| A complete reset of the system, so that all of functions, space derivatives, and time derivatives will all be re-evaluated. | |
| void | ResetFunctions () const |
| Force re-evaluation of the system next eval of functions. If something has changed in the system, call this. | |
| void | ResetJacobian () const |
| Force re-evaluation of the system next eval of Jacobians. If something has changed in the system, call this. | |
| template<typename T> | |
| void | SetImplicitParameters (Vec< T > new_values) const |
| template<typename T> | |
| void | SetPathVariable (T const &new_value) const |
| template<typename T> | |
| void | SetVariables (const Vec< T > &new_values) const |
| System () | |
| The default constructor for a system. | |
| System (std::string const &input) | |
| The copy operator, creates a system from a string using the Bertini parser for Bertini classic syntax. | |
| System (System &&other) | |
| The move copy operator. | |
| System (System const &other) | |
| The copy operator. | |
| template<typename T> | |
| Vec< T > | TimeDerivative () const |
| Compute the time-derivative of a system. | |
| template<typename Derived, typename T> | |
| Vec< T > | TimeDerivative (const Eigen::MatrixBase< Derived > &variable_values) const |
| Compute the time-derivative of a system. | |
| template<typename Derived, typename T> | |
| Vec< T > | TimeDerivative (const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| Compute the time-derivative of a system. | |
| template<typename Derived, typename T> | |
| void | TimeDerivativeInPlace (Vec< T > &ds_dt, const Eigen::MatrixBase< Derived > &variable_values, const T &path_variable_value) const |
| Compute the time-derivative of a system. | |
| auto | VariableGroups () const |
| std::vector< unsigned > | VariableGroupSizes () const |
| Get the sizes of the variable groups, according to the current ordering. | |
| VariableGroup | VariableOrdering () const |
| const VariableGroup & | Variables () const |
Friends | |
| void | swap (System &a, System &b) |
The fundamental polynomial system class for Bertini2.
The fundamental polynomial system class for Bertini2.
Other System types are derived from this, but this class is not abstract.
|
inline |
The default constructor for a system.
|
inlineexplicit |
The copy operator, creates a system from a string using the Bertini parser for Bertini classic syntax.
| bertini::System::System | ( | System const & | other | ) |
The copy operator.
|
inline |
The move copy operator.
| void bertini::System::AddConstant | ( | Fn const & | C | ) |
Add a constant function to the system. Constants must not depend on anything which can vary – they're constant!
| C | The constant to add. |
| void bertini::System::AddConstants | ( | std::vector< Fn > const & | C | ) |
Add some constant functions to the system. Constants must not depend on anything which can vary – they're constant!
| C | The constants to add. |
| void bertini::System::AddFunction | ( | Fn const & | F | ) |
Add a function to the system.
| F | The function to add. |
| void bertini::System::AddFunction | ( | Nd const & | F, |
| std::string const & | name = "unnamed_function" ) |
Add a function to the system.
| F | The function to add. |
| name | The name of the function |
| void bertini::System::AddFunctions | ( | std::vector< Fn > const & | F | ) |
Add some functions to the system.
| F | The functions to add. |
| void bertini::System::AddHomVariableGroup | ( | VariableGroup const & | v | ) |
Add a homogeneous (projective) variable group to the system. The system must be homogeneous with respect to this group, though this is not verified at the time of this call.
| v | The variable group to add. |
| void bertini::System::AddImplicitParameter | ( | Var const & | v | ) |
Add an implicit parameter to the system. Implicit parameters are advanced by the tracker akin to variable advancement.
| v | The implicit parameter to add. |
| void bertini::System::AddImplicitParameters | ( | VariableGroup const & | v | ) |
Add some implicit parameters to the system. Implicit parameters are advanced by the tracker akin to variable advancement.
| v | The implicit parameters to add. |
| void bertini::System::AddParameter | ( | Fn const & | F | ) |
Add an explicit parameter to the system. Explicit parameters should depend only on the path variable, though this is not checked in this function.
| F | The parameter to add. |
| void bertini::System::AddParameters | ( | std::vector< Fn > const & | F | ) |
Add some explicit parameters to the system. Explicit parameters should depend only on the path variable, though this is not checked in this function.
| F | The parameters to add. |
| void bertini::System::AddPathVariable | ( | Var const & | v | ) |
| void bertini::System::AddSubfunction | ( | Fn const & | F | ) |
Add a subfunction to the system.
Tacks them onto the end of the system.
| F | The subfunction to add. |
| void bertini::System::AddSubfunctions | ( | std::vector< Fn > const & | F | ) |
Add some subfunctions to the system.
Tacks them onto the end of the system.
| F | The subfunctions to add. |
| void bertini::System::AddUngroupedVariable | ( | Var const & | v | ) |
Add variables to the system which are in neither a regular variable group, nor in a homogeneous group. This is likely used for user-defined systems, Classic userhomotopy: 1;.
| v | The variable to add. |
| void bertini::System::AddUngroupedVariables | ( | VariableGroup const & | v | ) |
Add variables to the system which are in neither a regular variable group, nor in a homogeneous group. This is likely used for user-defined systems, Classic userhomotopy: 1;.
| v | The variables to add. |
| void bertini::System::AddVariableGroup | ( | VariableGroup const & | v | ) |
Add a variable group to the system. The system may be homogenized with respect to this variable group, though this is not done at the time of this call.
| v | The variable group to add. |
|
inline |
Get an affine variable group the class has defined.
It is up to you to ensure this group exists.
|
inline |
Dehomogenize a point, using the variable grouping / structure of the system.
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime_error,if | there is a mismatch between the number of variables in the input point, and the total number of var |
| void bertini::System::Differentiate | ( | ) | const |
Compute and internally store the symbolic Jacobian of the system.
|
inline |
Evaluate the system using the previously set variable (and time) values, creating vector of function values.
It is up to YOU to ensure that the system's variables (and path variable) has been set prior to this function call.
|
inline |
Evaluate the system, provided the system has no path variable defined.
Causes the current variable values to be set in the system. Resets the function tree's stored numbers.
| std::runtime_error,if | a path variable IS defined, but you didn't pass it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
|
inline |
Evaluate the system, provided a path variable is defined for the system.
| std::runtime_error,if | a path variable is NOT defined, and you passed it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
| path_variable_value | The current value of the path variable. |
|
inline |
Evaluate the system using the previously set variable (and time) values, in place.
It is up to YOU to ensure that the system's variables (and path variable) has been set prior to this function call.
|
inline |
Evaluate the system, provided the system has no path variable defined, in place.
Causes the current variable values to be set in the system. Resets the function tree's stored numbers.
| std::runtime_error,if | a path variable IS defined, but you didn't pass it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
|
inline |
Evaluate the system, provided a path variable is defined for the system, in place.
| std::runtime_error,if | a path variable is NOT defined, and you passed it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
| path_variable_value | The current value of the path variable. |
|
inline |
Get a function by its index.
This is just as scary as you think it is. It is up to you to make sure the function at this index exists.
|
inline |
Get the functions.
| bool bertini::System::HavePathVariable | ( | ) | const |
Query whether a path variable is set for this system
| void bertini::System::Homogenize | ( | ) |
Homogenize the system, adding new homogenizing variables for each VariableGroup defined for the system.
| std::runtime_error,if | the system is not polynomial, has a mismatch on the number of homogenizing variables and the number of variable groups (this would result from a partially homogenized system), or the homogenizing variable names somehow get screwed up by having duplicates. |
|
inline |
Get the homogeneous (projective) variable groups in the problem.
| bool bertini::System::IsHomogeneous | ( | ) | const |
Checks whether a system is homogeneous, overall. This means with respect to each variable group (including homogenizing variable if defined), homogeneous variable group, and ungrouped variables, if defined.
| std::runtime_error,if | the number of homogenizing variables does not match the number of variable_groups. |
| bool bertini::System::IsPolynomial | ( | ) | const |
Checks whether a system is polynomial, overall. This means with respect to each variable group (including homogenizing variable if defined), homogeneous variable group, and ungrouped variables, if defined.
| std::runtime_error,if | the number of homogenizing variables does not match the number of variable_groups. |
|
inline |
Evaluate the Jacobian matrix of the system, using the previous space and time values.
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
|
inline |
Evaluate the Jacobian of the system, provided a path variable is defined for the system.
| std::runtime_error,if | a path variable is NOT defined, and you passed it a value. Also throws if the number of variables doesn't match. |
| variable_values | The values of the variables, for the evaluation. |
| path_variable_value | The current value of the path variable. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
|
inline |
Evaluate the Jacobian matrix of the system, provided the system has no path variable defined.
| std::runtime_error,if | a path variable IS defined, but you didn't pass it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
|
inline |
Evaluate the Jacobian matrix of the system, using the previous space and time values, in place.
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
This is analogous to J = sys.JacobianInPlace();
The input matrix must have the correct size already
|
inline |
Evaluate the Jacobian of the system, provided a path variable is defined for the system, in place.
| std::runtime_error,if | a path variable is NOT defined, and you passed it a value. Also throws if the number of variables doesn't match. |
| variable_values | The values of the variables, for the evaluation. |
| path_variable_value | The current value of the path variable. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
|
inline |
Evaluate the Jacobian matrix of the system, provided the system has no path variable defined.
| std::runtime_error,if | a path variable IS defined, but you didn't pass it a value. Also throws if the number of variables doesn't match. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| variable_values | The values of the variables, for the evaluation. |
| size_t bertini::System::NumConstants | ( | ) | const |
Get the number of constants in this system
| size_t bertini::System::NumHomVariableGroups | ( | ) | const |
Get the number of homogeneous variable groups in the system
| size_t bertini::System::NumHomVariables | ( | ) | const |
Get the number of homogenizing variables in this system
| size_t bertini::System::NumImplicitParameters | ( | ) | const |
Get the number of implicit parameters in this system
| size_t bertini::System::NumNaturalFunctions | ( | ) | const |
Get the number of functions in this system, excluding patches.
| size_t bertini::System::NumNaturalVariables | ( | ) | const |
Get the number of variables in this system, NOT including homogenizing variables.
| size_t bertini::System::NumParameters | ( | ) | const |
Get the number of explicit parameters in this system
|
inline |
Get the number of patches in this system.
| size_t bertini::System::NumTotalFunctions | ( | ) | const |
Get the total number of functions, including patches
| size_t bertini::System::NumTotalVariableGroups | ( | ) | const |
Get the total number of variable groups in the system, including both affine and homogenous. Ignores the ungrouped variables, because they are not in any group.
| size_t bertini::System::NumUngroupedVariables | ( | ) | const |
get the number of variables which are ungrouped.
| size_t bertini::System::NumVariableGroups | ( | ) | const |
Get the number of affine variable groups in the system
| size_t bertini::System::NumVariables | ( | ) | const |
Get the total number of variables in this system, including homogenizing variables.
The assignment operator.
The move assignment operator.
|
inline |
Get the current precision of a system.
| void bertini::System::precision | ( | unsigned | new_precision | ) | const |
Change the precision of the entire system's functions, subfunctions, and all other nodes.
| new_precision | The new precision, in digits, to work in. This only affects the mpfr_complex types, not double. To use low-precision (doubles), use that number type in the templated functions. |
|
inline |
A complete reset of the system, so that all of functions, space derivatives, and time derivatives will all be re-evaluated.
|
inline |
Force re-evaluation of the system next eval of functions. If something has changed in the system, call this.
|
inline |
Force re-evaluation of the system next eval of Jacobians. If something has changed in the system, call this.
|
inline |
For a system with implicitly defined parameters, set their values. The values are determined externally to the system, and are tracked along with the variables.
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| new_values | The new updated values for the implicit parameters. |
|
inline |
Set the current value of the path variable.
| std::runtime_error,if | a path variable is not defined. |
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| new_value | The new updated values for the path variable. |
|
inline |
Set the values of the variables to be equal to the input values
| T | the number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime_error | if the number of variables doesn't match. |
The ordering of the variables matters.
The AffHomUng ordering is 1) variable groups, with homogenizing variable first. 2) homogeneous variable groups. 3) ungrouped variables. The FIFO ordering uses the order in which the variable groups were added.
The path variable is not considered a variable for this operation. It is set separately.
| new_values | The new updated values for the variables. |
|
inline |
Compute the time-derivative of a system.
If \(S\) is the system, and \(t\) is the path variable this computes \(\frac{dS}{dt}\).
| T | The number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime | error if the system does not have a path variable defined. |
|
inline |
Compute the time-derivative of a system.
If \(S\) is the system, and \(t\) is the path variable this computes \(\frac{dS}{dt}\).
| T | The number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime | error if the system does not have a path variable defined. |
|
inline |
Compute the time-derivative of a system.
If \(S\) is the system, and \(t\) is the path variable this computes \(\frac{dS}{dt}\).
| T | The number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime | error if the system does not have a path variable defined. |
|
inline |
Compute the time-derivative of a system.
If \(S\) is the system, and \(t\) is the path variable this computes \(\frac{dS}{dt}\).
| T | The number-type for return. Probably dbl=std::complex<double>, or mpfr_complex=bertini::mpfr_complex. |
| std::runtime | error if the system does not have a path variable defined. |
|
inline |
Get the affine variable groups in the problem.
|
inline |
Get the sizes of the variable groups, according to the current ordering.
| VariableGroup bertini::System::VariableOrdering | ( | ) | const |
Order the variables, by the order in which the groups were added.
This function returns the variables in First In First Out (FIFO) ordering.
Homogenizing variables precede affine variable groups, so that groups always are grouped together.
This function freshly constructs the ordering every time. If you want to use the cached value,
| std::runtime_error,if | there is a mismatch between the number of homogenizing variables and the number of variable_groups. This would happen if a system is homogenized, and then more stuff is added to it. |
| const VariableGroup & bertini::System::Variables | ( | ) | const |
Get the variables in the problem.
Returns the variable ordering, constructing it if necessary.