vnl_matrix< T > Class Template Reference

#include <vnl_matrix.h>

Inheritance diagram for vnl_matrix< T >:

vnl_file_matrix< T > vnl_matrix_ref< T > List of all members.

Detailed Description

template<class T>
class vnl_matrix< T >

An ordinary mathematical matrix.

The vnl_matrix<T> class implements two-dimensional arithmetic matrices for a user-specified numeric data type. Using the parameterized types facility of C++, it is possible, for example, for the user to create a matrix of rational numbers by parameterizing the vnl_matrix class over the Rational class. The only requirement for the type is that it supports the basic arithmetic operators.

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 set_size(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 83 of file vnl_matrix.h.

Public Types

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 ()
 Default constructor creates an empty matrix of size 0,0.
 vnl_matrix (unsigned r, unsigned c)
 Construct a matrix of size r rows by c columns.
 vnl_matrix (unsigned r, unsigned c, T const &v0)
 Construct a matrix of size r rows by c columns, and all emelemnts equal to v0.
 vnl_matrix (unsigned r, unsigned c, vnl_matrix_type t)
 Construct a matrix of size r rows by c columns, with a special type.
 vnl_matrix (unsigned r, unsigned c, unsigned n, T const values[])
 Construct a matrix of size r rows by c columns, initialised by an automatic array.
 vnl_matrix (T const *data_block, unsigned r, unsigned c)
 Construct a matrix of size r rows by c columns, initialised by a memory block.
 vnl_matrix (vnl_matrix< T > const &)
 Copy construct a matrix.
 vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, vnl_tag_add)
 vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, vnl_tag_sub)
 vnl_matrix (vnl_matrix< T > const &, T, vnl_tag_mul)
 vnl_matrix (vnl_matrix< T > const &, T, vnl_tag_div)
 vnl_matrix (vnl_matrix< T > const &, T, vnl_tag_add)
 vnl_matrix (vnl_matrix< T > const &, T, vnl_tag_sub)
 vnl_matrix (vnl_matrix< T > const &, vnl_matrix< T > const &, vnl_tag_mul)
 vnl_matrix (vnl_matrix< T > &that, vnl_tag_grab)
 ~vnl_matrix ()
 Matrix destructor.
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 &)
 set element with boundary checks if error checking is on.
get (unsigned r, unsigned c) const
 get element with boundary checks if error checking is on.
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.
void fill (T const &)
 Set all elements of matrix to specified value.
void fill_diagonal (T const &)
 Set all diagonal elements of matrix to specified value.
void copy_in (T const *)
 Fill (laminate) this matrix with the given data.
void set (T const *d)
 Fill (laminate) this matrix with the given data.
void copy_out (T *) const
 Fill the given array with this matrix.
vnl_matrix< T > & operator= (T const &v)
 Set all elements to value v.
vnl_matrix< T > & operator= (vnl_matrix< T > const &)
 Copies all elements of rhs matrix into lhs matrix.
vnl_matrix< T > & operator+= (T value)
 Add rhs to each element of lhs matrix in situ.
vnl_matrix< T > & operator-= (T value)
 Subtract rhs from each element of lhs matrix in situ.
vnl_matrix< T > & operator *= (T value)
 Scalar multiplication in situ of lhs matrix by rhs.
vnl_matrix< T > & operator/= (T value)
 Scalar division of lhs matrix in situ by rhs.
vnl_matrix< T > & operator+= (vnl_matrix< T > const &)
 Add rhs to lhs matrix in situ.
vnl_matrix< T > & operator-= (vnl_matrix< T > const &)
 Subtract rhs from lhs matrix in situ.
vnl_matrix< T > & operator *= (vnl_matrix< T > const &rhs)
 Multiply lhs matrix in situ by rhs.
vnl_matrix< T > operator- () const
 Negate all elements of matrix.
vnl_matrix< T > operator+ (T const &v) const
 Add rhs to each element of lhs matrix and return result in new matrix.
vnl_matrix< T > operator- (T const &v) const
 Subtract rhs from each element of lhs matrix and return result in new matrix.
