LAMA
lama::DenseVector< T > Class Template Reference

The template DenseVector represents a distributed 1D Vector with elements of type T. More...

#include <DenseVector.hpp>

Inheritance diagram for lama::DenseVector< T >:

Public Types

typedef T ValueType
 the Type of elements of this.
typedef const VectorExpressionMemberType
 ExpressionMemberType is the type that is used the template Expression to store a Vector.

Public Member Functions

 DenseVector ()
 Default constructor, creates replicated 0 vector.
 DenseVector (DistributionPtr distribution)
 creates a not initialized distributed DenseVector of the passed global size.
 DenseVector (const IndexType size, const ValueType value)
 creates a replicated DenseVector of the passed size initialized to the passed value.
 DenseVector (DistributionPtr distribution, const ValueType value)
 creates a distributed DenseVector of the passed global size initialized to the passed value.
template<typename OtherValueType >
 DenseVector (const IndexType size, const OtherValueType *values)
 Constructor of a replicated vector by replicated C++ array.
 DenseVector (const DenseVector< ValueType > &other)
 Override the default assignment operator.
 DenseVector (const Vector &other)
 More general constructor that creates a copy of an arbitrary vector.
 DenseVector (const Vector &other, DistributionPtr distribution)
 creates a redistributed copy of the passed vector
 DenseVector (const _LAMAArray &localValues, DistributionPtr distribution)
 creates a distributed DenseVector with given local values.
 DenseVector (const std::string &filename)
 This constructor creates a vector with the size and values stored in the file with the given filename.
 DenseVector (const Expression< Scalar, Vector, Times > &expression)
 creates a DenseVector with the Expression alpha*x.
 DenseVector (const Expression< Expression< Scalar, Vector, Times >, Expression< Scalar, Vector, Times >, Plus > &expression)
 creates a DenseVector with the Expression alpha*x+beta*y.
 DenseVector (const Expression< Expression< Scalar, Expression< Matrix, Vector, Times >, Times >, Expression< Scalar, Vector, Times >, Plus > &expression)
 creates a DenseVector with the Expression alpha * A * x + beta * y.
 DenseVector (const Expression< Scalar, Expression< Matrix, Vector, Times >, Times > &expression)
 creates a DenseVector with the Expression alpha*A*x.
 DenseVector (const Expression< Matrix, Vector, Times > &expression)
 creates a DenseVector with the Expression A*x.
virtual ~DenseVector ()
 releases all allocated resources.
void allocate (DistributionPtr distribution)
 Allocate a vector with a certain distribution, values are undefined.
DenseVectoroperator= (const DenseVector< T > &other)
 Override the default assignment operator.
DenseVectoroperator= (const Scalar)
 Reimplement scalar assignment as otherwise type conversion rules do not apply.
virtual Scalar::ScalarType getValueType () const
 Query the value type of the vector elements, e.g.
virtual void buildValues (_LAMAArray &values) const
 Implementation of pure method.
virtual void setValues (const _LAMAArray &values)
 Implementation of pure method.
virtual std::auto_ptr< Vectorcreate () const
 Create is a virtual constructor, which creates a new Vector with the same concrete class, size and distribuiton than this.
virtual std::auto_ptr< Vectorcreate (DistributionPtr distribution) const
 Create is a virtual constructor, which creates a new Vector with the same concrete class than this.
LAMAArray< T > & getLocalValues ()
 get a non constant reference to local values of this Dense Vector.
const LAMAArray< T > & getLocalValues () const
 get a constant reference to local values of this Dense Vector.
LAMAArray< T > & getHaloValues () const
 get a reference to halo values of this Dense Vector.
void updateHalo (const Halo &halo) const
 update the halo values according to the passed Halo.
std::auto_ptr< SyncTokenupdateHaloAsync (const Halo &halo) const
 update the halo values according to the passed Halo asynchronously.
virtual Scalar getValue (IndexType globalIndex) const
 returns a copy of the value at the passed global index.
virtual Scalar min () const
 returns the global minimum value of this.
virtual Scalar max () const
 returns the global maximum value of this.
