Jive reference manual
|
Provides a straightforward implementation of the VectorSpace
class.
More...
Public Member Functions | |
StdVectorSpace () | |
Constructs a vector space with zero size. More... | |
StdVectorSpace (int size) | |
Constructs a vector space with a given size. More... | |
void | resize (int n) |
Sets the size of this vector space. More... | |
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 product of several 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... | |
virtual int | size () const |
Returns the size of this vector space. More... | |
virtual void | print (const Vector &x) const |
Writes the constents of a vector to the standard output. More... | |
![]() | |
virtual 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... | |
Protected Member Functions | |
virtual | ~StdVectorSpace () |
![]() | |
virtual | ~VectorSpace () |
![]() | |
Collectable () | |
Creates an empty Collectable . More... | |
~Collectable () | |
Frees resources. More... | |
Additional Inherited Members | |
![]() | |
typedef util::Vector | Vector |
A vector type. More... | |
typedef util::Matrix | Matrix |
A matrix type. More... | |
![]() | |
static Class * | getType () |
Returns the Class instance representing the Object class. More... | |
![]() | |
jem::util::Event< int > | resizeEvent |
Signals that the size of this vector space has changed. More... | |
#include <jive/algebra/StdVectorSpace.h>
The StdVectorSpace
class is a subclass of the VectorSpace
class that provides a straightforward implementation of the scalar product of two vectors. If x
and y
denote two vectors of the same size, then the scalar product s
of these two vectors is computed as:
Or, using an array expression:
jive::algebra::StdVectorSpace::StdVectorSpace | ( | ) |
Constructs a vector space with zero size.
this->size() == 0
|
explicit |
Constructs a vector space with size size.
size | - the size of this vector space. |
size >= 0
this->size() == size
|
protectedvirtual |
void jive::algebra::StdVectorSpace::resize | ( | int | n | ) |
Sets the size of this vector space to n. This function emits the event resizeEvent
if the new size is different from the current size.
n | - the new size of this vector space. |
n >= 0
this->size() == n
|
virtual |
Returns the scalar product of the vectors x and y. The implementation provided by the StdVectorSpace
class simply executes:
Implements jive::algebra::VectorSpace.
|
virtual |
Fills the vector a with the scalar products of the columns of the matrices x and y. The implementation provided by the StdVectorClass
is given by:
Reimplemented from jive::algebra::VectorSpace.
|
virtual |
Fills the vector a with the scalar products of the vector x with the columns of the matrix y. If the size of a is larger than n
, with n
equal to the number of columns in y, then a
[n] is set to the scalar product of x with itself. The implementation of this function provided by the StdVectorSpace
classes calls the function matmul
to compute the scalar products.
Reimplemented from jive::algebra::VectorSpace.
|
virtual |
Returns the size of this vector space.
Implements jive::algebra::VectorSpace.
|
virtual |
Writes the contents of the vector x to the standard output. The output format is unspecified. Use this function for debugging purposes.
x | - the vector to be printed. |
x.size() == this->size()
Implements jive::algebra::VectorSpace.