#include <space.hh>
Inheritance diagram for RVL::StdSpace< Scalar, DataType >:
Public Member Functions | |
StdSpace () | |
StdSpace (const StdSpace< Scalar, DataType > &sp) | |
virtual | ~StdSpace () |
virtual DataContainerFactory const & | getDCF () const =0 |
access to DataContainerFactory | |
virtual LinearAlgebraPackage< Scalar > const & | getLAP () const =0 |
access to LinearAlgebraPackage | |
DataContainer * | buildDataContainer () const |
bool | operator== (const Space< Scalar > &sp) const |
comparison: first check for identity of addresses. | |
bool | isCompatible (DataContainer const &dc) const |
Scalar | inner (DataContainer const &x, DataContainer const &y) const |
void | zero (DataContainer &x) const |
void | linComb (Scalar a, DataContainer const &x, Scalar b, DataContainer &y) const |
ostream & | write (ostream &str) const |
This construction implements Space by pairing a DataContainerFactory (access to vectors) and a LinearAlgebraPackage (access to ops), both defined abstractly through methods returning appropriate references. All other methods (expressing vector space behaviour) implemented in this base class.
A typical implementation will provide a LinAlgPack and a DataContainerFactory, either as arguments to the constructor or through some internal construction mechanism, and return references to these. Thus only two methods need be implemented.
We could provide a concrete subclass which takes the LAP and DCF as constructor args. However this class would hardly ever be used, as LAPs and DCFs are not natural data in most apps.
Note that the LinearAlgebraPackage needs a separate template parameter for the DataType in the LDCs. In most cases, this is the same as the Scalar type.
Definition at line 276 of file space.hh.
RVL::StdSpace< Scalar, DataType >::StdSpace | ( | ) |
RVL::StdSpace< Scalar, DataType >::StdSpace | ( | const StdSpace< Scalar, DataType > & | sp | ) |
virtual RVL::StdSpace< Scalar, DataType >::~StdSpace | ( | ) | [virtual] |
virtual DataContainerFactory const& RVL::StdSpace< Scalar, DataType >::getDCF | ( | ) | const [pure virtual] |
virtual LinearAlgebraPackage<Scalar> const& RVL::StdSpace< Scalar, DataType >::getLAP | ( | ) | const [pure virtual] |
DataContainer* RVL::StdSpace< Scalar, DataType >::buildDataContainer | ( | ) | const [virtual] |
Implements RVL::Space< Scalar >.
Definition at line 291 of file space.hh.
References RVL::Factory< T >::build(), and RVL::StdSpace< Scalar, DataType >::getDCF().
bool RVL::StdSpace< Scalar, DataType >::operator== | ( | const Space< Scalar > & | sp | ) | const [virtual] |
comparison: first check for identity of addresses.
If these are equal, a very low-cost comparison has succeeded. Otherwise, delegate the decision to the comparison methods of the DC factory and LA package.
Implements RVL::Space< Scalar >.
Definition at line 297 of file space.hh.
References RVL::StdSpace< Scalar, DataType >::getDCF(), and RVL::StdSpace< Scalar, DataType >::getLAP().
bool RVL::StdSpace< Scalar, DataType >::isCompatible | ( | DataContainer const & | dc | ) | const [virtual] |
Implements RVL::Space< Scalar >.
Definition at line 311 of file space.hh.
References RVL::StdSpace< Scalar, DataType >::getDCF(), and RVL::DataContainerFactory::isCompatible().
Scalar RVL::StdSpace< Scalar, DataType >::inner | ( | DataContainer const & | x, | |
DataContainer const & | y | |||
) | const [virtual] |
Implements RVL::Space< Scalar >.
Definition at line 316 of file space.hh.
References RVL::DataContainer::eval(), and RVL::StdSpace< Scalar, DataType >::getLAP().
void RVL::StdSpace< Scalar, DataType >::zero | ( | DataContainer & | x | ) | const [virtual] |
Implements RVL::Space< Scalar >.
Definition at line 332 of file space.hh.
References RVL::DataContainer::eval(), and RVL::StdSpace< Scalar, DataType >::getLAP().
void RVL::StdSpace< Scalar, DataType >::linComb | ( | Scalar | a, | |
DataContainer const & | x, | |||
Scalar | b, | |||
DataContainer & | y | |||
) | const [virtual] |
Implements RVL::Space< Scalar >.
Definition at line 344 of file space.hh.
References RVL::DataContainer::eval(), and RVL::StdSpace< Scalar, DataType >::getLAP().
ostream& RVL::StdSpace< Scalar, DataType >::write | ( | ostream & | str | ) | const [virtual] |
Implements RVL::Writeable.
Definition at line 358 of file space.hh.
References RVL::StdSpace< Scalar, DataType >::getDCF(), RVL::StdSpace< Scalar, DataType >::getLAP(), and RVL::Writeable::write().