Vita
Public Member Functions | List of all members
vita::real::add Class Reference

Sum of two real numbers. More...

#include <real.h>

Inherits vita::function.

Public Member Functions

 add (const cvect &c={0})
 
bool associative () const final
 Is the symbol subject to the associative law of arithmetic? More...
 
std::string display (format) const final
 
value_t eval (symbol_params &args) const final
 Calculates the value of / performs the action associated with the symbol (it's implementation specific). More...
 
- Public Member Functions inherited from vita::function
category_t arg_category (std::size_t) const
 
unsigned arity () const final
 
virtual bool associative () const
 Is the symbol subject to the associative law of arithmetic? More...
 
virtual std::string display (format=c_format) const
 
 function (const std::string &, category_t, cvect)
 
 function (const std::string &, std::size_t)
 
bool is_valid () const override
 
- Public Member Functions inherited from vita::symbol
virtual unsigned arity () const =0
 
category_t category () const
 The type (a.k.a. More...
 
void category (category_t)
 Changes the category of a symbol. More...
 
virtual value_t eval (symbol_params &) const =0
 Calculates the value of / performs the action associated with the symbol (it's implementation specific). More...
 
virtual bool input () const
 An input variable is a feature from the learning domain. More...
 
virtual bool is_valid () const
 
std::string name () const
 
opcode_t opcode () const
 An opcode is a unique, numerical session ID for a symbol. More...
 
double penalty (core_interpreter *) const
 Used for automatic calculation of penalities due to broken constraints. More...
 
 symbol (const std::string &, category_t=0)
 
bool terminal () const
 

Additional Inherited Members

- Public Types inherited from vita::symbol
enum  format {
  c_format , cpp_format , mql_format , python_format ,
  sup_format
}
 Symbol rendering format. More...
 
- Static Public Member Functions inherited from vita::function
static const functioncast (const symbol *)
 This is a short cut function. More...
 

Detailed Description

Sum of two real numbers.

Definition at line 153 of file real.h.

Constructor & Destructor Documentation

◆ add()

vita::real::add::add ( const cvect &  c = {0})
inlineexplicit

Definition at line 156 of file real.h.

Member Function Documentation

◆ associative()

bool vita::real::add::associative ( ) const
inlinefinalvirtual

Is the symbol subject to the associative law of arithmetic?

Returns
true if the function is associative

OP is associative iff:

a OP (b OP c) = (a OP b) OP c = a OP b OP c

This information can be used for optimization and visualization.

Note
  • Terminals haven't arguments and cannot be associative.
  • Default (safe) value is false.

Reimplemented from vita::function.

Definition at line 158 of file real.h.

◆ display()

std::string vita::real::add::display ( format  ) const
inlinefinalvirtual
Returns
the name of the function
Warning
Specific functions have to specialize this method to support different output formats.

Reimplemented from vita::function.

Definition at line 160 of file real.h.

◆ eval()

value_t vita::real::add::eval ( symbol_params ) const
inlinefinalvirtual

Calculates the value of / performs the action associated with the symbol (it's implementation specific).

Implements vita::symbol.

Definition at line 165 of file real.h.


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