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

The Rational number type for Bertini2 expression trees. More...

#include <number.hpp>

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

Public Member Functions

void print (std::ostream &target) const override
 
- Public Member Functions inherited from bertini::node::Number
int Degree (std::shared_ptr< Variable > const &v=nullptr) const override
 Get the degree of this node.
 
int Degree (VariableGroup const &vars) const override
 Get the degree of this node.
 
std::shared_ptr< Node > Differentiate (std::shared_ptr< Variable > const &v=nullptr) const override
 Differentiate a number.
 
void Homogenize (VariableGroup const &vars, std::shared_ptr< Variable > const &homvar) override
 Homogenize this node.
 
bool IsHomogeneous (std::shared_ptr< Variable > const &v=nullptr) const override
 Is this node homogeneous?
 
bool IsHomogeneous (VariableGroup const &vars) const override
 
std::vector< int > MultiDegree (VariableGroup const &vars) const override
 Get the multidegree of this node.
 
void precision (unsigned int prec) const override
 
void Reset () 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.
 

Static Public Member Functions

template<unsigned long Digits = 50>
static Rational Rand ()
 Get a random complex rational node. Numerator and denominator will have about 50 digits.
 
template<int Digits = 50>
static Rational RandReal ()
 Get a random real rational node. Numerator and denominator will have about 50 digits.
 

Additional Inherited Members

- Protected Member Functions inherited from bertini::node::Node
void ResetStoredValues () const
 
- 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

The Rational number type for Bertini2 expression trees.

The Rational number type for Bertini2 expression trees. The ‘true value’ is stored using two mpq_rational numbers from the Boost.Multiprecision library, and the ratio is converted into a double or a mpfr_complex at evaluate time.

Member Function Documentation

◆ print()

void bertini::node::Rational::print ( std::ostream & target) const
overridevirtual

Virtual method for printing Nodes to arbitrary output streams.

Implements bertini::node::Node.

◆ Rand()

template<unsigned long Digits = 50>
static Rational bertini::node::Rational::Rand ( )
inlinestatic

Get a random complex rational node. Numerator and denominator will have about 50 digits.

See also
RandomRat()

◆ RandReal()

template<int Digits = 50>
static Rational bertini::node::Rational::RandReal ( )
inlinestatic

Get a random real rational node. Numerator and denominator will have about 50 digits.

See also
RandomRat()

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