Jive reference manual
List of all members | Public Member Functions | Protected Member Functions
jive::algebra::MPVectorSpace Class Reference

#include <jive/algebra/MPVectorSpace.h>

Inheritance diagram for jive::algebra::MPVectorSpace:
Inheritance graph

Public Member Functions

 MPVectorSpace ()
 
 MPVectorSpace (const Ref< Super > &inner, const Ref< MPContext > &mpx, const Ref< ItemMask > &mask=NIL)
 
virtual void readFrom (ObjectInput &in)
 
virtual void writeTo (ObjectOutput &out) const
 
virtual Ref< Objectclone () const
 
virtual idx_t globalSize () const
 
virtual bool isDistributed () const
 
virtual double product (const Vector &x, const Vector &y) const
 Computes the scalar product of two vectors. More...
 
virtual void products (const Vector &a, const Matrix &x, const Matrix &y) const
 Computes the scalar products of multiple vectors. More...
 
virtual void project (const Vector &a, const Vector &x, const Matrix &y) const
 Computes the scalar product of a vector with several other vectors. More...
 
VectorSpacegetInner () const
 
ItemMaskgetItemMask () const
 
virtual DofSpacegetDofSpace () const
 
- Public Member Functions inherited from jive::algebra::VectorSpace
virtual int size () const =0
 Returns the size of this vector space. More...
 
virtual void print (const Vector &x) const =0
 Writes the constents of a vector to the standard output. More...
 
- Public Member Functions inherited from jem::Object
virtual ClassgetClass () 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< Objectclone () const
 Returns a copy of this object. More...
 

Protected Member Functions

virtual ~MPVectorSpace ()
 
- Protected Member Functions inherited from jive::algebra::VectorSpace
virtual ~VectorSpace ()
 
- Protected Member Functions inherited from jem::Collectable
 Collectable ()
 Creates an empty Collectable. More...
 
 ~Collectable ()
 Frees resources. More...
 
- Protected Member Functions inherited from jem::Clonable
virtual ~Clonable ()
 
virtual void emitVTable_ ()
 
- Protected Member Functions inherited from jem::Interface
virtual ~Interface ()
 Empty destructor. More...
 
- Protected Member Functions inherited from jem::io::Serializable
virtual ~Serializable ()
 
virtual void emitVtableFunc_ ()
 

Additional Inherited Members

- Public Types inherited from jive::algebra::VectorSpace
typedef util::Vector Vector
 A vector type. More...
 
typedef util::Matrix Matrix
 A matrix type. More...
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 Returns the Class instance representing the Object class. More...
 
- Public Attributes inherited from jive::algebra::VectorSpace
jem::util::Event< int > resizeEvent
 Signals that the size of this vector space has changed. More...
 

Constructor & Destructor Documentation

jive::algebra::MPVectorSpace::MPVectorSpace ( )
jive::algebra::MPVectorSpace::MPVectorSpace ( const Ref< Super > &  inner,
const Ref< MPContext > &  mpx,
const Ref< ItemMask > &  mask = NIL 
)
virtual jive::algebra::MPVectorSpace::~MPVectorSpace ( )
protectedvirtual

Member Function Documentation

virtual void jive::algebra::MPVectorSpace::readFrom ( ObjectInput in)
virtual

Implements jem::io::Serializable.

virtual void jive::algebra::MPVectorSpace::writeTo ( ObjectOutput out) const
virtual

Implements jem::io::Serializable.

virtual Ref<Object> jive::algebra::MPVectorSpace::clone ( ) const
virtual

Implements jem::Clonable.

virtual idx_t jive::algebra::MPVectorSpace::globalSize ( ) const
virtual
virtual bool jive::algebra::MPVectorSpace::isDistributed ( ) const
virtual
virtual double jive::algebra::MPVectorSpace::product ( const Vector x,
const Vector y 
) const
virtual

Returns the scalar product (dot product) of the vectors x and y.

Parameters
x- a vector.
y- another vector.
Precondition
x.size() == this->size() &&
y.size() == this->size()
Returns
The scalar product of x and y.

Implements jive::algebra::VectorSpace.

virtual void jive::algebra::MPVectorSpace::products ( const Vector a,
const Matrix x,
const Matrix y 
) const
virtual

Computes the scalar products of the columns of the matrices x and y. The products are stored in the vector a. To be precise, a[i] is set to the scalar product of the i-th columns of the matrices x and y.

The implementation of this function provoded by the VectorSpace class repeatedly calls the member function product(). Derived classes are encouraged to provide a more efficient implementation.

Parameters
a- a vector that will be filled with the scalar products.
x- the first input matrix.
y- the second input matrix.
Precondition
a.size() == x.size(1) &&
x.size(0) == this->size() &&
y.size(0) == this->size() &&
y.size(1) == x.size(1)

Reimplemented from jive::algebra::VectorSpace.

virtual void jive::algebra::MPVectorSpace::project ( const Vector a,
const Vector x,
const Matrix y 
) const
virtual

Fills the vector a with the scalar products of the vector x with the columns of the matrix y. That is, a[i] is set to the scalar product of x with the i-th column of y. If the size of the vector a is larger than n, with n the number of columns in the matrix y, then a[n] is set to the scalar product of the vector x with itself. This behavior is particularly handy when implementing algorithms that involve an orthogonalization procedure.

The implementation of this function provoded by the VectorSpace class repeatedly calls the member function product(). Derived classes are encouraged to provide a more efficient implementation.

Parameters
a- a vector that will be filled with the scalar products.
x- an input vector.
y- an input matrix.
Precondition
a.size() == y.size(1) &&
x.size() == this->size() &&
y.size(0) == this->size()

Reimplemented from jive::algebra::VectorSpace.

VectorSpace * jive::algebra::MPVectorSpace::getInner ( ) const
ItemMask * jive::algebra::MPVectorSpace::getItemMask ( ) const
virtual DofSpace* jive::algebra::MPVectorSpace::getDofSpace ( ) const
virtual