Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
vnl_vector_fixed_ref_const< T, n > Class Template Reference

#include <vnl_fwd.h>

Inheritance diagram for vnl_vector_fixed_ref_const< T, n >:
Inheritance graph
[legend]

Public Types

typedef size_t size_type
 
typedef T element_type
 Type defs for iterators. More...
 
typedef T const * iterator
 Type defs for iterators. More...
 
typedef T const * const_iterator
 Const iterator type. More...
 
typedef vnl_c_vector< T >::abs_t abs_t
 

Public Member Functions

 vnl_vector_fixed_ref_const (vnl_vector_fixed< T, n > const &rhs)
 
 vnl_vector_fixed_ref_const (const T *dataptr)
 
 vnl_vector_fixed_ref_const (const vnl_vector_fixed_ref_const< T, n > &rhs)
 
const T * data_block () const
 
unsigned size () const
 Length of the vector. More...
 
get (unsigned int i) const
 Get value at element i. More...
 
void copy_out (T *ptr) const
 Copy elements to ptr[i]. More...
 
T const & operator() (unsigned int i) const
 Return reference to the element at specified index. More...
 
const T & operator[] (unsigned int i) const
 Return the i-th element. More...
 
const vnl_vector_ref< T > as_ref () const
 Explicit conversion to a vnl_vector_ref. More...
 
 operator const vnl_vector_ref< T > () const
 Cheap conversion to vnl_vector_ref. More...
 
const_iterator begin () const
 Iterator pointing to start of data. More...
 
const_iterator end () const
 Iterator pointing to element beyond end of data. More...
 
vnl_vector_fixed< T, n > apply (T(*f)(T)) const
 Apply f to each element. More...
 
vnl_vector_fixed< T, n > apply (T(*f)(const T &)) const
 Apply f to each element. More...
 
vnl_vector_fixed< T, n > operator- () const
 
vnl_vector< T > extract (unsigned int len, unsigned int start=0) const
 Returns a subvector specified by the start index and length. O(n). More...
 
vnl_vector< T > as_vector () const
 Convert to a vnl_vector. More...
 
abs_t squared_magnitude () const
 Return sum of squares of elements. More...
 
abs_t magnitude () const
 Return magnitude (length) of vector. More...
 
abs_t one_norm () const
 Return sum of absolute values of the elements. More...
 
abs_t two_norm () const
 Return sqrt of sum of squares of values of elements. More...
 
abs_t inf_norm () const
 Return largest absolute element value. More...
 
abs_t rms () const
 Root Mean Squares of values. More...
 
min_value () const
 Smallest value. More...
 
max_value () const
 Largest value. More...
 
unsigned arg_min () const
 Location of smallest value. More...
 
unsigned arg_max () const
 Location of largest value. More...
 
mean () const
 Mean of values in vector. More...
 
sum () const
 Sum of values in a vector. More...
 
void assert_size (unsigned sz) const
 Check that size()==sz if not, abort();. More...
 
void assert_finite () const
 Check that this is finite if not, abort();. More...
 
bool is_finite () const
 Return true if it's finite. More...
 
bool is_zero () const
 Return true iff all the entries are zero. More...
 
bool empty () const
 Return true iff the size is zero. More...
 
bool operator_eq (vnl_vector_fixed_ref_const< T, n > const &v) const
 Return true if *this == v. More...
 
bool operator_eq (vnl_vector< T > const &v) const
 Return true if *this == v. More...
 
void print (std::ostream &s) const
 Display the vector. More...
 
bool operator== (vnl_vector_fixed_ref_const< T, n > const &that) const
 Equality operator. More...
 
bool operator!= (vnl_vector_fixed_ref_const< T, n > const &that) const
 Inequality operator. More...
 

Static Public Member Functions

static void add (const T *a, const T *b, T *r)
 
static void add (const T *a, T b, T *r)
 
static void sub (const T *a, const T *b, T *r)
 
static void sub (const T *a, T b, T *r)
 
static void sub (T a, const T *b, T *r)
 
static void mul (const T *a, const T *b, T *r)
 
static void mul (const T *a, T b, T *r)
 
static void div (const T *a, const T *b, T *r)
 
static void div (const T *a, T b, T *r)
 

Protected Attributes

const T * data_
 

Private Member Functions

const vnl_vector_fixed_ref_const< T, n > & operator= (const vnl_vector_fixed< T, n > &) const
 See assert_finite(). More...
 
const vnl_vector_fixed_ref_const< T, n > & operator= (const vnl_vector_fixed_ref_const< T, n > &) const
 
void assert_finite_internal () const
 

Detailed Description

template<class T, unsigned int n>
class vnl_vector_fixed_ref_const< T, n >

Definition at line 26 of file vnl_fwd.h.

