stores a symmetric matrix as just the diagonal and lower triangular part. More...
#include <vnl_sym_matrix.h>
Public Types | |
| typedef T * | iterator |
| typedef const T * | const_iterator |
Public Member Functions | |
| vnl_sym_matrix () | |
| Construct an empty symmetric matrix. More... | |
| vnl_sym_matrix (unsigned nn) | |
| Construct a symmetric matrix of size nn by nn. More... | |
| vnl_sym_matrix (T const *data, unsigned nn) | |
| Construct a symmetric matrix with elements equal to data. More... | |
| vnl_sym_matrix (unsigned nn, const T &value) | |
| Construct a symmetric matrix with all elements equal to value. More... | |
| vnl_sym_matrix (vnl_matrix< T > const &that) | |
| Construct a symmetric matrix from a full matrix. More... | |
| vnl_sym_matrix (vnl_sym_matrix< T > const &that) | |
| Copy constructor. More... | |
| ~vnl_sym_matrix () | |
| vnl_sym_matrix< T > & | operator= (vnl_sym_matrix< T > const &that) |
| vnl_sym_matrix< T > & | operator *= (T v) |
| In-place arithmetic operations. More... | |
| vnl_sym_matrix< T > & | operator/= (T v) |
| In-place arithmetic operations. More... | |
| T | operator() (unsigned i, unsigned j) const |
| T & | operator() (unsigned i, unsigned j) |
| const T * | operator [] (unsigned i) const |
| Access a half-row of data. More... | |
| T | fast (unsigned i, unsigned j) const |
| fast access, however i >= j. More... | |
| T & | fast (unsigned i, unsigned j) |
| fast access, however i >= j. More... | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| unsigned int | size () const |
| Return the total number of elements stored by the matrix. More... | |
| unsigned int | rows () const |
| Return the number of rows. More... | |
| unsigned int | cols () const |
| Return the number of columns. More... | |
| unsigned int | columns () const |
| Return the number of columns. More... | |
| void | put (unsigned r, unsigned c, T const &v) |
| set element. More... | |
| T | get (unsigned r, unsigned c) const |
| get element. More... | |
| vnl_matrix< T > | as_matrix () const |
| Convert a vnl_sym_matrix to a vnl_matrix. More... | |
| void | set_size (int n) |
| Resize matrix to n by n. More... | |
| T * | data_block () |
| Return pointer to the lower triangular elements as a contiguous 1D C array;. More... | |
| T const * | data_block () const |
| Return pointer to the lower triangular elements as a contiguous 1D C array;. More... | |
| void | set_half_row (const vnl_vector< T > &half_row, unsigned i) |
| Set the first i values of row i. More... | |
| vnl_sym_matrix< T > & | update (vnl_sym_matrix< T > const &m, unsigned diag_start=0) |
| Replaces the symmetric submatrix of THIS matrix with the elements of matrix m. More... | |
| void | swap (vnl_sym_matrix &m) |
| Swap contents of m with THIS. More... | |
Protected Member Functions | |
| void | setup_index () |
| Set up the index array. More... | |
Protected Attributes | |
| T * | data_ |
| T ** | index_ |
| unsigned | nn_ |
Related Functions | |
(Note that these are not member functions.) | |
| template<class T > | |
| void | vsl_b_write (vsl_b_ostream &os, const vnl_sym_matrix< T > &v) |
| Binary save vnl_matrix to stream. More... | |
| template<class T > | |
| void | vsl_b_read (vsl_b_istream &is, vnl_sym_matrix< T > &v) |
| Binary load vnl_matrix from stream. More... | |
| template<class T > | |
| void | vsl_print_summary (std::ostream &os, const vnl_sym_matrix< T > &b) |
| Print human readable summary of object to a stream. More... | |
| template<class T > | |
| VNL_EXPORT vnl_sym_matrix< std::complex< T > > | vnl_complexify (vnl_sym_matrix< T > const &R) |
| Return complexified version of real symmetric matrix R. More... | |
| template<class T > | |
| VNL_EXPORT vnl_sym_matrix< T > | vnl_imag (vnl_sym_matrix< std::complex< T > > const &C) |
| Matrix of imaginary parts of vnl_sym_matrix<std::complex<T> >. More... | |
| template<class T > | |
| VNL_EXPORT vnl_sym_matrix< T > | vnl_real (vnl_sym_matrix< std::complex< T > > const &C) |
| Matrix of real parts of vnl_sym_matrix<std::complex<T> >. More... | |
| template<class T > | |
| VNL_EXPORT std::ostream & | operator<< (std::ostream &, vnl_sym_matrix< T > const &) |
| template<class T > | |
| void | swap (vnl_sym_matrix< T > &a, vnl_sym_matrix< T > &b) |
| Swap the contents of a and b. More... | |
stores a symmetric matrix as just the diagonal and lower triangular part.
vnl_sym_matrix stores a symmetric matrix for time and space efficiency. Specifically, only the diagonal and lower triangular elements are stored.
Definition at line 20 of file vnl_sym_matrix.h.
| typedef const T* vnl_sym_matrix< T >::const_iterator |
Definition at line 100 of file vnl_sym_matrix.h.
| typedef T* vnl_sym_matrix< T >::iterator |
Definition at line 97 of file vnl_sym_matrix.h.
|
inline |
Construct an empty symmetric matrix.
Definition at line 31 of file vnl_sym_matrix.h.
|
inlineexplicit |
Construct a symmetric matrix of size nn by nn.
Definition at line 34 of file vnl_sym_matrix.h.
|
inline |
Construct a symmetric matrix with elements equal to data.
Value should be stored row-wise, and contain the n*(n+1)/2 diagonal and lower triangular elements
Definition at line 184 of file vnl_sym_matrix.h.
|
inline |
Construct a symmetric matrix with all elements equal to value.
Definition at line 196 of file vnl_sym_matrix.h.
|
inlineexplicit |
Construct a symmetric matrix from a full matrix.
If NDEBUG is set, the symmetry of the matrix will be asserted.
Definition at line 207 of file vnl_sym_matrix.h.
|
inline |
Copy constructor.
Definition at line 223 of file vnl_sym_matrix.h.
| vnl_sym_matrix< T >::~vnl_sym_matrix | ( | ) |
Definition at line 62 of file vnl_sym_matrix.hxx.
|
inline |
Convert a vnl_sym_matrix to a vnl_matrix.
Definition at line 232 of file vnl_sym_matrix.h.
|
inline |
Definition at line 98 of file vnl_sym_matrix.h.
|
inline |
Definition at line 101 of file vnl_sym_matrix.h.
|
inline |
Return the number of columns.
A synonym for columns().
Definition at line 115 of file vnl_sym_matrix.h.
|
inline |
Return the number of columns.
A synonym for cols().
Definition at line 119 of file vnl_sym_matrix.h.
|
inline |
Return pointer to the lower triangular elements as a contiguous 1D C array;.
Definition at line 154 of file vnl_sym_matrix.h.
|
inline |
Return pointer to the lower triangular elements as a contiguous 1D C array;.
Definition at line 156 of file vnl_sym_matrix.h.
|
inline |
Definition at line 99 of file vnl_sym_matrix.h.
|
inline |
Definition at line 102 of file vnl_sym_matrix.h.
|
inline |
fast access, however i >= j.
Definition at line 84 of file vnl_sym_matrix.h.
|
inline |
fast access, however i >= j.
Definition at line 90 of file vnl_sym_matrix.h.
|
inline |
get element.
Definition at line 134 of file vnl_sym_matrix.h.
|
inline |
In-place arithmetic operations.
Definition at line 61 of file vnl_sym_matrix.h.
|
inline |
Access a half-row of data.
Only the first i+1 values from this pointer are valid.
Definition at line 78 of file vnl_sym_matrix.h.
|
inline |
Definition at line 68 of file vnl_sym_matrix.h.
|
inline |
Definition at line 72 of file vnl_sym_matrix.h.
|
inline |
In-place arithmetic operations.
Definition at line 63 of file vnl_sym_matrix.h.
| vnl_sym_matrix< T > & vnl_sym_matrix< T >::operator= | ( | vnl_sym_matrix< T > const & | that | ) |
Definition at line 52 of file vnl_sym_matrix.hxx.
|
inline |
set element.
Definition at line 122 of file vnl_sym_matrix.h.
|
inline |
Return the number of rows.
Definition at line 111 of file vnl_sym_matrix.h.
| void vnl_sym_matrix< T >::set_half_row | ( | const vnl_vector< T > & | half_row, |
| unsigned | i | ||
| ) |
Set the first i values of row i.
or the top i values of column i
Definition at line 80 of file vnl_sym_matrix.hxx.
|
inline |
Resize matrix to n by n.
You will loose any existing data.
Definition at line 243 of file vnl_sym_matrix.h.
|
protected |
Set up the index array.
Definition at line 70 of file vnl_sym_matrix.hxx.
|
inline |
Return the total number of elements stored by the matrix.
Since vnl_sym_matrix only stores the diagonal and lower triangular elements and must be square, this returns n*(n+1)/2, where n == rows() == cols().
Definition at line 108 of file vnl_sym_matrix.h.
| void vnl_sym_matrix< T >::swap | ( | vnl_sym_matrix< T > & | m | ) |
Swap contents of m with THIS.
Definition at line 36 of file vnl_sym_matrix.hxx.
| vnl_sym_matrix< T > & vnl_sym_matrix< T >::update | ( | vnl_sym_matrix< T > const & | m, |
| unsigned | diagonal_start = 0 |
||
| ) |
Replaces the symmetric submatrix of THIS matrix with the elements of matrix m.
Replaces the symmetric submatrix of THIS matrix, starting at top left corner, by the elements of matrix m.
Starting at top left corner. Complexity is
.
O(m*m).
Definition at line 18 of file vnl_sym_matrix.hxx.
|
related |
|
related |
Swap the contents of a and b.
Definition at line 268 of file vnl_sym_matrix.h.
|
related |
Return complexified version of real symmetric matrix R.
Definition at line 75 of file vnl_complex_ops.hxx.
|
related |
Matrix of imaginary parts of vnl_sym_matrix<std::complex<T> >.
Definition at line 266 of file vnl_complex_ops.hxx.
|
related |
Matrix of real parts of vnl_sym_matrix<std::complex<T> >.
Definition at line 195 of file vnl_complex_ops.hxx.
|
related |
Binary load vnl_matrix from stream.
|
related |
Binary save vnl_matrix to stream.
|
related |
Print human readable summary of object to a stream.
|
protected |
Definition at line 173 of file vnl_sym_matrix.h.
|
protected |
Definition at line 174 of file vnl_sym_matrix.h.
|
protected |
Definition at line 175 of file vnl_sym_matrix.h.
1.8.15