fast_sqr< T > Struct Template Reference

Fast square for small values. More...

#include <tools.hh>

Inheritance diagram for fast_sqr< T >:

Inheritance graph
[legend]
Collaboration diagram for fast_sqr< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 fast_sqr (void)
 Constructor.
int operator() (const T &x) const
 The function.

Public Attributes

boost::array< int, 512 > table
 Lookup-table.

Detailed Description

template<typename T>
struct fast_sqr< T >

Fast square for small values.

Implemented with lookup-tables.

Author:
Jan Wedekind (j.wedekind@shu.ac.uk)


Constructor & Destructor Documentation

template<typename T>
fast_sqr< T >::fast_sqr void   )  [inline]
 

Constructor.

Initialises the lookup-table.


Member Function Documentation

template<typename T>
int fast_sqr< T >::operator() const T &  x  )  const [inline]
 

The function.

x must be between -511 and 511.

Parameters:
x value to compute square of.
Returns:
x*x


The documentation for this struct was generated from the following file:
doxygen-1.4.5 documentation for micron-vision - Tue Jan 17 15:29:15 2006