28 # include <vcl_msvc_warnings.h> 42 assert(
m.cols() ==
m.rows());
47 template <
class T,
unsigned int n>
51 template <
class T,
unsigned int n>
56 inline unsigned int vpdt_size(
double ) {
return 1; }
85 template <
class T,
unsigned int n>
89 template <
class T,
unsigned int n>
107 template <
class T,
unsigned int n>
110 template <
class T,
unsigned int n>
118 inline const T&
vpdt_index(
const T& v,
unsigned int ) {
return v; }
128 inline const T&
vpdt_index(
const vnl_matrix<T>& v,
unsigned int i,
unsigned int j) { assert(i <
v.rows() && j <
v.columns());
return v(i,j); }
131 template <
class T,
unsigned int n>
134 template <
class T,
unsigned int n>
139 inline T&
vpdt_index(T& v,
unsigned int ,
unsigned int ) {
return v; }
142 inline const T&
vpdt_index(
const T& v,
unsigned int ,
unsigned int ) {
return v; }
149 inline float outer_product(
const float& v1,
const float& v2) {
return v1*v2; }
150 inline double outer_product(
const double& v1,
const double& v2) {
return v1*v2; }
153 #endif // vpdt_traits_h_
T & vpdt_index(vnl_vector< T > &v, unsigned int i)
Index into a vnl_vector.
void vpdt_set_size(vnl_vector< T > &v, unsigned int s)
Set the size of a vnl_vector.
A symmetric matrix represented in eigenvalue decomposition.
unsigned int vpdt_size(const vnl_vector< T > &v)
Access the size of a vnl_vector.
void vpdt_fill(vnl_vector< T > &v, const T &val)
Fill a vnl_vector.
float outer_product(const float &v1, const float &v2)
vnl defines outer_product for vectors but not scalars.