cgv
Loading...
Searching...
No Matches
cgv::math::mfunc< X, T > Class Template Referenceabstract

interface class for multivariate function with two template arguments: More...

#include <mfunc.h>

Inheritance diagram for cgv::math::mfunc< X, T >:
cgv::math::v2_func< X, T > cgv::math::v3_func< X, T >

Public Types

typedef cgv::math::vec< X > pnt_type
 points must have get_nr_independent_variables() components
 
typedef cgv::math::vec< X > vec_type
 vectors must have get_nr_independent_variables() components
 

Public Member Functions

virtual ~mfunc ()
 virtual destructor
 
virtual unsigned get_nr_independent_variables () const =0
 return the number of independent variables that are mapped by the function
 
virtual T evaluate (const pnt_type &p) const =0
 interface for evaluation of the multivariate function
 
virtual vec_type evaluate_gradient (const pnt_type &p) const
 interface for evaluation of the gradient of the multivariate function.
 

Detailed Description

template<typename X, typename T>
class cgv::math::mfunc< X, T >

interface class for multivariate function with two template arguments:

  • X defines the type of the independent variables and
    • T the type of range to which the function maps For example a function that maps from n double variables to an int would be declared as mfunc<double,int>

Definition at line 15 of file mfunc.h.

Member Typedef Documentation

◆ pnt_type

template<typename X , typename T >
typedef cgv::math::vec<X> cgv::math::mfunc< X, T >::pnt_type

points must have get_nr_independent_variables() components

Definition at line 19 of file mfunc.h.

◆ vec_type

template<typename X , typename T >
typedef cgv::math::vec<X> cgv::math::mfunc< X, T >::vec_type

vectors must have get_nr_independent_variables() components

Definition at line 21 of file mfunc.h.

Constructor & Destructor Documentation

◆ ~mfunc()

template<typename X , typename T >
virtual cgv::math::mfunc< X, T >::~mfunc ( )
inlinevirtual

virtual destructor

Definition at line 23 of file mfunc.h.

Member Function Documentation

◆ evaluate_gradient()

template<typename X , typename T >
virtual vec_type cgv::math::mfunc< X, T >::evaluate_gradient ( const pnt_type p) const
inlinevirtual

interface for evaluation of the gradient of the multivariate function.

default implementation uses central differences to approximate the gradient, with an epsilon of 1e-5.

Definition at line 31 of file mfunc.h.

References cgv::math::mfunc< X, T >::evaluate(), and cgv::math::vec< T >::size().

Referenced by cgv::render::gl::gl_implicit_surface_drawable_base::new_vertex().

◆ get_nr_independent_variables()

template<typename X , typename T >
virtual unsigned cgv::math::mfunc< X, T >::get_nr_independent_variables ( ) const
pure virtual

return the number of independent variables that are mapped by the function

Implemented in cgv::math::v2_func< X, T >, and cgv::math::v3_func< X, T >.


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