#include <vnl_matrix_fixed_ref.h>
Public Types | |
typedef T | element_type |
Type defs for iterators. | |
typedef T * | iterator |
Iterators. | |
typedef T const * | const_iterator |
Const iterators. | |
typedef vnl_c_vector< T >::abs_t | abs_t |
Type def for norms. | |
Public Member Functions | |
T * | data_block () const |
vnl_matrix_fixed_ref (vnl_matrix_fixed< T, num_rows, num_cols > &rhs) | |
vnl_matrix_fixed_ref (T *dataptr) | |
vnl_matrix_fixed_ref const & | operator= (const vnl_matrix_fixed_ref_const< T, num_rows, num_cols > &rhs) const |
Copy another vnl_matrix_fixed<T,m,n> into this. | |
void | put (unsigned r, unsigned c, T const &v) |
set element. | |
T | get (unsigned r, unsigned c) const |
get element. | |
T * | operator[] (unsigned r) const |
return pointer to given row. | |
T & | operator() (unsigned r, unsigned c) const |
Access an element for reading or writing. | |
vnl_matrix_fixed_ref const & | fill (T) const |
Sets all elements of matrix to specified value, and returns "*this". | |
vnl_matrix_fixed_ref const & | fill_diagonal (T) const |
Sets all diagonal elements of matrix to specified value; returns "*this". | |
vnl_matrix_fixed_ref const & | set_diagonal (vnl_vector< T > const &) const |
Sets the diagonal elements of this matrix to the specified list of values. | |
vnl_matrix_fixed_ref const & | copy_in (T const *) const |
Fills (laminates) this matrix with the given data, then returns it. | |
vnl_matrix_fixed_ref const & | set (T const *d) const |
Fills (laminates) this matrix with the given data, then returns it. | |
vnl_matrix_fixed_ref const & | inplace_transpose () const |
Fills the given array with this matrix. | |
vnl_matrix_fixed_ref const & | operator+= (T s) const |
Add s to each element of lhs matrix in situ. | |
vnl_matrix_fixed_ref const & | operator-= (T s) const |
Subtract s from each element of lhs matrix in situ. | |
vnl_matrix_fixed_ref const & | operator*= (T s) const |
vnl_matrix_fixed_ref const & | operator/= (T s) const |
vnl_matrix_fixed_ref const & | operator+= (vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const &m) const |
vnl_matrix_fixed_ref const & | operator+= (vnl_matrix< T > const &m) const |
vnl_matrix_fixed_ref const & | operator-= (vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const &m) const |
vnl_matrix_fixed_ref const & | operator-= (vnl_matrix< T > const &m) const |
vnl_matrix_fixed< T, num_rows, num_cols > | operator- () const |
Negate all elements of matrix. | |
vnl_matrix_fixed_ref const & | operator*= (vnl_matrix_fixed_ref_const< T, num_cols, num_cols > const &s) const |
vnl_matrix_fixed_ref const & | update (vnl_matrix< T > const &, unsigned top=0, unsigned left=0) const |
Set values of this matrix to those of M, starting at [top,left]. | |
vnl_matrix_fixed_ref const & | set_column (unsigned i, T const *v) const |
Set the elements of the i'th column to v[i] (No bounds checking). | |
vnl_matrix_fixed_ref const & | set_column (unsigned i, T value) const |
Set the elements of the i'th column to value, then return *this. | |
vnl_matrix_fixed_ref const & | set_column (unsigned j, vnl_vector< T > const &v) const |
Set j-th column to v, then return *this. | |
vnl_matrix_fixed_ref const & | set_column (unsigned j, vnl_vector_fixed< T, num_rows > const &v) const |
Set j-th column to v, then return *this. | |
vnl_matrix_fixed_ref const & | set_columns (unsigned starting_column, vnl_matrix< T > const &M) const |
Set columns to those in M, starting at starting_column, then return *this. | |
vnl_matrix_fixed_ref const & | set_row (unsigned i, T const *v) const |
Set the elements of the i'th row to v[i] (No bounds checking). | |
vnl_matrix_fixed_ref const & | set_row (unsigned i, T value) const |
Set the elements of the i'th row to value, then return *this. | |
vnl_matrix_fixed_ref const & | set_row (unsigned i, vnl_vector< T > const &v) const |
Set the i-th row to v, then return *this. | |
vnl_matrix_fixed_ref const & | set_row (unsigned i, vnl_vector_fixed< T, num_cols > const &v) const |
Set the i-th row to v, then return *this. | |
vnl_matrix_fixed_ref const & | set_identity () const |
Sets this matrix to an identity matrix, then returns "*this". | |
vnl_matrix_fixed_ref const & | flipud () const |
Reverses the order of rows, and returns "*this". | |
vnl_matrix_fixed_ref const & | fliplr () const |
Reverses the order of columns, and returns "*this". | |
vnl_matrix_fixed_ref const & | normalize_rows () const |
Normalizes each row so it is a unit vector, and returns "*this". | |
vnl_matrix_fixed_ref const & | normalize_columns () const |
Normalizes each column so it is a unit vector, and returns "*this". | |
vnl_matrix_fixed_ref const & | scale_row (unsigned row, T value) const |
Scales elements in given row by a factor T, and returns "*this". | |
vnl_matrix_fixed_ref const & | scale_column (unsigned col, T value) const |
Scales elements in given column by a factor T, and returns "*this". | |
bool | read_ascii (vcl_istream &s) const |
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 () const |
Iterator pointing to start of data. | |
iterator | end () const |
Iterator pointing to element beyond end of data. | |
bool | operator_eq (vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const &rhs) const |
Return true if *this == rhs. | |
bool | operator== (vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const &that) const |
Equality operator. | |
bool | operator!= (vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const &that) const |
Inequality operator. | |
vnl_vector_fixed< T, num_rows > | get_row (unsigned row_index) const |
Get j-th row. | |
vnl_vector_fixed< T, num_cols > | get_column (unsigned column_index) const |
Get j-th column. | |
vnl_vector< T > | get_diagonal () const |
Return a vector with the content of the (main) diagonal. | |
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 | print (vcl_ostream &os) const |
Print matrix to os in some hopefully sensible format. | |
void | copy_out (T *) const |
vnl_matrix_fixed< T, num_rows, num_cols > | apply (T(*f)(T)) const |
Make a new matrix by applying function to each element. | |
vnl_matrix_fixed< T, num_rows, num_cols > | 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< T > | extract (unsigned rowz, unsigned colz, unsigned top=0, unsigned left=0) const |
Extract a sub-matrix of size rows x cols, starting at (top,left). | |
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. | |
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 rowz, unsigned colz) const |
abort if size is not as expected. | |
void | assert_finite () const |
abort if matrix contains any INFs or NANs. | |
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) |
Protected Attributes | |
const T * | data_ |
Private Types | |
typedef vnl_matrix_fixed_ref_const< T, num_rows, num_cols > | base |
Definition at line 392 of file vnl_matrix_fixed_ref.h.
typedef vnl_c_vector<T>::abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::abs_t [inherited] |
Type def for norms.
Definition at line 279 of file vnl_matrix_fixed_ref.h.
typedef vnl_matrix_fixed_ref_const<T,num_rows,num_cols> vnl_matrix_fixed_ref< T, num_rows, num_cols >::base [private] |
Definition at line 394 of file vnl_matrix_fixed_ref.h.
typedef T const* vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::const_iterator [inherited] |
Const iterators.
Definition at line 209 of file vnl_matrix_fixed_ref.h.
typedef T vnl_matrix_fixed_ref< T, num_rows, num_cols >::element_type |
Type defs for iterators.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 743 of file vnl_matrix_fixed_ref.h.
typedef T* vnl_matrix_fixed_ref< T, num_rows, num_cols >::iterator |
Iterators.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 746 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref< T, num_rows, num_cols >::vnl_matrix_fixed_ref | ( | vnl_matrix_fixed< T, num_rows, num_cols > & | rhs | ) | [inline] |
Definition at line 402 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref< T, num_rows, num_cols >::vnl_matrix_fixed_ref | ( | T * | dataptr | ) | [inline, explicit] |
Definition at line 406 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::absolute_value_max | ( | ) | const [inline, inherited] |
Return largest absolute value.
Definition at line 294 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::absolute_value_sum | ( | ) | const [inline, inherited] |
Return sum of absolute values of elements.
Definition at line 291 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::add | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 366 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::add | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 367 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed< T, nrows, ncols > vnl_matrix_fixed_ref_const< T, nrows, ncols >::apply | ( | T(*)(T) | f | ) | const [inherited] |
Make a new matrix by applying function to each element.
Definition at line 174 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed< T, nrows, ncols > vnl_matrix_fixed_ref_const< T, nrows, ncols >::apply | ( | T(*)(T const &) | f | ) | const [inherited] |
Make a new matrix by applying function to each element.
Definition at line 165 of file vnl_matrix_fixed_ref.txx.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::arg_max | ( | ) | const [inline, inherited] |
Return location of maximum value of elements.
Definition at line 321 of file vnl_matrix_fixed_ref.h.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::arg_min | ( | ) | const [inline, inherited] |
Return location of minimum value of elements.
Definition at line 318 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::array_inf_norm | ( | ) | const [inline, inherited] |
Return largest absolute element value.
Definition at line 288 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::array_one_norm | ( | ) | const [inline, inherited] |
Return sum of absolute values of elements.
Definition at line 282 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::array_two_norm | ( | ) | const [inline, inherited] |
Return square root of sum of squared absolute element values.
Definition at line 285 of file vnl_matrix_fixed_ref.h.
const vnl_matrix<T> vnl_matrix_fixed_ref< T, num_rows, num_cols >::as_matrix | ( | ) | const [inline] |
Convert to a vnl_matrix.
Definition at line 739 of file vnl_matrix_fixed_ref.h.
vnl_matrix_ref<T> vnl_matrix_fixed_ref< 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_ref but not for vnl_matrix_fixed_ref. There is also a conversion operator that should work most of the time.
Definition at line 723 of file vnl_matrix_fixed_ref.h.
const vnl_matrix_ref<T> vnl_matrix_fixed_ref< 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_ref but not for vnl_matrix_fixed_ref. There is also a conversion operator that should work most of the time.
Definition at line 730 of file vnl_matrix_fixed_ref.h.
void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::assert_finite | ( | ) | const [inline, inherited] |
abort if matrix contains any INFs or NANs.
This function does or tests nothing if NDEBUG is defined
Definition at line 359 of file vnl_matrix_fixed_ref.h.
void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::assert_size | ( | unsigned | rowz, |
unsigned | colz | ||
) | const [inline, inherited] |
abort if size is not as expected.
This function does or tests nothing if NDEBUG is defined
Definition at line 351 of file vnl_matrix_fixed_ref.h.
iterator vnl_matrix_fixed_ref< T, num_rows, num_cols >::begin | ( | ) | const [inline] |
Iterator pointing to start of data.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 748 of file vnl_matrix_fixed_ref.h.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::cols | ( | ) | const [inline, inherited] |
Return number of columns.
A synonym for columns()
Definition at line 242 of file vnl_matrix_fixed_ref.h.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::columns | ( | ) | const [inline, inherited] |
Return number of columns.
A synonym for cols()
Definition at line 238 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed< T, ncols, nrows > vnl_matrix_fixed_ref_const< T, nrows, ncols >::conjugate_transpose | ( | ) | const [inherited] |
Return conjugate transpose.
Definition at line 197 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::copy_in | ( | T const * | p | ) | 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_ref<double,3,3>().copy_in(array));
Definition at line 247 of file vnl_matrix_fixed_ref.txx.
void vnl_matrix_fixed_ref_const< T, nrows, ncols >::copy_out | ( | T * | p | ) | const [inherited] |
Definition at line 257 of file vnl_matrix_fixed_ref.txx.
T* vnl_matrix_fixed_ref< T, num_rows, num_cols >::data_block | ( | ) | const [inline] |
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 399 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::div | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 373 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::div | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 374 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::empty | ( | ) | const [inline, inherited] |
Return true iff the size is zero.
Definition at line 329 of file vnl_matrix_fixed_ref.h.
iterator vnl_matrix_fixed_ref< T, num_rows, num_cols >::end | ( | ) | const [inline] |
Iterator pointing to element beyond end of data.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 750 of file vnl_matrix_fixed_ref.h.
static bool vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::equal | ( | const T * | a, |
const T * | b | ||
) | [inline, static, inherited] |
Definition at line 376 of file vnl_matrix_fixed_ref.h.
vnl_matrix< T > vnl_matrix_fixed_ref_const< T, nrows, ncols >::extract | ( | unsigned | rowz, |
unsigned | colz, | ||
unsigned | top = 0 , |
||
unsigned | left = 0 |
||
) | const [inherited] |
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]
Definition at line 227 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::fill | ( | T | value | ) | const |
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:
Definition at line 116 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::fill_diagonal | ( | T | value | ) | const |
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:
Definition at line 127 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::fliplr | ( | ) | const |
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();
Definition at line 685 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::flipud | ( | ) | const |
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();
Definition at line 667 of file vnl_matrix_fixed_ref.txx.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::fro_norm | ( | ) | const [inline, inherited] |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements).
Definition at line 306 of file vnl_matrix_fixed_ref.h.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::frobenius_norm | ( | ) | const [inline, inherited] |
Return Frobenius norm of matrix (sqrt of sum of squares of its elements).
Definition at line 303 of file vnl_matrix_fixed_ref.h.
T vnl_matrix_fixed_ref< T, num_rows, num_cols >::get | ( | unsigned | r, |
unsigned | c | ||
) | const [inline] |
get element.
Definition at line 424 of file vnl_matrix_fixed_ref.h.
vnl_vector_fixed<T,num_cols> vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::get_column | ( | unsigned | column_index | ) | const [inline, inherited] |
Get j-th column.
Definition at line 195 of file vnl_matrix_fixed_ref.h.
vnl_vector< T > vnl_matrix_fixed_ref_const< T, nrows, ncols >::get_diagonal | ( | ) | const [inherited] |
Return a vector with the content of the (main) diagonal.
Definition at line 424 of file vnl_matrix_fixed_ref.txx.
vnl_matrix< T > vnl_matrix_fixed_ref_const< T, nrows, ncols >::get_n_columns | ( | unsigned | colstart, |
unsigned | n | ||
) | const [inherited] |
Get n columns beginning at colstart.
Definition at line 374 of file vnl_matrix_fixed_ref.txx.
vnl_matrix< T > vnl_matrix_fixed_ref_const< T, nrows, ncols >::get_n_rows | ( | unsigned | rowstart, |
unsigned | n | ||
) | const [inherited] |
Get n rows beginning at rowstart.
Returns a copy of n rows, starting from "row".
Definition at line 361 of file vnl_matrix_fixed_ref.txx.
vnl_vector_fixed<T,num_rows> vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::get_row | ( | unsigned | row_index | ) | const [inline, inherited] |
Get j-th row.
Definition at line 186 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::has_nans | ( | ) | const [inherited] |
Return true if matrix contains NaNs.
Definition at line 584 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::inplace_transpose | ( | ) | const |
Fills the given array with this matrix.
Transpose square matrix M in place.
We assume that the argument points to a contiguous rows*cols array, stored rowwise. No bounds checking on the array 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();
Definition at line 735 of file vnl_matrix_fixed_ref.txx.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::is_finite | ( | ) | const [inherited] |
Return true if finite.
Definition at line 596 of file vnl_matrix_fixed_ref.txx.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::is_identity | ( | ) | const [inherited] |
Return true if all elements equal to identity.
Definition at line 526 of file vnl_matrix_fixed_ref.txx.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::is_identity | ( | double | tol | ) | const [inherited] |
Return true if all elements equal to identity, within given tolerance.
Return true if maximum absolute deviation of M from identity is <= tol.
Definition at line 543 of file vnl_matrix_fixed_ref.txx.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::is_zero | ( | ) | const [inherited] |
Return true if all elements equal to zero.
Definition at line 559 of file vnl_matrix_fixed_ref.txx.
bool vnl_matrix_fixed_ref_const< T, nrows, ncols >::is_zero | ( | double | tol | ) | const [inherited] |
Return true if all elements equal to zero, within given tolerance.
Definition at line 572 of file vnl_matrix_fixed_ref.txx.
T vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::max_value | ( | ) | const [inline, inherited] |
Return maximum value of elements.
Definition at line 315 of file vnl_matrix_fixed_ref.h.
T vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::mean | ( | ) | const [inline, inherited] |
Return mean of all matrix elements.
Definition at line 324 of file vnl_matrix_fixed_ref.h.
T vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::min_value | ( | ) | const [inline, inherited] |
Return minimum value of elements.
Definition at line 312 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::mul | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 371 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::mul | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 372 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::normalize_columns | ( | ) | const |
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:
Definition at line 309 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::normalize_rows | ( | ) | const |
Normalizes each row so it is a unit vector, and returns "*this".
Make each row of the matrix have unit norm.
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_ref<double,5,5>(1.0).normalize_rows());
All-zero rows are ignored.
Definition at line 283 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< 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 736 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator!= | ( | vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const & | that | ) | const [inline] |
Inequality operator.
Definition at line 763 of file vnl_matrix_fixed_ref.h.
T& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator() | ( | unsigned | r, |
unsigned | c | ||
) | const [inline] |
Access an element for reading or writing.
There are assert style boundary checks - #define NDEBUG to turn them off.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 432 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator*= | ( | T | s | ) | const [inline] |
Definition at line 525 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator*= | ( | vnl_matrix_fixed_ref_const< T, num_cols, num_cols > const & | s | ) | const [inline] |
Definition at line 571 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator+= | ( | T | s | ) | const [inline] |
Add s to each element of lhs matrix in situ.
Definition at line 513 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator+= | ( | vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const & | m | ) | const [inline] |
Definition at line 537 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator+= | ( | vnl_matrix< T > const & | m | ) | const [inline] |
Definition at line 543 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed<T,num_rows,num_cols> vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator- | ( | ) | const [inline] |
Negate all elements of matrix.
Definition at line 563 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator-= | ( | T | s | ) | const [inline] |
Subtract s from each element of lhs matrix in situ.
Definition at line 519 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator-= | ( | vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const & | m | ) | const [inline] |
Definition at line 550 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator-= | ( | vnl_matrix< T > const & | m | ) | const [inline] |
Definition at line 556 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator/= | ( | T | s | ) | const [inline] |
Definition at line 531 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator= | ( | const vnl_matrix_fixed_ref_const< T, num_rows, num_cols > & | rhs | ) | const [inline] |
Copy another vnl_matrix_fixed<T,m,n> into this.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 412 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator== | ( | vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const & | that | ) | const [inline] |
Equality operator.
Definition at line 760 of file vnl_matrix_fixed_ref.h.
T* vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator[] | ( | unsigned | r | ) | const [inline] |
return pointer to given row.
No boundary checking here.
Reimplemented from vnl_matrix_fixed_ref_const< T, num_rows, num_cols >.
Definition at line 428 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref< T, num_rows, num_cols >::operator_eq | ( | vnl_matrix_fixed_ref_const< T, num_rows, num_cols > const & | rhs | ) | const [inline] |
Return true if *this == rhs.
Definition at line 754 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref_const< T, nrows, ncols >::abs_t vnl_matrix_fixed_ref_const< T, nrows, ncols >::operator_inf_norm | ( | ) | const [inherited] |
Definition at line 718 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref_const< T, nrows, ncols >::abs_t vnl_matrix_fixed_ref_const< T, nrows, ncols >::operator_one_norm | ( | ) | const [inherited] |
Definition at line 702 of file vnl_matrix_fixed_ref.txx.
void vnl_matrix_fixed_ref_const< T, nrows, ncols >::print | ( | vcl_ostream & | os | ) | const [inherited] |
Print matrix to os in some hopefully sensible format.
Definition at line 151 of file vnl_matrix_fixed_ref.txx.
void vnl_matrix_fixed_ref< T, num_rows, num_cols >::put | ( | unsigned | r, |
unsigned | c, | ||
T const & | v | ||
) | [inline] |
set element.
Definition at line 421 of file vnl_matrix_fixed_ref.h.
bool vnl_matrix_fixed_ref< T, nrows, ncols >::read_ascii | ( | vcl_istream & | s | ) | const |
Definition at line 649 of file vnl_matrix_fixed_ref.txx.
abs_t vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::rms | ( | ) | const [inline, inherited] |
Return RMS of all elements.
Definition at line 309 of file vnl_matrix_fixed_ref.h.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::rows | ( | ) | const [inline, inherited] |
Return number of rows.
Definition at line 234 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::scale_column | ( | unsigned | col, |
T | value | ||
) | const |
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);
Definition at line 347 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::scale_row | ( | unsigned | row, |
T | value | ||
) | const |
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);
Definition at line 334 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref const& vnl_matrix_fixed_ref< T, num_rows, num_cols >::set | ( | T const * | d | ) | const [inline] |
Fills (laminates) this matrix with the given data, then returns it.
A synonym for copy_in()
Definition at line 494 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_column | ( | unsigned | i, |
T const * | v | ||
) | const |
Set the elements of the i'th column to v[i] (No bounds checking).
Definition at line 472 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_column | ( | unsigned | i, |
T | value | ||
) | const |
Set the elements of the i'th column to value, then return *this.
Definition at line 497 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_column | ( | unsigned | j, |
vnl_vector< T > const & | v | ||
) | const |
Set j-th column to v, then return *this.
Definition at line 489 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_column | ( | unsigned | j, |
vnl_vector_fixed< T, nrows > const & | v | ||
) | const |
Set j-th column to v, then return *this.
Definition at line 481 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_columns | ( | unsigned | starting_column, |
vnl_matrix< T > const & | M | ||
) | const |
Set columns to those in M, starting at starting_column, then return *this.
Definition at line 507 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_diagonal | ( | vnl_vector< T > const & | diag | ) | 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().
Definition at line 137 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_identity | ( | ) | const |
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:
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.
Definition at line 267 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_row | ( | unsigned | i, |
T const * | v | ||
) | const |
Set the elements of the i'th row to v[i] (No bounds checking).
Definition at line 436 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_row | ( | unsigned | i, |
T | value | ||
) | const |
Set the elements of the i'th row to value, then return *this.
Definition at line 461 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_row | ( | unsigned | i, |
vnl_vector< T > const & | v | ||
) | const |
Set the i-th row to v, then return *this.
Definition at line 453 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::set_row | ( | unsigned | i, |
vnl_vector_fixed< T, ncols > const & | v | ||
) | const |
Set the i-th row to v, then return *this.
Definition at line 445 of file vnl_matrix_fixed_ref.txx.
unsigned vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::size | ( | ) | const [inline, inherited] |
Return number of elements.
Definition at line 246 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::sub | ( | const T * | a, |
const T * | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 368 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::sub | ( | const T * | a, |
T | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 369 of file vnl_matrix_fixed_ref.h.
static void vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::sub | ( | T | a, |
const T * | b, | ||
T * | r | ||
) | [inline, static, inherited] |
Definition at line 370 of file vnl_matrix_fixed_ref.h.
vnl_matrix_fixed< T, ncols, nrows > vnl_matrix_fixed_ref_const< T, nrows, ncols >::transpose | ( | ) | const [inherited] |
Return transpose.
Definition at line 186 of file vnl_matrix_fixed_ref.txx.
vnl_matrix_fixed_ref< T, nrows, ncols > const & vnl_matrix_fixed_ref< T, nrows, ncols >::update | ( | vnl_matrix< T > const & | m, |
unsigned | top = 0 , |
||
unsigned | left = 0 |
||
) | const |
Set values of this matrix to those of M, starting at [top,left].
Definition at line 208 of file vnl_matrix_fixed_ref.txx.
const T* vnl_matrix_fixed_ref_const< T, num_rows, num_cols >::data_ [protected, inherited] |
Definition at line 171 of file vnl_matrix_fixed_ref.h.