Public Types | Public Member Functions | Private Attributes | Related Functions
vnl_diag_matrix_fixed< T, N > Class Template Reference

stores a diagonal matrix as a single vector. More...

#include <vnl_diag_matrix_fixed.h>

Inheritance diagram for vnl_diag_matrix_fixed< T, N >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef vnl_vector_fixed< T, N >
::iterator 
iterator
typedef vnl_vector_fixed< T, N >
::const_iterator 
const_iterator

Public Member Functions

 vnl_diag_matrix_fixed ()
 vnl_diag_matrix_fixed (T const &value)
 Construct a diagonal matrix with diagonal elements equal to value.
 vnl_diag_matrix_fixed (vnl_vector_fixed< T, N > const &that)
 Construct a diagonal matrix from a vnl_vector_fixed.
 ~vnl_diag_matrix_fixed ()
vnl_diag_matrix_fixedoperator= (vnl_diag_matrix_fixed< T, N > const &that)
vnl_diag_matrix_fixed< T, N > & operator*= (T v)
 In-place arithmetic operation.
vnl_diag_matrix_fixed< T, N > & operator/= (T v)
 In-place arithmetic operation.
vnl_diag_matrix_fixedinvert_in_place ()
 Invert a vnl_diag_matrix_fixed in-situ, then returns *this.
determinant () const
 Return determinant as product of diagonal values.
vnl_vector_fixed< T, N > solve (vnl_vector_fixed< T, N > const &b) const
 Return inv(D) * b.
void solve (vnl_vector_fixed< T, N > const &b, vnl_vector_fixed< T, N > *out) const
 Return inv(D) * b.
operator() (unsigned i, unsigned j) const
T & operator() (unsigned i, unsigned j)
T & operator() (unsigned i)
T const & operator() (unsigned i) const
T & operator[] (unsigned i)
T const & operator[] (unsigned i) const
void put (unsigned r, unsigned c, T const &v)
 set element with boundary checks.
get (unsigned r, unsigned c) const
 get element with boundary checks.
vnl_vector_fixed< T, N > get_diagonal () const
 Return a vector (copy) with the content of the (main) diagonal.
vnl_vector_fixed< T, N > const & diagonal () const
 Return diagonal elements as a vector.
vnl_diag_matrix_fixedfill_diagonal (T const &v)
 Set all diagonal elements of matrix to specified value.
vnl_diag_matrix_fixedset_diagonal (vnl_vector_fixed< T, N > const &v)
 Sets the diagonal elements of this matrix to the specified list of values.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
unsigned size () const
unsigned rows () const
unsigned cols () const
unsigned columns () const
vnl_matrix_fixed< T, N, N > as_matrix_fixed () const
 Convert a vnl_diag_matrix_fixed to a Matrix.
vnl_matrix_fixed< T, N, N > as_ref () const
 operator vnl_matrix_fixed< T, N, N > () const
vnl_diag_matrix_fixedfill (T const &x)
T * data_block ()
 Return pointer to the diagonal elements as a contiguous 1D C array;.
T const * data_block () const
vnl_diag_matrix_fixedset (vnl_vector_fixed< T, N > const &v)
 Set diagonal elements using vector, then return *this.

Private Attributes

vnl_vector_fixed< T, N > diagonal_

Related Functions

(Note that these are not member functions.)

template<class T , unsigned int N>
vcl_ostream & operator<< (vcl_ostream &, vnl_diag_matrix_fixed< T, N > const &)
template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator* (vnl_diag_matrix_fixed< T, N > const &A, vnl_diag_matrix_fixed< T, N > const &B)
 Multiply two vnl_diag_matrices. Just multiply the diag elements - n flops.
template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator+ (vnl_diag_matrix_fixed< T, N > const &A, vnl_diag_matrix_fixed< T, N > const &B)
 Add two vnl_diag_matrices. Just add the diag elements - n flops.
template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator- (vnl_diag_matrix_fixed< T, N > const &A, vnl_diag_matrix_fixed< T, N > const &B)
 Subtract two vnl_diag_matrices. Just subtract the diag elements - n flops.

Detailed Description

template<class T, unsigned int N>
class vnl_diag_matrix_fixed< T, N >

stores a diagonal matrix as a single vector.

