Functions
vpdt_access.h File Reference

Overloaded functions to allow uniform API access to various field types. More...

#include <vnl/vnl_vector.h>
#include <vnl/vnl_matrix.h>
#include <vnl/vnl_vector_fixed.h>
#include <vnl/vnl_matrix_fixed.h>
#include <vpdl/vpdt/vpdt_eigen_sym_matrix.h>
#include <cassert>

Go to the source code of this file.

Functions

template<class T >
unsigned int vpdt_size (const vnl_vector< T > &v)
 Access the size of a vnl_vector. More...
 
template<class T >
unsigned int vpdt_size (const vnl_matrix< T > &m)
 Access the size of a square vnl_matrix. More...
 
template<class T , unsigned int n>
unsigned int vpdt_size (const vnl_vector_fixed< T, n > &)
 Access the size of a vnl_vector_fixed. More...
 
template<class T , unsigned int n>
unsigned int vpdt_size (const vnl_matrix_fixed< T, n, n > &)
 Access the size of a square vnl_matrix_fixed. More...
 
unsigned int vpdt_size (float)
 Access the size of a scalar. More...
 
unsigned int vpdt_size (double)
 
template<class T >
void vpdt_set_size (vnl_vector< T > &v, unsigned int s)
 Set the size of a vnl_vector. More...
 
template<class T >
void vpdt_set_size (vnl_matrix< T > &m, unsigned int s)
 Set the size of a square vnl_matrix. More...
 
template<class T >
void vpdt_set_size (T &, unsigned int)
 Default case, do nothing. More...
 
template<class T >
void vpdt_fill (vnl_vector< T > &v, const T &val)
 Fill a vnl_vector. More...
 
template<class T >
void vpdt_fill (vnl_matrix< T > &m, const T &val)
 Fill a square vnl_matrix. More...
 
template<class T , unsigned int n>
void vpdt_fill (vnl_vector_fixed< T, n > &v, const T &val)
 Fill a vnl_vector_fixed. More...
 
template<class T , unsigned int n>
void vpdt_fill (vnl_matrix_fixed< T, n, n > &m, const T &val)
 Fill a square vnl_matrix_fixed. More...
 
template<class T >
void vpdt_fill (T &v, const T &val)
 Default case, assignment. More...
 
template<class T >
T & vpdt_index (vnl_vector< T > &v, unsigned int i)
 Index into a vnl_vector. More...
 
template<class T >
const T & vpdt_index (const vnl_vector< T > &v, unsigned int i)
 Index into a vnl_vector (const). More...
 
template<class T , unsigned int n>
T & vpdt_index (vnl_vector_fixed< T, n > &v, unsigned int i)
 Index into a vnl_vector_fixed. More...
 
template<class T , unsigned int n>
const T & vpdt_index (const vnl_vector_fixed< T, n > &v, unsigned int i)
 Index into a vnl_vector_fixed (const). More...
 
template<class T >
T & vpdt_index (T &v, unsigned int)
 Index into a scalar. More...
 
template<class T >
const T & vpdt_index (const T &v, unsigned int)
 Index into a scalar (const). More...
 
template<class T >
T & vpdt_index (vnl_matrix< T > &v, unsigned int i, unsigned int j)
 Index into a vnl_matrix. More...
 
template<class T >
const T & vpdt_index (const vnl_matrix< T > &v, unsigned int i, unsigned int j)
 Index into a vnl_matrix (const). More...
 
template<class T , unsigned int n>
T & vpdt_index (vnl_matrix_fixed< T, n, n > &v, unsigned int i, unsigned int j)
 Index into a vnl_matrix_fixed. More...
 
template<class T , unsigned int n>
const T & vpdt_index (const vnl_matrix_fixed< T, n, n > &v, unsigned int i, unsigned int j)
 Index into a vnl_matrix_fixed (const). More...
 
template<class T >
T & vpdt_index (T &v, unsigned int, unsigned int)
 Index into a scalar. More...
 
template<class T >
const T & vpdt_index (const T &v, unsigned int, unsigned int)
 Index into a scalar (const). More...
 
float outer_product (const float &v1, const float &v2)
 vnl defines outer_product for vectors but not scalars. More...
 
double outer_product (const double &v1, const double &v2)
 

Detailed Description

Overloaded functions to allow uniform API access to various field types.

Author
Matthew Leotta
Date
March 5, 2009

Since the same template code may apply to both scalars and vectors, we need a standard set of functions to treat scalars as a 1-d vector. Likewise, we need uniform access to variable and fixed size vectors. This includes functions to access dimension, set dimension, access elements, and more.

  Modifications
   <None yet>

Definition in file vpdt_access.h.

Function Documentation

◆ outer_product() [1/2]

float outer_product ( const float &  v1,
const float &  v2 
)
inline

vnl defines outer_product for vectors but not scalars.

Definition at line 149 of file vpdt_access.h.

◆ outer_product() [2/2]

double outer_product ( const double &  v1,
const double &  v2 
)
inline

Definition at line 150 of file vpdt_access.h.

◆ vpdt_fill() [1/5]

template<class T >
void vpdt_fill ( vnl_vector< T > &  v,
const T &  val 
)
inline

Fill a vnl_vector.

Definition at line 78 of file vpdt_access.h.

◆ vpdt_fill() [2/5]

template<class T >
void vpdt_fill ( vnl_matrix< T > &  m,
const T &  val 
)
inline

Fill a square vnl_matrix.

Definition at line 82 of file vpdt_access.h.

◆ vpdt_fill() [3/5]

template<class T , unsigned int n>
void vpdt_fill ( vnl_vector_fixed< T, n > &  v,
const T &  val 
)
inline

