3#include <cgv/math/vec.h>
14template <
typename X,
typename T>
32 static X epsilon = (X)1e-5;
33 static X inv_2_eps = (X)(0.5/epsilon);
34 unsigned n = p.
size();
37 for (
unsigned i=0; i<n; ++i) {
51template <
typename X,
typename T>
61template <
typename X,
typename T>
interface class for multivariate function with two template arguments:
cgv::math::vec< X > vec_type
vectors must have get_nr_independent_variables() components
cgv::math::vec< X > pnt_type
points must have get_nr_independent_variables() components
virtual vec_type evaluate_gradient(const pnt_type &p) const
interface for evaluation of the gradient of the multivariate function.
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 ~mfunc()
virtual destructor
specialization of a multivariate function to two independent variables, which only reimplements the m...
unsigned int get_nr_independent_variables() const
returns 2
specialization of a multivariate function to three independent variables, which only reimplements the...
unsigned int get_nr_independent_variables() const
returns 3
unsigned size() const
number of elements