gpufilter
GPU-Efficient Recursive Filtering and Summed-Area Tables
gpufilter::Vector< T, N > Class Template Reference

Vector class. More...

#include <util.h>

List of all members.

Public Member Functions

std::vector< T > to_vector () const
 Convert a vector of this class to an stl vector.
__host__ __device__ const T & operator[] (int i) const
 Access (constant) operator.
__host__ __device__ T & operator[] (int i)
 Access operator.
__host__ __device__ int size () const
 Get size (number of elements) of this vector.
__host__ __device__ Vectoroperator+= (const Vector &v)
 Add-then-assign operator.
__host__ __device__ Vector operator+ (const Vector &v) const
 Add operator.
__host__ __device__ Vectoroperator*= (const T &v)
 Multiply-then-assign operator.
__host__ __device__ Vector operator* (const T &v) const
 Multiply operator.
__host__ __device__ Vectoroperator/= (const T &v)
 Divide-then-assign operator.
__host__ __device__ Vector operator/ (const T &v) const
 Divide operator.
__host__ __device__ operator const T * () const
 Pointer-access operator (constant)
__host__ __device__ operator T * ()
 Pointer-access operator.

Private Attributes

m_data [N]
 Vector values.

Friends

std::ostream & operator<< (std::ostream &out, const Vector &v)
 Output stream operator.

Related Functions

(Note that these are not member functions.)

template<class T , int N>
__host__ __device__ Vector< T, N > zeros ()
 Instantiate a vector with zeros.
template<class T , int N, int R>
void fwd_inplace (const Vector< T, R > &p, Vector< T, N > &b, const Vector< T, R+1 > &w)
 Computes the forward operator on vectors (in-place)
template<class T , int N, int R>
void rev_inplace (Vector< T, N > &b, const Vector< T, R > &e, const Vector< T, R+1 > &w)
 Computes the reverse operator on vectors (in-place)

Detailed Description

template<class T, int N>
class gpufilter::Vector< T, N >

Vector class.

Vector class to represent special small vectors, such as the vector of filter weights $a_k$ used in forward and reverse filter computation (see equations 1 and 3 in [Nehab:2011] cited in alg5()).

Template Parameters:
TVector value type
NNumber of elements

Member Function Documentation

template<class T, int N>
__host__ __device__ gpufilter::Vector< T, N >::operator const T * ( ) const [inline]

Pointer-access operator (constant)

Returns:
Pointer to the first element of this vector
template<class T, int N>
__host__ __device__ gpufilter::Vector< T, N >::operator T * ( ) [inline]

Pointer-access operator.

Returns:
Pointer to the first element of this vector
template<class T, int N>
__host__ __device__ Vector gpufilter::Vector< T, N >::operator* ( const T &  v) const [inline]

Multiply operator.

Parameters:
[in]vVector to multiply values from
Returns:
Vector resulting from the multiplication with the input vector
template<class T, int N>
__host__ __device__ Vector& gpufilter::Vector< T, N >::operator*= ( const T &  v) [inline]

Multiply-then-assign operator.

Parameters:
[in]vVector to multiply values from
Returns:
This vector multiplied with the input vector
template<class T, int N>
__host__ __device__ Vector gpufilter::Vector< T, N >::operator+ ( const Vector< T, N > &  v) const [inline]

Add operator.

Parameters:
[in]vVector to add values from
Returns:
Vector resulting from the addition with the input vector
template<class T, int N>
__host__ __device__ Vector& gpufilter::Vector< T, N >::operator+= ( const Vector< T, N > &  v) [inline]

Add-then-assign operator.

Parameters:
[in]vVector to add values from
Returns:
This vector added with the input vector
template<class T, int N>
__host__ __device__ Vector gpufilter::Vector< T, N >::operator/ ( const T &  v) const [inline]

Divide operator.

Parameters:
[in]vVector to divide values from
Returns:
Vector resulting from the division with the input vector
template<class T, int N>
__host__ __device__ Vector& gpufilter::Vector< T, N >::operator/= ( const T &  v) [inline]

Divide-then-assign operator.

Parameters:
[in]vVector to divide values from
Returns:
This vector divided with the input vector
template<class T, int N>
__host__ __device__ const T& gpufilter::Vector< T, N >::operator[] ( int  i) const [inline]

Access (constant) operator.

Parameters:
[in]iPosition to access
Returns:
Value (constant reference) at given position
template<class T, int N>
__host__ __device__ T& gpufilter::Vector< T, N >::operator[] ( int  i) [inline]

Access operator.

Parameters:
[in]iPosition to access
Returns:
Value at given position
template<class T, int N>
__host__ __device__ int gpufilter::Vector< T, N >::size ( ) const [inline]

Get size (number of elements) of this vector.

Returns:
Vector size
template<class T, int N>
std::vector<T> gpufilter::Vector< T, N >::to_vector ( ) const [inline]

Convert a vector of this class to an stl vector.

Returns:
STL Vector

Friends And Related Function Documentation

template<class T , int N, int R>
void fwd_inplace ( const Vector< T, R > &  p,
Vector< T, N > &  b,
const Vector< T, R+1 > &  w 
) [related]

Computes the forward operator on vectors (in-place)

For more information see fwd().

Parameters:
[in]pPrologue $R$ vector ( $R$ is the filter order)
[in,out]bIn(out)put $N$ vector
[in]wFilter weights with $R+1$ size ( $R$ feedback coefficients)
Template Parameters:
NNumber of elements
RNumber of feedback coefficients
TMatrix value type
template<class T, int N>
std::ostream& operator<< ( std::ostream &  out,
const Vector< T, N > &  v 
) [friend]

Output stream operator.

Parameters:
[in,out]outOutput stream
[in]vVector to output values from
Returns:
Output stream
template<class T , int N, int R>
void rev_inplace ( Vector< T, N > &  b,
const Vector< T, R > &  e,
const Vector< T, R+1 > &  w 
) [related]

Computes the reverse operator on vectors (in-place)

For more information see rev().

Parameters:
[in,out]bIn(out)put $N$ vector
[in]eEpilogue $R$ vector ( $R$ is the filter order)
[in]wFilter weights with $R+1$ size ( $R$ feedback coefficients)
Template Parameters:
NNumber of elements
RNumber of feedback coefficients
TMatrix value type
template<class T , int N>
__host__ __device__ Vector< T, N > zeros ( ) [related]

Instantiate a vector with zeros.

Template Parameters:
TVector value type
NNumber of elements

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