Pure virtual base class of all functions. More...

#include <Function.h>

Inheritance diagram for MEAL::Function:
Reference::Able Reference::HeapTracked MEAL::Evaluable< std::complex< double > > MEAL::Evaluable< Jones< double > > MEAL::Evaluable< Matrix< 4, 4, std::complex< double > > > MEAL::Evaluable< Matrix< 4, 4, double > > MEAL::Evaluable< double > MEAL::Evaluable< Vector< 2, std::complex< double > > > MEAL::Evaluable< Vector< 3, double > > MEAL::Evaluable< T > MEAL::Null

Classes

class  Interface
 Textual interface to Function attributes. More...

Public Types

enum  Attribute { ParameterCount , Evaluation }
 Function attributes that require the attention of Composite models. More...

Public Member Functions

 Function ()
 Default constructor.
 Function (const Function &model)
 Copy constructor.
Functionoperator= (const Function &model)
 Assignment operator.
virtual ~Function ()
 Virtual destructor.
virtual Functionclone () const
 Clone.
virtual void copy (const Function *model)
 Does the work for operator =.
virtual TextInterface::Parserget_interface ()
 Return a text interface that can be used to access this instance.
virtual void parse (const std::string &text)
 Parses the values of model parameters and fit flags from a string.
virtual void print (std::string &text) const
 Prints the values of model parameters and fit flags to a string.
virtual std::string get_name () const =0
 Return the name of the class.
virtual std::string get_description () const
 Return the description of the class.
unsigned get_nparam () const
 Return the number of parameters.
std::string get_param_name (unsigned index) const
 Return the name of the specified parameter.
std::string get_param_description (unsigned index) const
 Return the description of the specified parameter.
double get_param (unsigned index) const
 Return the value of the specified parameter.
void set_param (unsigned index, double value)
 Set the value of the specified parameter.
double get_variance (unsigned index) const
 Return the variance of the specified parameter.
void set_variance (unsigned index, double value)
 Set the variance of the specified parameter.
bool get_infit (unsigned index) const
 Return true if parameter at index is to be fitted.
void set_infit (unsigned index, bool flag)
 Set flag for parameter at index to be fitted.
void set_argument (unsigned dimension, Argument *axis)
 Set the independent variable of the specified dimension.
Estimate< double > get_Estimate (unsigned index) const
 Return an Estimate of the specified parameter.
void set_Estimate (unsigned index, const Estimate< double > &param)
 Set the Estimate of the specified parameter.
void set_verbose (bool)
 Set the verbosity of this instance.
bool get_verbose () const
 Get the verbosity of this instance.
void set_evaluation_changed (bool _changed=true)
 Set true if the Function evaluation has changed.
bool get_evaluation_changed () const
 Return true if the Function evaluation has changed.
const ParameterPolicyget_parameter_policy () const
 Provide access to the parameter_policy attribute.
ParameterPolicyget_parameter_policy ()
 Provide access to the parameter_policy attribute.
bool has_parameter_policy () const
 Some wrappers may not have a parameter policy.
virtual void print_parameters (std::string &text, const std::string &separator) const
 Prints the values of model parameters and fit flags to a string.
Public Member Functions inherited from Reference::Able
 Able (const Able &)
Ableoperator= (const Able &)
unsigned get_reference_count () const
Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
HeapTrackedoperator= (const HeapTracked &)
bool __is_on_heap () const

Static Public Member Functions

template<class Model>
static Model * load (const std::string &filename)
 Construct a new Model instance from a file.
static Functionload_Function (const std::string &filename)
 Construct a new Function instance from a file.
static Functionfactory (const std::string &text)
 Construct a new Function instance from a string.
Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
static void operator delete (void *location, void *ptr)
static void operator delete (void *location)
static size_t get_heap_queue_size ()

Public Attributes

Callback< Attributechanged
 Callback executed when a Function Attribute has been changed.

Static Public Attributes

static bool verbose = false
 Verbosity flag.
static bool very_verbose = false
 Low-level verbosity flag.
static bool check_zero = false
 When set, some Functions will throw an Error if they evaluate to zero.
static bool check_variance = false
 When set, some Functions will throw an Error if input variance <= 0.
static bool cache_results = false
 When set, use the Cached evaluation policy and callbacks.

Protected Member Functions

void copy_evaluation_changed (const Function &model)
 Copy the evaluation changed state of another model instance.
void copy_parameter_policy (const Function *)
 Copy the parameter policy of another instance.
void set_parameter_policy (ParameterPolicy *policy)
 Set the parameter policy.
Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
void __dereference (bool auto_delete=true) const