vnl_diag_matrix_fixed stores a diagonal matrix for time and space efficiency. Specifically, only the diagonal elements are stored, and some matrix operations (currently *, + and -) are overloaded to use more efficient algorithms.

Definition at line 40 of file vnl_diag_matrix_fixed.h.


Member Typedef Documentation

template<class T, unsigned int N>
typedef vnl_vector_fixed<T,N>::const_iterator vnl_diag_matrix_fixed< T, N >::const_iterator

Definition at line 118 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
typedef vnl_vector_fixed<T,N>::iterator vnl_diag_matrix_fixed< T, N >::iterator

Definition at line 115 of file vnl_diag_matrix_fixed.h.


Constructor & Destructor Documentation

template<class T, unsigned int N>
vnl_diag_matrix_fixed< T, N >::vnl_diag_matrix_fixed ( ) [inline]

Definition at line 45 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed< T, N >::vnl_diag_matrix_fixed ( T const &  value) [inline]

Construct a diagonal matrix with diagonal elements equal to value.

Definition at line 49 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed< T, N >::vnl_diag_matrix_fixed ( vnl_vector_fixed< T, N > const &  that) [inline, explicit]

Construct a diagonal matrix from a vnl_vector_fixed.

The vector elements become the diagonal elements.

Definition at line 53 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed< T, N >::~vnl_diag_matrix_fixed ( ) [inline]

Definition at line 54 of file vnl_diag_matrix_fixed.h.


Member Function Documentation

template<class T , unsigned int N>
vnl_matrix_fixed< T, N, N > vnl_diag_matrix_fixed< T, N >::as_matrix_fixed ( ) const [inline]

Convert a vnl_diag_matrix_fixed to a Matrix.

Definition at line 157 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_matrix_fixed<T,N,N> vnl_diag_matrix_fixed< T, N >::as_ref ( ) const [inline]

Definition at line 130 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
iterator vnl_diag_matrix_fixed< T, N >::begin ( ) [inline]

Definition at line 116 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
const_iterator vnl_diag_matrix_fixed< T, N >::begin ( ) const [inline]

Definition at line 119 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
unsigned vnl_diag_matrix_fixed< T, N >::cols ( ) const [inline]

Definition at line 124 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
unsigned vnl_diag_matrix_fixed< T, N >::columns ( ) const [inline]

Definition at line 125 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T* vnl_diag_matrix_fixed< T, N >::data_block ( ) [inline]

Return pointer to the diagonal elements as a contiguous 1D C array;.

Definition at line 138 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T const* vnl_diag_matrix_fixed< T, N >::data_block ( ) const [inline]

Definition at line 139 of file vnl_diag_matrix_fixed.h.

template<class T , unsigned int N>
T vnl_diag_matrix_fixed< T, N >::determinant ( ) const [inline]

Return determinant as product of diagonal values.

Definition at line 186 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_vector_fixed<T,N> const& vnl_diag_matrix_fixed< T, N >::diagonal ( ) const [inline]

Return diagonal elements as a vector.

Definition at line 105 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
iterator vnl_diag_matrix_fixed< T, N >::end ( ) [inline]

Definition at line 117 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
const_iterator vnl_diag_matrix_fixed< T, N >::end ( ) const [inline]

Definition at line 120 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed& vnl_diag_matrix_fixed< T, N >::fill ( T const &  x) [inline]

Definition at line 135 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed& vnl_diag_matrix_fixed< T, N >::fill_diagonal ( T const &  v) [inline]

Set all diagonal elements of matrix to specified value.

Definition at line 108 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T vnl_diag_matrix_fixed< T, N >::get ( unsigned  r,
unsigned  c 
) const [inline]

get element with boundary checks.

Definition at line 97 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_vector_fixed<T,N> vnl_diag_matrix_fixed< T, N >::get_diagonal ( ) const [inline]

Return a vector (copy) with the content of the (main) diagonal.

Definition at line 102 of file vnl_diag_matrix_fixed.h.

template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > & vnl_diag_matrix_fixed< T, N >::invert_in_place ( ) [inline]

Invert a vnl_diag_matrix_fixed in-situ, then returns *this.

Just replaces each element with its reciprocal.

