31#ifndef BERTINI_OPERATOR_HPP
32#define BERTINI_OPERATOR_HPP
58 template <
typename Archive>
59 void serialize(Archive& ar,
const unsigned ) {
60 ar & boost::serialization::base_object<Node>(*
this);
110 int Degree(std::shared_ptr<Variable>
const& v =
nullptr)
const override;
121 bool IsHomogeneous(std::shared_ptr<Variable>
const& v =
nullptr)
const override;
141 template <
typename Archive>
142 void serialize(Archive& ar,
const unsigned ) {
143 ar & boost::serialization::base_object<Operator>(*
this);
201 virtual void PrecisionChangeSpecific(
unsigned prec)
const;
206 template <
typename Archive>
207 void serialize(Archive& ar,
const unsigned ) {
208 ar & boost::serialization::base_object<Operator>(*
this);
std::shared_ptr< Node > FirstOperand() const
std::vector< std::shared_ptr< Node > > operands_
Change the precision of this variable-precision tree node.
Definition operator.hpp:194
size_t NumOperands() const
auto const & Operands() const
Definition operator.hpp:174
virtual void AddOperand(std::shared_ptr< Node > n)
Add an operand (child) onto this operator.
virtual ~NaryOperator()=default
friend class boost::serialization::access
Definition operator.hpp:204
NaryOperator()
Definition operator.hpp:197
An interface for all nodes in a function tree, and for a function object as well.
Definition node.hpp:114
Abstract Node type from which all Operators inherit.
Definition operator.hpp:48
virtual ~Operator()=default
friend class boost::serialization::access
Definition operator.hpp:56
std::shared_ptr< Node > operand_
The single child (operand) of the unary operator.
Definition operator.hpp:136
bool IsHomogeneous(VariableGroup const &vars) const override
Check for homogeneity, with respect to a variable group.
virtual ~UnaryOperator()=default
int Degree(VariableGroup const &vars) const override
Degree with respect to a variable group, by the same rule as the one-variable form.
std::shared_ptr< Node > Operand() const
bool IsHomogeneous(std::shared_ptr< Variable > const &v=nullptr) const override
Check for homogeneity, absolutely with respect to all variables, including path variables and all oth...
void SetOperand(std::shared_ptr< Node > n)
Set the single child (operand) of this unary operator.
UnaryOperator(const std::shared_ptr< Node > &n)
Construct a unary operator over a single operand node.
Definition operator.hpp:78
std::size_t HashImpl() const override
Compute this node's structural hash.
friend class boost::serialization::access
Definition operator.hpp:139
int Degree(std::shared_ptr< Variable > const &v=nullptr) const override
Degree with respect to one variable (all variables when v is null).
std::vector< int > MultiDegreeImpl(VariableGroup const &vars) const override
Compute the multidegree with respect to a variable group.
bool IsSame(Node const &other) const override
Order-sensitive structural equality, shallow given interned children.
UnaryOperator()
Definition operator.hpp:137
Definition canonical.hpp:56
Definition algorithm_builder.hpp:36
std::vector< std::shared_ptr< node::Variable > > VariableGroup
An ordered group of variables (the unit of homogenization / variable grouping).
Definition node.hpp:69
Defines the abstract Node base class.