virtual Scalar l1Norm () const
 returns the L1 norm of this.
virtual Scalar l2Norm () const
 returns the L2 norm of this.
virtual Scalar maxNorm () const
 returns the max norm of this.
virtual void swap (Vector &other)
 Swap the content of of this vector with another vector.
virtual void writeAt (std::ostream &stream) const
 Write some information about this to the passed stream.
virtual void assign (const Expression< Expression< Scalar, Vector, Times >, Expression< Scalar, Vector, Times >, Plus > &expression)
 Assignment of a 'full' vector expression.
virtual void assign (const Scalar value)
 Assign this vector with a scalar values, does not change size, distribution.
virtual void assign (const Vector &other)
 Assign this vector with another vector, inherits size and distribution.
virtual void assign (const _LAMAArray &localValues, DistributionPtr dist)
 Assignment to vector by local values and distribution.
virtual void buildLocalValues (_LAMAArray &localValues) const
 Build an array with local values of a distributed vector.
virtual Scalar dotProduct (const Vector &other) const
virtual void prefetch (const ContextPtr location) const
 Starts a prefetch to make this valid at the passed context.
virtual void wait () const
 wait for a possibly running prefetch.
virtual void invert ()
 This method inverts all elements of the vector and is completely local.
virtual size_t getMemoryUsage () const
 getMemoryUsage returns the global memory that is allocated to hold this vector.
virtual void redistribute (DistributionPtr distribution)
 redistributes this vector to the new passed distribution.
void writeToFile (const std::string &fileBaseName, const File::FileType fileType=File::XDR, const File::DataType dataType=File::DOUBLE) const
Vectoroperator*= (const Scalar value)
Vectoroperator+= (const Vector &other)
Vectoroperator+= (const Expression< Scalar, Vector, Times > &expression)
Vectoroperator-= (const Vector &other)
const Scalar operator() (const IndexType i) const
 returns a copy of the value at the passed global index.
Scalar operator* (const Vector &other) const
 returns the dot product of this and other
IndexType size () const
 Returns the size of the vector.
void setContext (ContextPtr location)
 Set the 'preferred' context where data resides and computations are done.
ContextPtr getContext () const
 Getter for the context (pointer) of a vector.
void resize (DistributionPtr distributionPtr)
 Allocate this vector for a given distribution.
const DistributiongetDistribution () const
DistributionPtr getDistributionPtr () const

Static Public Member Functions

static void vectorPlusVector (ContextPtr context, LAMAArrayView< T > result, const T alpha, const LAMAArrayConstView< T > x, const T beta, const LAMAArrayConstView< T > y)
static std::auto_ptr< VectorcreateVector (const Scalar::ScalarType valueType, DistributionPtr distribution)

Protected Member Functions

virtual void resizeImpl ()
 LAMA_LOG_DECL_STATIC_LOGGER (logger)
void swap (Distributed &other)
void swapVector (Vector &other)
 Swap member variables of Vector class.
void setDistributionPtr (DistributionPtr distributionPtr)

Protected Attributes

ContextPtr mContext
 decides about location of vector operations

Private Member Functions

long getDataTypeSize (const File::DataType dataType) const
void writeVectorToFormattedFile (const std::string &fileName) const
void writeVectorToBinaryFile (const std::string &fileName, const long outputDataTypeSize) const
void writeVectorToXDRFile (const std::string &fileName, const long outputDataTypeSize) const
void writeVectorDataToBinaryFile (std::fstream &outFile, const long dataTypeSize) const
void readVectorHeader (const std::string &filename, File::FileType &fileType, long &dataTypeSize)
void writeVectorHeader (const std::string &fileName, const File::FileType &fileType, const long dataTypeSize) const
void writeVectorToMMFile (const std::string &filename, const File::DataType &dataType) const
void readVectorFromFormattedFile (const std::string &fileName)
void readVectorFromBinaryFile (const std::string &fileName, const long dataTypeSize)
void readVectorFromXDRFile (const std::string &fileName, const long dataTypeSizeHeader)
void readVectorDataFromBinaryFile (std::fstream &inFile, const long dataTypeSize)