Definition at line 175 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed< T, N >::operator vnl_matrix_fixed< T, N, N > ( ) const [inline]

Definition at line 133 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T vnl_diag_matrix_fixed< T, N >::operator() ( unsigned  i,
unsigned  j 
) const [inline]

Definition at line 77 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T& vnl_diag_matrix_fixed< T, N >::operator() ( unsigned  i,
unsigned  j 
) [inline]

Definition at line 81 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T& vnl_diag_matrix_fixed< T, N >::operator() ( unsigned  i) [inline]

Definition at line 85 of file vnl_diag_matrix_fixed.h.

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

Definition at line 86 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed<T,N>& vnl_diag_matrix_fixed< T, N >::operator*= ( v) [inline]

In-place arithmetic operation.

Definition at line 64 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed<T,N>& vnl_diag_matrix_fixed< T, N >::operator/= ( v) [inline]

In-place arithmetic operation.

Definition at line 66 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed& vnl_diag_matrix_fixed< T, N >::operator= ( vnl_diag_matrix_fixed< T, N > const &  that) [inline]

Definition at line 56 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
T& vnl_diag_matrix_fixed< T, N >::operator[] ( unsigned  i) [inline]

Definition at line 88 of file vnl_diag_matrix_fixed.h.

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

Definition at line 89 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
void vnl_diag_matrix_fixed< T, N >::put ( unsigned  r,
unsigned  c,
T const &  v 
) [inline]

set element with boundary checks.

Definition at line 92 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
unsigned vnl_diag_matrix_fixed< T, N >::rows ( ) const [inline]

Definition at line 123 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed& vnl_diag_matrix_fixed< T, N >::set ( vnl_vector_fixed< T, N > const &  v) [inline]

Set diagonal elements using vector, then return *this.

Definition at line 142 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_diag_matrix_fixed& vnl_diag_matrix_fixed< T, N >::set_diagonal ( vnl_vector_fixed< T, N > const &  v) [inline]

Sets the diagonal elements of this matrix to the specified list of values.

Definition at line 111 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
unsigned vnl_diag_matrix_fixed< T, N >::size ( ) const [inline]

Definition at line 122 of file vnl_diag_matrix_fixed.h.

template<class T, unsigned int N>
vnl_vector_fixed< T, N > vnl_diag_matrix_fixed< T, N >::solve ( vnl_vector_fixed< T, N > const &  b) const

Return inv(D) * b.

Definition at line 14 of file vnl_diag_matrix_fixed.txx.

template<class T, unsigned int N>
void vnl_diag_matrix_fixed< T, N >::solve ( vnl_vector_fixed< T, N > const &  b,
vnl_vector_fixed< T, N > *  out 
) const

Return inv(D) * b.

Definition at line 24 of file vnl_diag_matrix_fixed.txx.


Friends And Related Function Documentation

template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator* ( vnl_diag_matrix_fixed< T, N > const &  A,
vnl_diag_matrix_fixed< T, N > const &  B 
) [related]

Multiply two vnl_diag_matrices. Just multiply the diag elements - n flops.

Definition at line 198 of file vnl_diag_matrix_fixed.h.

template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator+ ( vnl_diag_matrix_fixed< T, N > const &  A,
vnl_diag_matrix_fixed< T, N > const &  B 
) [related]

Add two vnl_diag_matrices. Just add the diag elements - n flops.

Definition at line 236 of file vnl_diag_matrix_fixed.h.

template<class T , unsigned int N>
vnl_diag_matrix_fixed< T, N > operator- ( vnl_diag_matrix_fixed< T, N > const &  A,
vnl_diag_matrix_fixed< T, N > const &  B 
) [related]

Subtract two vnl_diag_matrices. Just subtract the diag elements - n flops.

Definition at line 269 of file vnl_diag_matrix_fixed.h.

template<class T , unsigned int N>
vcl_ostream & operator<< ( vcl_ostream &  ,
vnl_diag_matrix_fixed< T, N > const &   
) [related]

Member Data Documentation

template<class T, unsigned int N>
vnl_vector_fixed<T,N> vnl_diag_matrix_fixed< T, N >::diagonal_ [private]

Definition at line 42 of file vnl_diag_matrix_fixed.h.


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