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

A block of system functions, each a product of linear forms. More...

#include <products_of_linears_block.hpp>

Public Member Functions

 ProductsOfLinearsBlock ()
 ProductsOfLinearsBlock (size_t num_vars, std::vector< Mat< complex_mp > > factors)
size_t NumFunctions () const
 Number of functions (rows the block contributes to the system).
std::vector< int > Degrees () const
 Each function is a product of its linear factors, so its degree is the factor count.
std::vector< int > Degrees (VariableGroup const &) const
 Per-function degrees with respect to a given variable group (same as the total degrees).
bool IsHomogenized () const
 Whether Homogenize has folded the constant column onto a homogenizing variable.
void Homogenize (VariableGroup const &, std::shared_ptr< node::Variable > const &)
 Homogenize with respect to an affine variable group: fold each factor's constant column onto the homogenizing variable.
bool IsHomogeneous (VariableGroup const &) const
 Homogeneous once Homogenize has run, or when every factor's constant column is zero (the form the m-homogeneous start system builds directly).
bool IsPolynomial (VariableGroup const &) const
 Always true: a product of linear forms is a polynomial.
size_t NumVariables () const
 Number of variables the block expects in the input vector.
std::vector< Mat< complex_mp > > const & Factors () const
 The master (highest-precision) coefficient matrices, one per function; matrix i is (number of factors of f_i) x (num_vars+1), the last column being the constant/augmenting term.
void Describe (std::ostream &out, size_t &row, VariableGroup const &vars, bool verbose) const
 Human-facing description: terse shows prod of k linear forms; verbose shows the actual product of affine factors (x - 1) * (x + 1).
bool DependsOnPathVariable () const
 Products of linears do not depend on the path variable.
bool HasConstantJacobian () const
 The Jacobian is not constant (it depends on x), unlike a slice.
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

Detailed Description

A block of system functions, each a product of linear forms.

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.

Constructor & Destructor Documentation

◆ ProductsOfLinearsBlock() [1/2]

bertini::blocks::ProductsOfLinearsBlock::ProductsOfLinearsBlock ( )
inline

◆ ProductsOfLinearsBlock() [2/2]

bertini::blocks::ProductsOfLinearsBlock::ProductsOfLinearsBlock ( size_t num_vars,
std::vector< Mat< complex_mp > > factors )
inline
Parameters
num_varsThe number of variables (n). Each coefficient row has n+1 entries (the trailing entry multiplies the augmenting 1 – the constant / homogenizing term).
factorsOne augmented coefficient matrix per function; matrix i has shape (number-of-factors_i) x (num_vars + 1).

Member Function Documentation

◆ Degrees() [1/2]

std::vector< int > bertini::blocks::ProductsOfLinearsBlock::Degrees ( ) const
inline

Each function is a product of its linear factors, so its degree is the factor count.

◆ Degrees() [2/2]

std::vector< int > bertini::blocks::ProductsOfLinearsBlock::Degrees ( VariableGroup const & ) const
inline

Per-function degrees with respect to a given variable group (same as the total degrees).

◆ DependsOnPathVariable()

bool bertini::blocks::ProductsOfLinearsBlock::DependsOnPathVariable ( ) const
inline

Products of linears do not depend on the path variable.

◆ Describe()

void bertini::blocks::ProductsOfLinearsBlock::Describe ( std::ostream & out,
size_t & row,
VariableGroup const & vars,
bool verbose ) const
inline

Human-facing description: terse shows prod of k linear forms; verbose shows the actual product of affine factors (x - 1) * (x + 1).

◆ Differentiate()

void bertini::blocks::ProductsOfLinearsBlock::Differentiate ( ) const
inline

Analytic block: nothing symbolic to differentiate.

◆ EvalInPlace()

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

Evaluate the block's function values into a caller-provided segment.

The path variable is ignored (products of linears are autonomous).

Parameters
resultLength-NumFunctions() segment to write into.
varsLength-NumVariables() current variable values.

◆ Factors()

std::vector< Mat< complex_mp > > const & bertini::blocks::ProductsOfLinearsBlock::Factors ( ) const
inline

The master (highest-precision) coefficient matrices, one per function; matrix i is (number of factors of f_i) x (num_vars+1), the last column being the constant/augmenting term.

Exposed so the function-tree expansion (System::ExpandToFunctionTree) can rebuild f_i = prod_r L_r.

◆ HasConstantJacobian()

bool bertini::blocks::ProductsOfLinearsBlock::HasConstantJacobian ( ) const
inline

The Jacobian is not constant (it depends on x), unlike a slice.

◆ Homogenize()

void bertini::blocks::ProductsOfLinearsBlock::Homogenize ( VariableGroup const & ,
std::shared_ptr< node::Variable > const &  )
inline

Homogenize with respect to an affine variable group: fold each factor's constant column onto the homogenizing variable.

The System prepends the homogenizing variable to the ordering, so its column is the old constant column moved to the front – exactly what LinearFormsBlock does. The m-homogeneous start system builds its block already homogeneous (zero constant column, homogenizing variables among the columns) and is never asked; an affine block built by add_products_of_linears – a regeneration deformation, say – used to meet a no-op here and then be reported homogeneous, so a homogenized System kept an affine block with the wrong variable count and could neither be expanded to nodes nor tracked projectively (b2#376). A second affine group is not yet supported and throws.

◆ IsHomogeneous()

bool bertini::blocks::ProductsOfLinearsBlock::IsHomogeneous ( VariableGroup const & ) const
inline

Homogeneous once Homogenize has run, or when every factor's constant column is zero (the form the m-homogeneous start system builds directly).

◆ IsHomogenized()

bool bertini::blocks::ProductsOfLinearsBlock::IsHomogenized ( ) const
inline

Whether Homogenize has folded the constant column onto a homogenizing variable.

Then every column is a variable column and the block evaluates M*[vars] with no augmenting

  1. Derived from the shape (a constructed block always has num_vars+1 columns), so it adds no state and the canonical encoding is unchanged.

◆ IsPolynomial()

bool bertini::blocks::ProductsOfLinearsBlock::IsPolynomial ( VariableGroup const & ) const
inline

Always true: a product of linear forms is a polynomial.

◆ JacobianInPlace()

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

Evaluate the block's Jacobian (d f_i / d x_j) into a caller-provided block.

The path variable is ignored (products of linears are autonomous).

Parameters
JA NumFunctions() x NumVariables() block to write into.
varsLength-NumVariables() current variable values.

◆ NumFunctions()

size_t bertini::blocks::ProductsOfLinearsBlock::NumFunctions ( ) const
inline

Number of functions (rows the block contributes to the system).

◆ NumVariables()

size_t bertini::blocks::ProductsOfLinearsBlock::NumVariables ( ) const
inline

Number of variables the block expects in the input vector.

◆ Precision() [1/2]

unsigned bertini::blocks::ProductsOfLinearsBlock::Precision ( ) const
inline

Get the block's current working precision.

◆ Precision() [2/2]

void bertini::blocks::ProductsOfLinearsBlock::Precision ( unsigned new_precision) const
inline

Set the working precision; recasts the mpfr working coefficients from the master.

◆ TimeDerivInPlace()

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

Time-derivative into a caller-provided segment.

Products of linears are autonomous (no path-variable dependence), so this is identically zero.

◆ boost::serialization::access

friend class boost::serialization::access
friend