[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]
![]() |
Matrix Class Template Reference | ![]() |
---|
#include "vigra/matrix.hxx"
Inheritance diagram for Matrix:
Public Types | |
typedef Matrix< T, ALLOC > | matrix_type |
typedef MultiArrayView< 2, T, UnstridedArrayTag > | view_type |
typedef BaseType::value_type | value_type |
typedef BaseType::pointer | pointer |
typedef BaseType::const_pointer | const_pointer |
typedef BaseType::reference | reference |
typedef BaseType::const_reference | const_reference |
typedef BaseType::difference_type | difference_type |
typedef ALLOC | allocator_type |
typedef BaseType::SquaredNormType | SquaredNormType |
typedef BaseType::NormType | NormType |
Public Methods | |
Matrix () | |
Matrix (ALLOC const &alloc) | |
Matrix (const difference_type &shape, ALLOC const &alloc=allocator_type()) | |
Matrix (unsigned int rows, unsigned int columns, ALLOC const &alloc=allocator_type()) | |
Matrix (const difference_type &shape, const_reference init, allocator_type const &alloc=allocator_type()) | |
Matrix (unsigned int rows, unsigned int columns, const_reference init, allocator_type const &alloc=allocator_type()) | |
Matrix (const difference_type &shape, const_pointer init, RawArrayMemoryLayout layout=RowMajor, allocator_type const &alloc=allocator_type()) | |
Matrix (unsigned int rows, unsigned int columns, const_pointer init, RawArrayMemoryLayout layout=RowMajor, allocator_type const &alloc=allocator_type()) | |
Matrix (const Matrix &rhs) | |
Matrix (const TemporaryMatrix< T, ALLOC > &rhs) | |
template<class U, class C> | Matrix (const MultiArrayView< 2, U, C > &rhs) |
Matrix & | operator= (const Matrix &rhs) |
Matrix & | operator= (const TemporaryMatrix< T, ALLOC > &rhs) |
template<class U, class C> Matrix & | operator= (const MultiArrayView< 2, U, C > &rhs) |
view_type | rowVector (unsigned int d) const |
view_type | columnVector (unsigned int d) const |
unsigned int | rowCount () const |
unsigned int | columnCount () const |
unsigned int | elementCount () const |
bool | isSymmetric () const |
value_type & | operator() (unsigned int row, unsigned int column) |
value_type | operator() (unsigned int row, unsigned int column) const |
SquaredNormType | squaredNorm () const |
NormType | norm () const |
Matrix & | transpose () |
template<class U, class C> Matrix & | operator+= (MultiArrayView< 2, U, C > const &other) |
template<class U, class C> Matrix & | operator-= (MultiArrayView< 2, U, C > const &other) |
Matrix & | operator *= (T other) |
Matrix & | operator/= (T other) |
Detailed Description |
This is the basic class for all linear algebra computations. Matrices are strored in a column-major format, i.e. the row index is varying fastest. This is the same format as in the lapack and gmm++ libraries, so it will be easy to interface these libraries. In fact, if you need optimized high performance code, you should use them. The VIGRA linear algebra functionality is provided for smaller problems and rapid prototyping (no one wants to spend half the day installing a new library just to discover that the new algorithm idea didn't work anyway).
See also:
#include "vigra/matrix.hxx" or
|
the allocator type used to allocate the memory Reimplemented from MultiArray< 2, T, ALLOC >. |
|
const pointer type Reimplemented from MultiArray< 2, T, ALLOC >. |
|
const reference type (result of operator[] const) Reimplemented from MultiArray< 2, T, ALLOC >. |
|
difference type (used for offsetting) Reimplemented from MultiArray< 2, T, ALLOC >. |
|
the matrix type associated with this array. Reimplemented from MultiArray< 2, T, ALLOC >. |
|
the norm type (return type of norm(array)). Reimplemented from MultiArray< 2, T, ALLOC >. |
|
pointer type Reimplemented from MultiArray< 2, T, ALLOC >. |
|
reference type (result of operator[]) Reimplemented from MultiArray< 2, T, ALLOC >. |
|
the squared norm type (return type of squaredNorm(array)). Reimplemented from MultiArray< 2, T, ALLOC >. |
|
the array's value type Reimplemented from MultiArray< 2, T, ALLOC >. |
|
the view type associated with this array. Reimplemented from MultiArray< 2, T, ALLOC >. |
|
default constructor |
|
construct with given allocator |
|
construct with given shape and init all elements with zero. Note that the order of the axes is |
|
construct with given shape and init all elements with zero. Note that the order of the axes is |
|
construct with given shape and init all elements with the constant init. Note that the order of the axes is |
|
construct with given shape and init all elements with the constant init. Note that the order of the axes is |
|
construct with given shape and copy data from C-style array init. Unless layout is |
|
construct with given shape and copy data from C-style array init. Unless layout is |
|
copy constructor. Allocates new memory and copies tha data. |
|
construct from temporary matrix, which looses its data. This operation is equivalent to TemporaryMatrix<T> temp = ...; Matrix<T> m; m.swap(temp); |
|
construct from a MultiArrayView. Allocates new memory and copies tha data. rhs is assumed to be in column-major order already. |
|
number of columns (width) of the matrix. |
|
Create a matrix view that represents the column vector of column d. |
|
number of elements (width*height) of the matrix. Reimplemented from MultiArrayView< N, T >. |
|
check whether the matrix is symmetric. |
|
Frobenius norm. Root of sum of squares of the matrix elements. Reimplemented from MultiArrayView< N, T >. |
|
scalar multiply this with other |
|
read access to matrix element |
|
read/write access to matrix element |
|
add other to this (sizes must match). |
|
subtract other from this (sizes must match). |
|
scalar devide this by other |
|
assignment from arbitrary 2-dimensional MultiArrayView. |
|
assign a temporary matrix. This is implemented by swapping the data between the two matrices, so that all depending objects (array views, iterators) ar invalidated. |
|
assignment. If the size of rhs is the same as the matrix's old size, only the data are copied. Otherwise, new storage is allocated, which invalidates all objects (array views, iterators) depending on the matrix. |
|
number of rows (height) of the matrix. |
|
Create a matrix view that represents the row vector of row d. |
|
squared Frobenius norm. Sum of squares of the matrix elements. Reimplemented from MultiArrayView< N, T >. |
|
transpose matrix in-place (precondition: matrix must be square) |
© Ullrich Köthe (koethe@informatik.uni-hamburg.de) |
html generated using doxygen and Python
|