Public Types | Public Member Functions

op_unary< UnaryOperation, InterfaceType > Class Template Reference

Main class for all unary operations. More...

#include <unary_operators.hpp>

Inheritance diagram for op_unary< UnaryOperation, InterfaceType >:
op_interface< InterfaceType >

Public Types

typedef InterfaceType::numeric_type numeric_type

Public Member Functions

 op_unary ()
 op_unary (UnaryOperation const &uo)
UnaryOperation const & op () const
 Returns the expression tag.
std::string str () const
 Returns a string representation of the operator.
op_interface< InterfaceType > * clone () const
 Returns a copy of the operator. The caller must ensure the proper deletion of the returned pointer.
numeric_type apply (numeric_type value) const
 Applies the unary operation to the value.
bool is_unary () const
 Returns whether this operation is a unary operation (which is the case...).
InterfaceType * diff (const InterfaceType *e, const InterfaceType *diff_var) const
 Differentiates the unary operation acting on 'e' with respect to the variable passed.
InterfaceType * simplify (const InterfaceType *lhs, const InterfaceType *rhs) const
 Returns a simplified form of the unary expression (collect constants, remove trivial operations, etc.). The caller is responsible for deleting the pointer returned.
bool can_simplify () const
 Returns true if (and only if) the underlying unary expression can be simplified (collect constants, remove trivial operations, etc.).
bool equal (const op_interface< InterfaceType > *other) const
 Returns true if the passed 'other' operation equals this operation.

Detailed Description

template<typename UnaryOperation, typename InterfaceType>
class viennamath::op_unary< UnaryOperation, InterfaceType >

Main class for all unary operations.

Template Parameters:
UnaryOperation Type of the unary operation to be wrapped at runtime.
InterfaceType The expression runtime interface used for expression manipulation.

Member Typedef Documentation

typedef InterfaceType::numeric_type numeric_type

Reimplemented from op_interface< InterfaceType >.


Constructor & Destructor Documentation

op_unary (  )  [inline]
op_unary ( UnaryOperation const &  uo  )  [inline]

Member Function Documentation

numeric_type apply ( numeric_type  value  )  const [inline, virtual]

Applies the unary operation to the value.

Reimplemented from op_interface< InterfaceType >.

bool can_simplify (  )  const [inline, virtual]

Returns true if (and only if) the underlying unary expression can be simplified (collect constants, remove trivial operations, etc.).

Implements op_interface< InterfaceType >.

op_interface<InterfaceType>* clone (  )  const [inline, virtual]

Returns a copy of the operator. The caller must ensure the proper deletion of the returned pointer.

Implements op_interface< InterfaceType >.

InterfaceType* diff ( const InterfaceType *  e,
const InterfaceType *  diff_var 
) const [inline, virtual]

Differentiates the unary operation acting on 'e' with respect to the variable passed.

Reimplemented from op_interface< InterfaceType >.

bool equal ( const op_interface< InterfaceType > *  other  )  const [inline]

Returns true if the passed 'other' operation equals this operation.

bool is_unary (  )  const [inline, virtual]

Returns whether this operation is a unary operation (which is the case...).

Reimplemented from op_interface< InterfaceType >.

UnaryOperation const& op (  )  const [inline]

Returns the expression tag.

InterfaceType * simplify ( const InterfaceType *  lhs,
const InterfaceType *  rhs 
) const [virtual]

Returns a simplified form of the unary expression (collect constants, remove trivial operations, etc.). The caller is responsible for deleting the pointer returned.

Implements op_interface< InterfaceType >.

std::string str (  )  const [inline, virtual]

Returns a string representation of the operator.

Implements op_interface< InterfaceType >.


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