ARTS  2.3.1285(git:92a29ea9-dirty)
Block Class Reference

#include <covariance_matrix.h>

Public Types

enum  MatrixType { MatrixType::dense, MatrixType::sparse }
 

Public Member Functions

 Block (Range row_range, Range column_range, IndexPair indices, std::shared_ptr< Matrix > dense)
 
 Block (Range row_range, Range column_range, IndexPair indices, std::shared_ptr< Sparse > sparse)
 
 Block (const Block &)=default
 
 Block (Block &&)=default
 
Blockoperator= (const Block &)=default
 
Blockoperator= (Block &&)=default
 
 ~Block ()=default
 
Index nrows () const
 
Index ncols () const
 
Range get_row_range () const
 
Range get_column_range () const
 
Rangeget_row_range ()
 
Rangeget_column_range ()
 
void set_matrix (std::shared_ptr< Sparse > sparse)
 
void set_matrix (std::shared_ptr< Matrix > dense)
 
Vector diagonal () const
 
IndexPair get_indices () const
 
void set_indices (Index f, Index s)
 
MatrixType get_matrix_type () const
 
const Matrixget_dense () const
 
Matrixget_dense ()
 
const Sparseget_sparse () const
 
Sparseget_sparse ()
 

Private Attributes

Range row_range_
 
Range column_range_
 
IndexPair indices_
 
MatrixType matrix_type_
 
std::shared_ptr< Matrixdense_
 
std::shared_ptr< Sparsesparse_
 

Friends

void mult (MatrixView, ConstMatrixView, const Block &)
 
void mult (MatrixView, const Block &, ConstMatrixView)
 
void mult (VectorView, const Block &, ConstVectorView)
 
MatrixViewoperator+= (MatrixView &, const Block &)
 

Detailed Description

A block in a covariance matrix.

A block in a covariance matrix represents a correlation between two retrieval quantities. Each block holds a pointer to either a dense matrix of type Matrix or type Sparse. In addition to this it holds to two block indices i and j and two range objects that describe the position of the block in terms of the rows and columns of blocks in the matrix and the row and columns of elements, respectively.

Definition at line 62 of file covariance_matrix.h.

Member Enumeration Documentation

◆ MatrixType

enum Block::MatrixType
strong
Enumerator
dense 
sparse 

Definition at line 68 of file covariance_matrix.h.

Constructor & Destructor Documentation

◆ Block() [1/4]

Block::Block ( Range  row_range,
Range  column_range,
IndexPair  indices,
std::shared_ptr< Matrix dense 
)
inline

Definition at line 80 of file covariance_matrix.h.

Referenced by Block().

◆ Block() [2/4]

Block::Block ( Range  row_range,
Range  column_range,
IndexPair  indices,
std::shared_ptr< Sparse sparse 
)
inline

Definition at line 103 of file covariance_matrix.h.

References Block(), operator=(), and ~Block().

◆ Block() [3/4]

Block::Block ( const Block )
default

◆ Block() [4/4]

Block::Block ( Block &&  )
default

◆ ~Block()

Block::~Block ( )
default

Referenced by Block().

Member Function Documentation

◆ diagonal()

Vector Block::diagonal ( ) const
inline

Return the diagonal as a vector.

Definition at line 142 of file covariance_matrix.h.

References dense_, and sparse_.

◆ get_column_range() [1/2]

Range Block::get_column_range ( ) const
inline

The column range of this block

Definition at line 131 of file covariance_matrix.h.

References column_range_.

Referenced by covmat_seAddBlock(), covmat_seAddInverseBlock(), get_covariance_matrix_block(), mult(), operator+=(), and operator<<().

◆ get_column_range() [2/2]

Range& Block::get_column_range ( )
inline

The column range of this block

Definition at line 136 of file covariance_matrix.h.

References column_range_.

◆ get_dense() [1/2]

const Matrix& Block::get_dense ( ) const
inline

Definition at line 159 of file covariance_matrix.h.

References dense_.

Referenced by get_covariance_matrix_block(), and operator+=().

◆ get_dense() [2/2]

Matrix& Block::get_dense ( )
inline

Definition at line 164 of file covariance_matrix.h.

References dense_.

◆ get_indices()

IndexPair Block::get_indices ( ) const
inline

Return the indices of the retrieval quantities correlated by this block as std::pair.

Definition at line 151 of file covariance_matrix.h.

