Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::blocks::BlendBlock< SystemT > Class Template Reference

A block forming the blend (coupling homotopy) H = sum_i c_i(t) * operand_i of several systems. More...

#include <blend_block.hpp>

Public Types

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.
using OperandPtr = std::shared_ptr<const SystemT>
 Shorthand for a shared pointer to a (const) operand system.

Public Member Functions

 BlendBlock ()
 Construct an empty blend block at the current default precision.
 BlendBlock (Var path_variable, std::vector< Nd > coefficients, std::vector< OperandPtr > operands)
 BlendBlock (BlendBlock const &other)
 Memory-isolating copy constructor (deep-copies each operand system; ADR-0027).
BlendBlock & operator= (BlendBlock const &other)
 Memory-isolating copy assignment (deep-copies each operand system; ADR-0027).
 BlendBlock (BlendBlock &&)=default
 Move constructor.
BlendBlock & operator= (BlendBlock &&)=default
 Move assignment.
size_t NumFunctions () const
 The number of (natural) functions the blend contributes; the owning System adds any patch.
std::vector< Nd > const & Coefficients () const
 Accessors for the function-tree expansion (System::ExpandToFunctionTree): the blend is H = sum_i coefficients_[i](t) * operands_[i], so the expansion needs the coefficient nodes, the operand systems (each itself expanded), and the shared path variable.
std::vector< OperandPtr > const & Operands () const
 Get the operand systems being blended.
Var const & PathVariable () const
 Get the shared path variable the coefficients are functions of.
void Describe (std::ostream &out, size_t &row, VariableGroup const &, bool verbose) const
 Human-facing description: terse shows the blend f_a..f_b = c_0(t)*A + c_1(t)*B, with the coefficient nodes shown symbolically and the operands labelled A, B, ...; verbose lists each operand's functions indented.
std::vector< int > Degrees () const
 The blend c_0(t)f_0 + c_1(t)f_1 + ... has, per function, the max degree of its operands in the space variables (the t-coefficients are constant in space).
std::vector< int > Degrees (VariableGroup const &vars) const
 Per-function degrees with respect to a given variable group.
void Homogenize (VariableGroup const &, std::shared_ptr< node::Variable > const &)
 No-op: a blend's operands are already-prepared and cannot be homogenized.
bool IsHomogeneous (VariableGroup const &) const
 Query whether the blend is homogeneous (iff all operands are).
bool IsPolynomial (VariableGroup const &) const
 Query whether the blend is polynomial (iff all operands are).
bool DependsOnPathVariable () const
 A blend always depends on the path variable (through its coefficients).
bool HasConstantJacobian () const
 A blend does not have a constant Jacobian.
void Differentiate () const
 Analytic block: nothing symbolic to differentiate.
void Reintern (node::ReinternMemo &memo)
 Re-intern this block's nodes after deserialization (ADR-0042): path variable and coefficient nodes (gamma) rebuild through the live intern tables via the shared memo; derivative coefficients are re-derived from the rebuilt ones; operand systems recurse (loaded objects are owned here, so the const is safely cast away).
unsigned Precision () const
 Get the block's current working precision.
void Precision (unsigned new_precision) const
 Set the block's working precision (propagated to the operand systems).
template<typename T>
void EvalInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &path_value) const
 H(x,t) = sum_i c_i(t) * f_i(x) (natural functions only).
template<typename T>
void JacobianInPlace (Eigen::Ref< Mat< T > > J, Vec< T > const &vars, T const &path_value) const
 dH/dx = sum_i c_i(t) * (df_i/dx) (natural rows only)
template<typename T>
void TimeDerivInPlace (Eigen::Ref< Vec< T > > result, Vec< T > const &vars, T const &path_value) const
 dH/dt = sum_i c_i'(t) * f_i(x) (operands are autonomous in t)

Static Public Member Functions

static int CombineDegrees (int a, int b)
 Combine two per-function degrees, propagating the not-a-polynomial sentinel.

Friends

class boost::serialization::access

Detailed Description

template<typename SystemT>
class bertini::blocks::BlendBlock< SystemT >

