Public Types | Static Public Member Functions | Related Functions
vnl_c_vector< T > Class Template Reference

vnl_c_vector interfaces to lowlevel memory-block operations. More...

#include <vnl_c_vector.h>

List of all members.

Public Types

typedef vnl_numeric_traits< T >
::abs_t 
abs_t
typedef vnl_numeric_traits< T >
::real_t 
real_t

Static Public Member Functions

static T sum (T const *v, unsigned n)
static abs_t squared_magnitude (T const *p, unsigned n)
static void normalize (T *, unsigned n)
static void apply (T const *, unsigned, T(*f)(T), T *v_out)
static void apply (T const *, unsigned, T(*f)(T const &), T *v_out)
static void copy (T const *x, T *y, unsigned)
 y[i] = x[i].
static void scale (T const *x, T *y, unsigned, T const &)
 y[i] = a*x[i].
static void add (T const *x, T const *y, T *z, unsigned)
 z[i] = x[i] + y[i];.
static void add (T const *x, T const &y, T *z, unsigned)
 z[i] = x[i] + y;.
static void subtract (T const *x, T const *y, T *z, unsigned)
 z[i] = x[i] - y[i].
static void subtract (T const *x, T const &y, T *z, unsigned)
 z[i] = x[i] - y[i].
static void multiply (T const *x, T const *y, T *z, unsigned)
 z[i] = x[i] * y[i].
static void multiply (T const *x, T const &y, T *z, unsigned)
 z[i] = x[i] * y[i].
static void divide (T const *x, T const *y, T *z, unsigned)
 z[i] = x[i] / y[i].
static void divide (T const *x, T const &y, T *z, unsigned)
 z[i] = x[i] / y[i].
static void negate (T const *x, T *y, unsigned)
 y[i] = -x[i].
static void invert (T const *x, T *y, unsigned)
 y[i] = 1/x[i].
static void saxpy (T const &a, T const *x, T *y, unsigned)
 y[i] += a*x[i].
static void fill (T *x, unsigned, T const &v)
 x[i] = v.
static void reverse (T *x, unsigned)
static T dot_product (T const *, T const *, unsigned)
static T inner_product (T const *, T const *, unsigned)
 conjugate second.
static void conjugate (T const *, T *, unsigned)
static T max_value (T const *, unsigned)
 Returns max value of the vector.
static T min_value (T const *, unsigned)
 Returns min value of the vector.
static unsigned arg_max (T const *, unsigned)
 Returns location of max value of the vector.
static unsigned arg_min (T const *, unsigned)
 Returns location of min value of the vector.
static T mean (T const *p, unsigned n)
static real_t std (T const *p, unsigned n)
 The standard deviation.
static T sum_sq_diff_means (T const *v, unsigned n)
 The sum of squared differences from the mean.
static abs_t one_norm (T const *p, unsigned n)
 one_norm : sum of abs values.
static abs_t two_norm (T const *p, unsigned n)
 two_norm : sqrt of sum of squared abs values.
static abs_t inf_norm (T const *p, unsigned n)
 inf_norm : max of abs values.
static abs_t two_nrm2 (T const *p, unsigned n)
 two_nrm2 : sum of squared abs values.
static abs_t rms_norm (T const *p, unsigned n)
 rms_norm : sqrt of mean sum of squared abs values.
static T euclid_dist_sq (T const *, T const *, unsigned)
 Euclidean Distance between two vectors.
static T ** allocate_Tptr (vcl_size_t n)
 Memory allocation.
static T * allocate_T (vcl_size_t n)
static void deallocate (T **, vcl_size_t n_when_allocated)
static void deallocate (T *, vcl_size_t n_when_allocated)

Related Functions

(Note that these are not member functions.)

template<class T >
vcl_ostream & print_vector (vcl_ostream &, T const *, unsigned)
 Input & output.

Detailed Description

template<class T>
class vnl_c_vector< T >

vnl_c_vector interfaces to lowlevel memory-block operations.

Definition at line 38 of file vnl_c_vector.h.


Member Typedef Documentation

template<class T>
typedef vnl_numeric_traits<T>::abs_t vnl_c_vector< T >::abs_t

Definition at line 41 of file vnl_c_vector.h.

template<class T>
typedef vnl_numeric_traits<T>::real_t vnl_c_vector< T >::real_t

Definition at line 42 of file vnl_c_vector.h.


Member Function Documentation

template<class T>
void vnl_c_vector< T >::add ( T const *  x,
T const *  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] + y[i];.

Definition at line 113 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::add ( T const *  x,
T const &  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] + y;.

Definition at line 119 of file vnl_c_vector.txx.

template<class T >
T * vnl_c_vector< T >::allocate_T ( vcl_size_t  n) [static]

Definition at line 421 of file vnl_c_vector.txx.

template<class T >
T ** vnl_c_vector< T >::allocate_Tptr ( vcl_size_t  n) [static]

Memory allocation.

Definition at line 367 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::apply ( T const *  v,
unsigned  n,
T(*)(T)  f,
T *  v_out 
) [static]

Definition at line 49 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::apply ( T const *  v,
unsigned  n,
T(*)(T const &)  f,
T *  v_out 
) [static]

Definition at line 42 of file vnl_c_vector.txx.

template<class T>
unsigned vnl_c_vector< T >::arg_max ( T const *  src,
unsigned  n 
) [static]

Returns location of max value of the vector.

Definition at line 257 of file vnl_c_vector.txx.

template<class T>
unsigned vnl_c_vector< T >::arg_min ( T const *  src,
unsigned  n 
) [static]

Returns location of min value of the vector.

Definition at line 265 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::conjugate ( T const *  src,
T *  dst,
unsigned  n 
) [static]

