Go to the documentation of this file.
33 #ifndef covariance_matrix_h
34 #define covariance_matrix_h
83 std::shared_ptr<Matrix> dense)
106 std::shared_ptr<Sparse> sparse)
144 return dense_->diagonal();
236 explicit operator Matrix()
const;
396 std::vector<const Block *> &blocks)
const;
416 #endif // covariance_matrix_h
std::shared_ptr< Matrix > dense_
const Matrix & get_dense() const
const Sparse & get_sparse() const
CovarianceMatrix(CovarianceMatrix &&)=default
Block & operator=(const Block &)=default
friend void mult_inv(MatrixView, ConstMatrixView, const CovarianceMatrix &)
Range get_column_range() const
std::vector< Block > correlations_
invlib::Matrix< ArtsMatrix > Matrix
invlib wrapper type for ARTS matrices.
MatrixView & operator+=(MatrixView &, const Block &)
MatrixType get_matrix_type() const
Vector diagonal() const
Diagonal elements as vector.
Block(const Block &)=default
bool has_diagonal_blocks(const ArrayOfArrayOfIndex &jis) const
Checks that the covariance matrix contains one diagonal block per retrieval quantity.
void add_inv(MatrixView A, const Block &)
CovarianceMatrix(const CovarianceMatrix &)=default
void compute_inverse() const
Compute the inverse of this correlation matrix.
~CovarianceMatrix()=default
friend void mult(MatrixView, ConstMatrixView, const CovarianceMatrix &)
Implementation of Matrix, Vector, and such stuff.
std::vector< Block > inverses_
Index nblocks() const
! The number of blocks in the matrix excluding inverses.
Block(Range row_range, Range column_range, IndexPair indices, std::shared_ptr< Sparse > sparse)
CovarianceMatrix & operator=(CovarianceMatrix &&)=default
Block & operator=(Block &&)=default
const Block * get_block(Index i=-1, Index j=-1)
Return a pointer to the block with indices (i,j).
Range & get_column_range()
Matrix get_inverse() const
void add_correlation_inverse(Block c)
Add block inverse to covariance matrix.
friend std::ostream & operator<<(std::ostream &os, const CovarianceMatrix &v)
Index ndiagblocks() const
! The number of diagonal blocks in the matrix excluding inverses.
Range get_row_range() const
Routines for setting up the jacobian.
void add_correlation(Block c)
Add block to covariance matrix.
Binary output file stream class.
void solve(VectorView, const CovarianceMatrix &, ConstVectorView)
void generate_blocks(std::vector< std::vector< const Block * >> &) const
std::ostream & operator<<(std::ostream &os, const ConstVectorView &v)
void set_matrix(std::shared_ptr< Sparse > sparse)
void mult_inv(MatrixView, ConstMatrixView, const CovarianceMatrix &)
std::pair< Index, Index > IndexPair
A constant view of a Matrix.
constexpr Index get_extent() const
Returns the extent of the range.
friend MatrixView & operator+=(MatrixView &, const CovarianceMatrix &)
void set_matrix(std::shared_ptr< Matrix > dense)
void set_indices(Index f, Index s)
friend void xml_write_to_stream(ostream &, const CovarianceMatrix &, bofstream *, const String &, const Verbosity &)
Write CovarianceMatrix to XML output stream.
bool has_block(Index i, Index j)
Check if the block with indices (i, j) is contained in the covariance matrix.
friend MatrixView & operator+=(MatrixView &, const Block &)
Block(Range row_range, Range column_range, IndexPair indices, std::shared_ptr< Matrix > dense)
friend void xml_read_from_stream(istream &, CovarianceMatrix &, bifstream *, const Verbosity &)
Reads CovarianceMatrix from XML input stream.
Header file for sparse matrices.
friend void solve(VectorView, const CovarianceMatrix &, ConstVectorView)
void mult(MatrixView, ConstMatrixView, const Block &)
bool has_inverse(IndexPair indices) const
std::shared_ptr< Sparse > sparse_
bool is_consistent(const ArrayOfArrayOfIndex &jis) const
Checks that the dimensions of the blocks in the covariance matrix are consistent with ranges occupied...
INDEX Index
The type to use for all integer numbers and indices.
IndexPair get_indices() const
friend void add_inv(MatrixView, const CovarianceMatrix &)
CovarianceMatrix & operator=(const CovarianceMatrix &)=default
std::vector< Block > & get_inverse_blocks()
Blocks of the inverse covariance matrix.
std::vector< Block > & get_blocks()
Block in the covariance matrix.
Vector inverse_diagonal() const
Diagonal of the inverse of the covariance matrix as vector.
A constant view of a Vector.
friend void mult(MatrixView, ConstMatrixView, const Block &)
CovarianceMatrix()=default
Binary output file stream class.
void invert_correlation_block(std::vector< Block > &inverses, std::vector< const Block * > &blocks) const