Ginkgo: gko::preconditioner::block_interleaved_storage_scheme< IndexType > Struct 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::preconditioner::block_interleaved_storage_scheme< IndexType > Struct Template Reference
Linear Operators » Preconditioners » Jacobi Preconditioner

Defines the parameters of the interleaved block storage scheme used by block-Jacobi blocks. More...

`#include <ginkgo/core/preconditioner/jacobi.hpp>`

Inheritance diagram for gko::preconditioner::block_interleaved_storage_scheme< IndexType >:
[legend]

## Public Member Functions
| block_interleaved_storage_scheme (IndexType block_offset, IndexType group_offset, uint32 group_power)
IndexType | get_group_size () const noexcept
| Returns the number of elements in the group.
size_type | compute_storage_space (size_type num_blocks) const noexcept
| Computes the storage space required for the requested number of blocks.
IndexType | get_group_offset (IndexType block_id) const noexcept
| Returns the offset of the group belonging to the block with the given ID.
IndexType | get_block_offset (IndexType block_id) const noexcept
| Returns the offset of the block with the given ID within its group.
IndexType | get_global_block_offset (IndexType block_id) const noexcept
| Returns the offset of the block with the given ID.
IndexType | get_stride () const noexcept
| Returns the stride between columns of the block.

## Public Attributes
IndexType | block_offset
| The offset between consecutive blocks within the group.
IndexType | group_offset
| The offset between two block groups.
uint32 | group_power
| Then base 2 power of the group.

## Detailed Description

template<typename IndexType>
struct gko::preconditioner::block_interleaved_storage_scheme< IndexType >

Defines the parameters of the interleaved block storage scheme used by block-Jacobi blocks.

Template Parameters

  IndexType | type used for storing indices of the matrix

## Member Function Documentation

## ◆ compute_storage_space()

template<typename IndexType>

size_type gko::preconditioner::block_interleaved_storage_scheme< IndexType >::compute_storage_space | ( | size_type | num_blocks | ) | const
| inlinenoexcept

Computes the storage space required for the requested number of blocks.

Parameters

  num_blocks | the total number of blocks that needs to be stored

Returns
  the total memory (as the number of elements) that need to be allocated for the scheme

Note
  To simplify using the method in situations where the number of blocks is not known, for a special input size_type{} - 1 the method returns 0 to avoid overallocation of memory.

References gko::ceildiv(), and get_group_size().

## ◆ get_block_offset()

template<typename IndexType>

IndexType gko::preconditioner::block_interleaved_storage_scheme< IndexType >::get_block_offset | ( | IndexType | block_id | ) | const
| inlinenoexcept

Returns the offset of the block with the given ID within its group.

Parameters

  block_id | the ID of the block

Returns
  the offset of the block with ID block_id within its group

References block_offset, and get_group_size().

Referenced by get_global_block_offset().

## ◆ get_global_block_offset()

template<typename IndexType>

IndexType gko::preconditioner::block_interleaved_storage_scheme< IndexType >::get_global_block_offset | ( | IndexType | block_id | ) | const
| inlinenoexcept

Returns the offset of the block with the given ID.

Parameters

  block_id | the ID of the block

Returns
  the offset of the block with ID block_id

References get_block_offset(), and get_group_offset().

## ◆ get_group_offset()

template<typename IndexType>

IndexType gko::preconditioner::block_interleaved_storage_scheme< IndexType >::get_group_offset | ( | IndexType | block_id | ) | const
| inlinenoexcept

Returns the offset of the group belonging to the block with the given ID.

Parameters

  block_id | the ID of the block

Returns
  the offset of the group belonging to block with ID block_id

References group_offset, and group_power.

Referenced by get_global_block_offset().

## ◆ get_group_size()

template<typename IndexType>

IndexType gko::preconditioner::block_interleaved_storage_scheme< IndexType >::get_group_size | ( |  | ) | const
| inlinenoexcept

Returns the number of elements in the group.

Returns
  the number of elements in the group

References group_power, and gko::one().

Referenced by compute_storage_space(), and get_block_offset().

## ◆ get_stride()

template<typename IndexType>

IndexType gko::preconditioner::block_interleaved_storage_scheme< IndexType >::get_stride | ( |  | ) | const
| inlinenoexcept

Returns the stride between columns of the block.

Returns
  stride between columns of the block

References block_offset, and group_power.

## Member Data Documentation

## ◆ group_power

template<typename IndexType>

uint32 gko::preconditioner::block_interleaved_storage_scheme< IndexType >::group_power

Then base 2 power of the group.

I.e. the group contains 1 << group_power elements.

Referenced by get_group_offset(), get_group_size(), and get_stride().

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

- ginkgo/core/preconditioner/jacobi.hpp