Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
randomization_block.hpp File Reference

A System evaluation block that randomizes an overdetermined operand system down to a square one, so its isolated solutions can be found by homotopy continuation. More...

#include <vector>
#include <memory>
#include <stdexcept>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/split_member.hpp>
#include "bertini2/num_traits.hpp"
#include "bertini2/eigen_extensions.hpp"
#include "bertini2/function_tree.hpp"
#include "bertini2/function_tree/reintern.hpp"
#include "bertini2/system/blocks/describe.hpp"
Include dependency graph for randomization_block.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bertini::blocks::RandomizationBlock< SystemT >
 A block that randomizes an overdetermined operand system down to a square one (with a constant coefficient matrix). More...

Namespaces

namespace  bertini
namespace  bertini::blocks

Detailed Description

A System evaluation block that randomizes an overdetermined operand system down to a square one, so its isolated solutions can be found by homotopy continuation.

An overdetermined system F = (f_1, ..., f_N) of N functions in n variables (N > n) cannot be fed to a total-degree start system (which requires squareness). Randomization replaces F with n generic combinations whose isolated-solution set still contains that of F; the square result is solved and the extraneous solutions discarded.

This block holds the overdetermined system as a shared_ptr<SystemT> operand (mirroring BlendBlock<SystemT>) and a constant coefficient matrix, and emits the n randomized rows

g_i(x) = sum_j  c_ij * f_j(x) * prod_g  h_g^{(D_{i,g} - d_{j,g})}

where f_j is the operand's j-th natural function (homogenized to its own multidegree d_j), D_i is row i's target multidegree, h_g is the homogenizing variable of variable group g, and c_ij = 0 whenever any deficit D_{i,g} - d_{j,g} is negative. The h-power factors are what make a constant-coefficient combination of functions of differing degree homogenize correctly: before homogenization every h_g = 1 and the formula collapses to g_i = sum_j c_ij f_j.

Construction (degrees, sorting, the [I|C] / common-target-multidegree matrix) is done by System::Randomize, which hands this block the finished coefficient matrix and the per-row / per-function multidegrees. The block is multidegree-native so single-affine-group and multihomogeneous randomization share one evaluator.

Templated on the system type so SystemT stays a dependent name in the Block variant (a System contains a Block which contains a RandomizationBlock<System> holding a shared_ptr<System> – the template parameter breaks the recursive type), exactly as for BlendBlock<SystemT>.

Note
Like BlendBlock, the operand is held by shared_ptr and its mutable per-evaluation state (variable values) is shared across copies; per-thread tracking must Clone (the deep-clone of a block operand is a shared follow-up with BlendBlock).