|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
A block of system functions, each an affine linear form f_i(x) = c_i . More...
#include <linear_forms_block.hpp>
Public Member Functions | |
| LinearFormsBlock () | |
| LinearFormsBlock (size_t num_vars, Mat< complex_mp > coefficients) | |
| LinearFormsBlock (size_t num_vars, Mat< complex_mp > coefficients, bool homogenized) | |
| Construct a block in a stated homogenization state – for a loader restoring an archived block as it was, without re-running Homogenize. | |
| size_t | NumFunctions () const |
| Number of functions (rows the block contributes to the system). | |
| std::vector< int > | Degrees () const |
| Linear forms are degree 1. | |
| std::vector< int > | Degrees (VariableGroup const &) const |
| Per-function degrees with respect to a given variable group (all 1). | |
| bool | IsPolynomial (VariableGroup const &) const |
| Linear forms are polynomial. | |
| bool | IsHomogeneous (VariableGroup const &) const |
| An affine form a.x + b is inhomogeneous (it carries a constant); once homogenized the constant has become a homogenizing-variable coefficient, so it is degree-1 homogeneous. | |
| void | Homogenize (VariableGroup const &, std::shared_ptr< node::Variable > const &) |
| Homogenize: fold the constant column onto the homogenizing variable. | |
| size_t | NumVariables () const |
| Number of variables the block expects in the input vector. | |
| Mat< complex_mp > const & | Coefficients () const |
| The master coefficient matrix (one row per form). | |
| bool | IsHomogenized () const |
| Whether Homogenize has folded the constant column onto a homogenizing variable. | |
| void | Describe (std::ostream &out, size_t &row, VariableGroup const &vars, bool verbose) const |
| Human-facing description: each form prints as the placeholder 'f_k = c. | |
| bool | DependsOnPathVariable () const |
| Linear forms do not depend on the path variable. | |
| bool | HasConstantJacobian () const |
| The Jacobian is the (constant) coefficient matrix, independent of x and t. | |
| void | Differentiate () const |
| Analytic block: nothing symbolic to differentiate. | |
| unsigned | Precision () const |
| Get the block's current working precision. | |
| void | Precision (unsigned new_precision) const |
| Set the working precision; recasts the mpfr working coefficients from the master. | |
| template<typename T> | |
| void | EvalInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &) const |
| Evaluate the block's function values into a caller-provided segment. | |
| template<typename T> | |
| void | JacobianInPlace (Eigen::Ref< Mat< T > > J, Vec< T > const &vars, T const &) const |
| Evaluate the block's Jacobian (d f_i / d x_j) into a caller-provided block. | |
| template<typename T> | |
| void | TimeDerivInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &, T const &) const |
| Time-derivative into a caller-provided segment. | |
Friends | |
| class | boost::serialization::access |
A block of system functions, each an affine linear form f_i(x) = c_i .
[x ; 1].
Value-in / value-out: evaluation takes the variable vector and writes into a caller- provided segment, so the block is self-contained and unit-testable without a System.
|
inline |
|
inline |
| num_vars | The number of variables (n). The coefficient matrix has n+1 columns (the trailing column multiplies the augmenting 1 – the constant term of each form). |
| coefficients | The augmented coefficient matrix: one row per function, shape (number-of-functions) x (num_vars + 1). |
|
inline |
Construct a block in a stated homogenization state – for a loader restoring an archived block as it was, without re-running Homogenize.
| num_vars | The number of variables the block reads (the homogenizing variable included when homogenized). |
| coefficients | The coefficient matrix exactly as the block held it: num_vars + 1 columns (the last the constant term) when affine, num_vars columns when homogenized. |
| homogenized | Whether the constant column has already been folded onto a homogenizing variable. |
|
inline |
The master coefficient matrix (one row per form).
Affine: num_vars+1 columns, the last being the constant term. Homogeneous (post-Homogenize): num_vars columns, all variable columns. Exposed for the function-tree expansion (System::NaturalFunctionsAsNodes).
|
inline |
Linear forms are degree 1.
|
inline |
Per-function degrees with respect to a given variable group (all 1).
|
inline |
Linear forms do not depend on the path variable.
|
inline |
Human-facing description: each form prints as the placeholder 'f_k = c.
[x, y, 1]' (structure stays legible) followed by its actual coefficient row in a 'c =' legend below – short (4 significant figures) in terse, full precision in verbose. Terse truncates after kTerseRowCap forms so a large slice does not flood the terminal.
|
inline |
Analytic block: nothing symbolic to differentiate.
|
inline |
Evaluate the block's function values into a caller-provided segment.
The path variable is ignored (linear forms are autonomous).
| result | Length-NumFunctions() segment to write into. |
| vars | Length-NumVariables() current variable values. |
|
inline |
The Jacobian is the (constant) coefficient matrix, independent of x and t.
|
inline |
Homogenize: fold the constant column onto the homogenizing variable.
An augmented form a.x + b (last column = constant) becomes the homogeneous a.x + b*h, where the homogenizing variable h is prepended to the variable ordering – so its column is the old constant column. The block then evaluates M*[vars] directly (no augmenting 1). Currently supports a single affine variable group (the dominant bertini.linalg case); a second call (a second affine group) throws.
|
inline |
An affine form a.x + b is inhomogeneous (it carries a constant); once homogenized the constant has become a homogenizing-variable coefficient, so it is degree-1 homogeneous.
|
inline |
Whether Homogenize has folded the constant column onto a homogenizing variable.
|
inline |
Linear forms are polynomial.
|
inline |
Evaluate the block's Jacobian (d f_i / d x_j) into a caller-provided block.
The Jacobian of f(x) = M x + b is simply M (its variable columns) – constant in x. The path variable is unused (autonomous).
| J | A NumFunctions() x NumVariables() block to write into. |
| vars | Length-NumVariables() current variable values. The Jacobian does not depend on them, but they carry the PRECISION to evaluate at: the block materializes its working coefficients to match before writing them out (ADR-0057). |
|
inline |
Number of functions (rows the block contributes to the system).
|
inline |
Number of variables the block expects in the input vector.
|
inline |
Get the block's current working precision.
|
inline |
Set the working precision; recasts the mpfr working coefficients from the master.
|
inline |
Time-derivative into a caller-provided segment.
Linear forms are autonomous (no path-variable dependence), so this is identically zero.
|
friend |