Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_diag_matrix< T > Class Template Reference

#include <vnl_diag_matrix.h>

Inheritance diagram for vnl_diag_matrix:

Inheritance graph
[legend]
Collaboration diagram for vnl_diag_matrix< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef vnl_vector< T >::iterator iterator
typedef vnl_vector< T >::const_iterator const_iterator

Public Methods

 vnl_diag_matrix ()
 vnl_diag_matrix (unsigned nn)
 vnl_diag_matrix (unsigned nn, T const &value)
 vnl_diag_matrix (vnl_vector< T > const &that)
 ~vnl_diag_matrix ()
vnl_diag_matrix & operator= (vnl_diag_matrix< T > const &that)
vnl_diag_matrix< T > & operator *= (T v)
vnl_diag_matrix< T > & operator/= (T v)
void invert_in_place ()
determinant () const
vnl_vector< T > solve (vnl_vector< T > const &b)
void solve (vnl_vector< T > const &b, vnl_vector< T > *out)
operator() (unsigned i, unsigned j) const
T & operator() (unsigned i, unsigned j)
T & operator() (unsigned i)
T const & operator() (unsigned i) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
unsigned size () const
unsigned n () const
unsigned rows () const
unsigned cols () const
unsigned columns () const
vnl_matrix< T > asMatrix () const
void resize (int n)
void clear ()
T * data_block ()
T const * data_block () const
vnl_vector< T > const & diagonal () const
void set (vnl_vector< T > const &v)

Protected Attributes

vnl_vector< T > diagonal_

Detailed Description

template<class T>
class vnl_diag_matrix< T >

stores a diagonal matrix as a single vector. vnl_diag_matrix 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 38 of file vnl_diag_matrix.h.


Member Typedef Documentation

template<class T>
typedef vnl_vector<T>::const_iterator vnl_diag_matrix< T >::const_iterator
 

Definition at line 92 of file vnl_diag_matrix.h.

template<class T>
typedef vnl_vector<T>::iterator vnl_diag_matrix< T >::iterator
 

Definition at line 89 of file vnl_diag_matrix.h.


Constructor & Destructor Documentation

template<class T>
vnl_diag_matrix< T >::vnl_diag_matrix   [inline]
 

Definition at line 40 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix< T >::vnl_diag_matrix unsigned    nn [inline]
 

Construct an empty diagonal matrix.

Definition at line 44 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix< T >::vnl_diag_matrix unsigned    nn,
T const &    value
[inline]
 

Construct a diagonal matrix with diagonal elements equal to value.

Definition at line 48 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix< T >::vnl_diag_matrix vnl_vector< T > const &    that [inline]
 

Construct a diagonal matrix from a Vector.\ The vector elements become. the diagonal elements.

Definition at line 53 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix< T >::~vnl_diag_matrix   [inline]
 

Definition at line 54 of file vnl_diag_matrix.h.


Member Function Documentation

template<class T>
vnl_matrix< T > vnl_diag_matrix< T >::asMatrix   const [inline]
 

Convert a vnl_diag_matrix to a Matrix.

Definition at line 148 of file vnl_diag_matrix.h.

References vnl_diag_matrix< T >::data_block(), and vnl_diag_matrix< T >::diagonal_.

template<class T>
const_iterator vnl_diag_matrix< T >::begin   const [inline]
 

Definition at line 93 of file vnl_diag_matrix.h.

template<class T>
iterator vnl_diag_matrix< T >::begin   [inline]
 

Definition at line 90 of file vnl_diag_matrix.h.

template<class T>
void vnl_diag_matrix< T >::clear   [inline]
 

Definition at line 106 of file vnl_diag_matrix.h.

template<class T>
unsigned vnl_diag_matrix< T >::cols   const [inline]
 

Definition at line 99 of file vnl_diag_matrix.h.

template<class T>
unsigned vnl_diag_matrix< T >::columns   const [inline]
 

Definition at line 100 of file vnl_diag_matrix.h.

template<class T>
T const* vnl_diag_matrix< T >::data_block   const [inline]
 

Definition at line 111 of file vnl_diag_matrix.h.

template<class T>
T* vnl_diag_matrix< T >::data_block   [inline]
 

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

Definition at line 110 of file vnl_diag_matrix.h.

Referenced by vnl_diag_matrix< T >::asMatrix(), vnl_diag_matrix< T >::invert_in_place(), and operator+().

