Public Types | Public Member Functions

op_binary< BinaryOperation, InterfaceType > Class Template Reference

This is the common wrapper class for binary operations. More...

#include <binary_operators.hpp>

Inheritance diagram for op_binary< BinaryOperation, InterfaceType >:
op_interface< InterfaceType >

Public Types

typedef InterfaceType::numeric_type numeric_type

Public Member Functions

std::string str () const
 Returns a textual representation of the binary operation.
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 lhs, numeric_type rhs) const
 Applies the binary operation to the two values.
bool is_unary () const
 Returns whether this operation is a unary operation (which is not the case...).
InterfaceType * diff (const InterfaceType *lhs, const InterfaceType *rhs, const InterfaceType *diff_var) const
 Differentiates the unary operation acting on 'lhs' and 'rhs' 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 can_simplify (const InterfaceType *lhs, const InterfaceType *rhs) const
 Returns true if the binary expression can be simplified.
bool equal (const op_interface< InterfaceType > *other) const
 Returns true if the passed 'other' operation equals this operation.

Detailed Description

template<typename BinaryOperation, typename InterfaceType>
class viennamath::op_binary< BinaryOperation, InterfaceType >

This is the common wrapper class for binary operations.

Template Parameters:
BinaryOperation A tag encoding the binary operation.
InterfaceType The expression runtime interface used for expression manipulation.

Member Typedef Documentation

typedef InterfaceType::numeric_type numeric_type

Reimplemented from op_interface< InterfaceType >.


Member Function Documentation

numeric_type apply ( numeric_type  lhs,
numeric_type  rhs 
) const [inline]

Applies the binary operation to the two values.

bool can_simplify ( const InterfaceType *  lhs,
const InterfaceType *  rhs 
) const [inline, virtual]

Returns true if the binary expression can be simplified.

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 *  lhs,
const InterfaceType *  rhs,
const InterfaceType *  diff_var 
) const [inline, virtual]

Differentiates the unary operation acting on 'lhs' and 'rhs' 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 not the case...).

Reimplemented from op_interface< InterfaceType >.

InterfaceType* simplify ( const InterfaceType *  lhs,
const InterfaceType *  rhs 
) const [inline, 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 textual representation of the binary operation.

Implements op_interface< InterfaceType >.


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