Public Types | Public Member Functions

rt_function_symbol< InterfaceType > Class Template Reference

A function symbol. Can be used for unknown functions, test functions, etc. Cannot be evaluated, but substituted with an evaluable object. More...

#include <function_symbol.hpp>

Public Types

typedef InterfaceType::numeric_type numeric_type
typedef InterfaceType interface_type

Public Member Functions

template<typename Tag >
 rt_function_symbol (id_type i, Tag const &t)
 CTOR assigning the ID 'i' for the class of function symbols identified by the tag 't'.
 rt_function_symbol (id_type i, id_type t=0)
 CTOR assigning the ID 'i' for the class of function symbols identified by the ID 't'.
 rt_function_symbol ()
id_type id () const
id_type tag_id () const
InterfaceType * clone () const
 Returns a copy of the function symbol. The caller needs to ensure that the object the pointer is referring to is deleted.
numeric_type eval (std::vector< double > const &v) const
 Interface requirement: Evaluates the expression. This is illegal for a function symbol.
numeric_type eval (numeric_type v) const
 Interface requirement: Evaluates the expression. This is illegal for a function symbol.
std::string deep_str () const
 Returns a detailed string with all informations about the function symbol.
numeric_type unwrap () const
 Interface requirement: Evaluate to a constant. This is illegal for a function symbol.
InterfaceType * substitute (const InterfaceType *e, const InterfaceType *repl) const
 If this expression is equal to 'e', the replacement 'repl' is returned. Otherwise, a copy of this object is returned. Note that the caller is responsible for deleting the object the returned pointer is referring to.
InterfaceType * substitute (std::vector< const InterfaceType * > const &e, std::vector< const InterfaceType * > const &repl) const
 If this expression is equal to one of the elements of 'e', the corresponding replacement 'repl' is returned. Otherwise, a copy of this object is returned. Note that the caller is responsible for deleting the object the returned pointer is referring to.
bool deep_equal (const InterfaceType *other) const
 Returns true if the other function is semantically equal (same ID, same tag).
bool shallow_equal (const InterfaceType *other) const
 Returns true if the type of 'other' is also a function symbol (with possibly different ID).
InterfaceType * diff (const InterfaceType *diff_var) const
 Interface requirement. The differentiation of a function symbol is not allowed, thus an exception is thrown.

Detailed Description

template<typename InterfaceType>
class viennamath::rt_function_symbol< InterfaceType >

A function symbol. Can be used for unknown functions, test functions, etc. Cannot be evaluated, but substituted with an evaluable object.

Template Parameters:
InterfaceType The expression runtime interface to inherit from. Usually rt_expression_interface, but extensions are possible.

Member Typedef Documentation

typedef InterfaceType interface_type
typedef InterfaceType::numeric_type numeric_type

Constructor & Destructor Documentation

rt_function_symbol ( id_type  i,
Tag const &  t 
) [inline]

CTOR assigning the ID 'i' for the class of function symbols identified by the tag 't'.

Parameters:
i A numerical ID
t A tag class used for the compiletime ct_function_symbol
rt_function_symbol ( id_type  i,
id_type  t = 0 
) [inline]

CTOR assigning the ID 'i' for the class of function symbols identified by the ID 't'.

Parameters:
i A numerical ID
t An ID for the family of function symbols
rt_function_symbol (  )  [inline]

Member Function Documentation

InterfaceType* clone (  )  const [inline]

Returns a copy of the function symbol. The caller needs to ensure that the object the pointer is referring to is deleted.

bool deep_equal ( const InterfaceType *  other  )  const [inline]

Returns true if the other function is semantically equal (same ID, same tag).

std::string deep_str (  )  const [inline]

Returns a detailed string with all informations about the function symbol.

InterfaceType* diff ( const InterfaceType *  diff_var  )  const [inline]

Interface requirement. The differentiation of a function symbol is not allowed, thus an exception is thrown.

numeric_type eval ( std::vector< double > const &  v  )  const [inline]

Interface requirement: Evaluates the expression. This is illegal for a function symbol.

numeric_type eval ( numeric_type  v  )  const [inline]

Interface requirement: Evaluates the expression. This is illegal for a function symbol.

id_type id (  )  const [inline]
bool shallow_equal ( const InterfaceType *  other  )  const [inline]

Returns true if the type of 'other' is also a function symbol (with possibly different ID).

InterfaceType* substitute ( std::vector< const InterfaceType * > const &  e,
std::vector< const InterfaceType * > const &  repl 
) const [inline]

If this expression is equal to one of the elements of 'e', the corresponding replacement 'repl' is returned. Otherwise, a copy of this object is returned. Note that the caller is responsible for deleting the object the returned pointer is referring to.

InterfaceType* substitute ( const InterfaceType *  e,
const InterfaceType *  repl 
) const [inline]

If this expression is equal to 'e', the replacement 'repl' is returned. Otherwise, a copy of this object is returned. Note that the caller is responsible for deleting the object the returned pointer is referring to.

id_type tag_id (  )  const [inline]
numeric_type unwrap (  )  const [inline]

Interface requirement: Evaluate to a constant. This is illegal for a function symbol.


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