HyperspaceExplorer 0.7.1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
FunctionValueGrid< N, P, NUM > Class Template Reference

Values of a ParametricFunction stored on a grid representation of its parameter space. More...

#include <FunctionValueGrid.h>

Inheritance diagram for FunctionValueGrid< N, P, NUM >:
Inheritance graph
[legend]
Collaboration diagram for FunctionValueGrid< N, P, NUM >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef VertexGrid< N, P, NUM >
::grid_size_type 
grid_size_type
 Type for storing the size of the grid in all required dimensions.
typedef VertexGrid< N, P, NUM >
::value_storage_type 
value_storage_type
 Type for the storage of the function values on all grid points.
typedef ParametricFunction< N,
P, NUM > 
function_type
 The type of the function whose values are stored in this class.
typedef std::shared_ptr
< function_type
function_ptr_type
 The type of pointers to function_type, used for late binding.
typedef VecMath::Vector< P, NUM > boundary_type
 The type of the lower and upper bounds of the definition space.

Public Member Functions

 FunctionValueGrid ()
 Create an empty grid.
 FunctionValueGrid (const function_ptr_type &f)
 Prepare a grid with a defined ParametricFunction.
 FunctionValueGrid (const function_ptr_type &f, const grid_size_type &grid_size)
 Fill a grid with a defined grid size. The supplied ParametricFunction knows its definition space.
 FunctionValueGrid (const function_ptr_type &f, const grid_size_type &grid_size, const boundary_type &x_min, const boundary_type &x_max)
 Fill a grid with a defined grid size and boundaries.
void setGridSize (const grid_size_type &grid_size)
 Change the size of the grid. If possible, function values are recalculated.
void setBoundaries (const boundary_type &x_min, const boundary_type &x_max)
 Change the size of the definition space. If possible, function values are recalculated.

Private Member Functions

void recalculate_grid ()
 Loop over the entire definition space and fill the grid with the function values at those points.

Private Attributes

function_ptr_type _f
 The ParametricFunction that evaluates the points on the grid.
boundary_type _x_min
 Lower boundary of the grid in all dimensions.
boundary_type _x_max
 Upper boundary of the grid in all dimensions.

Static Private Attributes

static constexpr double EPSILON = 1e-8

Detailed Description

template<unsigned N, unsigned P, typename NUM = double>
class FunctionValueGrid< N, P, NUM >

Values of a ParametricFunction stored on a grid representation of its parameter space.

This class evaluates the parametric equation represented by a ParametricFunction on points throughout its definition space and stores the values of the function at those points in a P dimensional grid.

Template Parameters:
NThe dimension of the definition vector space.
PThe dimension of the parameter vector space.
NUMThe numeric type managed by the grid.
Author:
Lene Preuss <lene.preuss@gmail.com>

Constructor & Destructor Documentation

template<unsigned N, unsigned P, typename NUM >
FunctionValueGrid< N, P, NUM >::FunctionValueGrid ( const function_ptr_type f)

Prepare a grid with a defined ParametricFunction.

Parameters:
fThe function whose values are stored on its definition space.

References FunctionValueGrid< N, P, NUM >::setBoundaries().

Here is the call graph for this function:

template<unsigned N, unsigned P, typename NUM >
FunctionValueGrid< N, P, NUM >::FunctionValueGrid ( const function_ptr_type f,
const grid_size_type grid_size 
)

Fill a grid with a defined grid size. The supplied ParametricFunction knows its definition space.

Parameters:
fThe function whose values are stored on its definition space.
grid_sizeThe size of the grid in each of its dimensions.

References FunctionValueGrid< N, P, NUM >::setBoundaries(), and FunctionValueGrid< N, P, NUM >::setGridSize().

Here is the call graph for this function:

template<unsigned N, unsigned P, typename NUM >
FunctionValueGrid< N, P, NUM >::FunctionValueGrid ( const function_ptr_type f,
const grid_size_type grid_size,
const boundary_type x_min,
const boundary_type x_max 
)

Fill a grid with a defined grid size and boundaries.

Parameters:
fThe function whose values are stored on its definition space.
grid_sizeThe size of the grid in each of its dimensions.
x_minLower boundary of the definition space.
x_maxUpper boundary of the definition space.

References FunctionValueGrid< N, P, NUM >::setBoundaries(), and FunctionValueGrid< N, P, NUM >::setGridSize().

Here is the call graph for this function:


Member Function Documentation

template<unsigned N, unsigned P, typename NUM >
void FunctionValueGrid< N, P, NUM >::recalculate_grid ( ) [private]

Loop over the entire definition space and fill the grid with the function values at those points.

Initialize a LoopHelper and set it off.

References LoopHelper< N, P, dimension, NUM >::recalculateOneDimensionOfGrid().

Here is the call graph for this function:

template<unsigned N, unsigned P, typename NUM >
void FunctionValueGrid< N, P, NUM >::setBoundaries ( const boundary_type x_min,
const boundary_type x_max 
)

Change the size of the definition space. If possible, function values are recalculated.

Parameters:
x_minLower boundary of the definition space.
x_maxUpper boundary of the definition space.

References abs(), and VecMath::sqnorm().

Referenced by FunctionValueGrid< N, P, NUM >::FunctionValueGrid().

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned N, unsigned P, typename NUM >
void FunctionValueGrid< N, P, NUM >::setGridSize ( const grid_size_type grid_size)

Change the size of the grid. If possible, function values are recalculated.

Parameters:
grid_sizeThe new grid size.

Reimplemented from VertexGrid< N, P, NUM >.

References abs(), and VecMath::sqnorm().

Referenced by FunctionValueGrid< N, P, NUM >::FunctionValueGrid().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

template<unsigned N, unsigned P, typename NUM = double>
constexpr double FunctionValueGrid< N, P, NUM >::EPSILON = 1e-8 [static, private]
Todo:
this should be somewhere global.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo