ALTA  alpha
Public Member Functions | Protected Attributes | List of all members
alta::function Class Referenceabstract

Detailed Description

function are functors with a domain of definition specified by a vector interval \([\vec{min} .. \vec{max}]\) where \(\vec{min}\) and \(\vec{max}\) have the size of the input domain.

Any function used by the fitting algorithm should overload publicly this interface.

#include <function.h>

Collaboration diagram for alta::function:
Collaboration graph
[legend]

Public Member Functions

 function (const parameters &params)
 
virtual ~function ()
 Destructor function needed when using shared_ptr.
 
virtual vec operator() (const vec &x) const
 
virtual vec value (const vec &x) const =0
 
virtual void bootstrap (const ptr< data >, const arguments &args)
 Provide a first rough fit of the function. More...
 
virtual bool load (std::istream &in)=0
 Load function specific files.
 
virtual void save (const std::string &filename, const arguments &args) const
 Save the current function to a specific file type, args can be used to differenciate the type of export. More...
 
virtual void save_header (std::ostream &out, const arguments &args) const
 save the header of the output function file. The header should store general information about the fit such as the command line used the dimension of the fit. L2 and L_inf distance could be added here.
 
virtual void save_body (std::ostream &out, const arguments &args) const
 save function specific data. This has no use for ALTA exportbut allows to factorize the code in the C++ or matlab export by defining function calls that are common to all the plugins. More...
 
virtual void save_call (std::ostream &out, const arguments &args) const
 save object specific information. For an ALTA export the coefficients will be exported. For a C++ or matlab export, the call to the associated function will be done.
 
double L2_distance (const ptr< data > &d) const
 L2 norm to data. More...
 
double Linf_distance (const ptr< data > &d) const
 Linf norm to data. More...
 
virtual void setMin (const vec &min)
 
virtual void setMax (const vec &max)
 
virtual vec min () const
 
virtual vec max () const
 
const parametersparametrization () const
 
void setParametrization (const parameters &p)
 

Protected Attributes

parameters _parameters
 
vec _min
 
vec _max
 

Member Function Documentation

void function::bootstrap ( const ptr< data ,
const arguments args 
)
virtual

Can be used to set the diffuse component of the function for example. The default behavior is to load a function file.

Reimplemented in alta::product_function, alta::compound_function, and alta::nonlinear_function.

double function::L2_distance ( const ptr< data > &  d) const
Note
This distance is only valid with respect to the data sampling. If the measurement points are not uniformly distributed, then the metric does not represent the real difference integrated over the hemisphere.
double function::Linf_distance ( const ptr< data > &  d) const
Note
This distance is only valid with respect to the data sampling. If the measurement points are not uniformly distributed, then the metric does not represent the real difference integrated over the hemisphere.
void function::save ( const std::string &  filename,
const arguments args 
) const
virtual
See also
rational_function.cpp for an example

Reimplemented in shifted_gamma_function.

void function::save_body ( std::ostream &  out,
const arguments args 
) const
virtual

save function specific data. This has no use for ALTA export but allows to factorize the code in the C++ or matlab export by defining function calls that are common to all the plugins.

Reimplemented in alta::product_function, alta::compound_function, blinn_function, isotropic_lafortune_function, retroblinn_function, spherical_gaussian_function, abc_function, ward_function, lafortune_function, yoo_function, beckmann_function, beckmann_function, WalterSmith, shifted_gamma_function, schlick_fresnel, schlick_masking, schlick, retro_schlick, and smith.


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