A block forming the blend (coupling homotopy) H = sum_i c_i(t) * operand_i of several systems.

Member Typedef Documentation

◆ Nd

template<typename SystemT>
using bertini::blocks::BlendBlock< SystemT >::Nd = std::shared_ptr<node::Node>

Shorthand for a shared pointer to a generic node.

◆ OperandPtr

template<typename SystemT>
using bertini::blocks::BlendBlock< SystemT >::OperandPtr = std::shared_ptr<const SystemT>

Shorthand for a shared pointer to a (const) operand system.

◆ Var

template<typename SystemT>
using bertini::blocks::BlendBlock< SystemT >::Var = std::shared_ptr<node::Variable>

Shorthand for a shared pointer to a variable node.

Constructor & Destructor Documentation

◆ BlendBlock() [1/4]

template<typename SystemT>
bertini::blocks::BlendBlock< SystemT >::BlendBlock ( )
inline

Construct an empty blend block at the current default precision.

◆ BlendBlock() [2/4]

template<typename SystemT>
bertini::blocks::BlendBlock< SystemT >::BlendBlock ( Var path_variable,
std::vector< Nd > coefficients,
std::vector< OperandPtr > operands )
inline
Parameters
path_variableThe shared path variable t the coefficients are functions of.
coefficientsOne coefficient node c_i(t) per operand.
operandsThe Systems being blended; all must share NumNaturalFunctions().

◆ BlendBlock() [3/4]

template<typename SystemT>
bertini::blocks::BlendBlock< SystemT >::BlendBlock ( BlendBlock< SystemT > const & other)
inline

Memory-isolating copy constructor (deep-copies each operand system; ADR-0027).

◆ BlendBlock() [4/4]

template<typename SystemT>
bertini::blocks::BlendBlock< SystemT >::BlendBlock ( BlendBlock< SystemT > && )
default

Move constructor.

Member Function Documentation

◆ Coefficients()

template<typename SystemT>
std::vector< Nd > const & bertini::blocks::BlendBlock< SystemT >::Coefficients ( ) const
inline

Accessors for the function-tree expansion (System::ExpandToFunctionTree): the blend is H = sum_i coefficients_[i](t) * operands_[i], so the expansion needs the coefficient nodes, the operand systems (each itself expanded), and the shared path variable.

◆ CombineDegrees()

template<typename SystemT>
int bertini::blocks::BlendBlock< SystemT >::CombineDegrees ( int a,
int b )
inlinestatic

Combine two per-function degrees, propagating the not-a-polynomial sentinel.

A blend of functions is a polynomial only when every operand is, so a -1 from any operand must survive. A plain maximum starting at zero silently turned it into a claim of degree zero, which is how a transcendental homotopy came to report itself as a constant.

◆ Degrees() [1/2]

template<typename SystemT>
std::vector< int > bertini::blocks::BlendBlock< SystemT >::Degrees ( ) const
inline

The blend c_0(t)f_0 + c_1(t)f_1 + ... has, per function, the max degree of its operands in the space variables (the t-coefficients are constant in space).

A function that is not a polynomial reports -1, and that answer propagates through the blend.

◆ Degrees() [2/2]

template<typename SystemT>
std::vector< int > bertini::blocks::BlendBlock< SystemT >::Degrees ( VariableGroup const & vars) const
inline

Per-function degrees with respect to a given variable group.

◆ DependsOnPathVariable()

template<typename SystemT>
bool bertini::blocks::BlendBlock< SystemT >::DependsOnPathVariable ( ) const
inline

A blend always depends on the path variable (through its coefficients).

◆ Describe()

template<typename SystemT>
void bertini::blocks::BlendBlock< SystemT >::Describe ( std::ostream & out,
size_t & row,
VariableGroup const & ,
bool verbose ) const
inline

Human-facing description: terse shows the blend f_a..f_b = c_0(t)*A + c_1(t)*B, with the coefficient nodes shown symbolically and the operands labelled A, B, ...; verbose lists each operand's functions indented.

◆ Differentiate()

template<typename SystemT>
void bertini::blocks::BlendBlock< SystemT >::Differentiate ( ) const
inline