Private Attributes

LAMAArray< T > mLocalValues
 my local values of vector
LAMAArray< T > mHaloValues
 my halo values of vector

Detailed Description

template<typename T>
class lama::DenseVector< T >

The template DenseVector represents a distributed 1D Vector with elements of type T.

Parameters:
Tthe value type for the elements of this.

Member Typedef Documentation

typedef const Vector& lama::Vector::ExpressionMemberType [inherited]

ExpressionMemberType is the type that is used the template Expression to store a Vector.

template<typename T>
typedef T lama::DenseVector< T >::ValueType

the Type of elements of this.


Constructor & Destructor Documentation

template<typename T >
lama::DenseVector< T >::DenseVector ( )

Default constructor, creates replicated 0 vector.

template<typename T >
lama::DenseVector< T >::DenseVector ( DistributionPtr  distribution)

creates a not initialized distributed DenseVector of the passed global size.

Parameters:
[in]distributionthe distribution to use for the new vector.
template<typename T >
lama::DenseVector< T >::DenseVector ( const IndexType  size,
const ValueType  value 
)

creates a replicated DenseVector of the passed size initialized to the passed value.

Parameters:
[in]sizethe size of the new DenseVector.
[in]valuethe value to assign to all elements of the new DenseVector.
template<typename T >
lama::DenseVector< T >::DenseVector ( DistributionPtr  distribution,
const ValueType  value 
)

creates a distributed DenseVector of the passed global size initialized to the passed value.

Parameters:
[in]distributionthe distribution to use for the new vector.
[in]valuethe value to assign to all elements of the new DenseVector.
template<typename T >
template<typename OtherValueType >
lama::DenseVector< T >::DenseVector ( const IndexType  size,
const OtherValueType *  values 
)

Constructor of a replicated vector by replicated C++ array.

creates a new replicated DenseVector initialized with the passed values.

Parameters:
[in]sizethe size of the new DenseVector.
[in]valuesthe values to initialize the new DenseVector with.

References lama::DenseVector< T >::mLocalValues, and lama::Vector::size().

template<typename T >
lama::DenseVector< T >::DenseVector ( const DenseVector< ValueType > &  other)

Override the default assignment operator.

Parameters:
[in]otherthe dense vector that will be copied

The new constructed vector has the same distribution as the input vector.

References lama::Distributed::getDistribution(), lama::DenseVector< T >::getLocalValues(), lama::DenseVector< T >::mLocalValues, and lama::Vector::size().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Vector other)

More general constructor that creates a copy of an arbitrary vector.

References lama::DenseVector< T >::allocate(), lama::DenseVector< T >::assign(), and lama::Distributed::getDistributionPtr().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Vector other,
DistributionPtr  distribution 
)

creates a redistributed copy of the passed vector

Parameters:
[in]otherthe vector to take a copy from
[in]distributionthe distribution to use for the new vector.

Must be valid: other.size() == distribution.getGlobalSize()

References lama::DenseVector< T >::assign(), and lama::DenseVector< T >::redistribute().

template<typename T >
lama::DenseVector< T >::DenseVector ( const _LAMAArray localValues,
DistributionPtr  distribution 
)

creates a distributed DenseVector with given local values.

Parameters:
[in]localValuesthe local values to initialize the new DenseVector with.
[in]distributionthe distribution the

References lama::DenseVector< T >::assign(), LAMA_ASSERT_EQUAL_ERROR, lama::DenseVector< T >::mLocalValues, and lama::_LAMAArray::size().

template<typename T >
lama::DenseVector< T >::DenseVector ( const std::string &  filename)

This constructor creates a vector with the size and values stored in the file with the given filename.

Parameters:
[in]filenamethe name of the file to read the Vector from.

The distribution of the vector is CYCLIC(n) where n is the size of the vector. So only the first processor will hold all values.

Note: Only the first processor will read the matrix file.

References lama::File::BINARY, lama::File::FORMATTED, lama::CommunicatorFactory::get(), and lama::File::XDR.

