|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
The polynomial evaluation block: function trees + derivatives + SLP. More...
#include <polynomial_block.hpp>
Public Types | |
| using | NE = std::shared_ptr<node::NamedExpression> |
| Shorthand for a shared pointer to a named expression. | |
| using | Nd = std::shared_ptr<node::Node> |
| Shorthand for a shared pointer to a generic node. | |
| using | Var = std::shared_ptr<node::Variable> |
| Shorthand for a shared pointer to a variable node. | |
Public Member Functions | |
| PolynomialBlock () | |
| Construct an empty polynomial block at the current default precision. | |
| void | AddFunction (Nd const &f) |
| Add a function (one row of the block). | |
| void | AddConstant (NE const &f) |
| Add a named constant subfunction. | |
| void | SetVariableOrdering (VariableGroup const &vars) const |
| The variable ordering + path variable the function trees are evaluated against; the owning System keeps these in sync (they change as variable groups are added / the system is homogenized). | |
| void | SetPathVariable (Var const &t) const |
| Set the path variable the function trees are evaluated against. | |
| void | ClearPathVariable () const |
| Clear the path variable. | |
| std::vector< Nd > & | Functions () |
| Get mutable access to the block's functions. | |
| std::vector< Nd > const & | Functions () const |
| Get const access to the block's functions. | |
| std::vector< NE > const & | ConstantSubfunctions () const |
| Get the block's constant subfunctions. | |
| size_t | NumConstants () const |
| Get the number of constant subfunctions. | |
| bool | IsDifferentiated () const |
| Query whether the block's derivatives have been computed. | |
| void | Invalidate () const |
| Mark the block's derivatives as stale (to be recomputed on next use). | |
| std::vector< int > | Degrees () const |
| Per-function degrees (total, and with respect to a variable group). | |
| std::vector< int > | Degrees (VariableGroup const &vars) const |
| Per-function degrees with respect to a given variable group. | |
| void | Homogenize (VariableGroup const &group, Var const &hom_var) |
| Homogenize each function w.r.t. | |
| bool | IsHomogeneous (VariableGroup const &vars) const |
| Query whether every function is homogeneous with respect to a variable group. | |
| bool | IsPolynomial (VariableGroup const &vars) const |
| Query whether every function is polynomial in a variable group. | |
| size_t | NumFunctions () const |
| Get the number of functions in the block. | |
| bool | DependsOnPathVariable () const |
| Query whether the block depends on the path variable. | |
| void | Describe (std::ostream &out, size_t &row, VariableGroup const &, bool) const |
| Human-facing description: one line per function, f_k = <expression>. | |
| unsigned | Precision () const |
| Get the block's current working precision. | |
| void | Precision (unsigned new_precision) const |
| Set the block's working precision (delegated to the compiled SLP). | |
| template<typename T> | |
| void | EvalInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &path_value) const |
| Evaluate the block's functions in place at the given variable and path-variable values. | |
| template<typename T> | |
| void | JacobianInPlace (Eigen::Ref< Mat< T > > J, Vec< T > const &vars, T const &path_value) const |
| Evaluate the block's Jacobian in place at the given variable and path-variable values. | |
| template<typename T> | |
| void | TimeDerivInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &path_value) const |
| Evaluate the block's time derivative in place (zero if there is no path variable). | |
| VariableGroup const & | VariableOrdering () const |
| Get the variable ordering the functions are evaluated against. | |
| bool | HavePathVariable () const |
| Query whether the block has a path variable. | |
| Var | GetPathVariable () const |
| Get the block's path variable (may be null). | |
| size_t | NumNaturalFunctions () const |
| Get the number of natural (pre-randomization) functions. | |
| std::vector< Nd > const & | GetNaturalFunctions () const |
| Get the block's natural function trees. | |
| std::vector< Nd > const & | GetSpaceDerivatives () const |
| Get the per-variable space-derivative trees (computing them if needed). | |
| std::vector< Nd > const & | GetTimeDerivatives () const |
| Get the time-derivative trees (computing them if needed). | |
| void | Differentiate () const |
| Build the symbolic derivatives (and, for SLP eval, compile the SLP from this block). | |
| void | SimplifyFunctions () const |
| Simplify the function trees (and invalidate the derivatives, which must be rebuilt). | |
| void | SimplifyDerivatives () const |
| Simplify the derivative trees. | |
| void | Reintern (node::ReinternMemo &memo) |
| Re-intern this block's nodes after deserialization (ADR-0042): functions, constant subfunctions, variable ordering, and path variable are rebuilt through the live intern tables via the shared memo; the derivative/SLP caches (which reference the old nodes) are dropped and recompute on demand. | |
Friends | |
| class | boost::serialization::access |
The polynomial evaluation block: function trees + derivatives + SLP.
| using bertini::blocks::PolynomialBlock::Nd = std::shared_ptr<node::Node> |
Shorthand for a shared pointer to a generic node.
| using bertini::blocks::PolynomialBlock::NE = std::shared_ptr<node::NamedExpression> |
Shorthand for a shared pointer to a named expression.
| using bertini::blocks::PolynomialBlock::Var = std::shared_ptr<node::Variable> |
Shorthand for a shared pointer to a variable node.
|
inline |
Construct an empty polynomial block at the current default precision.
|
inline |
Add a named constant subfunction.
|
inline |
Add a function (one row of the block).
|
inline |
Clear the path variable.
|
inline |
Get the block's constant subfunctions.
|
inline |
Per-function degrees (total, and with respect to a variable group).
|
inline |
Per-function degrees with respect to a given variable group.
|
inline |
Query whether the block depends on the path variable.
|
inline |
Human-facing description: one line per function, f_k = <expression>.
Polynomials are the content, so terse and verbose are the same (the expression is shown either way).
|
inline |
Build the symbolic derivatives (and, for SLP eval, compile the SLP from this block).
Derivatives are NOT simplified here; explicit simplification is System::Simplify (SimplifyDerivatives), an opt-in the user invokes.
|
inline |
Evaluate the block's functions in place at the given variable and path-variable values.
|
inline |
Get mutable access to the block's functions.
|
inline |
Get const access to the block's functions.
|
inline |
Get the block's natural function trees.
|
inline |
Get the block's path variable (may be null).
|
inline |
Get the per-variable space-derivative trees (computing them if needed).
|
inline |
Get the time-derivative trees (computing them if needed).
|
inline |
Query whether the block has a path variable.
|
inline |
Homogenize each function w.r.t.
the group + its homogenizing var, functionally: each function is rebound to a freshly homogenized copy, so any external holder of the original function node never observes it change (shared variables are preserved).
|
inline |
Mark the block's derivatives as stale (to be recomputed on next use).
|
inline |
Query whether the block's derivatives have been computed.
|
inline |
Query whether every function is homogeneous with respect to a variable group.
|
inline |
Query whether every function is polynomial in a variable group.
|
inline |
Evaluate the block's Jacobian in place at the given variable and path-variable values.
|
inline |
Get the number of constant subfunctions.
|
inline |
Get the number of functions in the block.
|
inline |
Get the number of natural (pre-randomization) functions.
|
inline |
Get the block's current working precision.
|
inline |
Set the block's working precision (delegated to the compiled SLP).
|
inline |
Re-intern this block's nodes after deserialization (ADR-0042): functions, constant subfunctions, variable ordering, and path variable are rebuilt through the live intern tables via the shared memo; the derivative/SLP caches (which reference the old nodes) are dropped and recompute on demand.
Content is unchanged.
|
inline |
Set the path variable the function trees are evaluated against.
|
inline |
The variable ordering + path variable the function trees are evaluated against; the owning System keeps these in sync (they change as variable groups are added / the system is homogenized).
|
inline |
Simplify the derivative trees.
Simplification is functional and purely structural (Node::Simplified, ADR-0011), so it needs no point and no node evaluation. Requires the derivatives to already exist.
|
inline |
Simplify the function trees (and invalidate the derivatives, which must be rebuilt).
|
inline |
Evaluate the block's time derivative in place (zero if there is no path variable).
|
inline |
Get the variable ordering the functions are evaluated against.
|
friend |