Analytic block: nothing symbolic to differentiate.

◆ EvalInPlace()

template<typename SystemT>
template<typename T>
void bertini::blocks::BlendBlock< SystemT >::EvalInPlace ( Eigen::Ref< Vec< T > > result,
Vec< T > const & vars,
T const & path_value ) const
inline

H(x,t) = sum_i c_i(t) * f_i(x) (natural functions only).

◆ HasConstantJacobian()

template<typename SystemT>
bool bertini::blocks::BlendBlock< SystemT >::HasConstantJacobian ( ) const
inline

A blend does not have a constant Jacobian.

◆ Homogenize()

template<typename SystemT>
void bertini::blocks::BlendBlock< SystemT >::Homogenize ( VariableGroup const & ,
std::shared_ptr< node::Variable > const &  )
inline

No-op: a blend's operands are already-prepared and cannot be homogenized.

◆ IsHomogeneous()

template<typename SystemT>
bool bertini::blocks::BlendBlock< SystemT >::IsHomogeneous ( VariableGroup const & ) const
inline

Query whether the blend is homogeneous (iff all operands are).

◆ IsPolynomial()

template<typename SystemT>
bool bertini::blocks::BlendBlock< SystemT >::IsPolynomial ( VariableGroup const & ) const
inline

Query whether the blend is polynomial (iff all operands are).

◆ JacobianInPlace()

template<typename SystemT>
template<typename T>
void bertini::blocks::BlendBlock< SystemT >::JacobianInPlace ( Eigen::Ref< Mat< T > > J,
Vec< T > const & vars,
T const & path_value ) const
inline

dH/dx = sum_i c_i(t) * (df_i/dx) (natural rows only)

◆ NumFunctions()

template<typename SystemT>
size_t bertini::blocks::BlendBlock< SystemT >::NumFunctions ( ) const
inline

The number of (natural) functions the blend contributes; the owning System adds any patch.

◆ Operands()

template<typename SystemT>
std::vector< OperandPtr > const & bertini::blocks::BlendBlock< SystemT >::Operands ( ) const
inline

Get the operand systems being blended.

◆ operator=() [1/2]

template<typename SystemT>
BlendBlock & bertini::blocks::BlendBlock< SystemT >::operator= ( BlendBlock< SystemT > && )
default

Move assignment.

◆ operator=() [2/2]

template<typename SystemT>
BlendBlock & bertini::blocks::BlendBlock< SystemT >::operator= ( BlendBlock< SystemT > const & other)
inline

Memory-isolating copy assignment (deep-copies each operand system; ADR-0027).

◆ PathVariable()

template<typename SystemT>
Var const & bertini::blocks::BlendBlock< SystemT >::PathVariable ( ) const
inline

Get the shared path variable the coefficients are functions of.

◆ Precision() [1/2]

template<typename SystemT>
unsigned bertini::blocks::BlendBlock< SystemT >::Precision ( ) const
inline

Get the block's current working precision.

◆ Precision() [2/2]

template<typename SystemT>
void bertini::blocks::BlendBlock< SystemT >::Precision ( unsigned new_precision) const
inline

Set the block's working precision (propagated to the operand systems).

◆ Reintern()

template<typename SystemT>
void bertini::blocks::BlendBlock< SystemT >::Reintern ( node::ReinternMemo & memo)
inline

Re-intern this block's nodes after deserialization (ADR-0042): path variable and coefficient nodes (gamma) rebuild through the live intern tables via the shared memo; derivative coefficients are re-derived from the rebuilt ones; operand systems recurse (loaded objects are owned here, so the const is safely cast away).

Content unchanged.

◆ TimeDerivInPlace()

template<typename SystemT>
template<typename T>
void bertini::blocks::BlendBlock< SystemT >::TimeDerivInPlace ( Eigen::Ref< Vec< T > > result,
Vec< T > const & vars,
T const & path_value ) const
inline

dH/dt = sum_i c_i'(t) * f_i(x) (operands are autonomous in t)

◆ boost::serialization::access

template<typename SystemT>
friend class boost::serialization::access
friend