template<typename T >
lama::DenseVector< T >::DenseVector ( const Expression< Scalar, Vector, Times > &  expression)

creates a DenseVector with the Expression alpha*x.

Parameters:
[in]expressionalpha*x

References lama::DenseVector< T >::operator=().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Expression< Expression< Scalar, Vector, Times >, Expression< Scalar, Vector, Times >, Plus > &  expression)

creates a DenseVector with the Expression alpha*x+beta*y.

Parameters:
[in]expressiona*x+b*y

References lama::DenseVector< T >::allocate(), lama::Distributed::getDistributionPtr(), and lama::DenseVector< T >::operator=().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Expression< Expression< Scalar, Expression< Matrix, Vector, Times >, Times >, Expression< Scalar, Vector, Times >, Plus > &  expression)

creates a DenseVector with the Expression alpha * A * x + beta * y.

Parameters:
[in]expressiona*A*x+b*y

References lama::DenseVector< T >::allocate(), lama::Distributed::getDistributionPtr(), and lama::DenseVector< T >::operator=().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Expression< Scalar, Expression< Matrix, Vector, Times >, Times > &  expression)

creates a DenseVector with the Expression alpha*A*x.

Parameters:
[in]expressiona*A*x

References lama::DenseVector< T >::allocate(), lama::Distributed::getDistributionPtr(), and lama::DenseVector< T >::operator=().

template<typename T >
lama::DenseVector< T >::DenseVector ( const Expression< Matrix, Vector, Times > &  expression)
template<typename T >
lama::DenseVector< T >::~DenseVector ( ) [virtual]

releases all allocated resources.


Member Function Documentation

template<typename T >
void lama::DenseVector< T >::allocate ( DistributionPtr  distribution)

Allocate a vector with a certain distribution, values are undefined.

Referenced by lama::DenseVector< T >::DenseVector(), and lama::DenseMatrix< T >::getDiagonalImpl().

template<typename T >
void lama::DenseVector< T >::assign ( const Scalar  value) [virtual]

Assign this vector with a scalar values, does not change size, distribution.

Implements lama::Vector.

References lama::LAMAArrayUtils::assign().

template<typename T >
void lama::DenseVector< T >::assign ( const Vector other) [virtual]

Assign this vector with another vector, inherits size and distribution.

Implements lama::Vector.

References lama::Vector::buildLocalValues(), and lama::Distributed::getDistributionPtr().

template<typename T >
void lama::DenseVector< T >::assign ( const _LAMAArray localValues,
DistributionPtr  distribution 
) [virtual]

Assignment to vector by local values and distribution.

Implements lama::Vector.

References lama::LAMAArrayUtils::assign(), LAMA_ASSERT_EQUAL_ERROR, and lama::_LAMAArray::size().

template<typename T >
void lama::DenseVector< T >::buildLocalValues ( _LAMAArray localValues) const [virtual]

Build an array with local values of a distributed vector.

Parameters:
[out]localValueswill be an array that contains local values of the vector

For different value types, implicit format conversion will be done. A sparse vector should generate an array with all values.

Implements lama::Vector.

References lama::LAMAArrayUtils::assign().

template<typename T >
void lama::DenseVector< T >::buildValues ( _LAMAArray values) const [virtual]

Implementation of pure method.

Implements lama::Vector.

References lama::LAMAArrayUtils::assign().

template<typename T >
std::auto_ptr< Vector > lama::DenseVector< T >::create ( ) const [virtual]

Create is a virtual constructor, which creates a new Vector with the same concrete class, size and distribuiton than this.

Returns:
a pointer to the new Vector, caller has the owner ship.

Implements lama::Vector.

template<typename T >
std::auto_ptr< Vector > lama::DenseVector< T >::create ( DistributionPtr  distribution) const [virtual]

Create is a virtual constructor, which creates a new Vector with the same concrete class than this.

Parameters:
[in]distributionthe distribution to use for the new Vector.
Returns:
a pointer to the new Vector, caller has the owner ship.

Implements lama::Vector.

References lama::Vector::setContext().

ContextPtr lama::Vector::getContext ( ) const [inline, inherited]

