#include <vnl_matrix.h>
Inheritance diagram for vnl_matrix:
Public Types | |
typedef vnl_c_vector< T >::abs_t | abs_t |
typedef T | element_type |
typedef T * | iterator |
typedef T const * | const_iterator |
Public Methods | |
vnl_matrix () | |
vnl_matrix (unsigned r, unsigned c) | |
vnl_matrix (unsigned r, unsigned c, T const &v0) | |
vnl_matrix (unsigned r, unsigned c, vnl_matrix_type t) | |
vnl_matrix (unsigned r, unsigned c, unsigned n, T const values[]) | |
vnl_matrix (T const *data_block, unsigned r, unsigned c) | |
vnl_matrix (vnl_matrix< T > const &) | |
vnl_matrix (vnl_matrix< T > &that, const vnl_tag_grab &) | |
vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, const vnl_tag_add &) | |
vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, const vnl_tag_sub &) | |
vnl_matrix (vnl_matrix< T > const &, T, const vnl_tag_mul &) | |
vnl_matrix (vnl_matrix< T > const &, T, const vnl_tag_div &) | |
vnl_matrix (vnl_matrix< T > const &, T, const vnl_tag_add &) | |
vnl_matrix (vnl_matrix< T > const &, T, const vnl_tag_sub &) | |
vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, const vnl_tag_mul &) | |
~vnl_matrix () | |
unsigned | rows () const |
unsigned | columns () const |
unsigned | cols () const |
unsigned | size () const |
void | put (unsigned r, unsigned c, T const &) |
T | get (unsigned r, unsigned c) const |
T * | operator[] (unsigned r) |
T const * | operator[] (unsigned r) const |
T & | operator() (unsigned r, unsigned c) |
T const & | operator() (unsigned r, unsigned c) const |
void | fill (T const &) |
void | fill_diagonal (T const &) |
void | copy_in (T const *) |
void | set (T const *d) |
void | copy_out (T *) const |
vnl_matrix< T > & | operator= (T const &v) |
vnl_matrix< T > & | operator= (vnl_matrix< T > const &) |
vnl_matrix< T > & | operator+= (T value) |
vnl_matrix< T > & | operator-= (T value) |
vnl_matrix< T > & | operator *= (T value) |
vnl_matrix< T > & | operator/= (T value) |
vnl_matrix< T > & | operator+= (vnl_matrix< T > const &) |
vnl_matrix< T > & | operator-= (vnl_matrix< T > const &) |
vnl_matrix< T > & | operator *= (vnl_matrix< T > const &rhs) |
vnl_matrix< T > | operator- () const |
vnl_matrix< T > | operator+ (T const &v) const |
vnl_matrix< T > | operator- (T const &v) const |
vnl_matrix< T > | operator * (T const &v) const |
vnl_matrix< T > | operator/ (T const &v) const |
vnl_matrix< T > | operator+ (vnl_matrix< T > const &rhs) const |
vnl_matrix< T > | operator- (vnl_matrix< T > const &rhs) const |
vnl_matrix< T > | operator * (vnl_matrix< T > const &rhs) const |
vnl_matrix< T > | apply (T(*f)(T)) const |
vnl_matrix< T > | apply (T(*f)(T const &)) const |
vnl_matrix< T > | transpose () const |
vnl_matrix< T > | conjugate_transpose () const |
vnl_matrix< T > & | update (vnl_matrix< T > const &, unsigned top=0, unsigned left=0) |
void | set_column (unsigned i, T const *v) |
void | set_column (unsigned i, T value) |
void | set_column (unsigned j, vnl_vector< T > const &v) |
void | set_columns (unsigned starting_column, vnl_matrix< T > const &M) |
void | set_row (unsigned i, T const *v) |
void | set_row (unsigned i, T value) |
void | set_row (unsigned i, vnl_vector< T > const &) |
vnl_matrix< T > | extract (unsigned rows, unsigned cols, unsigned top=0, unsigned left=0) const |
vnl_vector< T > | get_row (unsigned row) const |
vnl_vector< T > | get_column (unsigned col) const |
vnl_matrix< T > | get_n_rows (unsigned rowstart, unsigned n) const |
vnl_matrix< T > | get_n_columns (unsigned colstart, unsigned n) const |
void | set_identity () |
void | inplace_transpose () |
void | flipud () |
void | fliplr () |
void | normalize_rows () |
void | normalize_columns () |
void | scale_row (unsigned row, T value) |
void | scale_column (unsigned col, T value) |
void | swap (vnl_matrix< T > &that) |
abs_t | array_one_norm () const |
abs_t | array_two_norm () const |
abs_t | array_inf_norm () const |
abs_t | absolute_value_sum () const |
abs_t | absolute_value_max () const |
abs_t | operator_one_norm () const |
abs_t | operator_inf_norm () const |
abs_t | frobenius_norm () const |
abs_t | fro_norm () const |
abs_t | rms () const |
T | min_value () const |
T | max_value () const |
T | mean () const |
abs_t | one_norm (void *) const |
abs_t | inf_norm (void *) const |
bool | is_identity (double tol=0) const |
bool | is_zero (double tol=0) const |
bool | is_finite () const |
bool | has_nans () const |
void | assert_size (unsigned rows, unsigned cols) const |
void | assert_finite () const |
bool | read_ascii (vcl_istream &s) |
T const * | data_block () const |
T * | data_block () |
T const *const * | data_array () const |
T ** | data_array () |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
bool | operator_eq (vnl_matrix< T > const &rhs) const |
bool | operator== (vnl_matrix< T > const &that) const |
bool | operator!= (vnl_matrix< T > const &that) const |
void | print (vcl_ostream &os) const |
void | clear () |
bool | resize (unsigned r, unsigned c) |
Static Public Methods | |
vnl_matrix< T > | read (vcl_istream &s) |
Protected Methods | |
void | destroy () |
Static Protected Methods | |
void | inline_function_tickler () |
Protected Attributes | |
unsigned | num_rows |
unsigned | num_cols |
T ** | data |
Note: Unlike the other sequence classes, the vnl_matrix<T> class is fixed-size. It will not grow once the size has been specified to the constructor or changed by the assignment or multiplication operators. The vnl_matrix<T> class is row-based with addresses of rows being cached, and elements accessed as m[row][col].
Note: The matrix can, however, be resized using the resize(nr,nc) function.
Note: Indexing of the matrix is zero-based, so the top-left element is M(0,0).
Note: Inversion of matrix M, and other operations such as solving systems of linear equations are handled by the matrix decomposition classes in vnl/algo, such as matrix_inverse, svd, qr etc.
Note: Use a vnl_vector<T> with these matrices.
Definition at line 85 of file vnl_matrix.h.
|
Type def for norms. Definition at line 426 of file vnl_matrix.h. |
|
Const iterators. Definition at line 557 of file vnl_matrix.h. Referenced by vnl_matrix< vcl_complex< T > >::min_value(), and vnl_matrix< vcl_complex< T > >::rms(). |
|
Definition at line 543 of file vnl_matrix.h. |
|
Iterators. Definition at line 547 of file vnl_matrix.h. Referenced by vnl_matrix< vcl_complex< T > >::fro_norm(), and vnl_matrix< vcl_complex< T > >::frobenius_norm(). |
|
Default constructor creates an empty matrix of size 0,0. Definition at line 89 of file vnl_matrix.h. |
|
Construct a matrix of size r rows by c columns. Contents are unspecified. Complexity /f |
|
Construct a matrix of size r rows by c columns, and all emelemnts equal to v0. Complexity /f |
|
Construct a matrix of size r rows by c columns, with a special type. Contents are specified by t Complexity /f |
|
Construct a matrix of size r rows by c columns, initialised by an automatic array. The first n elements, are initialised row-wise, to values. Complexity /f |
|
Construct a matrix of size r rows by c columns, initialised by a memory block. The values are initialise row wise from the data. Complexity /f |
|
Copy construct a matrix. Complexity /f |
|
Construct a matrix of size r rows by c columns, by taking ownership of another matrixes contents. The other matrix is rezised to empty. Definition at line 133 of file vnl_matrix.h. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Matrix destructor. Definition at line 155 of file vnl_matrix.h. |
|
Return largest absolute value. Definition at line 446 of file vnl_matrix.h. |
|
Return sum of absolute values of elements. Definition at line 442 of file vnl_matrix.h. |
|
Make a new matrix by applying function to each element. |
|
Make a new matrix by applying function to each element. |
|
Return largest absolute element value. Definition at line 438 of file vnl_matrix.h. |
|
Return sum of absolute values of elements. Definition at line 430 of file vnl_matrix.h. |
|
Return square root of sum of squared absolute element values. Definition at line 434 of file vnl_matrix.h. |
|
|
|
|
|
Iterator pointing to start of data. Definition at line 560 of file vnl_matrix.h. |
|
Iterator pointing to start of data. Definition at line 550 of file vnl_matrix.h. |
|
Make the matrix as if it had been default-constructed. |
|
Return number of columns. A synonym for columns() Definition at line 174 of file vnl_matrix.h. Referenced by vnl_matrix< vcl_complex< T > >::operator-(), and vnl_matrix< vcl_complex< T > >::rows(). |
|
Return number of columns. Definition at line 168 of file vnl_matrix.h. Referenced by vnl_transpose::asMatrix(), vnl_diag_matrix< T >::determinant(), vnl_transpose::operator *(), and vnl_matrix_fixed< T, 3, 3 >::vnl_matrix_fixed(). |
|
Return conjugate transpose. |
|
Fill (laminate) this matrix with the given data. We assume that p points to a contiguous rows*cols array, stored rowwise. Referenced by vnl_matrix< vcl_complex< T > >::operator()(). |
|
Fill the given array with this matrix. We assume that p points to a contiguous rows*cols array, stored rowwise. No bounds checking on the array |
|
Access the 2D array, so that elements can be accessed with array[row][col] directly. 2d array, [row][column]. Definition at line 541 of file vnl_matrix.h. |
|
Access the 2D array, so that elements can be accessed with array[row][col] directly. 2d array, [row][column]. Definition at line 536 of file vnl_matrix.h. |
|
Access the contiguous block storing the elements in the matrix row-wise.\ O(1). 1d array, row-major order. Definition at line 531 of file vnl_matrix.h. |
|
Access the contiguous block storing the elements in the matrix row-wise.\ O(1). 1d array, row-major order. Definition at line 526 of file vnl_matrix.h. Referenced by vnl_matrix_fixed< T, 3, 3 >::operator=(), and vnl_matrix_fixed< T, 3, 3 >::vnl_matrix_fixed(). |
|
Delete data. |
|
Iterator pointing to element beyond end of data. Definition at line 563 of file vnl_matrix.h. |
|
Iterator pointing to element beyond end of data. Definition at line 553 of file vnl_matrix.h. |
|
Extract a sub-matrix of size rows x cols, starting at (top,left). Thus it contains elements [top,top+rows-1][left,left+cols-1] |
|
Set all elements of matrix to specified value. Complexity /f Referenced by itk::Matrix< TMatrixElement, VNumberOfRows, VNumberOfRows >::Fill(), and vnl_matrix< vcl_complex< T > >::operator()(). |
|
Set all diagonal elements of matrix to specified value. Complexity /f |
|
Reverse order of columns. |
|
Reverse order of rows. |
|
Return frobenius norm of matrix (sqrt of sum of squares of its elements). Definition at line 460 of file vnl_matrix.h. |
|
Return frobenius norm of matrix (sqrt of sum of squares of its elements). Definition at line 456 of file vnl_matrix.h. |
|
get element with boundary checks if error checking is on. Definition at line 631 of file vnl_matrix.h. |
|
Get a vector equal to the given column. |
|
Get n columns beginning at colstart. |
|
Get n rows beginning at rowstart. |
|
Get a vector equal to the given row. Referenced by vnl_complex_eigensystem::eigen_value(), and vnl_complex_eigensystem::left_eigen_vector(). |
|
Return true if matrix contains NaNs. |
|
Definition at line 485 of file vnl_matrix.h. |
|
|
|
Transpose this matrix efficiently. |
|
Return true if finite. |
|
Return true if all elements equal to identity, within given tolerance. |
|
Return true if all elements equal to zero, within given tolerance. |
|
Return maximum value of elements. Definition at line 472 of file vnl_matrix.h. |
|
Return mean of all matrix elements. Definition at line 476 of file vnl_matrix.h. |
|
Return minimum value of elements. Definition at line 468 of file vnl_matrix.h. |
|
Normalize each column so it is a unit vector. Zero columns are ignored |
|
Normalize each row so it is a unit vector. Zero rows are ignored |
|
Definition at line 484 of file vnl_matrix.h. |
|
Matrix multiply lhs by rhs matrix and return result in new matrix. Definition at line 309 of file vnl_matrix.h. |
|
Scalar multiplication of lhs matrix by rhs and return result in new matrix. Definition at line 295 of file vnl_matrix.h. |
|
Multiply lhs matrix in situ by rhs. Definition at line 278 of file vnl_matrix.h. |
|
Scalar multiplication in situ of lhs matrix by rhs. |
|
Inequality operator. Definition at line 577 of file vnl_matrix.h. |
|
Access an element for reading. no boundary checks here. meant to be fast. Definition at line 207 of file vnl_matrix.h. |
|
Access an element for reading or writing. no boundary checks here. meant to be fast. Definition at line 202 of file vnl_matrix.h. |
|
Matrix add rhs to lhs matrix and return result in new matrix. Definition at line 303 of file vnl_matrix.h. |
|
Add rhs to each element of lhs matrix and return result in new matrix. Definition at line 287 of file vnl_matrix.h. |
|
Add rhs to lhs matrix in situ. |
|
Add rhs to each element of lhs matrix in situ. |
|
Matrix subtract rhs from lhs and return result in new matrix. Definition at line 306 of file vnl_matrix.h. |
|
Subtract rhs from each element of lhs matrix and return result in new matrix. Definition at line 291 of file vnl_matrix.h. |
|
Negate all elements of matrix. |
|
Subtract rhs from lhs matrix in situ. |
|
Subtract rhs from each element of lhs matrix in situ. |
|
Scalar division of lhs matrix by rhs and return result in new matrix. Definition at line 299 of file vnl_matrix.h. |
|
Scalar division of lhs matrix in situ by rhs. |
|
Copies all elements of rhs matrix into lhs matrix. Complexity /f |
|
Set all elements to value v. Complexity /f Definition at line 243 of file vnl_matrix.h. |
|
Equality operator. Definition at line 573 of file vnl_matrix.h. |
|
return pointer to given row. No boundary checking here. Definition at line 197 of file vnl_matrix.h. |
|
return pointer to given row. No boundary checking here. Definition at line 192 of file vnl_matrix.h. |
|
Return true if *this == rhs. Referenced by vnl_matrix< vcl_complex< T > >::mean(). |
|
|
|
|
|
Print matrix to os in some hopefully sensible format. |
|
set element with boundary checks if error checking is on. Definition at line 646 of file vnl_matrix.h. |
|
|
|
|
|
Resize to r rows by c columns.\ Old data lost. returns true if size changed. Reimplemented in vnl_matrix_fixed_ref< T, m, n >, vnl_matrix_fixed_ref< TScalarType, m, n >, and vnl_matrix_fixed_ref< double, m, n >. |
|
Return RMS of all elements. Definition at line 464 of file vnl_matrix.h. |
|
Return number of rows. Definition at line 164 of file vnl_matrix.h. Referenced by vnl_diag_matrix< T >::determinant(), vnl_transpose::operator *(), vnl_matrix< vcl_complex< T > >::operator-(), vnl_matrix< vcl_complex< T > >::rows(), and vnl_matrix_fixed< T, 3, 3 >::vnl_matrix_fixed(). |
|
Scale elements in given column by a factor of T. |
|
Scale elements in given row by a factor of T. |
|
Fill (laminate) this matrix with the given data. A synonym for copy_in() Definition at line 230 of file vnl_matrix.h. |
|
Set j-th colum to v. |
|
Set the elements of the i'th column to value. |
|
Set the elements of the i'th column to v[j] (No bounds checking). |
|
Set columns to those in M, starting at starting_column. |
|
Set this matrix to an identity matrix. Abort if the matrix is not square Referenced by itk::KalmanLinearEstimator< T, VEstimatorDimension >::ClearVariance(), itk::Matrix< TMatrixElement, VNumberOfRows, VNumberOfRows >::SetIdentity(), and itk::KalmanLinearEstimator< T, VEstimatorDimension >::SetVariance(). |
|
Set the i-th row. |
|
Set the elements of the i'th row to value. |
|
Set the elements of the i'th row to v[j] (No bounds checking). |
|
Return number of elements. This equals rows() * cols() Definition at line 179 of file vnl_matrix.h. |
|
Swap this matrix with that matrix. |
|
Return transpose. Referenced by vnl_symmetric_eigensystem< T >::nullvector(), vnl_transpose::operator vnl_matrix(), and vnl_transpose::vnl_transpose(). |
|
Set values of this matrix to those of M, starting at [top,left]. |
|
|
Definition at line 596 of file vnl_matrix.h. Referenced by vnl_matrix< vcl_complex< T > >::data_block(), vnl_matrix< vcl_complex< T > >::fro_norm(), vnl_matrix< vcl_complex< T > >::inf_norm(), vnl_matrix< vcl_complex< T > >::min_value(), and vnl_matrix< vcl_complex< T > >::~vnl_matrix(). |
|
Definition at line 595 of file vnl_matrix.h. Referenced by vnl_matrix< vcl_complex< T > >::data_block(), vnl_matrix< vcl_complex< T > >::fro_norm(), vnl_matrix< vcl_complex< T > >::inf_norm(), and vnl_matrix< vcl_complex< T > >::min_value(). |