Fixed size, stack-stored, space-efficient matrix. More...
#include <vnl_matrix_fixed.h>
Public Types | |
typedef vnl_matrix_fixed< T, num_rows, num_cols > | self |
typedef unsigned int | size_type |
typedef vnl_c_vector< T >::abs_t | abs_t |
Type def for norms. | |
typedef T | element_type |
typedef T * | iterator |
Iterators. | |
typedef T const * | const_iterator |
Const iterators. | |
Public Member Functions | |
vnl_matrix_fixed () | |
Construct an empty num_rows*num_cols matrix. | |
vnl_matrix_fixed (unsigned n, unsigned m) | |
Construct an empty num_rows*num_cols matrix. | |
vnl_matrix_fixed (T value) | |
Construct an m*n matrix and fill with value. | |
vnl_matrix_fixed (const T *datablck) | |
Construct an m*n Matrix and copy data into it row-wise. | |
vnl_matrix_fixed (const vnl_matrix_fixed &rhs) | |
Construct an m*n Matrix and copy rhs into it. | |
vnl_matrix_fixed (const vnl_matrix< T > &rhs) | |
Construct an m*n Matrix and copy rhs into it. | |
~vnl_matrix_fixed () | |
vnl_matrix_fixed & | operator= (T const &v) |
Set all elements to value v. | |
vnl_matrix_fixed & | operator= (const vnl_matrix< T > &rhs) |
Copy a vnl_matrix into this. | |
vnl_matrix_fixed & | operator= (const vnl_matrix_fixed &rhs) |
Copy another vnl_matrix_fixed<T,m,n> into this. | |
unsigned | rows () const |
Return number of rows. | |
unsigned | columns () const |
Return number of columns. | |
unsigned | cols () const |
Return number of columns. | |
unsigned | size () const |
Return number of elements. | |
void | put (unsigned r, unsigned c, T const &v) |
set element. | |
vnl_matrix_fixed & | set (unsigned r, unsigned c, T const &v) |
set element, and return *this. | |
T | get (unsigned r, unsigned c) const |
get element. | |
T * | operator[] (unsigned r) |
return pointer to given row. | |
T const * | operator[] (unsigned r) const |
return pointer to given row. | |
T & | operator() (unsigned r, unsigned c) |
Access an element for reading or writing. | |
T const & | operator() (unsigned r, unsigned c) const |
Access an element for reading. | |
vnl_matrix_fixed & | fill (T) |
Sets all elements of matrix to specified value, and returns "*this". | |
vnl_matrix_fixed & | fill_diagonal (T) |
Sets all diagonal elements of matrix to specified value; returns "*this". | |
vnl_matrix_fixed & | set_diagonal (vnl_vector< T > const &) |
Sets the diagonal elements of this matrix to the specified list of values. | |
vnl_matrix_fixed & | copy_in (T const *) |
Fills (laminates) this matrix with the given data, then returns it. | |
vnl_matrix_fixed & | set (T const *d) |
Fills (laminates) this matrix with the given data, then returns it. | |
void | copy_out (T *) const |
Fills the given array with this matrix. | |
vnl_matrix_fixed & | inplace_transpose () |
Transposes this matrix efficiently, if it is square, and returns it. | |
vnl_matrix_fixed & | operator+= (T s) |
Add s to each element of lhs matrix in situ. | |
vnl_matrix_fixed & | operator-= (T s) |
Subtract s from each element of lhs matrix in situ. | |
vnl_matrix_fixed & | operator*= (T s) |
vnl_matrix_fixed & | operator/= (T s) |
vnl_matrix_fixed & | operator+= (vnl_matrix_fixed const &m) |
vnl_matrix_fixed & | operator+= (vnl_matrix< T > const &m) |
vnl_matrix_fixed & | operator-= (vnl_matrix_fixed const &m) |
vnl_matrix_fixed & | operator-= (vnl_matrix< T > const &m) |
vnl_matrix_fixed | operator- () const |
Negate all elements of matrix. | |
vnl_matrix_fixed & | operator*= (vnl_matrix_fixed< T, num_cols, num_cols > const &s) |
vnl_matrix_fixed | apply (T(*f)(T)) const |
Make a new matrix by applying function to each element. | |
vnl_matrix_fixed | apply (T(*f)(T const &)) const |
Make a new matrix by applying function to each element. | |
vnl_matrix_fixed< T, num_cols, num_rows > | transpose () const |
Return transpose. | |
vnl_matrix_fixed< T, num_cols, num_rows > | conjugate_transpose () const |
Return conjugate transpose. | |
vnl_matrix_fixed & | update (vnl_matrix< T > const &, unsigned top=0, unsigned left=0) |
Set values of this matrix to those of M, starting at [top,left]. | |
vnl_matrix_fixed & | set_column (unsigned i, T const *v) |
Set the elements of the i'th column to v[i] (No bounds checking). | |
vnl_matrix_fixed & | set_column (unsigned i, T value) |
Set the elements of the i'th column to value, then return *this. | |
vnl_matrix_fixed & | set_column (unsigned j, vnl_vector< T > const &v) |
Set j-th column to v, then return *this. | |
vnl_matrix_fixed & | set_column (unsigned j, vnl_vector_fixed< T, num_rows > const &v) |
Set j-th column to v, then return *this. | |
vnl_matrix_fixed & | set_columns (unsigned starting_column, vnl_matrix< T > const &M) |
Set columns to those in M, starting at starting_column, then return *this. | |
vnl_matrix_fixed & | set_row (unsigned i, T const *v) |
Set the elements of the i'th row to v[i] (No bounds checking). | |
vnl_matrix_fixed & | set_row (unsigned i, T value) |
Set the elements of the i'th row to value, then return *this. | |
vnl_matrix_fixed & | set_row (unsigned i, vnl_vector< T > const &) |
Set the i-th row, then return *this. | |
vnl_matrix_fixed & | set_row (unsigned i, vnl_vector_fixed< T, num_cols > const &) |
Set the i-th row, then return *this. | |
vnl_matrix< T > | extract (unsigned r, unsigned c, unsigned top=0, unsigned left=0) const |
Extract a sub-matrix of size r x c, starting at (top,left). | |
void | extract (vnl_matrix< T > &sub_matrix, unsigned top=0, unsigned left=0) const |
Extract a sub-matrix starting at (top,left). | |
vnl_vector_fixed< T, num_cols > | get_row (unsigned row) const |
Get a vector equal to the given row. | |
vnl_vector_fixed< T, num_rows > | get_column (unsigned col) const |
Get a vector equal to the given column. | |
vnl_matrix< T > | get_n_rows (unsigned rowstart, unsigned n) const |
Get n rows beginning at rowstart. | |
vnl_matrix< T > | get_n_columns (unsigned colstart, unsigned n) const |
Get n columns beginning at colstart. | |
vnl_vector< T > | get_diagonal () const |
Return a vector with the content of the (main) diagonal. | |
vnl_matrix_fixed & | set_identity () |
Sets this matrix to an identity matrix, then returns "*this". | |
vnl_matrix_fixed & | flipud () |
Reverses the order of rows, and returns "*this". | |
vnl_matrix_fixed & | fliplr () |
Reverses the order of columns, and returns "*this". | |
vnl_matrix_fixed & | normalize_rows () |
Normalizes each row so it is a unit vector, and returns "*this". | |
vnl_matrix_fixed & | normalize_columns () |
Normalizes each column so it is a unit vector, and returns "*this". | |
vnl_matrix_fixed & | scale_row (unsigned row, T value) |
Scales elements in given row by a factor T, and returns "*this". | |
vnl_matrix_fixed & | scale_column (unsigned col, T value) |
Scales elements in given column by a factor T, and returns "*this". | |
abs_t | array_one_norm () const |
Return sum of absolute values of elements. | |
abs_t | array_two_norm () const |
Return square root of sum of squared absolute element values. | |
abs_t | array_inf_norm () const |
Return largest absolute element value. | |
abs_t | absolute_value_sum () const |
Return sum of absolute values of elements. | |
abs_t | absolute_value_max () const |
Return largest absolute value. | |
abs_t | operator_one_norm () const |
abs_t | operator_inf_norm () const |
abs_t | frobenius_norm () const |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements). | |
abs_t | fro_norm () const |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements). | |
abs_t | rms () const |
Return RMS of all elements. | |
T | min_value () const |
Return minimum value of elements. | |
T | max_value () const |
Return maximum value of elements. | |
unsigned | arg_min () const |
Return location of minimum value of elements. | |
unsigned | arg_max () const |
Return location of maximum value of elements. | |
T | mean () const |
Return mean of all matrix elements. | |
bool | empty () const |
Return true iff the size is zero. | |
bool | is_identity () const |
Return true if all elements equal to identity. | |
bool | is_identity (double tol) const |
Return true if all elements equal to identity, within given tolerance. | |
bool | is_zero () const |
Return true if all elements equal to zero. | |
bool | is_zero (double tol) const |
Return true if all elements equal to zero, within given tolerance. | |
bool | is_finite () const |
Return true if finite. | |
bool | has_nans () const |
Return true if matrix contains NaNs. | |
void | assert_size (unsigned nr_rows, unsigned nr_cols) const |
abort if size is not as expected. | |
void | assert_finite () const |
abort if matrix contains any INFs or NANs. | |
bool | read_ascii (vcl_istream &s) |
T const * | data_block () const |
Access the contiguous block storing the elements in the matrix row-wise. O(1). | |
T * | data_block () |
Access the contiguous block storing the elements in the matrix row-wise. O(1). | |
vnl_matrix_ref< T > | as_ref () |
Explicit conversion to a vnl_matrix_ref. | |
const vnl_matrix_ref< T > | as_ref () const |
Explicit conversion to a vnl_matrix_ref. | |
operator const vnl_matrix_ref< T > () const | |
Cheap conversion to vnl_matrix_ref. | |
const vnl_matrix< T > | as_matrix () const |
Convert to a vnl_matrix. | |
iterator | begin () |
Iterator pointing to start of data. | |
iterator | end () |
Iterator pointing to element beyond end of data. | |
const_iterator | begin () const |
Iterator pointing to start of data. | |
const_iterator | end () const |
Iterator pointing to element beyond end of data. | |
bool | operator_eq (vnl_matrix_fixed const &rhs) const |
Return true if *this == rhs. | |
bool | operator== (vnl_matrix_fixed const &that) const |
Equality operator. | |
bool | operator!= (vnl_matrix_fixed const &that) const |
Inequality operator. | |
bool | operator== (vnl_matrix< T > const &that) const |
Equality operator. | |
bool | operator!= (vnl_matrix< T > const &that) const |
Inequality operator. | |
void | print (vcl_ostream &os) const |
Print matrix to os in some hopefully sensible format. | |
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) |
static bool | equal (const T *a, const T *b) |
Private Member Functions | |
void | assert_finite_internal () const |
void | assert_size_internal (unsigned, unsigned) const |
Private Attributes | |
T | data_ [num_rows][num_cols] |
Fixed size, stack-stored, space-efficient matrix.
vnl_matrix_fixed is a fixed-length, stack storage vector. It has the same storage size as a C-style array. It is not related via inheritance to vnl_matrix. However, it can be converted cheaply to a vnl_matrix_ref.
Read the overview documentation of vnl_vector_fixed. The text there applies here.
Definition at line 111 of file vnl_matrix_fixed.h.
typedef vnl_c_vector<T>::abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::abs_t |
Type def for norms.
Definition at line 553 of file vnl_matrix_fixed.h.
typedef T const* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::const_iterator |
Const iterators.
Definition at line 700 of file vnl_matrix_fixed.h.
typedef T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::element_type |
Definition at line 690 of file vnl_matrix_fixed.h.
typedef T* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::iterator |
Iterators.
Definition at line 693 of file vnl_matrix_fixed.h.
typedef vnl_matrix_fixed<T,num_rows,num_cols> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::self |
Definition at line 116 of file vnl_matrix_fixed.h.
typedef unsigned int VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::size_type |
Definition at line 117 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::~vnl_matrix_fixed | ( | ) | [inline] |
Definition at line 167 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::absolute_value_max | ( | ) | const [inline] |
Return largest absolute value.
Definition at line 568 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::absolute_value_sum | ( | ) | const [inline] |
Return sum of absolute values of elements.
Definition at line 565 of file vnl_matrix_fixed.h.
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::add | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [static] |
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::add | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [static] |
vnl_matrix_fixed VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::apply | ( | T(*)(T) | f | ) | const |
Make a new matrix by applying function to each element.
vnl_matrix_fixed VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::apply | ( | T(*)(T const &) | f | ) | const |
Make a new matrix by applying function to each element.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::arg_max | ( | ) | const [inline] |
Return location of maximum value of elements.
Definition at line 595 of file vnl_matrix_fixed.h.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::arg_min | ( | ) | const [inline] |
Return location of minimum value of elements.
Definition at line 592 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::array_inf_norm | ( | ) | const [inline] |
Return largest absolute element value.
Definition at line 562 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::array_one_norm | ( | ) | const [inline] |
Return sum of absolute values of elements.
Definition at line 556 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::array_two_norm | ( | ) | const [inline] |
Return square root of sum of squared absolute element values.
Definition at line 559 of file vnl_matrix_fixed.h.
const vnl_matrix<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::as_matrix | ( | ) | const [inline] |
Convert to a vnl_matrix.
Definition at line 686 of file vnl_matrix_fixed.h.
vnl_matrix_ref<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::as_ref | ( | ) | [inline] |
Explicit conversion to a vnl_matrix_ref.
This is a cheap conversion for those functions that have an interface for vnl_matrix but not for vnl_matrix_fixed. There is also a conversion operator that should work most of the time.
Definition at line 670 of file vnl_matrix_fixed.h.
const vnl_matrix_ref<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::as_ref | ( | ) | const [inline] |
Explicit conversion to a vnl_matrix_ref.
This is a cheap conversion for those functions that have an interface for vnl_matrix but not for vnl_matrix_fixed. There is also a conversion operator that should work most of the time.
Definition at line 677 of file vnl_matrix_fixed.h.
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::assert_finite | ( | ) | const [inline] |
abort if matrix contains any INFs or NANs.
This function does or tests nothing if NDEBUG is defined
Definition at line 634 of file vnl_matrix_fixed.h.
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::assert_finite_internal | ( | ) | const [private] |
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::assert_size | ( | unsigned | nr_rows, |
unsigned | nr_cols | ||
) | const [inline] |
abort if size is not as expected.
This function does or tests nothing if NDEBUG is defined
Definition at line 625 of file vnl_matrix_fixed.h.
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::assert_size_internal | ( | unsigned | , |
unsigned | |||
) | const [private] |
iterator VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::begin | ( | ) | [inline] |
Iterator pointing to start of data.
Definition at line 695 of file vnl_matrix_fixed.h.
const_iterator VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::begin | ( | ) | const [inline] |
Iterator pointing to start of data.
Definition at line 702 of file vnl_matrix_fixed.h.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::cols | ( | ) | const [inline] |
Return number of columns.
A synonym for columns()
Definition at line 200 of file vnl_matrix_fixed.h.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::columns | ( | ) | const [inline] |
vnl_matrix_fixed<T,num_cols,num_rows> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::conjugate_transpose | ( | ) | const |
Return conjugate transpose.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::copy_in | ( | T const * | ) |
Fills (laminates) this matrix with the given data, then returns it.
We assume that the argument points to a contiguous rows*cols array, stored rowwise. No bounds checking on the array. Returning "*this" allows "chaining" two or more operations: e.g., to fill a square matrix column-wise, fill it rowwise then transpose:
M.copy_in(array).inplace_transpose();
Returning "*this" also allows passing a filled-in matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,3,3>().copy_in(array));
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::copy_out | ( | T * | ) | const |
Fills the given array with this matrix.
We assume that the argument points to a contiguous rows*cols array, stored rowwise. No bounds checking on the array.
T const* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::data_block | ( | ) | const [inline] |
Access the contiguous block storing the elements in the matrix row-wise. O(1).
1d array, row-major order.
Definition at line 650 of file vnl_matrix_fixed.h.
T* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::data_block | ( | ) | [inline] |
Access the contiguous block storing the elements in the matrix row-wise. O(1).
1d array, row-major order.
Definition at line 654 of file vnl_matrix_fixed.h.
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::div | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [static] |
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::div | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [static] |
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::empty | ( | ) | const [inline] |
Return true iff the size is zero.
Definition at line 603 of file vnl_matrix_fixed.h.
iterator VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::end | ( | ) | [inline] |
Iterator pointing to element beyond end of data.
Definition at line 697 of file vnl_matrix_fixed.h.
const_iterator VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::end | ( | ) | const [inline] |
Iterator pointing to element beyond end of data.
Definition at line 704 of file vnl_matrix_fixed.h.
static bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::equal | ( | const T * | a, |
const T * | b | ||
) | [static] |
vnl_matrix<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::extract | ( | unsigned | r, |
unsigned | c, | ||
unsigned | top = 0 , |
||
unsigned | left = 0 |
||
) | const |
Extract a sub-matrix of size r x c, starting at (top,left).
Thus it contains elements [top,top+r-1][left,left+c-1]
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::extract | ( | vnl_matrix< T > & | sub_matrix, |
unsigned | top = 0 , |
||
unsigned | left = 0 |
||
) | const |
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::fill | ( | T | ) |
Sets all elements of matrix to specified value, and returns "*this".
Complexity Returning "*this" allows "chaining" two or more operations: e.g., to set a matrix to a column-normalized all-elements-equal matrix, say
M.fill(1).normalize_columns();
Returning "*this" also allows passing such a matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,5,5>(1.0).normalize_columns());
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::fill_diagonal | ( | T | ) |
Sets all diagonal elements of matrix to specified value; returns "*this".
Complexity Returning "*this" allows "chaining" two or more operations: e.g., to set a 3x3 matrix to [5 0 0][0 10 0][0 0 15], just say
M.fill_diagonal(5).scale_row(1,2).scale_column(2,3);
Returning "*this" also allows passing a diagonal-filled matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,3,3>().fill_diagonal(5));
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::fliplr | ( | ) |
Reverses the order of columns, and returns "*this".
Returning "*this" allows "chaining" two or more operations: e.g., to flip both up-down and left-right, one could just say
M.flipud().fliplr();
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::flipud | ( | ) |
Reverses the order of rows, and returns "*this".
Returning "*this" allows "chaining" two or more operations: e.g., to flip both up-down and left-right, one could just say
M.flipud().fliplr();
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::fro_norm | ( | ) | const [inline] |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements).
Definition at line 580 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::frobenius_norm | ( | ) | const [inline] |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements).
Definition at line 577 of file vnl_matrix_fixed.h.
T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get | ( | unsigned | r, |
unsigned | c | ||
) | const [inline] |
get element.
Definition at line 213 of file vnl_matrix_fixed.h.
vnl_vector_fixed<T,num_rows> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get_column | ( | unsigned | col | ) | const |
Get a vector equal to the given column.
vnl_vector<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get_diagonal | ( | ) | const |
Return a vector with the content of the (main) diagonal.
vnl_matrix<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get_n_columns | ( | unsigned | colstart, |
unsigned | n | ||
) | const |
Get n columns beginning at colstart.
vnl_matrix<T> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get_n_rows | ( | unsigned | rowstart, |
unsigned | n | ||
) | const |
Get n rows beginning at rowstart.
vnl_vector_fixed<T,num_cols> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::get_row | ( | unsigned | row | ) | const |
Get a vector equal to the given row.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::has_nans | ( | ) | const |
Return true if matrix contains NaNs.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::inplace_transpose | ( | ) |
Transposes this matrix efficiently, if it is square, and returns it.
Returning "*this" allows "chaining" two or more operations: e.g., to fill a square matrix column-wise, fill it rowwise then transpose:
M.copy_in(array).inplace_transpose();
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::is_finite | ( | ) | const |
Return true if finite.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::is_identity | ( | ) | const |
Return true if all elements equal to identity.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::is_identity | ( | double | tol | ) | const |
Return true if all elements equal to identity, within given tolerance.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::is_zero | ( | ) | const |
Return true if all elements equal to zero.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::is_zero | ( | double | tol | ) | const |
Return true if all elements equal to zero, within given tolerance.
T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::max_value | ( | ) | const [inline] |
Return maximum value of elements.
Definition at line 589 of file vnl_matrix_fixed.h.
T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::mean | ( | ) | const [inline] |
Return mean of all matrix elements.
Definition at line 598 of file vnl_matrix_fixed.h.
T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::min_value | ( | ) | const [inline] |
Return minimum value of elements.
Definition at line 586 of file vnl_matrix_fixed.h.
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::mul | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [static] |
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::mul | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [static] |
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::normalize_columns | ( | ) |
Normalizes each column so it is a unit vector, and returns "*this".
Zero columns are not modified Returning "*this" allows "chaining" two or more operations: e.g., to set a matrix to a column-normalized all-elements-equal matrix, say
M.fill(1).normalize_columns();
Returning "*this" also allows passing such a matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,5,5>(1.0).normalize_columns());
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::normalize_rows | ( | ) |
Normalizes each row so it is a unit vector, and returns "*this".
Zero rows are not modified Returning "*this" allows "chaining" two or more operations: e.g., to set a matrix to a row-normalized all-elements-equal matrix, say
M.fill(1).normalize_rows();
Returning "*this" also allows passing such a matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,5,5>(1.0).normalize_rows());
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator const vnl_matrix_ref< T > | ( | ) | const [inline] |
Cheap conversion to vnl_matrix_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 683 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator!= | ( | vnl_matrix_fixed const & | that | ) | const [inline] |
Inequality operator.
Definition at line 718 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator!= | ( | vnl_matrix< T > const & | that | ) | const [inline] |
Inequality operator.
Definition at line 724 of file vnl_matrix_fixed.h.
T& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator() | ( | unsigned | r, |
unsigned | c | ||
) | [inline] |
Access an element for reading or writing.
There are assert style boundary checks - #define NDEBUG to turn them off.
Definition at line 225 of file vnl_matrix_fixed.h.
T const& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator() | ( | unsigned | r, |
unsigned | c | ||
) | const [inline] |
Access an element for reading.
There are assert style boundary checks - #define NDEBUG to turn them off.
Definition at line 236 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator*= | ( | T | s | ) | [inline] |
Definition at line 330 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator*= | ( | vnl_matrix_fixed< T, num_cols, num_cols > const & | s | ) | [inline] |
Definition at line 377 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator+= | ( | T | s | ) | [inline] |
Add s to each element of lhs matrix in situ.
Definition at line 318 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator+= | ( | vnl_matrix_fixed const & | m | ) | [inline] |
Definition at line 342 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator+= | ( | vnl_matrix< T > const & | m | ) | [inline] |
Definition at line 348 of file vnl_matrix_fixed.h.
vnl_matrix_fixed VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator- | ( | ) | const [inline] |
Negate all elements of matrix.
Definition at line 369 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator-= | ( | T | s | ) | [inline] |
Subtract s from each element of lhs matrix in situ.
Definition at line 324 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator-= | ( | vnl_matrix_fixed const & | m | ) | [inline] |
Definition at line 355 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator-= | ( | vnl_matrix< T > const & | m | ) | [inline] |
Definition at line 361 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator/= | ( | T | s | ) | [inline] |
Definition at line 336 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator= | ( | T const & | v | ) | [inline] |
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator= | ( | const vnl_matrix< T > & | rhs | ) | [inline] |
Copy a vnl_matrix into this.
Abort if rhs is not the same size.
Definition at line 175 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator= | ( | const vnl_matrix_fixed & | rhs | ) | [inline] |
Copy another vnl_matrix_fixed<T,m,n> into this.
Definition at line 183 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator== | ( | vnl_matrix_fixed const & | that | ) | const [inline] |
Equality operator.
Definition at line 715 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator== | ( | vnl_matrix< T > const & | that | ) | const [inline] |
Equality operator.
Definition at line 721 of file vnl_matrix_fixed.h.
T* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator[] | ( | unsigned | r | ) | [inline] |
return pointer to given row.
No boundary checking here.
Definition at line 217 of file vnl_matrix_fixed.h.
T const* VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator[] | ( | unsigned | r | ) | const [inline] |
return pointer to given row.
No boundary checking here.
Definition at line 221 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator_eq | ( | vnl_matrix_fixed const & | rhs | ) | const [inline] |
Return true if *this == rhs.
Definition at line 709 of file vnl_matrix_fixed.h.
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator_inf_norm | ( | ) | const |
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::operator_one_norm | ( | ) | const |
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::print | ( | vcl_ostream & | os | ) | const |
Print matrix to os in some hopefully sensible format.
void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::put | ( | unsigned | r, |
unsigned | c, | ||
T const & | v | ||
) | [inline] |
set element.
Definition at line 207 of file vnl_matrix_fixed.h.
bool VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::read_ascii | ( | vcl_istream & | s | ) |
abs_t VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::rms | ( | ) | const [inline] |
Return RMS of all elements.
Definition at line 583 of file vnl_matrix_fixed.h.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::rows | ( | ) | const [inline] |
Return number of rows.
Definition at line 192 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::scale_column | ( | unsigned | col, |
T | value | ||
) |
Scales elements in given column by a factor T, and returns "*this".
Returning "*this" allows "chaining" two or more operations: e.g., to set a 3x3 matrix to [3 0 0][0 2 0][0 0 1], one could say
M.set_identity().scale_row(0,3).scale_column(1,2);
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::scale_row | ( | unsigned | row, |
T | value | ||
) |
Scales elements in given row by a factor T, and returns "*this".
Returning "*this" allows "chaining" two or more operations: e.g., to set a 3x3 matrix to [3 0 0][0 2 0][0 0 1], one could say
M.set_identity().scale_row(0,3).scale_column(1,2);
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set | ( | unsigned | r, |
unsigned | c, | ||
T const & | v | ||
) | [inline] |
set element, and return *this.
Definition at line 210 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set | ( | T const * | d | ) | [inline] |
Fills (laminates) this matrix with the given data, then returns it.
A synonym for copy_in()
Definition at line 298 of file vnl_matrix_fixed.h.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_column | ( | unsigned | i, |
T const * | v | ||
) |
Set the elements of the i'th column to v[i] (No bounds checking).
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_column | ( | unsigned | i, |
T | value | ||
) |
Set the elements of the i'th column to value, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_column | ( | unsigned | j, |
vnl_vector< T > const & | v | ||
) |
Set j-th column to v, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_column | ( | unsigned | j, |
vnl_vector_fixed< T, num_rows > const & | v | ||
) |
Set j-th column to v, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_columns | ( | unsigned | starting_column, |
vnl_matrix< T > const & | M | ||
) |
Set columns to those in M, starting at starting_column, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_diagonal | ( | vnl_vector< T > const & | ) |
Sets the diagonal elements of this matrix to the specified list of values.
Returning "*this" allows "chaining" two or more operations: see the reasoning (and the examples) in the documentation for method fill_diagonal().
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_identity | ( | ) |
Sets this matrix to an identity matrix, then returns "*this".
Returning "*this" allows e.g. passing an identity matrix as argument to a function f, without having to name the constructed matrix:
f(vnl_matrix_fixed<double,5,5>().set_identity());
Returning "*this" also allows "chaining" two or more operations: e.g., to set a 3x3 matrix to [3 0 0][0 2 0][0 0 1], one could say
M.set_identity().scale_row(0,3).scale_column(1,2);
If the matrix is not square, anyhow set main diagonal to 1, the rest to 0.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_row | ( | unsigned | i, |
T const * | v | ||
) |
Set the elements of the i'th row to v[i] (No bounds checking).
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_row | ( | unsigned | i, |
T | value | ||
) |
Set the elements of the i'th row to value, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_row | ( | unsigned | i, |
vnl_vector< T > const & | |||
) |
Set the i-th row, then return *this.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::set_row | ( | unsigned | i, |
vnl_vector_fixed< T, num_cols > const & | |||
) |
Set the i-th row, then return *this.
unsigned VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::size | ( | ) | const [inline] |
Return number of elements.
Definition at line 204 of file vnl_matrix_fixed.h.
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::sub | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [static] |
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::sub | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [static] |
static void VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::sub | ( | T | a, |
const T * | b, | ||
T * | r | ||
) | [static] |
vnl_matrix_fixed<T,num_cols,num_rows> VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::transpose | ( | ) | const |
Return transpose.
vnl_matrix_fixed& VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::update | ( | vnl_matrix< T > const & | , |
unsigned | top = 0 , |
||
unsigned | left = 0 |
||
) |
Set values of this matrix to those of M, starting at [top,left].
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | ) | [inline] |
Construct an empty num_rows*num_cols matrix.
Definition at line 120 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | unsigned | n, |
unsigned | m | ||
) | [inline] |
Construct an empty num_rows*num_cols matrix.
The sole purpose of this constructor is to match the interface of vnl_matrix, so that algorithms can template over the matrix type itself. It is illegal to call this constructor without n==num_rows
and m==num_cols
.
Definition at line 128 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | T | value | ) | [inline, explicit] |
Construct an m*n matrix and fill with value.
Definition at line 134 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | const T * | datablck | ) | [inline, explicit] |
Construct an m*n Matrix and copy data into it row-wise.
Definition at line 143 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | const vnl_matrix_fixed & | rhs | ) | [inline] |
Construct an m*n Matrix and copy rhs into it.
Abort if rhs is not the same size.
Definition at line 150 of file vnl_matrix_fixed.h.
VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::vnl_matrix_fixed | ( | const vnl_matrix< T > & | rhs | ) | [inline] |
Construct an m*n Matrix and copy rhs into it.
Abort if rhs is not the same size.
Definition at line 157 of file vnl_matrix_fixed.h.
T VNL_MATRIX_FIXED_VCL60_WORKAROUND< T, num_rows, num_cols >::data_[num_rows][num_cols] [private] |
Definition at line 113 of file vnl_matrix_fixed.h.