Getter for the context (pointer) of a vector.

References lama::Vector::mContext.

template<typename T >
long lama::DenseVector< T >::getDataTypeSize ( const File::DataType  dataType) const [private]
template<typename T>
LAMAArray<T>& lama::DenseVector< T >::getHaloValues ( ) const [inline]

get a reference to halo values of this Dense Vector.

Returns:
a reference to the halo values of this.

Referenced by lama::SOR::iterateImpl(), lama::SpecializedJacobi::iterateTyped(), and lama::SparseMatrix< T >::matrixTimesVectorImpl().

template<typename T>
const LAMAArray<T>& lama::DenseVector< T >::getLocalValues ( ) const [inline]

get a constant reference to local values of this Dense Vector.

Returns:
a constant reference to the local values of this.
template<typename T >
size_t lama::DenseVector< T >::getMemoryUsage ( ) const [virtual]

getMemoryUsage returns the global memory that is allocated to hold this vector.

getMemoryUsage returns the global memory that is allocated to hold this vector. For a distributed vector all partitions are summed together.

Returns:
the memory consumption of this vector.

Implements lama::Vector.

template<typename T >
Scalar lama::DenseVector< T >::getValue ( IndexType  globalIndex) const [virtual]

returns a copy of the value at the passed global index.

Parameters:
[in]globalIndexthe global index to get the value at.
Returns:
a copy of the value at the passed global position.

As this operation requires communication in SPMD mode it can be very inefficient in some situations.

Implements lama::Vector.

References lama::nIndex.

template<typename T >
Scalar::ScalarType lama::DenseVector< T >::getValueType ( ) const [virtual]

Query the value type of the vector elements, e.g.

DOUBLE or FLOAT.

Implements lama::Vector.

template<typename T >
void lama::DenseVector< T >::invert ( ) [virtual]

This method inverts all elements of the vector and is completely local.

Implements lama::Vector.

References lama::WriteAccess< T >::get(), LAMA_CONTEXT_ACCESS, and LAMA_INTERFACE_FN_T.

template<typename T >
Scalar lama::DenseVector< T >::l1Norm ( ) const [virtual]

returns the L1 norm of this.

Returns:
the L1 norm of this.

l1Norm computes the sum of the absolute values of this.

Implements lama::Vector.

References lama::ReadAccess< T >::get(), lama::LAMAInterface::getBLAS1Interface(), lama::LAMAInterfaceRegistry::getInterface(), lama::LAMAInterfaceRegistry::getRegistry(), and LAMA_CONTEXT_ACCESS.

template<typename T >
Scalar lama::DenseVector< T >::l2Norm ( ) const [virtual]

returns the L2 norm of this.

Returns:
the L2 norm of this.

l2Norm computes the sum of the absolute values of this.

Implements lama::Vector.

References lama::ReadAccess< T >::get(), lama::LAMAInterface::getBLAS1Interface(), lama::LAMAInterfaceRegistry::getInterface(), lama::LAMAInterfaceRegistry::getRegistry(), LAMA_CONTEXT_ACCESS, and lama::sqrt().

template<typename T>
lama::DenseVector< T >::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [protected]

Reimplemented from lama::Vector.

template<typename T >
Scalar lama::DenseVector< T >::max ( ) const [virtual]

returns the global maximum value of this.

Returns:
the global maximum value of this vector.

Implements lama::Vector.

References lama::max(), and lama::ReadAccess< T >::size().

template<typename T >
Scalar lama::DenseVector< T >::maxNorm ( ) const [virtual]

returns the max norm of this.

Returns:
the max norm of this.

maxNorm computes the value of this with the largest magnitude.

Implements lama::Vector.

References lama::ReadAccess< T >::get(), LAMA_CONTEXT_ACCESS, LAMA_INTERFACE_FN_DEFAULT_T, and lama::Communicator::max().

template<typename T >
Scalar lama::DenseVector< T >::min ( ) const [virtual]

returns the global minimum value of this.

Returns:
the global minimum value of this vector.

Implements lama::Vector.

References lama::min(), and lama::ReadAccess< T >::size().