vnl_matrix< T > operator * (T const &v) const
 Scalar multiplication of lhs matrix by rhs and return result in new matrix.
vnl_matrix< T > operator/ (T const &v) const
 Scalar division of lhs matrix by rhs and return result in new matrix.
vnl_matrix< T > operator+ (vnl_matrix< T > const &rhs) const
 Matrix add rhs to lhs matrix and return result in new matrix.
vnl_matrix< T > operator- (vnl_matrix< T > const &rhs) const
 Matrix subtract rhs from lhs and return result in new matrix.
vnl_matrix< T > operator * (vnl_matrix< T > const &rhs) const
 Matrix multiply lhs by rhs matrix and return result in new matrix.
vnl_matrix< T > apply (T(*f)(T)) const
 Make a new matrix by applying function to each element.
vnl_matrix< T > apply (T(*f)(T const &)) const
 Make a new matrix by applying function to each element.
vnl_matrix< T > transpose () const
 Return transpose.
vnl_matrix< T > conjugate_transpose () const
 Return conjugate transpose.
vnl_matrix< T > & update (vnl_matrix< T > const &, unsigned top=0, unsigned left=0)
 Set values of this matrix to those of M, starting at [top,left].
void set_column (unsigned i, T const *v)
 Set the elements of the i'th column to v[j] (No bounds checking).
void set_column (unsigned i, T value)
 Set the elements of the i'th column to value.
void set_column (unsigned j, vnl_vector< T > const &v)
 Set j-th column to v.
void set_columns (unsigned starting_column, vnl_matrix< T > const &M)
 Set columns to those in M, starting at starting_column.
void set_row (unsigned i, T const *v)
 Set the elements of the i'th row to v[j] (No bounds checking).
void set_row (unsigned i, T value)
 Set the elements of the i'th row to value.
void set_row (unsigned i, vnl_vector< T > const &)
 Set the i-th row.
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< T > get_row (unsigned r) const
 Get a vector equal to the given row.
vnl_vector< T > get_column (unsigned c) 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.
void set_identity ()
 Set this matrix to an identity matrix.
void inplace_transpose ()
 Transpose this matrix efficiently.
void flipud ()
 Reverse order of rows.
void fliplr ()
 Reverse order of columns.
void normalize_rows ()
 Normalize each row so it is a unit vector.
void normalize_columns ()
 Normalize each column so it is a unit vector.
void scale_row (unsigned row, T value)
 Scale elements in given row by a factor of T.
void scale_column (unsigned col, T value)
 Scale elements in given column by a factor of T.
void swap (vnl_matrix< T > &that)
 Swap this matrix with that matrix.
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.
min_value () const
 Return minimum value of elements.
max_value () const
 Return maximum value of elements.
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 r, unsigned c) 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)
 Read a vnl_matrix from an ascii vcl_istream.
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).
T const *const * data_array () const
 Access the 2D array, so that elements can be accessed with array[row][col] directly.
T ** data_array ()
 Access the 2D array, so that elements can be accessed with array[row][col] directly.
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.
vnl_matrix< T > const & as_ref () const
 Return a reference to this.
vnl_matrix< T > & as_ref ()
 Return a reference to this.
bool operator_eq (vnl_matrix< T > const &rhs) const
 Return true if *this == rhs.
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.
void clear ()
 Make the matrix as if it had been default-constructed.
bool set_size (unsigned r, unsigned c)
 Resize to r rows by c columns. Old data lost.

Static Public Member Functions

static vnl_matrix< T > read (vcl_istream &s)
 Read a vnl_matrix from an ascii vcl_istream, automatically determining file size if the input matrix has zero size.

Protected Member Functions

void assert_size_internal (unsigned r, unsigned c) const
 Abort unless M has the given size.
void assert_finite_internal () const
 Abort if any element of M is inf or nan.
void destroy ()
 Delete data.

Static Protected Member Functions

static void inline_function_tickler ()

Protected Attributes

unsigned num_rows
unsigned num_cols
T ** data

Related Functions

