INMOST
A toolkit for distributed mathematical modeling
|
Class to store the distributed sparse hessian hyper matrix by compressed symmetric matrices. More...
#include <inmost_sparse.h>
Public Types | |
typedef interval< INMOST_DATA_ENUM_TYPE, HessianRow > | HessianRows |
typedef HessianRows::iterator | iterator |
typedef HessianRows::const_iterator | const_iterator |
Public Member Functions | |
HessianMatrix (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 Matrix class. More... | |
HessianMatrix (const HessianMatrix &other) | |
HessianMatrix & | operator= (HessianMatrix const &other) |
HessianRow & | operator[] (INMOST_DATA_ENUM_TYPE i) |
Return reference to i-th Row of the matrix. | |
const HessianRow & | operator[] (INMOST_DATA_ENUM_TYPE i) const |
Return reference to i-th Row of the matrix. | |
INMOST_DATA_ENUM_TYPE | Size () const |
Return the total number of rows in the matrix. | |
bool | Empty () const |
iterator | Begin () |
iterator | End () |
const_iterator | Begin () const |
const_iterator | End () const |
void | SetInterval (INMOST_DATA_ENUM_TYPE start, INMOST_DATA_ENUM_TYPE end) |
Set the start and the end row numbers of the distributed matrix interval. | |
void | GetInterval (INMOST_DATA_ENUM_TYPE &start, INMOST_DATA_ENUM_TYPE &end) const |
Get the start and the end row numbers of the distributed matrix interval. | |
void | ShiftInterval (INMOST_DATA_ENUM_TYPE shift) |
INMOST_DATA_ENUM_TYPE | GetFirstIndex () const |
Get the first row index of the distributed matrix interval. | |
INMOST_DATA_ENUM_TYPE | GetLastIndex () const |
Get the last row index of the distributed matrix interval. | |
INMOST_MPI_Comm | GetCommunicator () const |
Get the communicator which the matrix is associated with. | |
void | MoveRows (INMOST_DATA_ENUM_TYPE from, INMOST_DATA_ENUM_TYPE to, INMOST_DATA_ENUM_TYPE size) |
void | Swap (HessianMatrix &other) |
void | MatVec (INMOST_DATA_REAL_TYPE alpha, const Matrix &U, INMOST_DATA_REAL_TYPE beta, Matrix &J) const |
HyperMatrix-Matrix product of the form: J = alpha*H*U + beta * J. More... | |
void | Clear () |
Clear all data of the matrix. | |
void | Load (std::string file, INMOST_DATA_ENUM_TYPE beg=ENUMUNDEF, INMOST_DATA_ENUM_TYPE end=ENUMUNDEF) |
Load the matrix from a single data file in MTX format using the specified interval. More... | |
void | Save (std::string file, const AnnotationService *annotation=NULL) |
Save the distributed matrix to a single data file in MTX format using parallel MPI I/O. More... | |
bool & | isParallel () |
Check that matrix is in parallel state. | |
const bool & | isParallel () const |
std::string | GetName () const |
Get the matrix name specified in the main constructor. | |
Class to store the distributed sparse hessian hyper matrix by compressed symmetric matrices.
Definition at line 562 of file inmost_sparse.h.
INMOST::Sparse::HessianMatrix::HessianMatrix | ( | 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 Matrix class.
_name | Name of the matrix, 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. |
void INMOST::Sparse::HessianMatrix::Load | ( | std::string | file, |
INMOST_DATA_ENUM_TYPE | beg = ENUMUNDEF , |
||
INMOST_DATA_ENUM_TYPE | end = ENUMUNDEF |
||
) |
Load the matrix from a single data file in MTX format 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).
void INMOST::Sparse::HessianMatrix::MatVec | ( | INMOST_DATA_REAL_TYPE | alpha, |
const Matrix & | U, | ||
INMOST_DATA_REAL_TYPE | beta, | ||
Matrix & | J | ||
) | const |
HyperMatrix-Matrix product of the form: J = alpha*H*U + beta * J.
J - jacobian sparse matrix H - hessian symmetric sparse hypermatrix U - update sparse matrix
J | Input/output Matrix. |
void INMOST::Sparse::HessianMatrix::Save | ( | std::string | file, |
const AnnotationService * | annotation = NULL |
||
) |
Save the distributed matrix to a single data file in MTX format using parallel MPI I/O.