39 x = (
isnan(x)).select(0,x);
55 for (
const auto& a:
arity)
57 for (
unsigned int i = 0;
i< a.second; ++
i)
59 c_args += cstate[a.first].back();
60 cstate[a.first].pop_back();
82 cstate[
otype].push_back(c_args);
84 for (
const auto& a:
arity)
86 for (
unsigned int i = 0;
i< a.second; ++
i)
88 c_args =
"(" + c_args +
"+"
89 + cstate[a.first].back() +
")";
90 cstate[a.first].pop_back();
101 {
return std::unique_ptr<Node>(
clone_impl()); }
unsigned int total_arity()
void eval_complexity(map< char, vector< unsigned int >> &cstate)
evaluates complexity of this node in the context of its child nodes.
std::unique_ptr< Node > rnd_clone() const
makes a randomized unique copy ofnode
virtual Node * clone_impl() const =0
std::map< char, unsigned int > arity
arity of the operator
ArrayXf limited(ArrayXf x)
limits node output to be between MIN_FLT and MAX_FLT
virtual Node * rnd_clone_impl() const =0
std::unique_ptr< Node > clone() const
makes a unique copy of this node
void eval_complexity_db(map< char, vector< string >> &cstate)
evaluates complexity of this node in the context of its child nodes.
int complexity
complexity of node
ArrayXb isnan(const ArrayXf &x)
returns true for elements of x that are NaN
std::string to_string(const T &value)
template function to convert objects to string for logging