Epetra_IntVector Class Reference

Epetra_IntVector: A class for constructing and using dense integer vectors on a parallel computer. More...

#include <Epetra_IntVector.h>

Inheritance diagram for Epetra_IntVector:

Inheritance graph
[legend]
Collaboration diagram for Epetra_IntVector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors/destructors
 Epetra_IntVector (const Epetra_BlockMap &Map, bool zeroOut=true)
 Basic Epetra_IntVector constuctor.
 Epetra_IntVector (const Epetra_IntVector &Source)
 Epetra_IntVector copy constructor.
 Epetra_IntVector (Epetra_DataAccess CV, const Epetra_BlockMap &Map, int *V)
 Set vector values from user array.
virtual ~Epetra_IntVector ()
 Epetra_IntVector destructor.
Post-construction modification methods
int PutValue (int Value)
 Set all elements of the vector to Value.
Extraction methods
int ExtractCopy (int *V) const
 Put vector values into user-provided array.
int ExtractView (int **V) const
 Set user-provided address of V.
Mathematical methods
int MaxValue ()
 Find maximum value.
int MinValue ()
 Find minimum value.
Overloaded operators
Epetra_IntVectoroperator= (const Epetra_IntVector &Source)
 = Operator.
int & operator[] (int index)
 Element access function.
const int & operator[] (int index) const
 Element access function.
Attribute access functions
int * Values () const
 Returns a pointer to an array containing the values of this vector.
int MyLength () const
 Returns the local vector length on the calling processor of vectors in the multi-vector.
int GlobalLength () const
 Returns the global vector length of vectors in the multi-vector.
I/O methods
virtual void Print (ostream &os) const
 Print method.

Detailed Description

Epetra_IntVector: A class for constructing and using dense integer vectors on a parallel computer.

The Epetra_IntVector class enables the construction and use of integer dense vectors in a distributed memory environment. The distribution of the dense vector is determined in part by a Epetra_Comm object and a Epetra_Map (or Epetra_LocalMap or Epetra_BlockMap).

Distributed Global vs. Replicated Local

Constructing Epetra_IntVectors

There are four Epetra_IntVector constructors. The first is a basic constructor that allocates space and sets all values to zero, the second is a copy constructor. The third and fourth constructors work with user data. These 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 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_IntVector 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 vector.

There are four different Epetra_IntVector constructors:

Extracting Data from Epetra_IntVectors

Once a Epetra_IntVector 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 two Extract functions:

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


Constructor & Destructor Documentation

Epetra_IntVector::Epetra_IntVector ( const Epetra_BlockMap Map,
bool  zeroOut = true 
)

Basic Epetra_IntVector constuctor.

Creates a Epetra_IntVector object and, by default, fills with zero values.

Parameters:
In Map - 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:
In zeroOut - 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_IntVector.

Epetra_IntVector::Epetra_IntVector ( Epetra_DataAccess  CV,
const Epetra_BlockMap Map,
int *  V 
)

Set vector values from user array.

Parameters:
In Epetra_DataAccess - Enumerated type set to Copy or View.
In Map - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
In V - Pointer to an array of integer numbers..
Returns:
Integer error code, set to 0 if successful.
See Detailed Description section for further discussion.


Member Function Documentation

int Epetra_IntVector::ExtractCopy ( int *  V  )  const

Put vector values into user-provided array.

Parameters:
Out V - Pointer to memory space that will contain the vector values.
Returns:
Integer error code, set to 0 if successful.

int Epetra_IntVector::ExtractView ( int **  V  )  const

Set user-provided address of V.

Parameters:
Out V - Address of a pointer to that will be set to point to the values of the vector.
Returns:
Integer error code, set to 0 if successful.

int Epetra_IntVector::MaxValue (  ) 

Find maximum value.

Returns:
Maximum value across all processors.

int Epetra_IntVector::MinValue (  ) 

Find minimum value.

Returns:
Minimum value across all processors.

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

= Operator.

Parameters:
In A - Epetra_IntVector to copy.
Returns:
Epetra_IntVector.

const int& Epetra_IntVector::operator[] ( int  index  )  const [inline]

Element access function.

Returns:
V[Index].

int& Epetra_IntVector::operator[] ( int  index  )  [inline]

Element access function.

Returns:
V[Index].


The documentation for this class was generated from the following file:
Generated on Wed May 12 21:40:57 2010 for Epetra by  doxygen 1.4.7