Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
bertini::node::Variable Class Reference

Represents variable leaves in the function tree. More...

#include <variable.hpp>

Inheritance diagram for bertini::node::Variable:
[legend]
Collaboration diagram for bertini::node::Variable:
[legend]

Public Member Functions

int Degree (std::shared_ptr< Variable > const &v=nullptr) const override
 
int Degree (VariableGroup const &vars) const override
 
std::shared_ptr< Node > Differentiate (std::shared_ptr< Variable > const &v=nullptr) const override
 
void Homogenize (VariableGroup const &vars, std::shared_ptr< Variable > const &homvar) override
 
bool IsHomogeneous (std::shared_ptr< Variable > const &v=nullptr) const override
 
bool IsHomogeneous (VariableGroup const &vars) const override
 
std::vector< int > MultiDegree (VariableGroup const &vars) const override
 
void precision (unsigned int prec) const override
 
void Reset () const override
 
template<typename T>
void SetToNan ()
 Changes the value of the variable to be not-a-number.
 
template<typename T>
void SetToRand ()
 Changes the value of the variable to be a random complex number.
 
template<typename T>
void SetToRandUnit ()
 Changes the value of the variable to be a random complex number, of magnitude 1.
 
- Public Member Functions inherited from bertini::node::NamedSymbol
const std::string & name () const
 
void name (const std::string &new_name)
 
 NamedSymbol (const std::string &new_name)
 
void print (std::ostream &target) const override
 
- Public Member Functions inherited from bertini::node::Symbol
unsigned EliminateOnes () override
 A transform function, which eliminates nodes from the tree.
 
unsigned EliminateZeros () override
 A transform function, which eliminates nodes from the tree.
 
- Public Member Functions inherited from bertini::node::Node
template<typename T>
T Eval (std::shared_ptr< Variable > const &diff_variable=nullptr) const
 
template<typename T>
void EvalInPlace (T &eval_value, std::shared_ptr< Variable > const &diff_variable=nullptr) const
 
bool IsPolynomial (std::shared_ptr< Variable > const &v=nullptr) const
 
bool IsPolynomial (VariableGroup const &v) const
 
virtual unsigned ReduceDepth ()
 A mutating function which finds ways to reduce the depth of the tree.
 

Protected Member Functions

void FreshEval_d (dbl &evaluation_value, std::shared_ptr< Variable > const &diff_variable) const override
 
dbl FreshEval_d (std::shared_ptr< Variable > const &diff_variable) const override
 
void FreshEval_mp (mpfr_complex &evaluation_value, std::shared_ptr< Variable > const &diff_variable) const override
 
mpfr_complex FreshEval_mp (std::shared_ptr< Variable > const &diff_variable) const override
 
- Protected Member Functions inherited from bertini::node::Node
void ResetStoredValues () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from bertini::VisitableBase< RetT, CatchAll >
template<typename T>
static VisitReturnType AcceptBase (T &visited, VisitorBase &guest)
 Abstract method for how to accept a visitor.
 

Detailed Description

Represents variable leaves in the function tree.

This class represents variable leaves in the function tree. FreshEval returns the current value of the variable.

When differentiated, produces a differential referring to it.

Member Function Documentation

◆ Degree() [1/2]

int bertini::node::Variable::Degree ( std::shared_ptr< Variable > const & v = nullptr) const
overridevirtual

Compute the degree with respect to a single variable.

If this is the variable, then the degree is 1. Otherwise, 0.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Degree() [2/2]

int bertini::node::Variable::Degree ( VariableGroup const & vars) const
overridevirtual

Compute the overall degree with respect to a variable group.

Parameters
varsA group of variables.
Returns
The degree. Will be negative if the Node is non-polynomial.

Implements bertini::node::Node.

Here is the call graph for this function:

◆ Differentiate()

std::shared_ptr< Node > bertini::node::Variable::Differentiate ( std::shared_ptr< Variable > const & v = nullptr) const
overridevirtual

Differentiates a variable.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreshEval_d() [1/2]

void bertini::node::Variable::FreshEval_d ( dbl & evaluation_value,
std::shared_ptr< Variable > const &  ) const
overrideprotectedvirtual