(Note that these are not member functions.)

vnl_matrix< vcl_complex< T > > vnl_complexify (vnl_matrix< T > const &R)
 Return complexified version of real matrix R.
vnl_matrix< vcl_complex< T > > vnl_complexify (vnl_matrix< T > const &R, vnl_matrix< T > const &I)
 Return complex matrix R+j*I from two real matrices R and I.
vnl_det (vnl_matrix_fixed< T, 1, 1 > const &m)
 Determinant of small size matrices.
vnl_det (vnl_matrix_fixed< T, 2, 2 > const &m)
 Determinant of small size matrices.
vnl_det (vnl_matrix_fixed< T, 3, 3 > const &m)
 Determinant of small size matrices.
vnl_det (vnl_matrix_fixed< T, 4, 4 > const &m)
 Determinant of small size matrices.
vnl_matrix< T > operator * (vnl_matrix< T > const &A, vnl_diag_matrix< T > const &D)
 Multiply a vnl_matrix by a vnl_diag_matrix. Just scales the columns - mn flops.
vnl_matrix< T > operator * (vnl_diag_matrix< T > const &D, vnl_matrix< T > const &A)
 Multiply a vnl_diag_matrix by a vnl_matrix. Just scales the rows - mn flops.
vnl_matrix< T > operator+ (vnl_matrix< T > const &A, vnl_diag_matrix< T > const &D)
 Add a vnl_diag_matrix to a vnl_matrix. n adds, mn copies.
vnl_matrix< T > operator+ (vnl_diag_matrix< T > const &D, vnl_matrix< T > const &A)
 Add a vnl_matrix to a vnl_diag_matrix. n adds, mn copies.
vnl_matrix< T > operator- (vnl_matrix< T > const &A, vnl_diag_matrix< T > const &D)
 Subtract a vnl_diag_matrix from a vnl_matrix. n adds, mn copies.
vnl_matrix< T > operator- (vnl_diag_matrix< T > const &D, vnl_matrix< T > const &A)
 Subtract a vnl_matrix from a vnl_diag_matrix. n adds, mn copies.
vnl_matrix< T > vnl_imag (vnl_matrix< vcl_complex< T > > const &C)
 Matrix of imaginary parts of vnl_matrix<vcl_complex<T> >.
vnl_matrix< T > operator * (T const &value, vnl_matrix< T > const &m)
vnl_matrix< T > operator+ (T const &value, vnl_matrix< T > const &m)
void swap (vnl_matrix< T > &A, vnl_matrix< T > &B)
 Swap two matrices.
bool operator< (vnl_matrix< T > const &lhs, vnl_matrix< T > const &rhs)
 Define a complete ordering on vnl_matrix.
unsigned int vnl_rank (vnl_matrix< T > const &mat, vnl_rank_type=vnl_rank_both)
 Returns the rank of a matrix.
vnl_matrix< T > vnl_rank_row_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all)
 Row reduce a matrix.
vnl_matrix< T > vnl_rank_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all)
 Column reduce a matrix.
vnl_matrix< T > vnl_rank_row_column_reduce (vnl_matrix< T > const &mat, vnl_rank_pivot_type=vnl_rank_pivot_all)
 Row and column reduce a matrix.
vnl_matrix< T > vnl_real (vnl_matrix< vcl_complex< T > > const &C)
 Matrix of real parts of vnl_matrix<vcl_complex<T> >.
vnl_matrix< double > vnl_rotation_matrix (vnl_vector< double > const &axis)
 Returns an orthogonal 3x3 matrix which is a rotation about the axis, by an angle equal to ||axis||.
vnl_trace (vnl_matrix< T > const &M)
 Calculate trace of a matrix.
vnl_vector< T > operator * (vnl_matrix< T > const &m, vnl_vector< T > const &v)
 multiply matrix and (column) vector. O(m*n).


Member Typedef Documentation

template<class T>
typedef vnl_c_vector<T>::abs_t vnl_matrix< T >::abs_t

Type def for norms.

Definition at line 370 of file vnl_matrix.h.

