INMOST
Mathematical Modelling Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
INMOST::Sparse::Vector Class Reference

#include <inmost_sparse.h>

Collaboration diagram for INMOST::Sparse::Vector:

Public Types

typedef interval
< INMOST_DATA_ENUM_TYPE,
INMOST_DATA_REAL_TYPE
Entries
 
typedef Entries::iterator iterator
 
typedef Entries::const_iterator const_iterator
 

Public Member Functions

 Vector (std::string _name="", INMOST_DATA_ENUM_TYPE start=0, INMOST_DATA_ENUM_TYPE end=0, INMOST_MPI_Comm _comm=INMOST_MPI_COMM_WORLD)
 
 Vector (const Vector &other)
 
Vectoroperator= (Vector const &other)
 
 ~Vector ()
 
INMOST_DATA_REAL_TYPEoperator[] (INMOST_DATA_ENUM_TYPE i)
 Return reference to i-th element of the vector. More...
 
INMOST_DATA_REAL_TYPE operator[] (INMOST_DATA_ENUM_TYPE i) const
 Return i-th element of the vector. More...
 
INMOST_DATA_ENUM_TYPE Size () const
 Return the global size of the vector. More...
 
iterator Begin ()
 
const_iterator Begin () const
 
iterator End ()
 
const_iterator End () const
 
bool Empty () const
 
void SetInterval (INMOST_DATA_ENUM_TYPE start, INMOST_DATA_ENUM_TYPE end)
 Set the start and the end of the distributed vector interval. More...
 
void GetInterval (INMOST_DATA_ENUM_TYPE &start, INMOST_DATA_ENUM_TYPE &end) const
 Get the start and the end of the distributed vector interval. More...
 
void ShiftInterval (INMOST_DATA_ENUM_TYPE shift)
 
INMOST_DATA_ENUM_TYPE GetFirstIndex () const
 Get the first index of the distributed vector interval. More...
 
INMOST_MPI_Comm GetCommunicator () const
 Get the communicator which the vector is associated with. More...
 
void Swap (Vector &other)
 
void Save (std::string file)
 Save the distributed vector to a single data file using parallel MPI I/O. More...
 
void Load (std::string file, INMOST_DATA_ENUM_TYPE mbeg=ENUMUNDEF, INMOST_DATA_ENUM_TYPE mend=ENUMUNDEF)
 
boolisParallel ()
 
std::string GetName ()
 Get the vector name specified in the main constructor. More...
 
void Clear ()
 Clear all data of the current vector. More...
 

Detailed Description

Distributed vector class. This class can be used to store both local and distributed dense data of real type. For example, to form the right-hand side or initial guess to the solution.

See Also
Solve

Definition at line 26 of file inmost_sparse.h.

Member Typedef Documentation

Definition at line 31 of file inmost_sparse.h.

Definition at line 29 of file inmost_sparse.h.

Definition at line 30 of file inmost_sparse.h.

Constructor & Destructor Documentation

INMOST::Sparse::Vector::Vector ( std::string  _name = "",
INMOST_DATA_ENUM_TYPE  start = 0,
INMOST_DATA_ENUM_TYPE  end = 0,
INMOST_MPI_Comm  _comm = INMOST_MPI_COMM_WORLD 
)

Main constructor of the Vector class.

Parameters
_nameName of the vector, empty string by default.
startStart of the local data interval.
endEnd of the local data interval.
_commCommunicator for parallel data exchanges, MPI_COMM_WORLD by default.
INMOST::Sparse::Vector::Vector ( const Vector other)
INMOST::Sparse::Vector::~Vector ( )

Member Function Documentation

iterator INMOST::Sparse::Vector::Begin ( )
inline

Definition at line 53 of file inmost_sparse.h.

Here is the call graph for this function:

const_iterator INMOST::Sparse::Vector::Begin ( ) const
inline

Definition at line 54 of file inmost_sparse.h.

Here is the call graph for this function:

void INMOST::Sparse::Vector::Clear ( )
inline

Clear all data of the current vector.

Definition at line 83 of file inmost_sparse.h.

Here is the call graph for this function:

bool INMOST::Sparse::Vector::Empty ( ) const
inline

Definition at line 57 of file inmost_sparse.h.

Here is the call graph for this function:

iterator INMOST::Sparse::Vector::End ( )
inline

Definition at line 55 of file inmost_sparse.h.

Here is the call graph for this function:

const_iterator INMOST::Sparse::Vector::End ( ) const
inline

Definition at line 56 of file inmost_sparse.h.

Here is the call graph for this function:

INMOST_MPI_Comm INMOST::Sparse::Vector::GetCommunicator ( ) const
inline

Get the communicator which the vector is associated with.

Definition at line 66 of file inmost_sparse.h.

INMOST_DATA_ENUM_TYPE INMOST::Sparse::Vector::GetFirstIndex ( ) const
inline

Get the first index of the distributed vector interval.

Definition at line 64 of file inmost_sparse.h.

Here is the call graph for this function:

void INMOST::Sparse::Vector::GetInterval ( INMOST_DATA_ENUM_TYPE start,
INMOST_DATA_ENUM_TYPE end 
) const
inline

Get the start and the end of the distributed vector interval.

Definition at line 61 of file inmost_sparse.h.

Here is the call graph for this function:

std::string INMOST::Sparse::Vector::GetName ( )
inline

Get the vector name specified in the main constructor.

Definition at line 80 of file inmost_sparse.h.

bool& INMOST::Sparse::Vector::isParallel ( )
inline

Definition at line 78 of file inmost_sparse.h.

void INMOST::Sparse::Vector::Load ( std::string  file,
INMOST_DATA_ENUM_TYPE  mbeg = ENUMUNDEF,
INMOST_DATA_ENUM_TYPE  mend = ENUMUNDEF 
)

Load the vector from a single data file using the specified interval. If interval is not specified, then it will be automatically constructed, with the about equal block size (the last block may has larger dimension).

Vector& INMOST::Sparse::Vector::operator= ( Vector const &  other)
INMOST_DATA_REAL_TYPE& INMOST::Sparse::Vector::operator[] ( INMOST_DATA_ENUM_TYPE  i)
inline

Return reference to i-th element of the vector.

Definition at line 48 of file inmost_sparse.h.

INMOST_DATA_REAL_TYPE INMOST::Sparse::Vector::operator[] ( INMOST_DATA_ENUM_TYPE  i) const
inline

Return i-th element of the vector.

Definition at line 50 of file inmost_sparse.h.

void INMOST::Sparse::Vector::Save ( std::string  file)

Save the distributed vector to a single data file using parallel MPI I/O.

void INMOST::Sparse::Vector::SetInterval ( INMOST_DATA_ENUM_TYPE  start,
INMOST_DATA_ENUM_TYPE  end 
)
inline

Set the start and the end of the distributed vector interval.

Definition at line 59 of file inmost_sparse.h.

Here is the call graph for this function:

void INMOST::Sparse::Vector::ShiftInterval ( INMOST_DATA_ENUM_TYPE  shift)
inline

Definition at line 62 of file inmost_sparse.h.

Here is the call graph for this function:

INMOST_DATA_ENUM_TYPE INMOST::Sparse::Vector::Size ( ) const
inline

Return the global size of the vector.

Definition at line 52 of file inmost_sparse.h.

Here is the call graph for this function:

void INMOST::Sparse::Vector::Swap ( Vector other)
inline

Definition at line 68 of file inmost_sparse.h.

Here is the call graph for this function:


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