template<class T> class ColMat

Column oriented matrix class.

Public Fields

[more]Vector<T> v_
Stores the matrix elements

Public Methods

[more] ColMat()
Constructor with no arguments (no memory allocation is performed).
[more] ColMat(size_t i, size_t j)
Create matrix.
[more] ColMat(size_t i, size_t j, const T& e)
Create matrix.
[more]ColMat<T> operator-()
Negation operator (elementwise).
[more]ColMat<T> operator+=(const T f)
Add "f" to every matrix element.
[more]ColMat<T> operator-=(const T f)
Subtract "f" from each matrix element.
[more]ColMat<T> operator*=(const T f)
Multiply each matrix element by the value of "f".
[more]ColMat<T> operator/=(const T f)
Divide each matrix element by "f".
[more]ColMat<T> operator+=(const ColMat<T> &b)
Add another matrix "b".
[more]ColMat<T> operator-=(const ColMat<T> &b)
Subtract another matrix "b" from itself.
[more]ColMat<T> operator*=(const ColMat<T> &b)
Multiply each matrix element (of the matrix on the left of "*=") by the corresponding element of the "b" matrix
[more]ColMat<T> operator/=(const ColMat<T> &b)
Divide each matrix element (of the matrix on the left of "*=") by the corresponding element of the "b" matrix
[more]void random(void)
The function that fills in the matrix with random elements between 0 and 1 (two subsequent calls to random will generate different elements).
[more]inline T& operator()(size_t i, size_t j)
Indexing operator.
[more]inline const T& operator()(size_t i, size_t j) const
Indexing operator.
[more]ColMat<T> & operator=(const T&)
Assignment operator.
[more]ColMat<T> operator()(const Vector<size_t> &I, const Vector<size_t> &J ) const
Array slicing.
[more]Vector<T> operator()(const Vector<size_t> &I, const size_t j ) const
Array slicing.
[more]Vector<T> operator()(const size_t i, const Vector<size_t> &J ) const
Array slicing.
[more]size_t size(size_t i) const
Get Matrix sizes.
[more]size_t isize() const
Get the number of rows.
[more]size_t jsize() const
Get the number of columns.
[more]ColMat<T> & newsize(size_t, size_t)
Resize the matrix.
[more]ColMat<T> & alloc(const size_t nr, const size_t nc)
Allocate space.


Documentation

Column oriented matrix class.

Matrices are column majored, ie elements in a column are adjacent in memory. This implementation can be used with Lapack and is compatible with the Fortran array layout, but not with the "C/C++" array layout.

oVector<T> v_
Stores the matrix elements

o ColMat()
Constructor with no arguments (no memory allocation is performed).

o ColMat(size_t i, size_t j)
Create matrix. Elements are not set.
Parameters:
i - no. of rows
j - no. of columns.

o ColMat(size_t i, size_t j, const T& e)
Create matrix. Elelemnts are set.
Parameters:
i - the number of rows
j - the number of columns
e - value of each element

oColMat<T> operator-()
Negation operator (elementwise).

oColMat<T> operator+=(const T f)
Add "f" to every matrix element.

oColMat<T> operator-=(const T f)
Subtract "f" from each matrix element.

oColMat<T> operator*=(const T f)
Multiply each matrix element by the value of "f".

oColMat<T> operator/=(const T f)
Divide each matrix element by "f".

oColMat<T> operator+=(const ColMat<T> &b)
Add another matrix "b".

oColMat<T> operator-=(const ColMat<T> &b)
Subtract another matrix "b" from itself.

oColMat<T> operator*=(const ColMat<T> &b)
Multiply each matrix element (of the matrix on the left of "*=") by the corresponding element of the "b" matrix

oColMat<T> operator/=(const ColMat<T> &b)
Divide each matrix element (of the matrix on the left of "*=") by the corresponding element of the "b" matrix

ovoid random(void)
The function that fills in the matrix with random elements between 0 and 1 (two subsequent calls to random will generate different elements).

oinline T& operator()(size_t i, size_t j)
Indexing operator.
Parameters:
i - the row number
j - the column number
Returns:
reference to an element pointed by i and j

oinline const T& operator()(size_t i, size_t j) const
Indexing operator.
Parameters:
i - the row number
j - the column number
Returns:
reference to an element pointed by i and j

oColMat<T> & operator=(const T&)
Assignment operator. Set all elements.

oColMat<T> operator()(const Vector<size_t> &I, const Vector<size_t> &J ) const
Array slicing. Given 2 integer vectors I and J.

oVector<T> operator()(const Vector<size_t> &I, const size_t j ) const
Array slicing. Given the integer vector I and a index j.

oVector<T> operator()(const size_t i, const Vector<size_t> &J ) const
Array slicing. Given index i and the integer vector J.

osize_t size(size_t i) const
Get Matrix sizes. The argument should be either 1 or 0
Parameters:
i - =0 to get the number of columns, =0 to get the number of rows.
Returns:
size

osize_t isize() const
Get the number of rows.

osize_t jsize() const
Get the number of columns.

oColMat<T> & newsize(size_t, size_t)
Resize the matrix.

oColMat<T> & alloc(const size_t nr, const size_t nc)
Allocate space. Elements are not initialized.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.