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

Class to store the compressed symmetric matrix of a hessian row. More...

#include <inmost_sparse.h>

Classes

struct  hessian_entry_s
 
struct  hessian_index_s
 Entry of the sparse matrix row. More...
 

Public Types

typedef struct INMOST::Sparse::HessianRow::hessian_index_s index
 Entry of the sparse matrix row.
 
typedef struct INMOST::Sparse::HessianRow::hessian_entry_s entry
 
typedef Entries::iterator iterator
 
typedef Entries::const_iterator const_iterator
 
typedef Entries::reverse_iterator reverse_iterator
 
typedef Entries::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 HessianRow (const HessianRow &other)
 
 HessianRow (entry *pbegin, entry *pend)
 
HessianRowoperator= (HessianRow const &other)
 
INMOST_DATA_REAL_TYPE & operator[] (index i)
 The operator [] used to fill the sparse matrix row, but not to access individual elements of the row.
 
INMOST_DATA_REAL_TYPE operator[] (index i) const
 The operator [] used to access individual elements of the row.
 
INMOST_DATA_REAL_TYPE get_safe (index i) const
 
void Clear ()
 Clear all data of the current row.
 
void Swap (HessianRow &other)
 
INMOST_DATA_ENUM_TYPE Size () const
 The size of the sparse row, i.e. the total number of nonzero elements.
 
bool Empty () const
 
indexGetIndex (INMOST_DATA_ENUM_TYPE k)
 
INMOST_DATA_REAL_TYPE & GetValue (INMOST_DATA_ENUM_TYPE k)
 
index GetIndex (INMOST_DATA_ENUM_TYPE k) const
 
INMOST_DATA_REAL_TYPE GetValue (INMOST_DATA_ENUM_TYPE k) const
 
iterator Begin ()
 
iterator End ()
 
const_iterator Begin () const
 
const_iterator End () const
 
reverse_iterator rBegin ()
 
reverse_iterator rEnd ()
 
const_reverse_iterator rBegin () const
 
const_reverse_iterator rEnd () const
 
void RowVec (INMOST_DATA_REAL_TYPE alpha, const Row &rU, INMOST_DATA_REAL_TYPE beta, Row &rJ) const
 Return the scalar product of the current sparse row by a dense Vector.
 
void MoveRow (HessianRow &new_pos)
 
void Zero ()
 Set the vector entries by zeroes.
 
void Push (index ind, INMOST_DATA_REAL_TYPE val)
 Push specified element into sparse row. More...
 
void Resize (INMOST_DATA_ENUM_TYPE size)
 Resize row to specified size. More...
 
void Print () const
 
bool isSorted () const
 

Static Public Member Functions

static __INLINE index make_index (INMOST_DATA_ENUM_TYPE _first, INMOST_DATA_ENUM_TYPE _second)
 
static __INLINE entry make_entry (index ind, INMOST_DATA_REAL_TYPE val)
 
static void MergeSortedRows (INMOST_DATA_REAL_TYPE alpha, const HessianRow &left, INMOST_DATA_REAL_TYPE beta, const HessianRow &right, HessianRow &output)
 output = alpha * left + beta *right
 
static void MergeJacobianHessian (INMOST_DATA_REAL_TYPE a, const Row &JL, const Row &JR, INMOST_DATA_REAL_TYPE b, const HessianRow &HL, INMOST_DATA_REAL_TYPE c, const HessianRow &HR, HessianRow &output)
 
static void MergeJacobianHessian (INMOST_DATA_REAL_TYPE a, const Row &JL, const Row &JR, INMOST_DATA_REAL_TYPE b, const HessianRow &H, HessianRow &output)
 

Detailed Description

Class to store the compressed symmetric matrix of a hessian row.

Definition at line 333 of file inmost_sparse.h.

Member Function Documentation

◆ Push()

void INMOST::Sparse::HessianRow::Push ( index  ind,
INMOST_DATA_REAL_TYPE  val 
)
inline

Push specified element into sparse row.

This function should be used only if the index is not repeated in the row.

Definition at line 426 of file inmost_sparse.h.

◆ Resize()

void INMOST::Sparse::HessianRow::Resize ( INMOST_DATA_ENUM_TYPE  size)
inline

Resize row to specified size.

It is intended to be used together with non-const Row::GetIndex and Row::GetValue that allow for the modification of individual entries.

Parameters
sizeNew size of the row.

Definition at line 431 of file inmost_sparse.h.


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