const Scalar lama::Vector::operator() ( const IndexType  i) const [inherited]

returns a copy of the value at the passed global index.

Parameters:
[in]ithe global index to get the value at.
Returns:
a copy of the value at the passed global position.

As this operator requires communication ins SPMD mode it can be very inefficient in some situations.

References lama::Vector::getValue().

Scalar lama::Vector::operator* ( const Vector other) const [inherited]

returns the dot product of this and other

Parameters:
[in]otherthe vector do calculate the dot product with.
Returns:
the dot product of this and other

References lama::Vector::dotProduct(), and LAMA_REGION.

Vector & lama::Vector::operator*= ( const Scalar  value) [inherited]
Vector & lama::Vector::operator+= ( const Vector other) [inherited]
Vector & lama::Vector::operator+= ( const Expression< Scalar, Vector, Times > &  expression) [inherited]
Vector & lama::Vector::operator-= ( const Vector other) [inherited]
template<typename T >
DenseVector< T > & lama::DenseVector< T >::operator= ( const DenseVector< T > &  other)

Override the default assignment operator.

Note: all other assignment operators are inherited from class Vector.

Referenced by lama::DenseVector< T >::DenseVector().

template<typename T >
DenseVector< T > & lama::DenseVector< T >::operator= ( const Scalar  value)

Reimplement scalar assignment as otherwise type conversion rules do not apply.

Reimplemented from lama::Vector.

template<typename T >
void lama::DenseVector< T >::prefetch ( const ContextPtr  context) const [virtual]

Starts a prefetch to make this valid at the passed context.

Parameters:
[in]contextspecifies the location to make this vector valid at

Implements lama::Vector.

Referenced by lama::DenseMatrix< T >::matrixTimesVectorImpl(), and lama::SparseMatrix< T >::matrixTimesVectorImpl().

template<typename T >
void lama::DenseVector< T >::readVectorDataFromBinaryFile ( std::fstream &  inFile,
const long  dataTypeSize 
) [private]
template<typename T >
void lama::DenseVector< T >::readVectorFromBinaryFile ( const std::string &  fileName,
const long  dataTypeSize 
) [private]

References LAMA_THROWEXCEPTION.

template<typename T >
void lama::DenseVector< T >::readVectorFromFormattedFile ( const std::string &  fileName) [private]

References LAMA_THROWEXCEPTION.

template<typename T >
void lama::DenseVector< T >::readVectorFromXDRFile ( const std::string &  fileName,
const long  dataTypeSizeHeader 
) [private]
template<typename T >
void lama::DenseVector< T >::readVectorHeader ( const std::string &  filename,
File::FileType fileType,
long &  dataTypeSize 
) [private]
template<typename T >
void lama::DenseVector< T >::redistribute ( DistributionPtr  distribution) [virtual]

redistributes this vector to the new passed distribution.

Parameters:
[in]distributionthe new distribution for this vector.

The global vector itself remains unchanged; only local parts can be now different.

Implements lama::Vector.

References lama::ReadAccess< T >::get(), lama::WriteAccess< T >::get(), LAMA_ASSERT_DEBUG, LAMA_ASSERT_EQUAL_ERROR, and lama::LAMAArray< T >::swap().

Referenced by lama::DenseVector< T >::DenseVector().

void lama::Vector::resize ( DistributionPtr  distributionPtr) [inherited]

Allocate this vector for a given distribution.

All elements of the vector are undefined after this operation. Elements can be set e.g. with

References lama::Vector::resizeImpl(), and lama::Distributed::setDistributionPtr().

Referenced by lama::SparseMatrix< T >::getDiagonal(), lama::CRTPMatrix< DenseMatrix< T >, T >::matrixTimesVector(), lama::SparseMatrix< T >::matrixTimesVector(), and lama::Vector::operator=().

template<typename T >
void lama::DenseVector< T >::resizeImpl ( ) [protected, virtual]
void lama::Vector::setContext ( ContextPtr  location) [inherited]

Set the 'preferred' context where data resides and computations are done.

References lama::Vector::mContext.