Member Typedef Documentation

◆ abs_t

template<class T, unsigned int n>
typedef vnl_c_vector<T>::abs_t vnl_vector_fixed_ref_const< T, n >::abs_t

Definition at line 139 of file vnl_vector_fixed_ref.h.

◆ const_iterator

template<class T, unsigned int n>
typedef T const* vnl_vector_fixed_ref_const< T, n >::const_iterator

Const iterator type.

Definition at line 109 of file vnl_vector_fixed_ref.h.

◆ element_type

template<class T, unsigned int n>
typedef T vnl_vector_fixed_ref_const< T, n >::element_type

Type defs for iterators.

Definition at line 104 of file vnl_vector_fixed_ref.h.

◆ iterator

template<class T, unsigned int n>
typedef T const* vnl_vector_fixed_ref_const< T, n >::iterator

Type defs for iterators.

Definition at line 106 of file vnl_vector_fixed_ref.h.

◆ size_type

template<class T, unsigned int n>
typedef size_t vnl_vector_fixed_ref_const< T, n >::size_type

Definition at line 35 of file vnl_vector_fixed_ref.h.

Constructor & Destructor Documentation

◆ vnl_vector_fixed_ref_const() [1/3]

template<class T, unsigned int n>
vnl_vector_fixed_ref_const< T, n >::vnl_vector_fixed_ref_const ( vnl_vector_fixed< T, n > const &  rhs)
inline

Definition at line 37 of file vnl_vector_fixed_ref.h.

◆ vnl_vector_fixed_ref_const() [2/3]

template<class T, unsigned int n>
vnl_vector_fixed_ref_const< T, n >::vnl_vector_fixed_ref_const ( const T *  dataptr)
inlineexplicit

Definition at line 39 of file vnl_vector_fixed_ref.h.

◆ vnl_vector_fixed_ref_const() [3/3]

template<class T, unsigned int n>
vnl_vector_fixed_ref_const< T, n >::vnl_vector_fixed_ref_const ( const vnl_vector_fixed_ref_const< T, n > &  rhs)
inline

Definition at line 41 of file vnl_vector_fixed_ref.h.

Member Function Documentation

