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.


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

Generated using doxygen 1.8.17