gko::batch::matrix::Identity#

Batched identity LinOp. The batched analogue of gko::matrix::Identity: apply(b, x) copies the right-hand-side block into the solution block for every batch item. Used as a no-op preconditioner placeholder.

template<typename ValueType = default_precision>
class Identity #

Inherits from

  • public gko::batch::EnableBatchLinOp<Identity<default_precision>>

The batch Identity matrix, which represents a batch of Identity matrices.

Template Parameters:

ValueType – precision of matrix elements

Public Functions

void apply(
ptr_param<const MultiVector<value_type>> b,
ptr_param<MultiVector<value_type>> x,
)#

Apply the matrix to a multi-vector. Represents the matrix vector multiplication, x = I * b, where x and b are both multi-vectors.

Parameters:
  • b – the multi-vector to be applied to

  • x – the output multi-vector

void apply(
ptr_param<const MultiVector<value_type>> alpha,
ptr_param<const MultiVector<value_type>> b,
ptr_param<const MultiVector<value_type>> beta,
ptr_param<MultiVector<value_type>> x,
)#

Apply the matrix to a multi-vector with a linear combination of the given input vector. Represents the matrix vector multiplication, x = alpha * I

  • b + beta * x, where x and b are both multi-vectors.

Parameters:
  • alpha – the scalar to scale the matrix-vector product with

  • b – the multi-vector to be applied to

  • beta – the scalar to scale the x vector with

  • x – the output multi-vector

Public Static Functions

static std::unique_ptr<Identity> create(
std::shared_ptr<const Executor> exec,
const batch_dim<2> &size = batch_dim<2>{},
)#

Creates an Identity matrix of the specified size.

Parameters:
  • execExecutor associated to the matrix

  • size – size of the batch matrices in a batch_dim object

Returns:

A smart pointer to the newly created matrix.