gko::Transposable#

Trait interface for operators that can produce their transpose and conjugate transpose. Provides two virtual methods, transpose() and conj_transpose(), both returning a fresh unique_ptr<LinOp> that represents the transformed operator. Concrete classes that implement this trait include matrix::Csr, matrix::Dense, the Krylov solvers (which return the solver for the transposed system), and the preconditioners that support it.

Use gko::as<Transposable>(linop) to access the trait at runtime when working with a generic LinOp pointer.

class Transposable#

Linear operators which support transposition should implement the Transposable interface.

It provides two functionalities, the normal transpose and the conjugate transpose.

The normal transpose returns the transpose of the linear operator without changing any of its elements representing the operation, \(B = A^{T}\).

The conjugate transpose returns the conjugate of each of the elements and additionally transposes the linear operator representing the operation, \(B = A^{H}\).

#

Example: Transposing a Csr matrix:#

//Transposing an object of LinOp type.
//The object you want to transpose.
auto op = matrix::Csr::create(exec);
//Transpose the object by first converting it to a transposable type.
auto trans = op->transpose();

Subclassed by

Public Functions

virtual std::unique_ptr<LinOp> transpose() const = 0#

Returns a LinOp representing the transpose of the Transposable object.

Returns:

a pointer to the new transposed object

virtual std::unique_ptr<LinOp> conj_transpose() const = 0#

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns:

a pointer to the new conjugate transposed object