44#ifndef EPETRA_MULTIVECTOR_H
45#define EPETRA_MULTIVECTOR_H
320#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
323#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
347#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
348 int ReplaceGlobalValue(
int GlobalBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
350#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
351 int ReplaceGlobalValue(
long long GlobalBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
375#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
378#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
402#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
403 int SumIntoGlobalValue(
int GlobalBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
405#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
406 int SumIntoGlobalValue(
long long GlobalBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
434 int ReplaceMyValue(
int MyRow,
int VectorIndex,
double ScalarValue);
456 int ReplaceMyValue(
int MyBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
479 int SumIntoMyValue(
int MyRow,
int VectorIndex,
double ScalarValue);
501 int SumIntoMyValue(
int MyBlockRow,
int BlockRowOffset,
int VectorIndex,
double ScalarValue);
645 int Scale(
double ScalarValue);
703 int Norm1 (
double * Result)
const;
713 int Norm2 (
double * Result)
const;
722 int NormInf (
double * Result)
const;
752 int MinValue (
double * Result)
const;
764 int MaxValue (
double * Result)
const;
830 int Multiply(
char TransA,
char TransB,
double ScalarAB,
906 double *
const & operator [] (
int i)
const {
return Pointers_[i]; }
952 virtual void Print(std::ostream & os)
const;
978 int ResetView(
double ** ArrayOfPointers);
1017 int AllocateForView(
void);
1019 template<
typename int_type>
1020 int ChangeGlobalValue(int_type GlobalBlockRow,
1025 int ChangeMyValue(
int MyBlockRow,
1036 int * PermuteToLIDs,
1037 int * PermuteFromLIDs,
Epetra_BLAS(void)
Epetra_BLAS Constructor.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Epetra_CompObject()
Basic Epetra_CompObject constuctor.
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
virtual int CheckSizes(const Epetra_SrcDistObject &Source)=0
Allows the source and target (this) objects to be compared for compatibility, return nonzero if not.
virtual int UnpackAndCombine(const Epetra_SrcDistObject &Source, int NumImportIDs, int *ImportLIDs, int LenImports, char *Imports, int &SizeOfPacket, Epetra_Distributor &Distor, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor)=0
Perform any unpacking and combining after call to DoTransfer().
virtual int PackAndPrepare(const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)=0
Perform any packing or preparation required for call to DoTransfer().
virtual int CopyAndPermute(const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor, Epetra_CombineMode CombineMode=Zero)=0
Perform ID copies and permutations that are on processor.
Epetra_DistObject & operator=(const Epetra_DistObject &src)
Epetra_DistObject(const Epetra_BlockMap &Map)
Basic Epetra_DistObject constuctor.
virtual void Print(std::ostream &os) const
Print method.
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements.
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
int GlobalLength() const
Returns the global vector length of vectors in the multi-vector.
int NormInf(double *Result) const
Compute Inf-norm of each vector in multi-vector.
int Scale(double ScalarValue)
Scale the current values of a multi-vector, this = ScalarValue*this.
int NumVectors() const
Returns the number of vectors in the multi-vector.
int Reciprocal(const Epetra_MultiVector &A)
Puts element-wise reciprocal values of input Multi-vector in target.
int Abs(const Epetra_MultiVector &A)
Puts element-wise absolute values of input Multi-vector in target.
int SumIntoGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Adds ScalarValue to existing value at the specified (GlobalRow, VectorIndex) location.
int MinValue(double *Result) const
Compute minimum value of each vector in multi-vector.
int Dot(const Epetra_MultiVector &A, double *Result) const
Computes dot product of each corresponding pair of vectors.
int MyLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
int ExtractView(double **A, int *MyLDA) const
Set user-provided addresses of A and MyLDA.
void UpdateVectors() const
int NormWeighted(const Epetra_MultiVector &Weights, double *Result) const
Compute Weighted 2-norm (RMS Norm) of each vector in multi-vector.
bool ConstantStride() const
Returns true if this multi-vector has constant stride between vectors.
int ReplaceGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (GlobalRow, VectorIndex) location with ScalarValue.
int Stride() const
Returns the stride between vectors in the multi-vector (only meaningful if ConstantStride() is true).
double * Values() const
Get pointer to MultiVector values.
int Multiply(char TransA, char TransB, double ScalarAB, const Epetra_MultiVector &A, const Epetra_MultiVector &B, double ScalarThis)
Matrix-Matrix multiplication, this = ScalarThis*this + ScalarAB*A*B.
int Norm1(double *Result) const
Compute 1-norm of each vector in multi-vector.
void UpdateDoubleTemp() const
int Update(double ScalarA, const Epetra_MultiVector &A, double ScalarThis)
Update multi-vector values with scaled values of A, this = ScalarThis*this + ScalarA*A.
int ReplaceMyValue(int MyRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (MyRow, VectorIndex) location with ScalarValue.
double ** Pointers() const
Get pointer to individual vector pointers.
int MeanValue(double *Result) const
Compute mean (average) value of each vector in multi-vector.
int SumIntoMyValue(int MyRow, int VectorIndex, double ScalarValue)
Adds ScalarValue to existing value at the specified (MyRow, VectorIndex) location.
int Random()
Set multi-vector values to random numbers.
unsigned int Seed()
Get seed from Random function.
int Norm2(double *Result) const
Compute 2-norm of each vector in multi-vector.
int MaxValue(double *Result) const
Compute maximum value of each vector in multi-vector.
int ExtractCopy(double *A, int MyLDA) const
Put multi-vector values into user-provided two-dimensional array.
long long GlobalLength64() const
Returns the 64-bit global vector length of vectors in the multi-vector.
int SetSeed(unsigned int Seed_in)
Set seed for Random function.
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
int ReciprocalMultiply(double ScalarAB, const Epetra_MultiVector &A, const Epetra_MultiVector &B, double ScalarThis)
Multiply a Epetra_MultiVector by the reciprocal of another, element-by-element.
Epetra_Vector ** Vectors_
int AllocateForCopy(void)
Epetra_MultiVector(const Epetra_BlockMap &Map, int NumVectors, bool zeroOut=true)
Basic Epetra_MultiVector constuctor.
Epetra_OffsetIndex: This class builds index for efficient mapping of data from one Epetra_CrsGraph ba...
Epetra_SrcDistObject: A class for supporting flexible source distributed objects for import/export op...
Epetra_Util: The Epetra Util Wrapper Class.
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.