Fill a vnl_vector_fixed.

Definition at line 86 of file vpdt_access.h.

◆ vpdt_fill() [4/5]

template<class T , unsigned int n>
void vpdt_fill ( vnl_matrix_fixed< T, n, n > &  m,
const T &  val 
)
inline

Fill a square vnl_matrix_fixed.

Definition at line 90 of file vpdt_access.h.

◆ vpdt_fill() [5/5]

template<class T >
void vpdt_fill ( T &  v,
const T &  val 
)
inline

Default case, assignment.

Definition at line 94 of file vpdt_access.h.

◆ vpdt_index() [1/12]

template<class T >
T& vpdt_index ( vnl_vector< T > &  v,
unsigned int  i 
)
inline

Index into a vnl_vector.

Definition at line 101 of file vpdt_access.h.

◆ vpdt_index() [2/12]

template<class T >
const T& vpdt_index ( const vnl_vector< T > &  v,
unsigned int  i 
)
inline

Index into a vnl_vector (const).

Definition at line 104 of file vpdt_access.h.

◆ vpdt_index() [3/12]

template<class T , unsigned int n>
T& vpdt_index ( vnl_vector_fixed< T, n > &  v,
unsigned int  i 
)
inline

Index into a vnl_vector_fixed.

Definition at line 108 of file vpdt_access.h.

◆ vpdt_index() [4/12]

template<class T , unsigned int n>
const T& vpdt_index ( const vnl_vector_fixed< T, n > &  v,
unsigned int  i 
)
inline

Index into a vnl_vector_fixed (const).

Definition at line 111 of file vpdt_access.h.

◆ vpdt_index() [5/12]

template<class T >
T& vpdt_index ( T &  v,
unsigned int   
)
inline

Index into a scalar.

Definition at line 115 of file vpdt_access.h.

◆ vpdt_index() [6/12]

template<class T >
const T& vpdt_index ( const T &  v,
unsigned int   
)
inline

Index into a scalar (const).

Definition at line 118 of file vpdt_access.h.

◆ vpdt_index() [7/12]

template<class T >
T& vpdt_index ( vnl_matrix< T > &  v,
unsigned int  i,
unsigned int  j 
)
inline

Index into a vnl_matrix.

Definition at line 125 of file vpdt_access.h.

◆ vpdt_index() [8/12]

template<class T >
const T& vpdt_index ( const vnl_matrix< T > &  v,
unsigned int  i,
unsigned int  j 
)
inline

Index into a vnl_matrix (const).

Definition at line 128 of file vpdt_access.h.

◆ vpdt_index() [9/12]

template<class T , unsigned int n>
T& vpdt_index ( vnl_matrix_fixed< T, n, n > &  v,
unsigned int  i,
unsigned int  j 
)
inline

Index into a vnl_matrix_fixed.

Definition at line 132 of file vpdt_access.h.

◆ vpdt_index() [10/12]

template<class T , unsigned int n>
const T& vpdt_index ( const vnl_matrix_fixed< T, n, n > &  v,
unsigned int  i,
unsigned int  j 
)
inline

Index into a vnl_matrix_fixed (const).

Definition at line 135 of file vpdt_access.h.

◆ vpdt_index() [11/12]

template<class T >
T& vpdt_index ( T &  v,
unsigned int  ,
unsigned int   
)
inline

Index into a scalar.

Definition at line 139 of file vpdt_access.h.

◆ vpdt_index() [12/12]

template<class T >
const T& vpdt_index ( const T &  v,
unsigned int  ,
unsigned int   
)
inline

Index into a scalar (const).

Definition at line 142 of file vpdt_access.h.

◆ vpdt_set_size() [1/3]

template<class T >
void vpdt_set_size ( vnl_vector< T > &  v,
unsigned int  s 
)
inline

Set the size of a vnl_vector.

Definition at line 63 of file vpdt_access.h.

◆ vpdt_set_size() [2/3]

template<class T >
void vpdt_set_size ( vnl_matrix< T > &  m,
unsigned int  s 
)
inline

Set the size of a square vnl_matrix.

Definition at line 67 of file vpdt_access.h.

◆ vpdt_set_size() [3/3]

template<class T >
void vpdt_set_size ( T &  ,
unsigned int   
)
inline

Default case, do nothing.

Definition at line 71 of file vpdt_access.h.

◆ vpdt_size() [1/6]

template<class T >
unsigned int vpdt_size ( const vnl_vector< T > &  v)
inline

Access the size of a vnl_vector.

Definition at line 36 of file vpdt_access.h.

◆ vpdt_size() [2/6]

template<class T >
unsigned int vpdt_size ( const vnl_matrix< T > &  m)
inline

Access the size of a square vnl_matrix.

Definition at line 40 of file vpdt_access.h.

◆ vpdt_size() [3/6]

template<class T , unsigned int n>
unsigned int vpdt_size ( const vnl_vector_fixed< T, n > &  )
inline

Access the size of a vnl_vector_fixed.

Definition at line 48 of file vpdt_access.h.

◆ vpdt_size() [4/6]

template<class T , unsigned int n>
unsigned int vpdt_size ( const vnl_matrix_fixed< T, n, n > &  )
inline

Access the size of a square vnl_matrix_fixed.

Definition at line 52 of file vpdt_access.h.

◆ vpdt_size() [5/6]

unsigned int vpdt_size ( float  )
inline

Access the size of a scalar.

Definition at line 55 of file vpdt_access.h.

◆ vpdt_size() [6/6]

unsigned int vpdt_size ( double  )
inline

Definition at line 56 of file vpdt_access.h.