References indices_.

Referenced by get_covariance_matrix_block(), CovarianceMatrix::invert_correlation_block(), CovarianceMatrix::is_consistent(), mult(), operator+=(), and operator<<().

◆ get_matrix_type()

MatrixType Block::get_matrix_type ( ) const
inline

Return the type of the matrix holding the correlation coefficients.

Definition at line 157 of file covariance_matrix.h.

References matrix_type_.

Referenced by get_covariance_matrix_block(), and operator+=().

◆ get_row_range() [1/2]

Range Block::get_row_range ( ) const
inline

The row range of this block

Definition at line 129 of file covariance_matrix.h.

References row_range_.

Referenced by covmat_seAddBlock(), covmat_seAddInverseBlock(), get_covariance_matrix_block(), mult(), operator+=(), and operator<<().

◆ get_row_range() [2/2]

Range& Block::get_row_range ( )
inline

The row range of this block

Definition at line 134 of file covariance_matrix.h.

References row_range_.

◆ get_sparse() [1/2]

const Sparse& Block::get_sparse ( ) const
inline

Definition at line 169 of file covariance_matrix.h.

References sparse_.

Referenced by get_covariance_matrix_block(), and operator+=().

◆ get_sparse() [2/2]

Sparse& Block::get_sparse ( )
inline

Definition at line 174 of file covariance_matrix.h.

References mult, operator+=, and sparse_.

◆ ncols()

Index Block::ncols ( ) const
inline

Number of columns of this block

Definition at line 126 of file covariance_matrix.h.

References column_range_, and Range::get_extent().

◆ nrows()

Index Block::nrows ( ) const
inline

Number of rows of this block

Definition at line 124 of file covariance_matrix.h.

References Range::get_extent(), and row_range_.

◆ operator=() [1/2]

Block& Block::operator= ( const Block )
default

Referenced by Block().

◆ operator=() [2/2]

Block& Block::operator= ( Block &&  )
default

◆ set_indices()

void Block::set_indices ( Index  f,
Index  s 
)
inline

Return the indices of the retrieval quantities correlated by this block as std::pair.

Definition at line 154 of file covariance_matrix.h.

References indices_.

◆ set_matrix() [1/2]

void Block::set_matrix ( std::shared_ptr< Sparse sparse)
inline

Definition at line 138 of file covariance_matrix.h.

References sparse, and sparse_.

◆ set_matrix() [2/2]

void Block::set_matrix ( std::shared_ptr< Matrix dense)
inline

Definition at line 139 of file covariance_matrix.h.

References dense, and dense_.

Friends And Related Function Documentation

◆ mult [1/3]

void mult ( MatrixView  ,
ConstMatrixView  ,
const Block  
)
friend

Definition at line 38 of file covariance_matrix.cc.

Referenced by get_sparse().

◆ mult [2/3]

void mult ( MatrixView  ,
const Block ,
ConstMatrixView   
)
friend

Definition at line 68 of file covariance_matrix.cc.

◆ mult [3/3]

void mult ( VectorView  ,
const Block ,
ConstVectorView   
)
friend

Definition at line 98 of file covariance_matrix.cc.

◆ operator+=

MatrixView& operator+= ( MatrixView ,
const Block  
)
friend

Definition at line 120 of file covariance_matrix.cc.

Referenced by get_sparse().

Member Data Documentation

◆ column_range_

Range Block::column_range_
private

Definition at line 187 of file covariance_matrix.h.

Referenced by get_column_range(), and ncols().

◆ dense_

std::shared_ptr<Matrix> Block::dense_
private

Definition at line 192 of file covariance_matrix.h.

Referenced by diagonal(), get_dense(), mult(), and set_matrix().

◆ indices_

IndexPair Block::indices_
private

Definition at line 188 of file covariance_matrix.h.

Referenced by get_indices(), and set_indices().

◆ matrix_type_

MatrixType Block::matrix_type_
private

Definition at line 190 of file covariance_matrix.h.

Referenced by get_matrix_type(), and mult().

◆ row_range_

Range Block::row_range_
private

Definition at line 187 of file covariance_matrix.h.

Referenced by get_row_range(), and nrows().

◆ sparse_

std::shared_ptr<Sparse> Block::sparse_
private

Definition at line 193 of file covariance_matrix.h.

Referenced by diagonal(), get_sparse(), mult(), and set_matrix().


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