INMOST
Mathematical Modelling Toolkit
|
#include <inmost_sparse.h>
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) | |
Vector & | operator= (Vector const &other) |
~Vector () | |
INMOST_DATA_REAL_TYPE & | operator[] (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) |
bool & | isParallel () |
std::string | GetName () |
Get the vector name specified in the main constructor. More... | |
void | Clear () |
Clear all data of the current vector. More... | |
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.
Definition at line 26 of file inmost_sparse.h.
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.
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.
_name | Name of the vector, empty string by default. |
start | Start of the local data interval. |
end | End of the local data interval. |
_comm | Communicator for parallel data exchanges, MPI_COMM_WORLD by default. |
INMOST::Sparse::Vector::Vector | ( | const Vector & | other | ) |
INMOST::Sparse::Vector::~Vector | ( | ) |
|
inline |
|
inline |
|
inline |
Clear all data of the current vector.
Definition at line 83 of file inmost_sparse.h.
|
inline |
|
inline |
|
inline |
|
inline |
Get the communicator which the vector is associated with.
Definition at line 66 of file inmost_sparse.h.
|
inline |
Get the first index of the distributed vector interval.
Definition at line 64 of file inmost_sparse.h.
|
inline |
Get the start and the end of the distributed vector interval.
Definition at line 61 of file inmost_sparse.h.
|
inline |
Get the vector name specified in the main constructor.
Definition at line 80 of file inmost_sparse.h.
|
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).
|
inline |
Return reference to i-th element of the vector.
Definition at line 48 of file inmost_sparse.h.
|
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.
|
inline |
Set the start and the end of the distributed vector interval.
Definition at line 59 of file inmost_sparse.h.
|
inline |
|
inline |
Return the global size of the vector.
Definition at line 52 of file inmost_sparse.h.
|
inline |