template<class T>
typedef T vnl_matrix< T >::element_type

Definition at line 477 of file vnl_matrix.h.

template<class T>
typedef T* vnl_matrix< T >::iterator

Iterators.

Definition at line 480 of file vnl_matrix.h.

template<class T>
typedef T const* vnl_matrix< T >::const_iterator

Const iterators.

Definition at line 487 of file vnl_matrix.h.


Constructor & Destructor Documentation

template<class T>
vnl_matrix< T >::vnl_matrix (  )  [inline]

Default constructor creates an empty matrix of size 0,0.

Definition at line 87 of file vnl_matrix.h.

template<class T>
vnl_matrix< T >::vnl_matrix ( unsigned  r,
unsigned  c 
)

Construct a matrix of size r rows by c columns.

Contents are unspecified. Complexity $O(1)$

Definition at line 141 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( unsigned  r,
unsigned  c,
T const &  v0 
)

Construct a matrix of size r rows by c columns, and all emelemnts equal to v0.

Complexity $O(r.c)$

Definition at line 150 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( unsigned  r,
unsigned  c,
vnl_matrix_type  t 
)

Construct a matrix of size r rows by c columns, with a special type.

Contents are specified by t Complexity $O(r.c)$

Definition at line 161 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( unsigned  r,
unsigned  c,
unsigned  n,
T const  values[] 
)

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 $O(n)$

Definition at line 177 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( T const *  data_block,
unsigned  r,
unsigned  c 
)

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 $O(r.c)$

Definition at line 193 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &   ) 

Copy construct a matrix.

Complexity $O(r.c)$

Definition at line 208 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
vnl_matrix< T > const &  ,
vnl_tag_add   
)

Definition at line 229 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
vnl_matrix< T > const &  ,
vnl_tag_sub   
)

Definition at line 249 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
,
vnl_tag_mul   
)

Definition at line 269 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
,
vnl_tag_div   
)

Definition at line 283 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
,
vnl_tag_add   
)

Definition at line 297 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
,
vnl_tag_sub   
)

Definition at line 311 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > const &  ,
vnl_matrix< T > const &  ,
vnl_tag_mul   
)

Definition at line 325 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T >::vnl_matrix ( vnl_matrix< T > &  that,
vnl_tag_grab   
) [inline]

Definition at line 133 of file vnl_matrix.h.

template<class T>
vnl_matrix< T >::~vnl_matrix (  ) 

Matrix destructor.

Definition at line 352 of file vnl_matrix.txx.


Member Function Documentation

template<class T>
unsigned vnl_matrix< T >::rows (  )  const [inline]

Return number of rows.

Definition at line 145 of file vnl_matrix.h.

template<class T>
unsigned vnl_matrix< T >::columns (  )  const [inline]

Return number of columns.

A synonym for cols()

Definition at line 149 of file vnl_matrix.h.

template<class T>
unsigned vnl_matrix< T >::cols (  )  const [inline]

Return number of columns.

A synonym for columns()

Definition at line 153 of file vnl_matrix.h.

template<class T>
unsigned vnl_matrix< T >::size (  )  const [inline]

Return number of elements.

This equals rows() * cols()

Definition at line 157 of file vnl_matrix.h.

template<class T>
void vnl_matrix< T >::put ( unsigned  row,
unsigned  column,
T const &  value 
) [inline]

set element with boundary checks if error checking is on.

Checks for valid range of indices.

Definition at line 586 of file vnl_matrix.h.

template<class T>
T vnl_matrix< T >::get ( unsigned  row,
unsigned  column 
) const [inline]

get element with boundary checks if error checking is on.

Checks for valid range of indices.

Definition at line 571 of file vnl_matrix.h.

template<class T>
T* vnl_matrix< T >::operator[] ( unsigned  r  )  [inline]

return pointer to given row.

No boundary checking here.

Definition at line 167 of file vnl_matrix.h.

template<class T>
T const* vnl_matrix< T >::operator[] ( unsigned  r  )  const [inline]

return pointer to given row.

No boundary checking here.

