ML Version of the Day
Public Member Functions | Friends
MLAPI::MultiVector Class Reference

Basic class for distributed double-precision vectors. More...

#include <MLAPI_MultiVector.h>

Inheritance diagram for MLAPI::MultiVector:
Inheritance graph
[legend]
Collaboration diagram for MLAPI::MultiVector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool IsAlias (const MultiVector &rhs) const
 MultiVector ()
 Default constructor.
 MultiVector (const Space &VectorSpace, const int NumVectors=1, bool SetToZero=true)
 Constructor for a given Space.
 MultiVector (const Space &VectorSpace, double **Values, const int NumVectors=1)
 Constructor with a given Space, and user-provided array of values.
 MultiVector (const Space &VectorSpace, Teuchos::RefCountPtr< DoubleVector > RCPValues)
 Constructor with a given Space, and user-provided RefCountPtr.
 MultiVector (const Space &VectorSpace, std::vector< Teuchos::RefCountPtr< DoubleVector > > RCPValues)
 Constructor with a given Space, and user-provided array of values.
 MultiVector (const MultiVector &rhs)
 Copy constructor.
 ~MultiVector ()
 Destructor.
void Reshape ()
 Resets this object.
void Reshape (const Space &S, const int NumVectors=1, const bool SetToZero=true)
 Sets the space of this vector.
void Append (const int NumVectors=1, const bool SetToZero=true)
 Appends a new vector.
void Append (const MultiVector &rhs)
 Appends a new vector.
void Delete (const int v)
 Deletes the last vector.
MultiVectoroperator= (double rhs)
 Sets all elements of this vector to rhs.
MultiVectoroperator= (const MultiVector &rhs)
 Copies the rhs into this object.
MultiVectoroperator= (const BaseLinearCombination &rhs)
 Sets the elements from the input BaseLinearCombination.
bool operator== (const MultiVector &rhs) const
MultiVectoroperator= (const std::string &Label)
 Sets the name of this object, does not touch vector elements or space.
const double & operator() (const int i) const
 Returns the value of local element i (const version).
double & operator() (const int i)
 Returns the value of local element i (non-const version).
const double & operator() (const int i, const int v) const
 Returns the value of local element i.
double & operator() (const int i, const int v)
 Returns the value of local element i (non-const version)
const SpaceGetVectorSpace () const
 Returns the Space on which this vector is defined.
SpaceGetVectorSpace ()
 Returns the Space on which this vector is defined (non-const)
int GetNumVectors () const
 Returns the number of vectors.
int GetMyLength () const
 Returns the local length of each vector.
int GetGlobalLength () const
 Returns the global length of each vector.
double * GetValues (const int v)
 Returns a pointer to the double array (non-const version)
const double * GetValues (const int v) const
 Returns a pointer to the double array (const version)
Teuchos::RefCountPtr
< DoubleVector > & 
GetRCPValues (const int v)
 Returns a pointer to the double array (non-const version)
const Teuchos::RefCountPtr
< DoubleVector > & 
GetRCPValues (const int v) const
 Returns a pointer to the double array (const version)
void SetRCPValues (const Teuchos::RefCountPtr< DoubleVector > &RCPValues, const int v)
 Sets the RefCountPtr<Values_>
void Update (const double alpha, int v=-1)
 Sets this(v) = rhs.
void Update (const MultiVector &rhs)
 Sets this = rhs.
void Update (double alpha, const MultiVector &rhs)
 Sets this = alpha * rhs.
void Update (double alpha, const MultiVector &x, double beta, const MultiVector &y)
 Sets this = alpha * x + beta * y.
void Update (double alpha, const MultiVector &rhs, double beta)
 Sets this = alpha * rhs + beta * this.
double DotProduct (const MultiVector &rhs, int v=-1) const
 Computes the dot product between this vector and rhs.
double Norm2 (int v=-1) const
 Computes the 2-norm of this vector.
double NormInf (int v=-1) const
 Computes the infinite norm of this vector.
double NormOne (int v=-1) const
 Computes the one norm of this vector.
void Reciprocal (int v=-1)
 Replaces each element of the vector with its reciprocal.
void Scale (const double Factor, int v=-1)
 Scales each element by the specified factor.
void Random (int v=-1)
 Populates the vector with random elements.
void Sort (int v=-1, const bool IsIncreasing=false)
 Sorts the component of the vector.
virtual std::ostream & Print (std::ostream &os, const bool verbose=true) const
 Prints basic information about this object on std::ostream.

Friends

std::ostream & operator<< (std::ostream &os, MultiVector const &mv)

Detailed Description

Basic class for distributed double-precision vectors.

Author:
Marzio Sala, SNL 9214.
Date:
Last updated on Feb-05.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends