Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

BTK::CachedUnaryFunction< T, ArgType > Struct Template Reference

#include <cached_function.h>

Collaboration diagram for BTK::CachedUnaryFunction< T, ArgType >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

template<typename UnaryFunction>  CachedUnaryFunction (UnaryFunction &func, ArgType min_arg, ArgType max_arg, ArgType sample_spacing)
 ~CachedUnaryFunction ()
operator() (ArgType arg)

Detailed Description

template<typename T, typename ArgType>
struct BTK::CachedUnaryFunction< T, ArgType >

a lookup-table based function approximator

when constucted from a function object (func), this class samples the function within a specified range and stores the results in a lookup table. When called it approximates the function value by returning the linear interpolate of the two nearest sample points.


Constructor & Destructor Documentation

template<typename T, typename ArgType>
template<typename UnaryFunction>
BTK::CachedUnaryFunction< T, ArgType >::CachedUnaryFunction UnaryFunction &  func,
ArgType  min_arg,
ArgType  max_arg,
ArgType  sample_spacing
 

CachedUnaryFunction constructor

Parameters:
func the function to be approximated
min_arg the lowest argument value needed
max_arg the highest argument value needed
sample_spacing the size between argument sample points

template<typename T, typename ArgType>
BTK::CachedUnaryFunction< T, ArgType >::~CachedUnaryFunction  )  [inline]
 


Member Function Documentation

template<typename T, typename ArgType>
T BTK::CachedUnaryFunction< T, ArgType >::operator() ArgType  arg  ) 
 

return a linear-interpolate approximation of func


The documentation for this struct was generated from the following file:
Generated on Wed Apr 14 00:43:21 2004 for BTK by doxygen 1.3.6