MEAL::GroupRule< T > Class Template Referenceabstract

Abstract base class of closed, associative, binary operators. More...

#include <GroupRule.h>

Inheritance diagram for MEAL::GroupRule< T >:
MEAL::ProductRule< T > MEAL::SumRule< T >

Public Types

typedef T::Result Result

Public Member Functions

 GroupRule ()
 Default constructor.
 GroupRule (const GroupRule &meta)
 Copy constructor.
GroupRuleoperator= (const GroupRule &meta)
 Assignment operator.
 ~GroupRule ()
 Destructor.
void add_model (T *model)
 Add an element to the result.
void remove_model (T *model)
 Remove an element from the result.
T * get_model (unsigned i)
 Get the specified component.
const T * get_model (unsigned i) const
unsigned get_nmodel () const
 Get the number of components.
void clear ()
 Clear all models.
void parse (const std::string &text)
 Parse the values of model parameters and fit flags from a string.
std::string class_name () const

Protected Member Functions

void print_parameters (std::string &text, const std::string &sep) const
 Prints the values of model parameters and fit flags to a string.
void calculate (Result &result, std::vector< Result > *grad)
 Return the result and its gradient.
virtual const Result get_identity () const =0
 Return the group identity.
virtual void operate (Result &total, const Result &element)=0
 Set the total equal to "total group operation element".
virtual const Result partial (const Result &element) const =0
 Neighbouring terms stay in each other's partial derivatives.

Detailed Description

template<class T>
class MEAL::GroupRule< T >

Abstract base class of closed, associative, binary operators.

Because the binary operation is associative, this class is implemented as a series of elements; that is, an arbitrary number of models can be added. By inheriting this class and defining the get_identity(), operate(), and partial() pure virtual methods, derived classes may define the closed, associative binary operation, such as the product or sum.

Member Function Documentation

◆ get_identity()

template<class T>
virtual const Result MEAL::GroupRule< T >::get_identity ( ) const
protectedpure virtual

◆ operate()

template<class T>
virtual void MEAL::GroupRule< T >::operate ( Result & total,
const Result & element )
protectedpure virtual

Set the total equal to "total group operation element".

Implemented in MEAL::ProductRule< T >, MEAL::ProductRule< Complex >, MEAL::ProductRule< Complex2 >, and MEAL::SumRule< T >.

Referenced by calculate().

◆ partial()

template<class T>
virtual const Result MEAL::GroupRule< T >::partial ( const Result & element) const
protectedpure virtual

Neighbouring terms stay in each other's partial derivatives.

Implemented in MEAL::ProductRule< T >, MEAL::ProductRule< Complex >, MEAL::ProductRule< Complex2 >, and MEAL::SumRule< T >.

Referenced by calculate().


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

Generated using doxygen 1.14.0