Definition at line 231 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::copy ( T const *  x,
T *  y,
unsigned  n 
) [static]

y[i] = x[i].

Definition at line 56 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::deallocate ( T **  v,
vcl_size_t  n_when_allocated 
) [static]

Definition at line 373 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::deallocate ( T *  p,
vcl_size_t  n_when_allocated 
) [static]

Definition at line 429 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::divide ( T const *  x,
T const *  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] / y[i].

Definition at line 149 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::divide ( T const *  x,
T const &  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] / y[i].

Definition at line 155 of file vnl_c_vector.txx.

template<class T>
T vnl_c_vector< T >::dot_product ( T const *  a,
T const *  b,
unsigned  n 
) [static]

Definition at line 214 of file vnl_c_vector.txx.

template<class T>
T vnl_c_vector< T >::euclid_dist_sq ( T const *  a,
T const *  b,
unsigned  n 
) [static]

Euclidean Distance between two vectors.

Sum of Differences squared.

Definition at line 273 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::fill ( T *  x,
unsigned  n,
T const &  v 
) [static]

x[i] = v.

Definition at line 195 of file vnl_c_vector.txx.

template<class T>
static abs_t vnl_c_vector< T >::inf_norm ( T const *  p,
unsigned  n 
) [inline, static]

inf_norm : max of abs values.

Definition at line 127 of file vnl_c_vector.h.

template<class T>
T vnl_c_vector< T >::inner_product ( T const *  a,
T const *  b,
unsigned  n 
) [static]

conjugate second.

Definition at line 221 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::invert ( T const *  x,
T *  y,
unsigned  n 
) [static]

y[i] = 1/x[i].

Definition at line 176 of file vnl_c_vector.txx.

template<class T>
T vnl_c_vector< T >::max_value ( T const *  src,
unsigned  n 
) [static]

Returns max value of the vector.

Definition at line 241 of file vnl_c_vector.txx.

template<class T>
static T vnl_c_vector< T >::mean ( T const *  p,
unsigned  n 
) [inline, static]

Definition at line 107 of file vnl_c_vector.h.

template<class T>
T vnl_c_vector< T >::min_value ( T const *  src,
unsigned  n 
) [static]

Returns min value of the vector.

Definition at line 249 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::multiply ( T const *  x,
T const *  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] * y[i].

Definition at line 137 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::multiply ( T const *  x,
T const &  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] * y[i].

Definition at line 143 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::negate ( T const *  x,
T *  y,
unsigned  n 
) [static]

y[i] = -x[i].

Note that this is a no-op when T is an unsigned type.

Definition at line 165 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::normalize ( T *  v,
unsigned  n 
) [static]

Definition at line 26 of file vnl_c_vector.txx.

template<class T>
static abs_t vnl_c_vector< T >::one_norm ( T const *  p,
unsigned  n 
) [inline, static]

one_norm : sum of abs values.

Definition at line 119 of file vnl_c_vector.h.

template<class T>
void vnl_c_vector< T >::reverse ( T *  x,
unsigned  n 
) [static]

Definition at line 203 of file vnl_c_vector.txx.

template<class T>
static abs_t vnl_c_vector< T >::rms_norm ( T const *  p,
unsigned  n 
) [inline, static]

rms_norm : sqrt of mean sum of squared abs values.

Definition at line 135 of file vnl_c_vector.h.

template<class T>
void vnl_c_vector< T >::saxpy ( T const &  a,
T const *  x,
T *  y,
unsigned  n 
) [static]

y[i] += a*x[i].

Definition at line 187 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::scale ( T const *  x,
T *  y,
unsigned  n,
T const &  a_ 
) [static]

y[i] = a*x[i].

Definition at line 63 of file vnl_c_vector.txx.

template<class T>
static abs_t vnl_c_vector< T >::squared_magnitude ( T const *  p,
unsigned  n 
) [inline, static]

Definition at line 45 of file vnl_c_vector.h.

template<class T>
static real_t vnl_c_vector< T >::std ( T const *  p,
unsigned  n 
) [inline, static]

The standard deviation.

This method uses the 1/(n-1) normalisation, assuming that your data is a sample of a population.

Definition at line 112 of file vnl_c_vector.h.

template<class T>
void vnl_c_vector< T >::subtract ( T const *  x,
T const *  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] - y[i].

Definition at line 125 of file vnl_c_vector.txx.

template<class T>
void vnl_c_vector< T >::subtract ( T const *  x,
T const &  y,
T *  z,
unsigned  n 
) [static]

z[i] = x[i] - y[i].

Definition at line 131 of file vnl_c_vector.txx.

template<class T>
T vnl_c_vector< T >::sum ( T const *  v,
unsigned  n 
) [static]

Definition at line 20 of file vnl_c_vector.txx.

template<class T>
T vnl_c_vector< T >::sum_sq_diff_means ( T const *  v,
unsigned  n 
) [static]

The sum of squared differences from the mean.

Definition at line 279 of file vnl_c_vector.txx.

template<class T>
static abs_t vnl_c_vector< T >::two_norm ( T const *  p,
unsigned  n 
) [inline, static]

two_norm : sqrt of sum of squared abs values.

Definition at line 123 of file vnl_c_vector.h.

template<class T>
static abs_t vnl_c_vector< T >::two_nrm2 ( T const *  p,
unsigned  n 
) [inline, static]

two_nrm2 : sum of squared abs values.

Definition at line 131 of file vnl_c_vector.h.


Friends And Related Function Documentation

template<class T >
vcl_ostream & print_vector ( vcl_ostream &  ,
T const *  ,
unsigned   
) [related]

Input & output.


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