Classes | Functions
core/vnl/vnl_diag_matrix.h File Reference

Contains class for diagonal matrices. More...

#include <vcl_cassert.h>
#include <vcl_iosfwd.h>
#include <vnl/vnl_vector.h>
#include <vnl/vnl_matrix.h>

Go to the source code of this file.

Classes

class  vnl_diag_matrix< T >
 stores a diagonal matrix as a single vector. More...

Functions

template<class T >
vnl_vector< T > operator* (vnl_diag_matrix< T > const &D, vnl_vector< T > const &A)
 Multiply a vnl_diag_matrix by a vnl_vector. n flops.
template<class T >
vcl_ostream & operator<< (vcl_ostream &, vnl_diag_matrix< T > const &)
 Print in MATLAB diag([1 2 3]) form.
template<class T >
vnl_diag_matrix< T > operator* (vnl_diag_matrix< T > const &A, vnl_diag_matrix< T > const &B)
 Multiply two vnl_diag_matrices. Just multiply the diag elements - n flops.
template<class T >
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.
template<class T >
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.
template<class T >
vnl_diag_matrix< T > operator+ (vnl_diag_matrix< T > const &A, vnl_diag_matrix< T > const &B)
 Add two vnl_diag_matrices. Just add the diag elements - n flops.
template<class T >
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.
template<class T >
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.
template<class T >
vnl_diag_matrix< T > operator- (vnl_diag_matrix< T > const &A, vnl_diag_matrix< T > const &B)
 Subtract two vnl_diag_matrices. Just subtract the diag elements - n flops.
template<class T >
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.
template<class T >
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.
template<class T >
vnl_vector< T > operator* (vnl_vector< T > const &A, vnl_diag_matrix< T > const &D)
 Multiply a vnl_vector by a vnl_diag_matrix. n flops.

Detailed Description

Contains class for diagonal matrices.

Author:
Andrew W. Fitzgibbon (Oxford RRG)
Date:
5 Aug 1996
    Modifications
     IMS (Manchester) 16 Mar 2001: Tidied up the documentation + added binary_io
     Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
     Sep.2002 - Peter Vanroose - Added operator+, operator-, operator*
     Mar.2004 - Peter Vanroose - removed deprecated resize()
     Oct.2010 - Peter Vanroose - mutators and setters now return *this
     Jan.2011 - Peter Vanroose - added methods set_diagonal() & get_diagonal()
   

Definition in file vnl_diag_matrix.h.


Function Documentation

template<class T >
vnl_vector< T > operator* ( vnl_diag_matrix< T > const &  D,
vnl_vector< T > const &  A 
) [inline]

Multiply a vnl_diag_matrix by a vnl_vector. n flops.

Definition at line 332 of file vnl_diag_matrix.h.

template<class T >
vnl_diag_matrix< T > operator* ( vnl_diag_matrix< T > const &  A,
vnl_diag_matrix< T > const &  B 
) [inline]

Multiply two vnl_diag_matrices. Just multiply the diag elements - n flops.

Definition at line 206 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator* ( vnl_matrix< T > const &  A,
vnl_diag_matrix< T > const &  D 
) [inline]

Multiply a vnl_matrix by a vnl_diag_matrix. Just scales the columns - mn flops.

Definition at line 219 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator* ( vnl_diag_matrix< T > const &  D,
vnl_matrix< T > const &  A 
) [inline]

Multiply a vnl_diag_matrix by a vnl_matrix. Just scales the rows - mn flops.

Definition at line 233 of file vnl_diag_matrix.h.

template<class T >
vnl_vector< T > operator* ( vnl_vector< T > const &  A,
vnl_diag_matrix< T > const &  D 
) [inline]

Multiply a vnl_vector by a vnl_diag_matrix. n flops.

Definition at line 342 of file vnl_diag_matrix.h.

template<class T >
vnl_diag_matrix< T > operator+ ( vnl_diag_matrix< T > const &  A,
vnl_diag_matrix< T > const &  B 
) [inline]

Add two vnl_diag_matrices. Just add the diag elements - n flops.

Definition at line 247 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator+ ( vnl_matrix< T > const &  A,
vnl_diag_matrix< T > const &  D 
) [inline]

Add a vnl_diag_matrix to a vnl_matrix. n adds, mn copies.

Definition at line 260 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator+ ( vnl_diag_matrix< T > const &  D,
vnl_matrix< T > const &  A 
) [inline]

Add a vnl_matrix to a vnl_diag_matrix. n adds, mn copies.

Definition at line 275 of file vnl_diag_matrix.h.

template<class T >
vnl_diag_matrix< T > operator- ( vnl_diag_matrix< T > const &  A,
vnl_diag_matrix< T > const &  B 
) [inline]

Subtract two vnl_diag_matrices. Just subtract the diag elements - n flops.

Definition at line 283 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator- ( vnl_matrix< T > const &  A,
vnl_diag_matrix< T > const &  D 
) [inline]

Subtract a vnl_diag_matrix from a vnl_matrix. n adds, mn copies.

Definition at line 296 of file vnl_diag_matrix.h.

template<class T >
vnl_matrix< T > operator- ( vnl_diag_matrix< T > const &  D,
vnl_matrix< T > const &  A 
) [inline]

Subtract a vnl_matrix from a vnl_diag_matrix. n adds, mn copies.

Definition at line 311 of file vnl_diag_matrix.h.

template<class T >
vcl_ostream & operator<< ( vcl_ostream &  ,
vnl_diag_matrix< T > const &   
)

Print in MATLAB diag([1 2 3]) form.

Definition at line 34 of file vnl_diag_matrix.txx.