template<class T>
T vnl_diag_matrix< T >::determinant   const [inline]
 

Return determinant as product of diagonal values.

Definition at line 174 of file vnl_diag_matrix.h.

References vnl_matrix< T >::columns(), and vnl_matrix< T >::rows().

template<class T>
vnl_vector<T> const& vnl_diag_matrix< T >::diagonal   const [inline]
 

Return diagonal elements as a vector.

Definition at line 115 of file vnl_diag_matrix.h.

template<class T>
const_iterator vnl_diag_matrix< T >::end   const [inline]
 

Definition at line 94 of file vnl_diag_matrix.h.

template<class T>
iterator vnl_diag_matrix< T >::end   [inline]
 

Definition at line 91 of file vnl_diag_matrix.h.

template<class T>
void vnl_diag_matrix< T >::invert_in_place   [inline]
 

Invert a vnl_diag_matrix in-situ. Just replaces each element with its reciprocal.

Definition at line 162 of file vnl_diag_matrix.h.

References vnl_diag_matrix< T >::data_block(), and vnl_diag_matrix< T >::diagonal_.

template<class T>
unsigned vnl_diag_matrix< T >::n   const [inline]
 

Definition at line 97 of file vnl_diag_matrix.h.

Referenced by operator+(), and vnl_diag_matrix< vcl_complex< double > >::rows().

template<class T>
vnl_diag_matrix<T>& vnl_diag_matrix< T >::operator *=   v [inline]
 

In-place arithmetic operations.

Definition at line 65 of file vnl_diag_matrix.h.

template<class T>
T const& vnl_diag_matrix< T >::operator() unsigned    i const [inline]
 

Definition at line 86 of file vnl_diag_matrix.h.

template<class T>
T& vnl_diag_matrix< T >::operator() unsigned    i [inline]
 

Definition at line 85 of file vnl_diag_matrix.h.

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

Definition at line 81 of file vnl_diag_matrix.h.

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

Definition at line 77 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix<T>& vnl_diag_matrix< T >::operator/=   v [inline]
 

In-place arithmetic operations.

Definition at line 68 of file vnl_diag_matrix.h.

template<class T>
vnl_diag_matrix& vnl_diag_matrix< T >::operator= vnl_diag_matrix< T > const &    that [inline]
 

Definition at line 57 of file vnl_diag_matrix.h.

template<class T>
void vnl_diag_matrix< T >::resize int    n [inline]
 

Definition at line 105 of file vnl_diag_matrix.h.

template<class T>
unsigned vnl_diag_matrix< T >::rows   const [inline]
 

Definition at line 98 of file vnl_diag_matrix.h.

template<class T>
void vnl_diag_matrix< T >::set vnl_vector< T > const &    v [inline]
 

Set diagonal elements using vector.

Definition at line 119 of file vnl_diag_matrix.h.

template<class T>
unsigned vnl_diag_matrix< T >::size void    const [inline]
 

Definition at line 96 of file vnl_diag_matrix.h.

template<class T>
void vnl_diag_matrix< T >::solve vnl_vector< T > const &    b,
vnl_vector< T > *    out
 

template<class T>
vnl_vector<T> vnl_diag_matrix< T >::solve vnl_vector< T > const &    b
 


Member Data Documentation

template<class T>
vnl_vector<T> vnl_diag_matrix< T >::diagonal_ [protected]
 

Definition at line 122 of file vnl_diag_matrix.h.

Referenced by vnl_diag_matrix< T >::asMatrix(), vnl_diag_matrix< vcl_complex< double > >::begin(), vnl_diag_matrix< vcl_complex< double > >::clear(), vnl_diag_matrix< vcl_complex< double > >::cols(), vnl_diag_matrix< vcl_complex< double > >::columns(), vnl_diag_matrix< vcl_complex< double > >::data_block(), vnl_diag_matrix< vcl_complex< double > >::end(), vnl_diag_matrix< T >::invert_in_place(), vnl_diag_matrix< vcl_complex< double > >::operator()(), vnl_diag_matrix< vcl_complex< double > >::operator/=(), vnl_diag_matrix< vcl_complex< double > >::operator=(), vnl_diag_matrix< vcl_complex< double > >::rows(), and vnl_diag_matrix< vcl_complex< double > >::vnl_diag_matrix().


The documentation for this class was generated from the following file:
Generated at Fri May 21 01:16:45 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000