Overridden code for specific node types, for how to evaluate themselves. Called from the wrapper EvalInPlace<>() call from Node, if so required (by resetting, etc).

If we had the ability to use template virtual functions, we would have. However, this is impossible with current C++ without using experimental libraries, so we have two copies – because there are two number types for Nodes, dbl and mpfr_complex.

Implements bertini::node::Node.

Here is the call graph for this function:

◆ FreshEval_d() [2/2]

dbl bertini::node::Variable::FreshEval_d ( std::shared_ptr< Variable > const & ) const
overrideprotectedvirtual

Overridden code for specific node types, for how to evaluate themselves. Called from the wrapper Eval<>() call from Node, if so required (by resetting, etc).

If we had the ability to use template virtual functions, we would have. However, this is impossible with current C++ without using experimental libraries, so we have two copies – because there are two number types for Nodes, dbl and mpfr_complex.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreshEval_mp() [1/2]

void bertini::node::Variable::FreshEval_mp ( mpfr_complex & evaluation_value,
std::shared_ptr< Variable > const &  ) const
overrideprotectedvirtual

Overridden code for specific node types, for how to evaluate themselves. Called from the wrapper Eval<>() call from Node, if so required (by resetting, etc).

If we had the ability to use template virtual functions, we would have. However, this is impossible with current C++ without using experimental libraries, so we have two copies – because there are two number types for Nodes, dbl and mpfr_complex.

Implements bertini::node::Node.

Here is the call graph for this function:

◆ FreshEval_mp() [2/2]

mpfr_complex bertini::node::Variable::FreshEval_mp ( std::shared_ptr< Variable > const & ) const
overrideprotectedvirtual

Overridden code for specific node types, for how to evaluate themselves. Called from the wrapper Eval<>() call from Node, if so required (by resetting, etc).

If we had the ability to use template virtual functions, we would have. However, this is impossible with current C++ without using experimental libraries, so we have two copies – because there are two number types for Nodes, dbl and mpfr_complex.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Homogenize()

void bertini::node::Variable::Homogenize ( VariableGroup const & vars,
std::shared_ptr< Variable > const & homvar )
overridevirtual

Homogenize a tree, inputting a variable group holding the non-homogeneous variables, and the new homogenizing variable. The homvar may be an element of the variable group, that's perfectly ok.

Parameters
homvarThe homogenizing variable, which is multiplied against terms with degree deficiency with repect to other terms.
varsA group of variables, with respect to which you wish to homogenize.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsHomogeneous() [1/2]

bool bertini::node::Variable::IsHomogeneous ( std::shared_ptr< Variable > const & v = nullptr) const
overridevirtual

Check for homogeneity, absolutely with respect to all variables, including path variables and all other variable types, or with respect to a single varaible, if passed.

Returns
True if it is homogeneous, false if not.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsHomogeneous() [2/2]

bool bertini::node::Variable::IsHomogeneous ( VariableGroup const & vars) const
overridevirtual

Check for homogeneity, with respect to a variable group.

Implements bertini::node::Node.

Here is the call graph for this function:

◆ MultiDegree()

std::vector< int > bertini::node::Variable::MultiDegree ( VariableGroup const & vars) const
overridevirtual

Compute the multidegree with respect to a variable group. This is for homogenization, and testing for homogeneity.

Returns
A vector containing the degrees. Negative entries indicate non-polynomiality.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ precision()

void bertini::node::Variable::precision ( unsigned int prec) const
overridevirtual

Change the precision of this variable-precision tree node.

Parameters
precthe number of digits to change precision to.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

void bertini::node::Variable::Reset ( ) const
overridevirtual

Tells code to run a fresh eval on node next time.

Implements bertini::node::Node.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetToNan()

template<typename T>
template void bertini::node::Variable::SetToNan< mpfr_complex > ( )

Changes the value of the variable to be not-a-number.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetToRand()

template<typename T>
template void bertini::node::Variable::SetToRand< mpfr_complex > ( )

Changes the value of the variable to be a random complex number.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetToRandUnit()

template<typename T>
template void bertini::node::Variable::SetToRandUnit< mpfr_complex > ( )

Changes the value of the variable to be a random complex number, of magnitude 1.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: