Ginkgo: gko::DiagonalExtractable< ValueType > Class Template Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::DiagonalExtractable< ValueType > Class Template Referenceabstract
Linear Operators

The diagonal of a LinOp implementing this interface can be extracted. More...

`#include <ginkgo/core/base/lin_op.hpp>`

Inheritance diagram for gko::DiagonalExtractable< ValueType >:
[legend]
Collaboration diagram for gko::DiagonalExtractable< ValueType >:
[legend]

## Public Types
using | value_type = ValueType

## Public Member Functions
std::unique_ptr< LinOp > | extract_diagonal_linop () const override
| Extracts the diagonal entries of the matrix into a vector.
virtual std::unique_ptr< matrix::Diagonal< ValueType > > | extract_diagonal () const =0
| Extracts the diagonal entries of the matrix into a vector.

## Detailed Description

template<typename ValueType>
class gko::DiagonalExtractable< ValueType >

The diagonal of a LinOp implementing this interface can be extracted.

extract_diagonal extracts the elements whose col and row index are the same and stores the result in a min(nrows, ncols) x 1 dense matrix.

## Member Function Documentation

## ◆ extract_diagonal()

template<typename ValueType>

virtual std::unique_ptr< matrix::Diagonal< ValueType > > gko::DiagonalExtractable< ValueType >::extract_diagonal | ( |  | ) | const
| pure virtual

Extracts the diagonal entries of the matrix into a vector.

Parameters

  diag | the vector into which the diagonal will be written

Implemented in gko::matrix::Coo< ValueType, IndexType >, gko::matrix::Coo< ValueType, IndexType >, gko::matrix::Csr< ValueType, IndexType >, gko::matrix::Csr< value_type, index_type >, gko::matrix::Csr< ValueType, IndexType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, gko::matrix::Ell< ValueType, IndexType >, gko::matrix::Ell< value_type, index_type >, gko::matrix::Ell< ValueType, IndexType >, gko::matrix::Fbcsr< ValueType, IndexType >, gko::matrix::Fbcsr< ValueType, IndexType >, gko::matrix::Hybrid< ValueType, IndexType >, and gko::matrix::Sellp< ValueType, IndexType >.

## ◆ extract_diagonal_linop()

template<typename ValueType>

std::unique_ptr< LinOp > gko::DiagonalExtractable< ValueType >::extract_diagonal_linop | ( |  | ) | const
| overridevirtual

Extracts the diagonal entries of the matrix into a vector.

Returns
  linop the linop of diagonal format

Implements gko::DiagonalLinOpExtractable.

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

- ginkgo/core/base/lin_op.hpp