Referenced by lama::DenseVector< T >::create(), and lama::GMRES::initialize().

template<typename T >
void lama::DenseVector< T >::setValues ( const _LAMAArray values) [virtual]

Implementation of pure method.

Implements lama::Vector.

References lama::LAMAArrayUtils::assign(), LAMA_ASSERT_ERROR, and lama::_LAMAArray::size().

IndexType lama::Vector::size ( ) const [inline, inherited]

Returns the size of the vector.

Returns:
the size of this vector.

References lama::Distributed::getDistributionPtr().

Referenced by lama::DenseVector< T >::DenseVector(), and lama::Solver::solveInit().

void lama::Distributed::swap ( Distributed other) [protected, inherited]
template<typename T >
void lama::DenseVector< T >::swap ( Vector other) [virtual]

Swap the content of of this vector with another vector.

Parameters:
[in,out]otherthe Vector to swap the contents with.

Swap is only possible if both vectors are of the same kind (DENSE) and have the same value type.

Implements lama::Vector.

References LAMA_THROWEXCEPTION, lama::DenseVector< T >::mHaloValues, lama::DenseVector< T >::mLocalValues, and lama::Vector::swapVector().

void lama::Vector::swapVector ( Vector other) [protected, inherited]

Swap member variables of Vector class.

References lama::Vector::mContext, and lama::Vector::swap().

Referenced by lama::DenseVector< T >::swap().

template<typename T >
void lama::DenseVector< T >::updateHalo ( const Halo halo) const

update the halo values according to the passed Halo.

Parameters:
[in]halothe halo which describes which remote values should be put into the halo cache.

References lama::Halo::getHaloSize(), lama::WriteAccess< T >::release(), and lama::WriteAccess< T >::reserve().

Referenced by lama::SOR::iterateImpl().

template<typename T >
std::auto_ptr< SyncToken > lama::DenseVector< T >::updateHaloAsync ( const Halo halo) const

update the halo values according to the passed Halo asynchronously.

Parameters:
[in]halothe halo which describes which remote values should be put into the halo cache.
Returns:
a SyncToken which can be used to synchronize to the asynchronous update.

References lama::Halo::getHaloSize(), lama::WriteAccess< T >::release(), and lama::WriteAccess< T >::reserve().

template<typename T >
void lama::DenseVector< T >::wait ( ) const [virtual]

wait for a possibly running prefetch.

Implements lama::Vector.

template<typename T >
void lama::DenseVector< T >::writeAt ( std::ostream &  stream) const [virtual]

Write some information about this to the passed stream.

Parameters:
[out]streamthe stream to write to.

Reimplemented from lama::Vector.

template<typename T >
void lama::DenseVector< T >::writeToFile ( const std::string &  fileBaseName,
const File::FileType  fileType = File::XDR,
const File::DataType  dataType = File::DOUBLE 
) const
template<typename T >
void lama::DenseVector< T >::writeVectorDataToBinaryFile ( std::fstream &  outFile,
const long  dataTypeSize 
) const [private]
template<typename T >
void lama::DenseVector< T >::writeVectorHeader ( const std::string &  fileName,
const File::FileType fileType,
const long  dataTypeSize 
) const [private]
template<typename T >
void lama::DenseVector< T >::writeVectorToBinaryFile ( const std::string &  fileName,
const long  outputDataTypeSize 
) const [private]
template<typename T >
void lama::DenseVector< T >::writeVectorToFormattedFile ( const std::string &  fileName) const [private]
template<typename T >
void lama::DenseVector< T >::writeVectorToXDRFile ( const std::string &  fileName,
const long  outputDataTypeSize 
) const [private]

Field Documentation

ContextPtr lama::Vector::mContext [protected, inherited]

decides about location of vector operations

Referenced by lama::Vector::getContext(), lama::Vector::setContext(), lama::Vector::swapVector(), and lama::Vector::Vector().

template<typename T>
LAMAArray<T> lama::DenseVector< T >::mHaloValues [mutable, private]

my halo values of vector

Referenced by lama::DenseVector< T >::swap().


The documentation for this class was generated from the following files: