INMOST
A toolkit for distributed mathematical modeling
INMOST::Sparse::HessianMatrix Class Reference

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, HessianRowHessianRows
 
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)
 
HessianMatrixoperator= (HessianMatrix const &other)
 
HessianRowoperator[] (INMOST_DATA_ENUM_TYPE i)
 Return reference to i-th Row of the matrix.
 
const HessianRowoperator[] (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.
 

Detailed Description

Class to store the distributed sparse hessian hyper matrix by compressed symmetric matrices.

Definition at line 562 of file inmost_sparse.h.

Constructor & Destructor Documentation

◆ HessianMatrix()

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.

Parameters
_nameName of the matrix, 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.

Member Function Documentation

◆ Load()

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).

◆ MatVec()

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

Parameters
JInput/output Matrix.

◆ Save()

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.

See also
http://math.nist.gov/MatrixMarket/formats.html

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