Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Epetra_IntMultiVector Class Reference

Epetra_IntMultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in parallel. More...

#include <Epetra_IntMultiVector.h>

Inheritance diagram for Epetra_IntMultiVector:
Inheritance graph
[legend]

Public Member Functions

int ReplaceMap (const Epetra_BlockMap &map)
 Replace map, only if new map has same point-structure as current map. More...
 
int Reduce ()
 
- Public Member Functions inherited from Epetra_DistObject
 Epetra_DistObject (const Epetra_BlockMap &Map)
 Basic Epetra_DistObject constuctor. More...
 
 Epetra_DistObject (const Epetra_BlockMap &Map, const char *const Label)
 
 Epetra_DistObject (const Epetra_DistObject &Source)
 Epetra_DistObject copy constructor. More...
 
virtual ~Epetra_DistObject ()
 Epetra_DistObject destructor. More...
 
int Import (const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Imports an Epetra_DistObject using the Epetra_Import object. More...
 
int Import (const Epetra_SrcDistObject &A, const Epetra_Export &Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Imports an Epetra_DistObject using the Epetra_Export object. More...
 
int Export (const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Exports an Epetra_DistObject using the Epetra_Import object. More...
 
int Export (const Epetra_SrcDistObject &A, const Epetra_Export &Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Exports an Epetra_DistObject using the Epetra_Export object. More...
 
const Epetra_BlockMapMap () const
 Returns the address of the Epetra_BlockMap for this multi-vector. More...
 
const Epetra_CommComm () const
 Returns the address of the Epetra_Comm for this multi-vector. More...
 
bool DistributedGlobal () const
 Returns true if this multi-vector is distributed global, i.e., not local replicated. More...
 
- Public Member Functions inherited from Epetra_Object
 Epetra_Object (int TracebackModeIn=-1, bool set_label=true)
 Epetra_Object Constructor. More...
 
 Epetra_Object (const char *const Label, int TracebackModeIn=-1)
 Epetra_Object Constructor. More...
 
 Epetra_Object (const Epetra_Object &Object)
 Epetra_Object Copy Constructor. More...
 
virtual ~Epetra_Object ()
 Epetra_Object Destructor. More...
 
virtual void SetLabel (const char *const Label)
 Epetra_Object Label definition using char *. More...
 
virtual const char * Label () const
 Epetra_Object Label access funtion. More...
 
virtual int ReportError (const std::string Message, int ErrorCode) const
 Error reporting method. More...
 
- Public Member Functions inherited from Epetra_SrcDistObject
virtual ~Epetra_SrcDistObject ()
 Epetra_SrcDistObject destructor. More...
 
- Public Member Functions inherited from Epetra_CompObject
Epetra_CompObjectoperator= (const Epetra_CompObject &src)
 
 Epetra_CompObject ()
 Basic Epetra_CompObject constuctor. More...
 
 Epetra_CompObject (const Epetra_CompObject &Source)
 Epetra_CompObject copy constructor. More...
 
virtual ~Epetra_CompObject ()
 Epetra_CompObject destructor. More...
 
void SetFlopCounter (const Epetra_Flops &FlopCounter_in)
 Set the internal Epetra_Flops() pointer. More...
 
void SetFlopCounter (const Epetra_CompObject &CompObject)
 Set the internal Epetra_Flops() pointer to the flop counter of another Epetra_CompObject. More...
 
void UnsetFlopCounter ()
 Set the internal Epetra_Flops() pointer to 0 (no flops counted). More...
 
Epetra_FlopsGetFlopCounter () const
 Get the pointer to the Epetra_Flops() object associated with this object, returns 0 if none. More...
 
void ResetFlops () const
 Resets the number of floating point operations to zero for this multi-vector. More...
 
double Flops () const
 Returns the number of floating point operations with this multi-vector. More...
 
void UpdateFlops (int Flops_in) const
 Increment Flop count for this object. More...
 
void UpdateFlops (long int Flops_in) const
 Increment Flop count for this object. More...
 
void UpdateFlops (long long Flops_in) const
 Increment Flop count for this object. More...
 
void UpdateFlops (double Flops_in) const
 Increment Flop count for this object. More...
 
void UpdateFlops (float Flops_in) const
 Increment Flop count for this object. More...
 
- Public Member Functions inherited from Epetra_BLAS
 Epetra_BLAS (void)
 Epetra_BLAS Constructor. More...
 
 Epetra_BLAS (const Epetra_BLAS &BLAS)
 Epetra_BLAS Copy Constructor. More...
 
virtual ~Epetra_BLAS (void)
 Epetra_BLAS Destructor. More...
 
float ASUM (const int N, const float *X, const int INCX=1) const
 Epetra_BLAS one norm function (SASUM). More...
 
double ASUM (const int N, const double *X, const int INCX=1) const
 Epetra_BLAS one norm function (DASUM). More...
 
float DOT (const int N, const float *X, const float *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS dot product function (SDOT). More...
 
double DOT (const int N, const double *X, const double *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS dot product function (DDOT). More...
 
float NRM2 (const int N, const float *X, const int INCX=1) const
 Epetra_BLAS norm function (SNRM2). More...
 
double NRM2 (const int N, const double *X, const int INCX=1) const
 Epetra_BLAS norm function (DNRM2). More...
 
void SCAL (const int N, const float ALPHA, float *X, const int INCX=1) const
 Epetra_BLAS vector scale function (SSCAL) More...
 
void SCAL (const int N, const double ALPHA, double *X, const int INCX=1) const
 Epetra_BLAS vector scale function (DSCAL) More...
 
void COPY (const int N, const float *X, float *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS vector copy function (SCOPY) More...
 
void COPY (const int N, const double *X, double *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS vector scale function (DCOPY) More...
 
int IAMAX (const int N, const float *X, const int INCX=1) const
 Epetra_BLAS arg maximum of absolute value function (ISAMAX) More...
 
int IAMAX (const int N, const double *X, const int INCX=1) const
 Epetra_BLAS arg maximum of absolute value function (IDAMAX) More...
 
void AXPY (const int N, const float ALPHA, const float *X, float *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS vector update function (SAXPY) More...
 
void AXPY (const int N, const double ALPHA, const double *X, double *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS vector update function (DAXPY) More...
 
void GEMV (const char TRANS, const int M, const int N, const float ALPHA, const float *A, const int LDA, const float *X, const float BETA, float *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS matrix-vector multiply function (SGEMV) More...
 
void GEMV (const char TRANS, const int M, const int N, const double ALPHA, const double *A, const int LDA, const double *X, const double BETA, double *Y, const int INCX=1, const int INCY=1) const
 Epetra_BLAS matrix-vector multiply function (DGEMV) More...
 
void GEMM (const char TRANSA, const char TRANSB, const int M, const int N, const int K, const float ALPHA, const float *A, const int LDA, const float *B, const int LDB, const float BETA, float *C, const int LDC) const
 Epetra_BLAS matrix-matrix multiply function (SGEMM) More...
 
void GEMM (const char TRANSA, const char TRANSB, const int M, const int N, const int K, const double ALPHA, const double *A, const int LDA, const double *B, const int LDB, const double BETA, double *C, const int LDC) const
 Epetra_BLAS matrix-matrix multiply function (DGEMM) More...
 
void SYMM (const char SIDE, const char UPLO, const int M, const int N, const float ALPHA, const float *A, const int LDA, const float *B, const int LDB, const float BETA, float *C, const int LDC) const
 Epetra_BLAS symmetric matrix-matrix multiply function (SSYMM) More...
 
void SYMM (const char SIDE, const char UPLO, const int M, const int N, const double ALPHA, const double *A, const int LDA, const double *B, const int LDB, const double BETA, double *C, const int LDC) const
 Epetra_BLAS matrix-matrix multiply function (DSYMM) More...
 
void TRMM (const char SIDE, const char UPLO, const char TRANSA, const char DIAG, const int M, const int N, const float ALPHA, const float *A, const int LDA, float *B, const int LDB) const
 Epetra_BLAS triangular matrix-matrix multiply function (STRMM) More...
 
void TRMM (const char SIDE, const char UPLO, const char TRANSA, const char DIAG, const int M, const int N, const double ALPHA, const double *A, const int LDA, double *B, const int LDB) const
 Epetra_BLAS triangular matrix-matrix multiply function (DTRMM) More...
 
void SYRK (const char UPLO, const char TRANS, const int N, const int K, const float ALPHA, const float *A, const int LDA, const float BETA, float *C, const int LDC) const
 Eperta_BLAS symetric rank k funtion (ssyrk) More...
 
void SYRK (const char UPLO, const char TRANS, const int N, const int K, const double ALPHA, const double *A, const int LDA, const double BETA, double *C, const int LDC) const
 Eperta_BLAS symetric rank k funtion (dsyrk) More...
 

Protected Member Functions

void Assign (const Epetra_IntMultiVector &rhs)
 
int CheckInput ()
 
- Protected Member Functions inherited from Epetra_DistObject
virtual int DoTransfer (const Epetra_SrcDistObject &A, Epetra_CombineMode CombineMode, int NumSameIDs, int NumPermuteIDs, int NumRemoteIDs, int NumExportIDs, int *PermuteToLIDs, int *PermuteFromLIDs, int *RemoteLIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &LenImports, char *&Imports, Epetra_Distributor &Distor, bool DoReverse, const Epetra_OffsetIndex *Indexor)
 Perform actual transfer (redistribution) of data across memory images, using Epetra_Distributor object. More...
 
- Protected Member Functions inherited from Epetra_Object
std::string toString (const int &x) const
 
std::string toString (const long long &x) const
 
std::string toString (const double &x) const
 

Protected Attributes

int * Values_
 
- Protected Attributes inherited from Epetra_DistObject
Epetra_BlockMap Map_
 
const Epetra_CommComm_
 
char * Exports_
 
char * Imports_
 
int LenExports_
 
int LenImports_
 
int * Sizes_
 
- Protected Attributes inherited from Epetra_CompObject
Epetra_FlopsFlopCounter_
 

Private Member Functions

int AllocateForCopy (void)
 
int DoCopy (void)
 
void UpdateOrdinalTemp () const
 
void UpdateIntVectors () const
 
int AllocateForView (void)
 
int DoView (void)
 
template<typename int_type >
int ChangeGlobalValue (int_type GlobalBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue, bool SumInto)
 
int ChangeMyValue (int MyBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue, bool SumInto)
 
int CheckSizes (const Epetra_SrcDistObject &A)
 Allows the source and target (this) objects to be compared for compatibility, return nonzero if not. More...
 
int CopyAndPermute (const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor, Epetra_CombineMode CombineMode=Zero)
 Perform ID copies and permutations that are on processor. More...
 
int PackAndPrepare (const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)
 Perform any packing or preparation required for call to DoTransfer(). More...
 
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)
 Perform any unpacking and combining after call to DoTransfer(). More...
 

Private Attributes

int ** Pointers_
 
int MyLength_
 
long long GlobalLength_
 
int NumVectors_
 
bool UserAllocated_
 
bool ConstantStride_
 
int Stride_
 
bool Allocated_
 
int * OrdinalTemp_
 
Epetra_IntVector ** IntVectors_
 
Epetra_Util Util_
 

Constructors/destructors

 Epetra_IntMultiVector (const Epetra_BlockMap &Map, int NumVectors, bool zeroOut=true)
 Basic Epetra_IntMultiVector constuctor. More...
 
 Epetra_IntMultiVector (const Epetra_IntMultiVector &Source)
 Epetra_MultiVector copy constructor. More...
 
 Epetra_IntMultiVector (Epetra_DataAccess CV, const Epetra_BlockMap &Map, int *A, int MyLDA, int NumVectors)
 Set multi-vector values from two-dimensional array. More...
 
 Epetra_IntMultiVector (Epetra_DataAccess CV, const Epetra_BlockMap &Map, int **ArrayOfPointers, int NumVectors)
 Set multi-vector values from array of pointers. More...
 
 Epetra_IntMultiVector (Epetra_DataAccess CV, const Epetra_IntMultiVector &Source, int *Indices, int NumVectors)
 Set multi-vector values from list of vectors in an existing Epetra_IntMultiVector. More...
 
 Epetra_IntMultiVector (Epetra_DataAccess CV, const Epetra_IntMultiVector &Source, int StartIndex, int NumVectors)
 Set multi-vector values from range of vectors in an existing Epetra_IntMultiVector. More...
 
virtual ~Epetra_IntMultiVector ()
 Epetra_MultiVector destructor. More...
 

Post-construction modification routines

int ReplaceGlobalValue (int GlobalRow, int VectorIndex, int OrdinalValue)
 Replace current value at the specified (GlobalRow, VectorIndex) location with OrdinalValue. More...
 
int ReplaceGlobalValue (long long GlobalRow, int VectorIndex, int OrdinalValue)
 
int ReplaceGlobalValue (int GlobalBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 Replace current value at the specified (GlobalBlockRow, BlockRowOffset, VectorIndex) location with OrdinalValue. More...
 
int ReplaceGlobalValue (long long GlobalBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 
int SumIntoGlobalValue (int GlobalRow, int VectorIndex, int OrdinalValue)
 Adds OrdinalValue to existing value at the specified (GlobalRow, VectorIndex) location. More...
 
int SumIntoGlobalValue (long long GlobalRow, int VectorIndex, int OrdinalValue)
 
int SumIntoGlobalValue (int GlobalBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 Adds OrdinalValue to existing value at the specified (GlobalBlockRow, BlockRowOffset, VectorIndex) location. More...
 
int SumIntoGlobalValue (long long GlobalBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 
int ReplaceMyValue (int MyRow, int VectorIndex, int OrdinalValue)
 Replace current value at the specified (MyRow, VectorIndex) location with OrdinalValue. More...
 
int ReplaceMyValue (int MyBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 Replace current value at the specified (MyBlockRow, BlockRowOffset, VectorIndex) location with OrdinalValue. More...
 
int SumIntoMyValue (int MyRow, int VectorIndex, int OrdinalValue)
 Adds OrdinalValue to existing value at the specified (MyRow, VectorIndex) location. More...
 
int SumIntoMyValue (int MyBlockRow, int BlockRowOffset, int VectorIndex, int OrdinalValue)
 Adds OrdinalValue to existing value at the specified (MyBlockRow, BlockRowOffset, VectorIndex) location. More...
 
int PutScalar (int OrdinalConstant)
 Initialize all values in a multi-vector with constant value. More...
 

Extraction methods

int ExtractCopy (int *A, int MyLDA) const
 Put multi-vector values into user-provided two-dimensional array. More...
 
int ExtractCopy (int **ArrayOfPointers) const
 Put multi-vector values into user-provided array of pointers. More...
 
int ExtractView (int **A, int *MyLDA) const
 Set user-provided addresses of A and MyLDA. More...
 
int ExtractView (int ***ArrayOfPointers) const
 Set user-provided addresses of ArrayOfPointers. More...
 

Mathematical methods

int MinValue (int *Result) const
 Compute minimum value of each vector in multi-vector. More...
 
int MaxValue (int *Result) const
 Compute maximum value of each vector in multi-vector. More...
 

Overloaded operators

Epetra_IntMultiVectoroperator= (const Epetra_IntMultiVector &Source)
 = Operator. More...
 
int *& operator[] (int i)
 Vector access function. More...
 
int *const & operator[] (int i) const
 Vector access function. More...
 
Epetra_IntVector *& operator() (int i)
 Vector access function. More...
 
const Epetra_IntVector *& operator() (int i) const
 Vector access function. More...
 

Attribute access functions

int NumVectors () const
 Returns the number of vectors in the multi-vector. More...
 
int MyLength () const
 Returns the local vector length on the calling processor of vectors in the multi-vector. More...
 
int GlobalLength () const
 Returns the global vector length of vectors in the multi-vector. More...
 
long long GlobalLength64 () const
 
int Stride () const
 Returns the stride between vectors in the multi-vector (only meaningful if ConstantStride() is true). More...
 
bool ConstantStride () const
 Returns true if this multi-vector has constant stride between vectors. More...
 

I/O methods

virtual void Print (std::ostream &os) const
 Print method. More...
 

Expert-only unsupported methods

int ResetView (int **ArrayOfPointers)
 Reset the view of an existing multivector to point to new user data. More...
 
int * Values () const
 Get pointer to MultiVector values. More...
 
int ** Pointers () const
 Get pointer to individual vector pointers. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Epetra_Object
static void SetTracebackMode (int TracebackModeValue)
 Set the value of the Epetra_Object error traceback report mode. More...
 
static int GetTracebackMode ()
 Get the value of the Epetra_Object error report mode. More...
 
static std::ostream & GetTracebackStream ()
 Get the output stream for error reporting. More...
 
- Static Public Attributes inherited from Epetra_Object
static int TracebackMode
 

Detailed Description

Epetra_IntMultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in parallel.

The Epetra_IntMultiVector class enables the construction and use of ordinal-valued, dense vectors, multi-vectors, and matrices in a distributed memory environment. The dimensions and distribution of the dense multi-vectors is determined in part by a Epetra_Comm object, a Epetra_Map (or Epetra_LocalMap or Epetra_BlockMap) and the number of vectors passed to the constructors described below.

There are several concepts that important for understanding the Epetra_IntMultiVector class:

Constructing Epetra_IntMultiVectors

Except for the basic constructor and copy constructor, Epetra_IntMultiVector constructors have two data access modes:

  1. Copy mode - Allocates memory and makes a copy of the user-provided data. In this case, the user data is not needed after construction.
  2. View mode - Creates a "view" of the user data. In this case, the user data is required to remain intact for the life of the multi-vector.
Warning
View mode is extremely dangerous from a data hiding perspective. Therefore, we strongly encourage users to develop code using Copy mode first and only use the View mode in a secondary optimization phase.

All Epetra_IntMultiVector constructors require a map argument that describes the layout of elements on the parallel machine. Specifically, map is a Epetra_Map, Epetra_LocalMap or Epetra_BlockMap object describing the desired memory layout for the multi-vector.

There are six different Epetra_IntMultiVector constructors:

Extracting Data from Epetra_IntMultiVectors

Once a Epetra_IntMultiVector is constructed, it is possible to extract a copy of the values or create a view of them.

Warning
ExtractView functions are extremely dangerous from a data hiding perspective. For both ExtractView fuctions, there is a corresponding ExtractCopy function. We strongly encourage users to develop code using ExtractCopy functions first and only use the ExtractView functions in a secondary optimization phase.

There are four Extract functions:

Vector, Matrix and Utility Functions

Once a Epetra_IntMultiVector is constructed, a variety of mathematical functions can be applied to the individual vectors. Specifically:

Counting Floating Point Operations

Each Epetra_IntMultiVector object keep track of the number of serial floating point operations performed using the specified object as the this argument to the function. The Flops() function returns this number as a double precision number. Using this information, in conjunction with the Epetra_Time class, one can get accurate parallel performance numbers. The ResetFlops() function resets the floating point counter.

Warning
A Epetra_Map, Epetra_LocalMap or Epetra_BlockMap object is required for all Epetra_IntMultiVector constructors.

Definition at line 179 of file Epetra_IntMultiVector.h.

Constructor & Destructor Documentation

Epetra_IntMultiVector::Epetra_IntMultiVector ( const Epetra_BlockMap Map,
int  NumVectors,
bool  zeroOut = true 
)

Basic Epetra_IntMultiVector constuctor.

Creates a Epetra_IntMultiVector object and, by default, fills with zero values.
Parameters
InMap - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
Warning
Note that, because Epetra_LocalMap derives from Epetra_Map and Epetra_Map derives from Epetra_BlockMap, this constructor works for all three types of Epetra map classes.
Parameters
InNumVectors - Number of vectors in multi-vector.
InzeroOut - If true then the allocated memory will be zeroed out initialy. If false then this memory will not be touched which can be significantly faster.
Returns
Pointer to a Epetra_IntMultiVector.

Definition at line 60 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::Epetra_IntMultiVector ( const Epetra_IntMultiVector Source)

Epetra_MultiVector copy constructor.

Definition at line 85 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::Epetra_IntMultiVector ( Epetra_DataAccess  CV,
const Epetra_BlockMap Map,
int *  A,
int  MyLDA,
int  NumVectors 
)

Set multi-vector values from two-dimensional array.

Parameters
InEpetra_DataAccess - Enumerated type set to Copy or View.
InMap - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
InA - Pointer to an array of ordinal numbers. The first vector starts at A. The second vector starts at A+MyLDA, the third at A+2*MyLDA, and so on.
InMyLDA - The "Leading Dimension", or stride between vectors in memory.
Warning
This value refers to the stride on the calling processor. Thus it is a local quantity, not a global quantity.
Parameters
InNumVectors - Number of vectors in multi-vector.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 111 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::Epetra_IntMultiVector ( Epetra_DataAccess  CV,
const Epetra_BlockMap Map,
int **  ArrayOfPointers,
int  NumVectors 
)

Set multi-vector values from array of pointers.

Parameters
InEpetra_DataAccess - Enumerated type set to Copy or View.
InMap - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
InArrayOfPointers - An array of pointers such that ArrayOfPointers[i] points to the memory location containing ith vector to be copied.
InNumVectors - Number of vectors in multi-vector.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 141 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::Epetra_IntMultiVector ( Epetra_DataAccess  CV,
const Epetra_IntMultiVector Source,
int *  Indices,
int  NumVectors 
)

Set multi-vector values from list of vectors in an existing Epetra_IntMultiVector.

Parameters
InEpetra_DataAccess - Enumerated type set to Copy or View.
InSource - An existing fully constructed Epetra_IntMultiVector.
InIndices - Integer list of the vectors to copy.
InNumVectors - Number of vectors in multi-vector.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 172 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::Epetra_IntMultiVector ( Epetra_DataAccess  CV,
const Epetra_IntMultiVector Source,
int  StartIndex,
int  NumVectors 
)

Set multi-vector values from range of vectors in an existing Epetra_IntMultiVector.

Parameters
InEpetra_DataAccess - Enumerated type set to Copy or View.
InSource - An existing fully constructed Epetra_IntMultiVector.
InStartIndex - First of the vectors to copy.
InNumVectors - Number of vectors in multi-vector.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 203 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector::~Epetra_IntMultiVector ( )
virtual

Epetra_MultiVector destructor.

Definition at line 230 of file Epetra_IntMultiVector.cpp.

Member Function Documentation

int Epetra_IntMultiVector::ReplaceGlobalValue ( int  GlobalRow,
int  VectorIndex,
int  OrdinalValue 
)

Replace current value at the specified (GlobalRow, VectorIndex) location with OrdinalValue.

Replaces the existing value for a single entry in the multivector. The specified global row must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

If the map associated with this multivector is an Epetra_BlockMap, only the first point entry associated with the global row will be modified. To modify a different point entry, use the other version of this method

Parameters
InGlobalRow - Row of Multivector to modify in global index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if GlobalRow not associated with calling processor set to -1 if VectorIndex >= NumVectors().

Definition at line 363 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ReplaceGlobalValue ( long long  GlobalRow,
int  VectorIndex,
int  OrdinalValue 
)

Definition at line 372 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ReplaceGlobalValue ( int  GlobalBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Replace current value at the specified (GlobalBlockRow, BlockRowOffset, VectorIndex) location with OrdinalValue.

Replaces the existing value for a single entry in the multivector. The specified global block row and block row offset must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

Parameters
InGlobalBlockRow - BlockRow of Multivector to modify in global index space.
InBlockRowOffset - Offset into BlockRow of Multivector to modify in global index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if GlobalRow not associated with calling processor set to -1 if VectorIndex >= NumVectors(), set to -2 if BlockRowOffset is out-of-range.

Definition at line 381 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ReplaceGlobalValue ( long long  GlobalBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Definition at line 390 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoGlobalValue ( int  GlobalRow,
int  VectorIndex,
int  OrdinalValue 
)

Adds OrdinalValue to existing value at the specified (GlobalRow, VectorIndex) location.

Sums the given value into the existing value for a single entry in the multivector. The specified global row must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

If the map associated with this multivector is an Epetra_BlockMap, only the first point entry associated with the global row will be modified. To modify a different point entry, use the other version of this method

Parameters
InGlobalRow - Row of Multivector to modify in global index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if GlobalRow not associated with calling processor set to -1 if VectorIndex >= NumVectors().

Definition at line 399 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoGlobalValue ( long long  GlobalRow,
int  VectorIndex,
int  OrdinalValue 
)

Definition at line 408 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoGlobalValue ( int  GlobalBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Adds OrdinalValue to existing value at the specified (GlobalBlockRow, BlockRowOffset, VectorIndex) location.

Sums the given value into the existing value for a single entry in the multivector. The specified global block row and block row offset must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

Parameters
InGlobalBlockRow - BlockRow of Multivector to modify in global index space.
InBlockRowOffset - Offset into BlockRow of Multivector to modify in global index space.
InVectorIndex - Vector within MultiVector that should to modify.
InScalarValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if GlobalRow not associated with calling processor set to -1 if VectorIndex >= NumVectors(), set to -2 if BlockRowOffset is out-of-range.

Definition at line 417 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoGlobalValue ( long long  GlobalBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Definition at line 426 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ReplaceMyValue ( int  MyRow,
int  VectorIndex,
int  OrdinalValue 
)

Replace current value at the specified (MyRow, VectorIndex) location with OrdinalValue.

Replaces the existing value for a single entry in the multivector. The specified local row must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

This method is intended for use with vectors based on an Epetra_Map. If used on a vector based on a non-trivial Epetra_BlockMap, this will update only block row 0, i.e.

Epetra_IntMultiVector::ReplaceMyValue ( MyRow, VectorIndex, OrdinalValue ) is equivalent to: Epetra_IntMultiVector::ReplaceMyValue ( 0, MyRow, VectorIndex, OrdinalValue )

Parameters
InMyRow - Row of IntMultivector to modify in local index space.
InVectorIndex - Vector within IntMultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if MyRow not associated with calling processor set to -1 if VectorIndex >= NumVectors().

Definition at line 434 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ReplaceMyValue ( int  MyBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Replace current value at the specified (MyBlockRow, BlockRowOffset, VectorIndex) location with OrdinalValue.

Replaces the existing value for a single entry in the multivector. The specified local block row and block row offset must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

Parameters
InMyBlockRow - BlockRow of Multivector to modify in local index space.
InBlockRowOffset - Offset into BlockRow of Multivector to modify in local index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if MyRow not associated with calling processor set to -1 if VectorIndex >= NumVectors(), set to -2 if BlockRowOffset is out-of-range.

Definition at line 441 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoMyValue ( int  MyRow,
int  VectorIndex,
int  OrdinalValue 
)

Adds OrdinalValue to existing value at the specified (MyRow, VectorIndex) location.

Sums the given value into the existing value for a single entry in the multivector. The specified local row must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

If the map associated with this multivector is an Epetra_BlockMap, only the first point entry associated with the local row will be modified. To modify a different point entry, use the other version of this method

Parameters
InMyRow - Row of Multivector to modify in local index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if MyRow not associated with calling processor set to -1 if VectorIndex >= NumVectors().

Definition at line 448 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::SumIntoMyValue ( int  MyBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue 
)

Adds OrdinalValue to existing value at the specified (MyBlockRow, BlockRowOffset, VectorIndex) location.

Sums the given value into the existing value for a single entry in the multivector. The specified local block row and block row offset must correspond to a GID owned by the map of the multivector on the calling processor. In other words, this method does not perform cross-processor communication.

Parameters
InMyBlockRow - BlockRow of Multivector to modify in local index space.
InBlockRowOffset - Offset into BlockRow of Multivector to modify in local index space.
InVectorIndex - Vector within MultiVector that should to modify.
InOrdinalValue - Value to add to existing value.
Returns
Integer error code, set to 0 if successful, set to 1 if MyRow not associated with calling processor set to -1 if VectorIndex >= NumVectors(), set to -2 if BlockRowOffset is out-of-range.

Definition at line 454 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::PutScalar ( int  OrdinalConstant)

Initialize all values in a multi-vector with constant value.

Parameters
InOrdinalConstant - Value to use.
Returns
Integer error code, set to 0 if successful.

Definition at line 568 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ExtractCopy ( int *  A,
int  MyLDA 
) const

Put multi-vector values into user-provided two-dimensional array.

Parameters
OutA - Pointer to memory space that will contain the multi-vector values. The first vector will be copied to the memory pointed to by A. The second vector starts at A+MyLDA, the third at A+2*MyLDA, and so on.
InMyLDA - The "Leading Dimension", or stride between vectors in memory.
Warning
This value refers to the stride on the calling processor. Thus it is a local quantity, not a global quantity.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 494 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ExtractCopy ( int **  ArrayOfPointers) const

Put multi-vector values into user-provided array of pointers.

Parameters
OutArrayOfPointers - An array of pointers to memory space that will contain the multi-vector values, such that ArrayOfPointers[i] points to the memory location where the ith vector to be copied.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 529 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ExtractView ( int **  A,
int *  MyLDA 
) const

Set user-provided addresses of A and MyLDA.

Parameters
A(Out) - Address of a pointer to that will be set to point to the values of the multi-vector. The first vector will be at the memory pointed to by A. The second vector starts at A+MyLDA, the third at A+2*MyLDA, and so on.
MyLDA(Out) - Address of the "Leading Dimension", or stride between vectors in memory.
Warning
This value refers to the stride on the calling processor. Thus it is a local quantity, not a global quantity.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 547 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ExtractView ( int ***  ArrayOfPointers) const

Set user-provided addresses of ArrayOfPointers.

Parameters
ArrayOfPointers(Out) - Address of array of pointers to memory space that will set to the multi-vector array of pointers, such that ArrayOfPointers[i] points to the memory location where the ith vector is located.
Returns
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 560 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::MinValue ( int *  Result) const

Compute minimum value of each vector in multi-vector.

Note that the vector contents must be already initialized for this function to compute a well-defined result. The length of the vector need not be greater than zero on all processors. If length is greater than zero on any processor then a valid result will be computed.

Parameters
OutResult - Result[i] contains minimum value of ith vector.
Returns
Integer error code, set to 0 if successful.

Definition at line 1096 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::MaxValue ( int *  Result) const

Compute maximum value of each vector in multi-vector.

Note that the vector contents must be already initialized for this function to compute a well-defined result. The length of the vector need not be greater than zero on all processors. If length is greater than zero on any processor then a valid result will be computed.

Parameters
OutResult - Result[i] contains maximum value of ith vector.
Returns
Integer error code, set to 0 if successful.

Definition at line 1209 of file Epetra_IntMultiVector.cpp.

Epetra_IntMultiVector & Epetra_IntMultiVector::operator= ( const Epetra_IntMultiVector Source)

= Operator.

Parameters
InA - Epetra_IntMultiVector to copy.
Returns
Epetra_IntMultiVector.

Definition at line 1356 of file Epetra_IntMultiVector.cpp.

int*& Epetra_IntMultiVector::operator[] ( int  i)
inline

Vector access function.

Returns
Pointer to the array of ordinals containing the local values of the ith vector in the multi-vector.

Definition at line 626 of file Epetra_IntMultiVector.h.

int* const& Epetra_IntMultiVector::operator[] ( int  i) const
inline

Vector access function.

Returns
Pointer to the array of ordinal containing the local values of the ith vector in the multi-vector.

Definition at line 632 of file Epetra_IntMultiVector.h.

Epetra_IntVector *& Epetra_IntMultiVector::operator() ( int  i)

Vector access function.

Returns
An Epetra_IntVector pointer to the ith vector in the multi-vector.

Definition at line 1323 of file Epetra_IntMultiVector.cpp.

const Epetra_IntVector *& Epetra_IntMultiVector::operator() ( int  i) const

Vector access function.

Returns
An Epetra_IntVector pointer to the ith vector in the multi-vector.

Definition at line 1339 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::NumVectors ( ) const
inline

Returns the number of vectors in the multi-vector.

Definition at line 651 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::MyLength ( ) const
inline

Returns the local vector length on the calling processor of vectors in the multi-vector.

Definition at line 654 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::GlobalLength ( ) const
inline

Returns the global vector length of vectors in the multi-vector.

Definition at line 658 of file Epetra_IntMultiVector.h.

long long Epetra_IntMultiVector::GlobalLength64 ( ) const
inline

Definition at line 664 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::Stride ( ) const
inline

Returns the stride between vectors in the multi-vector (only meaningful if ConstantStride() is true).

Definition at line 667 of file Epetra_IntMultiVector.h.

bool Epetra_IntMultiVector::ConstantStride ( ) const
inline

Returns true if this multi-vector has constant stride between vectors.

Definition at line 670 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::ReplaceMap ( const Epetra_BlockMap map)

Replace map, only if new map has same point-structure as current map.

return 0 if map is replaced, -1 if not.

Definition at line 509 of file Epetra_IntMultiVector.cpp.

void Epetra_IntMultiVector::Print ( std::ostream &  os) const
virtual

Print method.

Reimplemented from Epetra_DistObject.

Definition at line 1437 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ResetView ( int **  ArrayOfPointers)

Reset the view of an existing multivector to point to new user data.

Allows the (very) light-weight replacement of multivector values for an existing multivector that was constructed using an Epetra_DataAccess mode of View. No checking is performed to see if the array of values passed in contains valid data. It is assumed that the user has verified the integrity of data before calling this method. This method is useful for situations where a multivector is needed for use with an Epetra operator or matrix and the user is not passing in a multivector, or the multivector is being passed in with another map that is not exactly compatible with the operator, but has the correct number of entries.

This method is used by AztecOO and Ifpack in the matvec, and solve methods to improve performance and reduce repeated calls to constructors and destructors.

Parameters
ArrayOfPointersContains the array of pointers containing the multivector data.
Returns
Integer error code, set to 0 if successful, -1 if the multivector was not created as a View.
Warning
This method is extremely dangerous and should only be used by experts.

Definition at line 1424 of file Epetra_IntMultiVector.cpp.

int* Epetra_IntMultiVector::Values ( ) const
inline

Get pointer to MultiVector values.

Definition at line 711 of file Epetra_IntMultiVector.h.

int** Epetra_IntMultiVector::Pointers ( ) const
inline

Get pointer to individual vector pointers.

Definition at line 714 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::Reduce ( )

Definition at line 1388 of file Epetra_IntMultiVector.cpp.

void Epetra_IntMultiVector::Assign ( const Epetra_IntMultiVector rhs)
protected

Definition at line 1365 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::CheckInput ( )
protected
int Epetra_IntMultiVector::AllocateForCopy ( void  )
private

Definition at line 248 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::DoCopy ( void  )
private

Definition at line 278 of file Epetra_IntMultiVector.cpp.

void Epetra_IntMultiVector::UpdateOrdinalTemp ( ) const
inlineprivate

Definition at line 740 of file Epetra_IntMultiVector.h.

void Epetra_IntMultiVector::UpdateIntVectors ( ) const
inlineprivate

Definition at line 743 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::AllocateForView ( void  )
private

Definition at line 306 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::DoView ( void  )
private

Definition at line 333 of file Epetra_IntMultiVector.cpp.

template<typename int_type >
int Epetra_IntMultiVector::ChangeGlobalValue ( int_type  GlobalBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue,
bool  SumInto 
)
private

Definition at line 462 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::ChangeMyValue ( int  MyBlockRow,
int  BlockRowOffset,
int  VectorIndex,
int  OrdinalValue,
bool  SumInto 
)
private

Definition at line 473 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::CheckSizes ( const Epetra_SrcDistObject Source)
privatevirtual

Allows the source and target (this) objects to be compared for compatibility, return nonzero if not.

Implements Epetra_DistObject.

Definition at line 583 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::CopyAndPermute ( const Epetra_SrcDistObject Source,
int  NumSameIDs,
int  NumPermuteIDs,
int *  PermuteToLIDs,
int *  PermuteFromLIDs,
const Epetra_OffsetIndex Indexor,
Epetra_CombineMode  CombineMode = Zero 
)
privatevirtual

Perform ID copies and permutations that are on processor.

Implements Epetra_DistObject.

Definition at line 592 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::PackAndPrepare ( const Epetra_SrcDistObject Source,
int  NumExportIDs,
int *  ExportLIDs,
int &  LenExports,
char *&  Exports,
int &  SizeOfPacket,
int *  Sizes,
bool &  VarSizes,
Epetra_Distributor Distor 
)
privatevirtual

Perform any packing or preparation required for call to DoTransfer().

Implements Epetra_DistObject.

Definition at line 697 of file Epetra_IntMultiVector.cpp.

int Epetra_IntMultiVector::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 
)
privatevirtual

Perform any unpacking and combining after call to DoTransfer().

Implements Epetra_DistObject.

Definition at line 789 of file Epetra_IntMultiVector.cpp.

Member Data Documentation

int* Epetra_IntMultiVector::Values_
protected

Definition at line 730 of file Epetra_IntMultiVector.h.

int** Epetra_IntMultiVector::Pointers_
private

Definition at line 792 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::MyLength_
private

Definition at line 794 of file Epetra_IntMultiVector.h.

long long Epetra_IntMultiVector::GlobalLength_
private

Definition at line 795 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::NumVectors_
private

Definition at line 796 of file Epetra_IntMultiVector.h.

bool Epetra_IntMultiVector::UserAllocated_
private

Definition at line 797 of file Epetra_IntMultiVector.h.

bool Epetra_IntMultiVector::ConstantStride_
private

Definition at line 798 of file Epetra_IntMultiVector.h.

int Epetra_IntMultiVector::Stride_
private

Definition at line 799 of file Epetra_IntMultiVector.h.

bool Epetra_IntMultiVector::Allocated_
private

Definition at line 800 of file Epetra_IntMultiVector.h.

int* Epetra_IntMultiVector::OrdinalTemp_
mutableprivate

Definition at line 801 of file Epetra_IntMultiVector.h.

Epetra_IntVector** Epetra_IntMultiVector::IntVectors_
mutableprivate

Definition at line 802 of file Epetra_IntMultiVector.h.

Epetra_Util Epetra_IntMultiVector::Util_
private

Definition at line 803 of file Epetra_IntMultiVector.h.


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