ARTS 2.5.4 (git: 31ce4f0e)
Block Class Reference

#include <covariance_matrix.h>

Public Types

enum class  MatrixType { dense , 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 64 of file covariance_matrix.h.

Member Enumeration Documentation

◆ MatrixType

enum class Block::MatrixType
strong
Enumerator
dense 
sparse 

Definition at line 70 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 82 of file covariance_matrix.h.

◆ Block() [2/4]

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

Definition at line 105 of file covariance_matrix.h.

◆ Block() [3/4]

Block::Block ( const Block )
default

◆ Block() [4/4]

Block::Block ( Block &&  )
default

◆ ~Block()

Block::~Block ( )
default

Member Function Documentation

◆ diagonal()

Vector Block::diagonal ( ) const
inline

Return the diagonal as a vector.

Definition at line 144 of file covariance_matrix.h.

References dense_, and sparse_.

◆ get_column_range() [1/2]

Range & Block::get_column_range ( )
inline

The column range of this block

Definition at line 138 of file covariance_matrix.h.

References column_range_.

◆ get_column_range() [2/2]

Range Block::get_column_range ( ) const
inline

The column range of this block

Definition at line 133 of file covariance_matrix.h.

References column_range_.

Referenced by covmat_seAddInverseBlock().

◆ get_dense() [1/2]

Matrix & Block::get_dense ( )
inline

Definition at line 166 of file covariance_matrix.h.

References ARTS_ASSERT, and dense_.

◆ get_dense() [2/2]

const Matrix & Block::get_dense ( ) const
inline

Definition at line 161 of file covariance_matrix.h.

References ARTS_ASSERT, and 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 153 of file covariance_matrix.h.

References indices_.

◆ get_matrix_type()

MatrixType Block::get_matrix_type ( ) const
inline

Return the type of the matrix holding the correlation coefficients.

Definition at line 159 of file covariance_matrix.h.

References matrix_type_.

◆ get_row_range() [1/2]

Range & Block::get_row_range ( )
inline

The row range of this block

Definition at line 136 of file covariance_matrix.h.

References row_range_.

◆ get_row_range() [2/2]

Range Block::get_row_range ( ) const
inline

The row range of this block

Definition at line 131 of file covariance_matrix.h.

References row_range_.

Referenced by covmat_seAddInverseBlock().

◆ get_sparse() [1/2]

Sparse & Block::get_sparse ( )
inline

Definition at line 176 of file covariance_matrix.h.

References ARTS_ASSERT, and sparse_.

◆ get_sparse() [2/2]

const Sparse & Block::get_sparse ( ) const
inline

Definition at line 171 of file covariance_matrix.h.

References ARTS_ASSERT, and sparse_.

◆ ncols()

Index Block::ncols ( ) const
inline

Number of columns of this block

Definition at line 128 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 126 of file covariance_matrix.h.

References Range::get_extent(), and row_range_.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Block & Block::operator= ( const 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 156 of file covariance_matrix.h.

References indices_.

◆ set_matrix() [1/2]

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

Definition at line 141 of file covariance_matrix.h.

References dense, dense_, matrix_type_, and sparse_.

◆ set_matrix() [2/2]

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

Definition at line 140 of file covariance_matrix.h.

References dense_, matrix_type_, sparse, and sparse_.

Friends And Related Function Documentation

◆ mult [1/3]

void mult ( MatrixView  ,
const Block ,
ConstMatrixView   
)
friend

Definition at line 68 of file covariance_matrix.cc.

◆ mult [2/3]

void mult ( MatrixView  ,
ConstMatrixView  ,
const Block  
)
friend

Definition at line 38 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.

Member Data Documentation

◆ column_range_

Range Block::column_range_
private

Definition at line 189 of file covariance_matrix.h.

Referenced by get_column_range(), and ncols().

◆ dense_

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

Definition at line 194 of file covariance_matrix.h.

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

◆ indices_

IndexPair Block::indices_
private

Definition at line 190 of file covariance_matrix.h.

Referenced by get_indices(), and set_indices().

◆ matrix_type_

MatrixType Block::matrix_type_
private

Definition at line 192 of file covariance_matrix.h.

Referenced by get_matrix_type(), and set_matrix().

◆ row_range_

Range Block::row_range_
private

Definition at line 189 of file covariance_matrix.h.

Referenced by get_row_range(), and nrows().

◆ sparse_

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

Definition at line 195 of file covariance_matrix.h.

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


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