#include <matrix.h>
Inheritance diagram for MatrixC:
Public Methods | |
virtual int | capacity () const |
current capacity will be removed r.s.n. | |
bool | operator== (const MatrixC<Tp>& B) const |
logical operator equal, uses STL equal. | |
bool | operator!= (const MatrixC<Tp>& B) const |
logical operator not equal, uses STL equal. | |
constructors and destructor | |
MatrixC () | |
default constructor. | |
MatrixC (const int nr, const int nc, const Tp value=0) | |
standard constructor. | |
MatrixC (const int nr, const int nc, const int nu, const Tp value) | |
constructor to be called for banded matrices. | |
MatrixC (const Tp* A, const int nr, const int nc=1) | |
constructor that takes a double array of length nr*nc. | |
MatrixC (const valarray<Tp>& A, const int nc=1) | |
constructor from a valarray, the optional argument nc is the number of columns. | |
MatrixC (const MatrixC& B) | |
copy constructor. | |
virtual | ~MatrixC () |
virtual destructor. | |
assignment | |
MatrixC& | operator= (const MatrixC& B) |
assignment operator. | |
virtual MatrixC& | operator= (const Tp value) |
assignment with a constant value. | |
overloaded virtual methods of the base class Matrix | |
these methods provide default implementations for derived classes | |
virtual int | nr (const int i=0) const |
number of rows. | |
virtual int | nc (const int i=0) const |
number of columns. | |
virtual int | size () const |
size is the number of elements of the Matrix. | |
virtual bool | empty () const |
true if the Matrix is empty. | |
virtual Ref<Tp> | operator() (const int i, const int j=0) |
non constant, write access to elements. | |
virtual Tp | operator() (const int i, const int j=0) const |
constant, read only access to elements. | |
miscellaneous methods | |
void | get_own_copy () |
get own copy of matrix data. | |
void | resize (const int nr, const int nc, const Tp value=0) |
resize Matrix. | |
virtual void | stream (istream& s) |
input from stream. | |
virtual void | stream (ostream& s) |
output to stream. | |
virtual MatrixC& | assign (const int nc, const Tp* value) |
assign Matrix with a C-style array, uses fast unchecked write access. | |
virtual MatrixC& | assign (const int nr, const int nc, const Tp* value) |
assign Matrix with a C-style array, uses fast unchecked write access. | |
virtual MatrixC& | assign (const int nr, const int nc, const Tp** value) |
assign Matrix with the old LinAl C-style Matrix. | |
conversion operator for use of MatrixC as a C-style array | |
User defined conversion operators are at least controversial since they allow direct, unchecked but also fast access to the raw matrix data in C and Fortran functions.
They are necessary for the BLAS and LAPACK interface but they could possibly at least be made protected. | |
operator Tp * () const | |
read access. | |
operator Tp * () | |
read and write access. | |
Matrix low level algebraic methods | |
The following methods implement low level algebraic functionality.
These methods are called internally by the algebraic operators. The standard methods are guaranteed to work for all derived classes, because they are generic algorithms using operator() to access elements. When the implementation is optimized for speed, these methods should be overloaded. | |
MatrixC<Tp> | transpose () const |
return transposed Matrix. | |
void | add (const MatrixC<Tp>& B) |
add Matrix B to this Matrix. | |
void | add (const Tp value) |
add constant value this Matrix. | |
void | subtract (const MatrixC<Tp>& B) |
subtract Matrix B from this Matrix. | |
void | subtract (const Tp value) |
subtract constant value from this Matrix. | |
void | multiply (const MatrixC<Tp>& A, const MatrixC<Tp>& B, const char TRANSA=0, const char TRANSB=0, const Tp ALPHA=1, const Tp BETA=0) |
multiply Matrix A with Matrix B and write to this Matrix. | |
void | multiply (const Tp value) |
multiply this Matrix with constant value. | |
Protected Methods | |
protected access to MatrixC data for members and derived classes | |
virtual Tp& | operator[] (const int i) const |
fast sequential access operator[], available to members only. | |
virtual Tp& | operator[] (const int i) |
fast sequential access operator[], available to members only. | |
virtual Tp* | ref (const int i, const int j) const |
low level reference to data returns a pointer, use this with care. | |
virtual Tp | read (const int i, const int j) const |
low level read. | |
virtual void | write (const int i, const int j, const Tp v) |
low level write. | |
virtual void | add (const int i, const int j, const Tp v) |
low level add to. | |
virtual void | sub (const int i, const int j, const Tp v) |
low level sub from. | |
virtual void | mul (const int i, const int j, const Tp v) |
low level mul with. | |
virtual void | div (const int i, const int j, const Tp v) |
low level div by. | |
Protected Attributes | |
MdataC<Tp>* | D |
MatrixC<Tp> contains only a pointer to the actual data representation. |
|
default constructor.
|
|
standard constructor.
|
|
constructor to be called for banded matrices.
|
|
constructor that takes a double array of length nr*nc.
|
|
constructor from a valarray, the optional argument nc is the number of columns.
|
|
copy constructor.
|
|
virtual destructor.
|
|
assignment operator.
|
|
assignment with a constant value.
|
|
number of rows.
Reimplemented from Matrix. |
|
number of columns.
Reimplemented from Matrix. |
|
size is the number of elements of the Matrix.
Reimplemented from Matrix. |
|
true if the Matrix is empty.
Reimplemented from Matrix. |
|
non constant, write access to elements.
Reimplemented from Matrix. |
|
constant, read only access to elements.
Reimplemented from Matrix. |
|
get own copy of matrix data.
|
|
resize Matrix.
|
|
input from stream.
|
|
output to stream.
|
|
assign Matrix with a C-style array, uses fast unchecked write access.
|
|
assign Matrix with a C-style array, uses fast unchecked write access.
|
|
assign Matrix with the old LinAl C-style Matrix.
|
|
current capacity will be removed r.s.n.
|
|
logical operator equal, uses STL equal.
|
|
logical operator not equal, uses STL equal.
|
|
read access.
|
|
read and write access.
|
|
return transposed Matrix.
|
|
|
|
add constant value this Matrix.
|
|
subtract Matrix B from this Matrix.
|
|
subtract constant value from this Matrix.
|
|
multiply Matrix A with Matrix B and write to this Matrix.
|
|
multiply this Matrix with constant value.
|
|
fast sequential access operator[], available to members only.
|
|
fast sequential access operator[], available to members only.
|
|
low level reference to data returns a pointer, use this with care.
Reimplemented from Matrix. |
|
low level read.
Reimplemented from Matrix. |
|
low level write.
Reimplemented from Matrix. |
|
low level add to.
Reimplemented from Matrix. |
|
low level sub from.
Reimplemented from Matrix. |
|
low level mul with.
Reimplemented from Matrix. |
|
low level div by.
Reimplemented from Matrix. |
|
MatrixC<Tp> contains only a pointer to the actual data representation.
|