Jive reference manual
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
jive::algebra::AbstractMatrix Class Referenceabstract

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::ClassgetClass () const
 Returns the Class instance representing the runtime class of this object. More...
 
- Public Member Functions inherited from jem::Object
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< Objectclone () const
 Returns a copy of this object. More...
 

Static Public Member Functions

static jem::ClassgetType ()
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 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

- Protected Member Functions inherited from jem::Collectable
 Collectable ()
 Creates an empty Collectable. More...
 
 ~Collectable ()
 Frees resources. More...
 

Detailed Description

#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.

See also
VectorSpace.

Member Typedef Documentation

The Self type is a convenient synonym for AbstractMatrix.

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.

Member Function Documentation

Shape jive::algebra::AbstractMatrix::shape ( ) const
pure virtual
virtual void jive::algebra::AbstractMatrix::matmul ( const Vector lhs,
const Vector rhs 
) const
pure virtual
bool jive::algebra::AbstractMatrix::isSquare ( ) const

Tests whether this matrix has a square shape.

Returns
( shape()[0] == shape()[1] )
static jem::Class* jive::algebra::AbstractMatrix::getType ( )
static
virtual jem::Class* jive::algebra::AbstractMatrix::getClass ( ) const
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.

Returns
A pointer to the Class instance representing the runtime class of this object.

Reimplemented from jem::Object.

Reimplemented in jive::algebra::SparseMatrix.

Member Data Documentation

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.