◆ add() [1/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::add ( const T *  a,
const T *  b,
T *  r 
)
inlinestatic

Definition at line 233 of file vnl_vector_fixed_ref.h.

◆ add() [2/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::add ( const T *  a,
b,
T *  r 
)
inlinestatic

Definition at line 238 of file vnl_vector_fixed_ref.h.

◆ apply() [1/2]

template<class T , unsigned int n>
vnl_vector_fixed< T, n > vnl_vector_fixed_ref_const< T, n >::apply ( T(*)(T)  f) const

Apply f to each element.

Returns a new vector with the result.

Definition at line 22 of file vnl_vector_fixed_ref.hxx.

◆ apply() [2/2]

template<class T , unsigned int n>
vnl_vector_fixed< T, n > vnl_vector_fixed_ref_const< T, n >::apply ( T(*)(const T &)  f) const

Apply f to each element.

Returns a new vector with the result.

Definition at line 32 of file vnl_vector_fixed_ref.hxx.

◆ arg_max()

template<class T, unsigned int n>
unsigned vnl_vector_fixed_ref_const< T, n >::arg_max ( ) const
inline

Location of largest value.

Definition at line 173 of file vnl_vector_fixed_ref.h.

◆ arg_min()

template<class T, unsigned int n>
unsigned vnl_vector_fixed_ref_const< T, n >::arg_min ( ) const
inline

Location of smallest value.

Definition at line 170 of file vnl_vector_fixed_ref.h.

◆ as_ref()

template<class T, unsigned int n>
const vnl_vector_ref<T> vnl_vector_fixed_ref_const< T, n >::as_ref ( ) const
inline

Explicit conversion to a vnl_vector_ref.

This is a cheap conversion for those functions that have an interface for vnl_vector_ref but not for vnl_vector_fixed_ref. There is also a conversion operator that should work most of the time.

See also
vnl_vector_ref::non_const

Definition at line 93 of file vnl_vector_fixed_ref.h.

◆ as_vector()

template<class T, unsigned int n>
vnl_vector<T> vnl_vector_fixed_ref_const< T, n >::as_vector ( ) const
inline

Convert to a vnl_vector.

Definition at line 135 of file vnl_vector_fixed_ref.h.

◆ assert_finite()

template<class T, unsigned int n>
void vnl_vector_fixed_ref_const< T, n >::assert_finite ( ) const
inline

Check that this is finite if not, abort();.

This function does or tests nothing if NDEBUG is defined

Definition at line 192 of file vnl_vector_fixed_ref.h.

◆ assert_finite_internal()

template<class T , unsigned int n>
void vnl_vector_fixed_ref_const< T, n >::assert_finite_internal ( ) const
private

Definition at line 106 of file vnl_vector_fixed_ref.hxx.

◆ assert_size()

template<class T, unsigned int n>
void vnl_vector_fixed_ref_const< T, n >::assert_size ( unsigned  sz) const
inline

Check that size()==sz if not, abort();.

This function does or tests nothing if NDEBUG is defined

Definition at line 185 of file vnl_vector_fixed_ref.h.

◆ begin()

template<class T, unsigned int n>
const_iterator vnl_vector_fixed_ref_const< T, n >::begin ( ) const
inline

Iterator pointing to start of data.

Definition at line 111 of file vnl_vector_fixed_ref.h.

◆ copy_out()

template<class T, unsigned int n>
void vnl_vector_fixed_ref_const< T, n >::copy_out ( T *  ptr) const
inline

Copy elements to ptr[i].

Note: ptr[i] must be valid for i=0..size()-1

Definition at line 59 of file vnl_vector_fixed_ref.h.

◆ data_block()

template<class T, unsigned int n>
const T* vnl_vector_fixed_ref_const< T, n >::data_block ( ) const
inline

Definition at line 43 of file vnl_vector_fixed_ref.h.

◆ div() [1/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::div ( const T *  a,
const T *  b,
T *  r 
)
inlinestatic

Definition at line 268 of file vnl_vector_fixed_ref.h.

◆ div() [2/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::div ( const T *  a,
b,
T *  r 
)
inlinestatic

Definition at line 273 of file vnl_vector_fixed_ref.h.

◆ empty()

template<class T, unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::empty ( ) const
inline

Return true iff the size is zero.

Definition at line 205 of file vnl_vector_fixed_ref.h.

◆ end()

template<class T, unsigned int n>
const_iterator vnl_vector_fixed_ref_const< T, n >::end ( ) const
inline

Iterator pointing to element beyond end of data.

Definition at line 113 of file vnl_vector_fixed_ref.h.

◆ extract()

template<class T , unsigned int n>
vnl_vector< T > vnl_vector_fixed_ref_const< T, n >::extract ( unsigned int  len,
unsigned int  start = 0 
) const

Returns a subvector specified by the start index and length. O(n).

Definition at line 43 of file vnl_vector_fixed_ref.hxx.

◆ get()

template<class T, unsigned int n>
T vnl_vector_fixed_ref_const< T, n >::get ( unsigned int  i) const
inline

Get value at element i.

Definition at line 55 of file vnl_vector_fixed_ref.h.

◆ inf_norm()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::inf_norm ( ) const
inline

Return largest absolute element value.

Definition at line 154 of file vnl_vector_fixed_ref.h.

◆ is_finite()

template<class T , unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::is_finite ( ) const

Return true if it's finite.

Definition at line 71 of file vnl_vector_fixed_ref.hxx.

◆ is_zero()

template<class T , unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::is_zero ( ) const

Return true iff all the entries are zero.

Definition at line 83 of file vnl_vector_fixed_ref.hxx.

◆ magnitude()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::magnitude ( ) const
inline

Return magnitude (length) of vector.

Definition at line 145 of file vnl_vector_fixed_ref.h.

◆ max_value()

template<class T, unsigned int n>
T vnl_vector_fixed_ref_const< T, n >::max_value ( ) const
inline

Largest value.

Definition at line 167 of file vnl_vector_fixed_ref.h.

◆ mean()

template<class T, unsigned int n>
T vnl_vector_fixed_ref_const< T, n >::mean ( ) const
inline

Mean of values in vector.

Definition at line 176 of file vnl_vector_fixed_ref.h.

◆ min_value()

template<class T, unsigned int n>
T vnl_vector_fixed_ref_const< T, n >::min_value ( ) const
inline

Smallest value.

Definition at line 164 of file vnl_vector_fixed_ref.h.

◆ mul() [1/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::mul ( const T *  a,
const T *  b,
T *  r 
)
inlinestatic

Definition at line 258 of file vnl_vector_fixed_ref.h.

◆ mul() [2/2]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::mul ( const T *  a,
b,
T *  r 
)
inlinestatic

Definition at line 263 of file vnl_vector_fixed_ref.h.

◆ one_norm()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::one_norm ( ) const
inline

Return sum of absolute values of the elements.

Definition at line 148 of file vnl_vector_fixed_ref.h.

◆ operator const vnl_vector_ref< T >()

template<class T, unsigned int n>
vnl_vector_fixed_ref_const< T, n >::operator const vnl_vector_ref< T > ( ) const
inline

Cheap conversion to vnl_vector_ref.

Sometimes, such as with templated functions, the compiler cannot use this user-defined conversion. For those cases, use the explicit as_ref() method instead.

Definition at line 99 of file vnl_vector_fixed_ref.h.

◆ operator!=()

template<class T, unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::operator!= ( vnl_vector_fixed_ref_const< T, n > const &  that) const
inline

Inequality operator.

Definition at line 283 of file vnl_vector_fixed_ref.h.

◆ operator()()

template<class T, unsigned int n>
T const& vnl_vector_fixed_ref_const< T, n >::operator() ( unsigned int  i) const
inline

Return reference to the element at specified index.

There are assert style boundary checks - #define NDEBUG to turn them off.

Definition at line 67 of file vnl_vector_fixed_ref.h.

◆ operator-()

template<class T, unsigned int n>
vnl_vector_fixed<T,n> vnl_vector_fixed_ref_const< T, n >::operator- ( ) const
inline

Definition at line 125 of file vnl_vector_fixed_ref.h.

◆ operator=() [1/2]

template<class T, unsigned int n>
const vnl_vector_fixed_ref_const<T,n>& vnl_vector_fixed_ref_const< T, n >::operator= ( const vnl_vector_fixed< T, n > &  ) const
inlineprivate

See assert_finite().

Definition at line 287 of file vnl_vector_fixed_ref.h.

◆ operator=() [2/2]

template<class T, unsigned int n>
const vnl_vector_fixed_ref_const<T,n>& vnl_vector_fixed_ref_const< T, n >::operator= ( const vnl_vector_fixed_ref_const< T, n > &  ) const
inlineprivate

Definition at line 292 of file vnl_vector_fixed_ref.h.

◆ operator==()

template<class T, unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::operator== ( vnl_vector_fixed_ref_const< T, n > const &  that) const
inline

Equality operator.

Definition at line 280 of file vnl_vector_fixed_ref.h.

◆ operator[]()

template<class T, unsigned int n>
const T& vnl_vector_fixed_ref_const< T, n >::operator[] ( unsigned int  i) const
inline

Return the i-th element.

Definition at line 77 of file vnl_vector_fixed_ref.h.

◆ operator_eq() [1/2]

template<class T, unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::operator_eq ( vnl_vector_fixed_ref_const< T, n > const &  v) const
inline

Return true if *this == v.

Definition at line 208 of file vnl_vector_fixed_ref.h.

◆ operator_eq() [2/2]

template<class T, unsigned int n>
bool vnl_vector_fixed_ref_const< T, n >::operator_eq ( vnl_vector< T > const &  v) const
inline

Return true if *this == v.

Definition at line 216 of file vnl_vector_fixed_ref.h.

◆ print()

template<class T , unsigned int n>
void vnl_vector_fixed_ref_const< T, n >::print ( std::ostream &  s) const

Display the vector.

Output each element separated by a single space.

Definition at line 117 of file vnl_vector_fixed_ref.hxx.

◆ rms()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::rms ( ) const
inline

Root Mean Squares of values.

Definition at line 161 of file vnl_vector_fixed_ref.h.

◆ size()

template<class T, unsigned int n>
unsigned vnl_vector_fixed_ref_const< T, n >::size ( ) const
inline

Length of the vector.

This is always n.

Definition at line 52 of file vnl_vector_fixed_ref.h.

◆ squared_magnitude()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::squared_magnitude ( ) const
inline

Return sum of squares of elements.

Definition at line 142 of file vnl_vector_fixed_ref.h.

◆ sub() [1/3]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::sub ( const T *  a,
const T *  b,
T *  r 
)
inlinestatic

Definition at line 243 of file vnl_vector_fixed_ref.h.

◆ sub() [2/3]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::sub ( const T *  a,
b,
T *  r 
)
inlinestatic

Definition at line 248 of file vnl_vector_fixed_ref.h.

◆ sub() [3/3]

template<class T, unsigned int n>
static void vnl_vector_fixed_ref_const< T, n >::sub ( a,
const T *  b,
T *  r 
)
inlinestatic

Definition at line 253 of file vnl_vector_fixed_ref.h.

◆ sum()

template<class T, unsigned int n>
T vnl_vector_fixed_ref_const< T, n >::sum ( ) const
inline

Sum of values in a vector.

Definition at line 179 of file vnl_vector_fixed_ref.h.

◆ two_norm()

template<class T, unsigned int n>
abs_t vnl_vector_fixed_ref_const< T, n >::two_norm ( ) const
inline

Return sqrt of sum of squares of values of elements.

Definition at line 151 of file vnl_vector_fixed_ref.h.

Member Data Documentation

◆ data_

template<class T, unsigned int n>
const T* vnl_vector_fixed_ref_const< T, n >::data_
protected

Definition at line 32 of file vnl_vector_fixed_ref.h.


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