Protected Attributes

Reference::To< ParameterPolicyparameter_policy
 The policy for managing function parameters.
Reference::To< ArgumentPolicyargument_policy
 The policy for managing function arguments.
bool set_parameter_policy_context
 Set the parameter policy context.
bool this_verbose
 The verbosity of this instance.

Friends

class ParameterPolicy
class ArgumentPolicy

Detailed Description

Pure virtual base class of all functions.

A Function may consist of an arbitrary number of parameters. Using the Abscissa class, a Function may also be constrained by one or more independent variables. The specification of the Function base class promotes its use with the LevenbergMarquardt template class.

Member Enumeration Documentation

◆ Attribute

Function attributes that require the attention of Composite models.

Enumerator
ParameterCount 

Number of Function parameters, as returned by get_nparam.

Evaluation 

Function evaluation, as returned by the evaluate method.

Member Function Documentation

◆ clone()

◆ factory()

MEAL::Function * MEAL::Function::factory ( const std::string & text)
static

Construct a new Function instance from a string.

Construct a new model instance from a string.

Referenced by load_Function(), and MEAL::GroupRule< T >::parse().

◆ get_interface()

TextInterface::Parser * MEAL::Function::get_interface ( )
virtual

Return a text interface that can be used to access this instance.

Reimplemented in MEAL::Polynomial2D, and MEAL::Polynomial.

◆ get_name()

virtual std::string MEAL::Function::get_name ( ) const
pure virtual

Return the name of the class.

Implemented in MEAL::Boost1, MEAL::Boost, MEAL::BoostUnion, MEAL::ChainRule< MEAL::Scalar >, MEAL::Coherency, MEAL::Complex2Constant, MEAL::ComplexCartesian, MEAL::ComplexCorrelation, MEAL::ComplexRVM, MEAL::CongruenceTransformation, MEAL::CrossCoherency, MEAL::Depolarizer, MEAL::Gaussian, MEAL::JonesCloude, MEAL::JonesMueller, MEAL::JonesSpinor, MEAL::ModeCoherency, MEAL::MuellerTransformation, MEAL::Null, MEAL::OrthogonalModes, MEAL::OrthoRVM, MEAL::PhysicalCoherency, MEAL::Polar, MEAL::Polynomial2D, MEAL::Polynomial, MEAL::PositionAngles, MEAL::PowerLaw, MEAL::ProductRule< Complex >, MEAL::ProductRule< Complex2 >, MEAL::RotatingVectorModel, MEAL::Rotation1, MEAL::Rotation, MEAL::ScalarAbsolute, MEAL::ScalarArgument, MEAL::ScalarBesselI0, MEAL::ScalarConstant, MEAL::ScalarCosine, MEAL::ScalarErrorFunction, MEAL::ScalarExponential, MEAL::ScalarHypCosine, MEAL::ScalarHypSine, MEAL::ScalarHypTangent, MEAL::ScalarInverseHypTangent, MEAL::ScalarInverseTangent2, MEAL::ScalarInverseTangent, MEAL::ScalarLogarithm, MEAL::ScalarLogistic, MEAL::ScalarParameter, MEAL::ScalarPower, MEAL::ScalarRoot, MEAL::ScalarSine, MEAL::ScalarTangent, MEAL::ScaledVonMises, MEAL::ScaledVonMisesDeriv, MEAL::SingularCoherency, MEAL::SpinorJones, MEAL::Steps, MEAL::UnaryExample, MEAL::Union, MEAL::UnitTangent, MEAL::Value< MEAL::Scalar >, MEAL::Vectorize< T, Map >, MEAL::VectorRule< MEAL::Scalar >, and MEAL::VonMises.

Referenced by MEAL::Cached< T >::class_name(), MEAL::ForwardResult< T >::class_name(), MEAL::NotCached< T >::class_name(), MEAL::Evaluable< T >::evaluate(), MEAL::Composite::get_imap(), MEAL::GroupRule< Complex >::parse(), and print().

◆ parse()

void MEAL::Function::parse ( const std::string & text)
virtual

◆ print()

void MEAL::Function::print ( std::string & text) const
virtual

Prints the values of model parameters and fit flags to a string.

Reimplemented in MEAL::Boost1, and MEAL::Rotation1.

References get_name(), and print_parameters().

◆ print_parameters()

void MEAL::Function::print_parameters ( std::string & text,
const std::string & separator ) const
virtual

The documentation for this class was generated from the following files:
  • Function.h
  • Function.C
  • Function_factory.C
  • Function_load.C
  • Function_parse.C
  • Function_print.C

Generated using doxygen 1.14.0