Public Types | Static Public Member Functions | Related Functions | List of all members
vnl_c_vector< T > Class Template Reference

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

#include <vnl_c_vector.h>

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

Related Functions

(Note that these are not member functions.)

template<class T >
VNL_EXPORT std::ostream & print_vector (std::ostream &, T const *, unsigned)
 Input & output. More...
 

Detailed Description

template<class T>
class vnl_c_vector< T >

vnl_c_vector interfaces to lowlevel memory-block operations.

Definition at line 39 of file vnl_c_vector.h.

Member Typedef Documentation

◆ abs_t

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

Definition at line 42 of file vnl_c_vector.h.

◆ real_t

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

Definition at line 43 of file vnl_c_vector.h.

Member Function Documentation

◆ add() [1/2]

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 114 of file vnl_c_vector.hxx.

◆ add() [2/2]

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 120 of file vnl_c_vector.hxx.

◆ allocate_T()

template<class T >
T * vnl_c_vector< T >::allocate_T ( const std::size_t  n)
static

Definition at line 403 of file vnl_c_vector.hxx.

◆ allocate_Tptr()

template<class T >
T ** vnl_c_vector< T >::allocate_Tptr ( const std::size_t  n)
static

Memory allocation.

Definition at line 361 of file vnl_c_vector.hxx.

◆ apply() [1/2]

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

Definition at line 50 of file vnl_c_vector.hxx.

◆ apply() [2/2]

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 43 of file vnl_c_vector.hxx.

◆ arg_max()

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 258 of file vnl_c_vector.hxx.

◆ arg_min()

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 266 of file vnl_c_vector.hxx.

◆ conjugate()

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

Definition at line 232 of file vnl_c_vector.hxx.

◆ copy()

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

y[i] = x[i].

Definition at line 57 of file vnl_c_vector.hxx.

◆ deallocate() [1/2]

template<class T>
void vnl_c_vector< T >::deallocate ( T **  v,
const std::size_t  n_when_allocated 
)
static

Definition at line 367 of file vnl_c_vector.hxx.

◆ deallocate() [2/2]

template<class T>
void vnl_c_vector< T >::deallocate ( T *  p,
const std::size_t  n_when_allocated 
)
static

Definition at line 411 of file vnl_c_vector.hxx.

◆ divide() [1/2]

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 150 of file vnl_c_vector.hxx.

◆ divide() [2/2]

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 156 of file vnl_c_vector.hxx.

◆ dot_product()

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

Definition at line 215 of file vnl_c_vector.hxx.

◆ euclid_dist_sq()

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 274 of file vnl_c_vector.hxx.

◆ fill()

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

x[i] = v.

Definition at line 196 of file vnl_c_vector.hxx.

◆ inf_norm()

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

inf_norm : max of abs values.

Definition at line 128 of file vnl_c_vector.h.

◆ inner_product()

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

conjugate second.

Definition at line 222 of file vnl_c_vector.hxx.

◆ invert()

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 177 of file vnl_c_vector.hxx.

◆ max_value()

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 242 of file vnl_c_vector.hxx.

◆ mean()

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

Definition at line 108 of file vnl_c_vector.h.

◆ min_value()

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 250 of file vnl_c_vector.hxx.

◆ multiply() [1/2]

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 138 of file vnl_c_vector.hxx.

◆ multiply() [2/2]

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 144 of file vnl_c_vector.hxx.

◆ negate()

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 166 of file vnl_c_vector.hxx.

◆ normalize()

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

Definition at line 27 of file vnl_c_vector.hxx.

◆ one_norm()

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

one_norm : sum of abs values.

Definition at line 120 of file vnl_c_vector.h.

◆ reverse()

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

Definition at line 204 of file vnl_c_vector.hxx.

◆ rms_norm()

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

rms_norm : sqrt of mean sum of squared abs values.

Definition at line 136 of file vnl_c_vector.h.

◆ saxpy()

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 188 of file vnl_c_vector.hxx.

◆ scale()

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 64 of file vnl_c_vector.hxx.

◆ squared_magnitude()

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

Definition at line 46 of file vnl_c_vector.h.

◆ std()

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

The standard deviation.

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

Definition at line 113 of file vnl_c_vector.h.

◆ subtract() [1/2]

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 126 of file vnl_c_vector.hxx.

◆ subtract() [2/2]

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 132 of file vnl_c_vector.hxx.

◆ sum()

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

Definition at line 21 of file vnl_c_vector.hxx.

◆ sum_sq_diff_means()

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 280 of file vnl_c_vector.hxx.

◆ two_norm()

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

two_norm : sqrt of sum of squared abs values.

Definition at line 124 of file vnl_c_vector.h.

◆ two_nrm2()

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

two_nrm2 : sum of squared abs values.

Definition at line 132 of file vnl_c_vector.h.

Friends And Related Function Documentation

◆ print_vector()

template<class T >
VNL_EXPORT std::ostream & print_vector ( std::ostream &  ,
T const *  ,
unsigned   
)
related

Input & output.


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