Definition at line 171 of file vnl_matrix.h.

template<class T>
T& vnl_matrix< T >::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 175 of file vnl_matrix.h.

template<class T>
T const& vnl_matrix< T >::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 186 of file vnl_matrix.h.

template<class T>
void vnl_matrix< T >::fill ( T const &   ) 

Set all elements of matrix to specified value.

Complexity $O(r.c)$

Definition at line 414 of file vnl_matrix.txx.

template<class T>
void vnl_matrix< T >::fill_diagonal ( T const &   ) 

Set all diagonal elements of matrix to specified value.

Complexity $O(\min(r,c))$

Definition at line 424 of file vnl_matrix.txx.

template<class T>
void vnl_matrix< T >::copy_in ( T const *   ) 

Fill (laminate) this matrix with the given data.

We assume that p points to a contiguous rows*cols array, stored rowwise.

Definition at line 856 of file vnl_matrix.txx.

template<class T>
void vnl_matrix< T >::set ( T const *  d  )  [inline]

Fill (laminate) this matrix with the given data.

A synonym for copy_in()

Definition at line 212 of file vnl_matrix.h.

template<class T>
void vnl_matrix< T >::copy_out ( T *   )  const

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.

Definition at line 867 of file vnl_matrix.txx.

template<class T>
vnl_matrix<T>& vnl_matrix< T >::operator= ( T const &  v  )  [inline]

Set all elements to value v.

Complexity $O(r.c)$

Definition at line 222 of file vnl_matrix.h.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator= ( vnl_matrix< T > const &   ) 

Copies all elements of rhs matrix into lhs matrix.

Complexity $O(\min(r,c))$

Reimplemented in vnl_int_matrix.

Definition at line 448 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator+= ( value  ) 

Add rhs to each element of lhs matrix in situ.

Definition at line 507 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator-= ( value  ) 

Subtract rhs from each element of lhs matrix in situ.

Definition at line 516 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator *= ( value  ) 

Scalar multiplication in situ of lhs matrix by rhs.

Definition at line 525 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator/= ( value  ) 

Scalar division of lhs matrix in situ by rhs.

Definition at line 534 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator+= ( vnl_matrix< T > const &  rhs  ) 

Add rhs to lhs matrix in situ.

O(m*n). The dimensions of the two matrices must be identical.

Definition at line 547 of file vnl_matrix.txx.

template<class T>
vnl_matrix< T > & vnl_matrix< T >::operator-= ( vnl_matrix< T > const &  rhs  ) 

Subtract rhs from lhs matrix in situ.

O(m*n). The dimensions of the two matrices must be identical.

Definition at line 568 of file vnl_matrix.txx.

template<class T>
vnl_matrix<T>& vnl_matrix< T >::operator *= ( vnl_matrix< T > const &  rhs  )  [inline]

Multiply lhs matrix in situ by rhs.

Definition at line 249 of file vnl_matrix.h.

template<class T>
vnl_matrix< T > vnl_matrix< T >::operator- (  )  const

Negate all elements of matrix.

O(m*n).

Definition at line 626 of file vnl_matrix.txx.

template<class T>
vnl_matrix<T> vnl_matrix< T >::operator+ ( T const &  v  )  const [inline]

Add rhs to each element of lhs matrix and return result in new matrix.

Definition at line 256 of file vnl_matrix.h.

template<class T>
vnl_matrix<T> vnl_matrix< T >::operator- ( T const &  v  )  const [inline]

Subtract rhs from each element of lhs matrix and return result in new matrix.

Definition at line 259 of file vnl_matrix.h.

template<class T>
vnl_matrix<T> vnl_matrix< T >::operator * ( T const &  v  )  const [inline]

Scalar multiplication of lhs matrix by rhs and return result in new matrix.

Definition at line 262 of file vnl_matrix.h.

template<class T>
vnl_matrix<T> vnl_matrix< T >::operator/ ( T const &  v  )  const [inline]

Scalar division of lhs matrix by rhs and return result in new matrix.

Definition at line 265 of file vnl_matrix.h. </