|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
A block that randomizes an overdetermined operand system down to a square one (with a constant coefficient matrix). More...
#include <randomization_block.hpp>
Public Types | |
| using | Var = std::shared_ptr<node::Variable> |
| Shorthand for a shared pointer to a variable node. | |
| using | OperandPtr = std::shared_ptr<SystemT> |
| Shorthand for a shared pointer to the operand system. | |
Public Member Functions | |
| RandomizationBlock () | |
| Construct an empty randomization block at the current default precision. | |
| RandomizationBlock (OperandPtr operand, Mat< complex_mp > coefficients, std::vector< std::vector< int > > target_multidegrees, std::vector< std::vector< int > > operand_multidegrees, size_t num_groups) | |
| RandomizationBlock (RandomizationBlock const &other) | |
| Memory-isolating copy constructor (deep-copies the operand system; ADR-0027). | |
| RandomizationBlock & | operator= (RandomizationBlock const &other) |
| Memory-isolating copy assignment (deep-copies the operand system; ADR-0027). | |
| RandomizationBlock (RandomizationBlock &&)=default | |
| Move constructor. | |
| RandomizationBlock & | operator= (RandomizationBlock &&)=default |
| Move assignment. | |
| size_t | NumFunctions () const |
| Number of randomized functions (rows this block contributes) = n. | |
| std::vector< int > | Degrees () const |
| The randomized functions' degrees: the (total) target degree of each row, i.e. | |
| std::vector< int > | Degrees (VariableGroup const &vars) const |
| Per-group target degree. | |
| bool | IsPolynomial (VariableGroup const &) const |
| The randomized system is polynomial / homogeneous exactly when the operand is (System's IsPolynomial/IsHomogeneous are whole-system, no-argument checks – as BlendBlock delegates). | |
| bool | IsHomogeneous (VariableGroup const &) const |
| Query whether the randomized system is homogeneous (iff homogenized and the operand is). | |
| void | Homogenize (VariableGroup const &, Var const &hom_var) |
| Homogenize: thread the owning system's homogenizing variable for this group into the operand, so the operand's functions and this block's h-power deficit factors share one set of homogenizing variables. | |
| void | RestoreHomogenization (std::vector< Var > hom_vars) |
| Mark the block homogenized with the given homogenizing variables, WITHOUT touching the operand – for a loader restoring an archived block whose operand is already homogenized (the canonical-encoding reader). | |
| bool | DependsOnPathVariable () const |
| The randomization itself adds no path-variable dependence; it inherits the operand's. | |
| bool | HasConstantJacobian () const |
| The randomized Jacobian varies in x (operand Jacobian times constants, plus h-power terms). | |
| void | Differentiate () const |
| Analytic block: nothing symbolic to differentiate (the operand differentiates itself). | |
| OperandPtr const & | Operand () const |
| The overdetermined operand, for the function-tree expansion oracle and the matrix getter. | |
| Mat< complex_mp > const & | RandomizationMatrix () const |
| The randomization matrix R (master, highest precision); n x N, row i column j is c_ij. | |
| bool | IsHomogenized () const |
| Query whether the operand has been homogenized. | |
| std::vector< Var > const & | HomVars () const |
| Get the homogenizing variables accumulated, one per affine variable group. | |
| std::vector< std::vector< int > > const & | TargetMultidegrees () const |
| Get the target multidegrees (per randomized row, per variable group). | |
| std::vector< std::vector< int > > const & | OperandMultidegrees () const |
| Get the operand multidegrees (per operand function, per variable group). | |
| size_t | NumGroups () const |
| Get the number of variable groups the multidegree bookkeeping spans. | |
| void | Reintern (node::ReinternMemo &memo) |
| Re-intern this block's nodes after deserialization (ADR-0042): the homogenizing variables rebuild through the live intern tables via the shared memo, and the operand system recurses. | |
| void | Describe (std::ostream &out, size_t &row, VariableGroup const &, bool verbose) const |
| Human-facing description: terse shows 'f_a..f_b = R . | |
| unsigned | Precision () const |
| Get the block's current working precision. | |
| void | Precision (unsigned new_precision) const |
| Set the working precision: recast the mpfr working coefficients from the master and bring the operand to the same precision (so a high-precision coefficient is not multiplied against a low-precision operand value). | |
| template<typename T> | |
| void | EvalInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &) const |
| Evaluate the randomized 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 randomized Jacobian into a caller-provided block. | |
| template<typename T> | |
| void | TimeDerivInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &, T const &) const |
| Time-derivative. | |
Friends | |
| class | boost::serialization::access |
A block that randomizes an overdetermined operand system down to a square one (with a constant coefficient matrix).
| using bertini::blocks::RandomizationBlock< SystemT >::OperandPtr = std::shared_ptr<SystemT> |
Shorthand for a shared pointer to the operand system.
| using bertini::blocks::RandomizationBlock< SystemT >::Var = std::shared_ptr<node::Variable> |
Shorthand for a shared pointer to a variable node.
|
inline |
Construct an empty randomization block at the current default precision.
|
inline |
| operand | The overdetermined system being randomized (N natural functions). |
| coefficients | The n x N constant matrix; row i, column j is c_ij. |
| target_multidegrees | n rows, each a length-num_groups vector D_i (row i's target degree per variable group). |
| operand_multidegrees | N rows, each a length-num_groups vector d_j (operand function j's degree per variable group), measured on the affine operand. |
| num_groups | The number of (affine) variable groups G. |
|
inline |
Memory-isolating copy constructor (deep-copies the operand system; ADR-0027).
|
default |
Move constructor.
|
inline |
The randomized functions' degrees: the (total) target degree of each row, i.e.
the sum of its target multidegree over the variable groups. This is the degree-reporting hook – the path count of the squared system is the product of these.
|
inline |
Per-group target degree.
We match the group against the operand's variable groups by identity so the correct column of the target multidegree is returned; an unrecognized group reports the total (defensive – the owning System asks per its own groups).
|
inline |
The randomization itself adds no path-variable dependence; it inherits the operand's.
|
inline |
Human-facing description: terse shows 'f_a..f_b = R .
g (R: nxN)' then the underlying functions 'g_j' indented (they are the interesting part); verbose additionally prints R's entries.
|
inline |
Analytic block: nothing symbolic to differentiate (the operand differentiates itself).
|
inline |
Evaluate the randomized function values into a caller-provided segment.
g_i = sum_j c_ij * f_j * prod_g h_g^{(D_{i,g} - d_{j,g})}.
|
inline |
The randomized Jacobian varies in x (operand Jacobian times constants, plus h-power terms).
|
inline |
Homogenize: thread the owning system's homogenizing variable for this group into the operand, so the operand's functions and this block's h-power deficit factors share one set of homogenizing variables.
The owning System calls this once per affine variable group, in group order. We accumulate the supplied hom vars; once we have one per group we homogenize the operand with exactly those variables (System::Homogenize(VariableGroup const&) reuses them rather than minting fresh ones) and record each hom var's position in the operand's variable ordering for the h-power factors.
|
inline |
Get the homogenizing variables accumulated, one per affine variable group.
|
inline |
Query whether the randomized system is homogeneous (iff homogenized and the operand is).
|
inline |
Query whether the operand has been homogenized.
|
inline |
The randomized system is polynomial / homogeneous exactly when the operand is (System's IsPolynomial/IsHomogeneous are whole-system, no-argument checks – as BlendBlock delegates).
Query whether the randomized system is polynomial (iff the operand is).
|
inline |
Evaluate the randomized Jacobian into a caller-provided block.
By the product rule on c_ij * f_j * W_ij(x) (W_ij = prod_g h_g^{e_{ij,g}}): d g_i / d x_l = sum_j c_ij [ (d f_j / d x_l) W_ij + f_j (d W_ij / d x_l) ], and dW_ij/dx_l is nonzero only when x_l is a homogenizing variable h_{g'} appearing in W_ij.
|
inline |
Number of randomized functions (rows this block contributes) = n.
|
inline |
Get the number of variable groups the multidegree bookkeeping spans.
|
inline |
The overdetermined operand, for the function-tree expansion oracle and the matrix getter.
|
inline |
Get the operand multidegrees (per operand function, per variable group).
|
default |
Move assignment.
|
inline |
Memory-isolating copy assignment (deep-copies the operand system; ADR-0027).
|
inline |
Get the block's current working precision.
|
inline |
Set the working precision: recast the mpfr working coefficients from the master and bring the operand to the same precision (so a high-precision coefficient is not multiplied against a low-precision operand value).
|
inline |
The randomization matrix R (master, highest precision); n x N, row i column j is c_ij.
|
inline |
Re-intern this block's nodes after deserialization (ADR-0042): the homogenizing variables rebuild through the live intern tables via the shared memo, and the operand system recurses.
The coefficient matrices hold no nodes. Content unchanged.
|
inline |
Mark the block homogenized with the given homogenizing variables, WITHOUT touching the operand – for a loader restoring an archived block whose operand is already homogenized (the canonical-encoding reader).
Never call this after Homogenize.
| hom_vars | The homogenizing variable of each affine variable group, in group order. |
|
inline |
Get the target multidegrees (per randomized row, per variable group).
|
inline |
Time-derivative.
The randomization is autonomous in the path variable; if the operand depends on t (unusual for a randomized target) its rows would contribute, but the common case is an autonomous operand, so this is zero.
|
friend |