Jive reference manual
|
Defines a common interface for different matrix types. More...
Inherits jem::Object.
Inherited by jive::algebra::ConstrainedMatrix, jive::algebra::DenseMatrixObject, jive::algebra::DiagMatrixObject, jive::algebra::IdentMatrixObject, jive::algebra::MPMatrixObject, jive::algebra::NullMatrixObject, jive::algebra::SparseMatrix, jive::algebra::SparseMatrixObject, jive::implict::TransientMatrix, jive::model::ImplicitMatrix, jive::solver::CoarseMatrix, jive::solver::Preconditioner, jive::solver::Restrictor, and jive::solver::SchurMatrix.
Public Types | |
typedef AbstractMatrix | Self |
The type of this class. More... | |
typedef jem::Tuple< int, 2 > | Shape |
A type representing the shape of a matrix. More... | |
typedef util::Vector | Vector |
A vector type. More... | |
Public Member Functions | |
Shape | shape () const =0 |
Returns the shape of this matrix. More... | |
virtual void | matmul (const Vector &lhs, const Vector &rhs) const =0 |
Matrix-vector multiplication. More... | |
bool | isSquare () const |
Tests whether this matrix is square. More... | |
virtual jem::Class * | getClass () const |
Returns the Class instance representing the runtime class of this object. More... | |
![]() | |
virtual String | toString () const |
Returns a short textual description of this object. More... | |
virtual long | hashValue () const |
Returns a hash value for this object. More... | |
virtual bool | equals (const Ref< Object > &obj) const |
Tests whether two objects are equal. More... | |
Ref< Object > | clone () const |
Returns a copy of this object. More... | |
Static Public Member Functions | |
static jem::Class * | getType () |
![]() | |
static Class * | getType () |
Returns the Class instance representing the Object class. More... | |
Public Attributes | |
jem::util::Event< Self & > | newShapeEvent |
Signals that the shape of this matrix has changed. More... | |
jem::util::Event< Self & > | newValuesEvent |
Signals that the contents of this matrix have been modified. More... | |
Additional Inherited Members | |
![]() | |
Collectable () | |
Creates an empty Collectable . More... | |
~Collectable () | |
Frees resources. More... | |
#include <jive/algebra/AbstractMatrix.h>
The AbstractMatrix
class is the superclass of various matrix classes. It can be used to implement algorithms that need to execute a series of matrix-vector products and that do not care how the elements of a matrix are stored in memory.
VectorSpace
. The Self
type is a convenient synonym for AbstractMatrix
.
typedef jem::Tuple<int,2> jive::algebra::AbstractMatrix::Shape |
The Shape
type represents the shape of an AbstractMatrix
. It is a synonym for jem::Tuple<int,2>
.
The Vector
type is just an alias for jive::util::Vector
.
|
pure virtual |
Returns the shape of this matrix. If s
denotes the returned Shape
object, then s
[0] equals the number of rows and s
[1] equals the number of columns in this matrix.
Implemented in jive::algebra::SparseMatrix, jive::algebra::SparseMatrixObject, jive::algebra::DenseMatrixObject, jive::algebra::MPMatrixObject, jive::algebra::DiagMatrixObject, jive::algebra::IdentMatrixObject, jive::algebra::NullMatrixObject, jive::algebra::ConstrainedMatrix, jive::solver::SchurMatrix, jive::solver::DualPrecon, jive::model::ImplicitMatrix, jive::solver::CoarseMatrix, jive::solver::SparseIFactor, jive::solver::NeumannPrecon, jive::solver::CoarsePrecon, jive::solver::SolverPrecon, jive::implict::TransientMatrix, jive::solver::DiagPrecon, jive::solver::MPRestrictor, jive::solver::DummyPrecon, jive::solver::Preconditioner, jive::solver::Restrictor, jive::solver::DenseRestrictor, and jive::solver::SparseRestrictor.
|
pure virtual |
Multiplies the vector rhs with this matrix and stores the result in the vector lhs. The sizes of the two vectors must be compatible with the shape of this matrix.
lhs | - the result vector. |
rhs | - the vector to be multiplied by this matrix. |
Implemented in jive::algebra::SparseMatrix, jive::algebra::DenseMatrixObject, jive::algebra::MPMatrixObject, jive::algebra::IdentMatrixObject, jive::algebra::NullMatrixObject, jive::algebra::ConstrainedMatrix, jive::solver::DualPrecon, jive::solver::SchurMatrix, jive::solver::SparseIFactor, jive::model::ImplicitMatrix, jive::solver::NeumannPrecon, jive::solver::CoarsePrecon, jive::solver::SolverPrecon, jive::solver::DiagPrecon, jive::implict::TransientMatrix, jive::solver::MPRestrictor, jive::solver::DummyPrecon, jive::solver::Preconditioner, jive::solver::DenseRestrictor, jive::solver::Restrictor, and jive::solver::SparseRestrictor.
bool jive::algebra::AbstractMatrix::isSquare | ( | ) | const |
|
static |
|
virtual |
Returns a pointer to the Class
instance representing the runtime class of this object. If T
denotes the runtime class of this object, then this function is equivalent with T::getType()
. The pointer is valid during the entire lifetime of the program.
Class
instance representing the runtime class of this object. Reimplemented from jem::Object.
Reimplemented in jive::algebra::SparseMatrix.
jem::util::Event<Self&> jive::algebra::AbstractMatrix::newShapeEvent |
The newShapeEvent
is emitted whenever the shape of this matrix changes. The event argument is a reference to this AbstractMatrix
object.
jem::util::Event<Self&> jive::algebra::AbstractMatrix::newValuesEvent |
The newValuesEvent
is emitted whenever the contents of this matrix have been modified. The event argument is a reference to this AbstractMatrix
object.
Note that the newValuesEvent
does not have to be emitted when the newShapeEvent
is emitted; if the the shape of a matrix has been modified, then, by definition, its contents have been modified too.