TDLS 0.4.0
Tiny Device-callable Linear Solvers
Loading...
Searching...
No Matches
tdls::ArrowheadStorageMap< Storage, Coupling, Layout > Struct Template Reference

Index of every entry of an arrowhead matrix in its storage. More...

#include <storage_map.hpp>

Static Public Member Functions

static TDLS_HOST_DEVICE constexpr bool valid (const ArrowheadShape &s) noexcept
 Whether a shape suits this storage and coupling: positive sizes, coupled rows inside the border (diagonal coupling) or coupling_row = 0 (dense coupling), a border and a coupling_row multiple of the block (Bsr), a dimension and a number of stored entries below 2^31. The checks cannot overflow, whatever the shape.
 
static TDLS_HOST_DEVICE constexpr long long wide_size (const ArrowheadShape &s) noexcept
 Number of stored entries, in 64-bit arithmetic (the overflow check of valid()).
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int size (const ArrowheadShape &s) noexcept
 Number of stored entries.
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int abb (const ArrowheadShape &s, const int r, const int c) noexcept
 Border-border entry (r, c), r and c < border.
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int abk (const ArrowheadShape &s, const int k, const int r, const int i) noexcept
 Coupling entry of border row r and unknown i of block k (dense coupling).
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int abk_diag (const ArrowheadShape &s, const int k, const int i) noexcept
 Coupling entry of border row coupling_row + i and unknown i of block k (diagonal coupling).
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int akb (const ArrowheadShape &s, const int k, const int i, const int c) noexcept
 Entry of row i of block k in border column c.
 
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int d (const ArrowheadShape &s, const int k, const int i, const int j) noexcept
 Entry (i, j) of the diagonal block k.
 
static TDLS_HOST_DEVICE constexpr bool in_pattern (const ArrowheadShape &s, const int r, const int c) noexcept
 Whether entry (r, c) of the full matrix belongs to the pattern.
 
static TDLS_HOST_DEVICE constexpr void csr_pattern (const ArrowheadShape &s, int *ptr, int *idx) noexcept
 Writes the canonical compressed index arrays of the pattern: CSR (row pointers, column indices) under the row-major layout, CSC (column pointers, row indices) under the column-major one, minor indices in increasing order. Meaningful for the Csr storage.
 
static TDLS_HOST_DEVICE constexpr void bsr_pattern (const ArrowheadShape &s, int *ptr, int *idx) noexcept
 Writes the canonical block compressed index arrays, in square blocks of block entries: BSR by block rows under the row-major layout, BSC by block columns under the column-major one, minor block indices in increasing order. Meaningful for the Bsr storage.
 

Static Public Attributes

static constexpr bool diag = Coupling == ArrowheadCoupling::Diagonal
 Whether the couplings are diagonal.
 
static constexpr bool col = Layout == MatrixLayout::ColMajor
 Whether the matrix is stored by columns.
 

Detailed Description

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
struct tdls::ArrowheadStorageMap< Storage, Coupling, Layout >

Index of every entry of an arrowhead matrix in its storage.

Template Parameters
Storagestorage of the matrix
Couplingpattern of the couplings A_bk
Layoutorder of the stored matrix, by rows or by columns

Member Function Documentation

◆ abb()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::abb ( const ArrowheadShape & s,
const int r,
const int c )
inlinestaticnodiscardconstexprnoexcept

Border-border entry (r, c), r and c < border.

Parameters
[in]sshape (valid)
[in]rborder row
[in]cborder column
Returns
its index in the storage

◆ abk()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::abk ( const ArrowheadShape & s,
const int k,
const int r,
const int i )
inlinestaticnodiscardconstexprnoexcept

Coupling entry of border row r and unknown i of block k (dense coupling).

Parameters
[in]sshape (valid)
[in]kblock
[in]rborder row
[in]iunknown of the block
Returns
its index in the storage

◆ abk_diag()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::abk_diag ( const ArrowheadShape & s,
const int k,
const int i )
inlinestaticnodiscardconstexprnoexcept

Coupling entry of border row coupling_row + i and unknown i of block k (diagonal coupling).

Parameters
[in]sshape (valid)
[in]kblock
[in]iunknown of the block
Returns
its index in the storage

◆ akb()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::akb ( const ArrowheadShape & s,
const int k,
const int i,
const int c )
inlinestaticnodiscardconstexprnoexcept

Entry of row i of block k in border column c.

Parameters
[in]sshape (valid)
[in]kblock
[in]irow of the block
[in]cborder column
Returns
its index in the storage

◆ bsr_pattern()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
static TDLS_HOST_DEVICE constexpr void tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::bsr_pattern ( const ArrowheadShape & s,
int * ptr,
int * idx )
inlinestaticconstexprnoexcept

Writes the canonical block compressed index arrays, in square blocks of block entries: BSR by block rows under the row-major layout, BSC by block columns under the column-major one, minor block indices in increasing order. Meaningful for the Bsr storage.

Parameters
[in]sshape (valid, border a multiple of block)
[out]ptrborder / block + blocks + 1 pointers
[out]idxsize(s) / (block * block) minor block indices

◆ csr_pattern()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
static TDLS_HOST_DEVICE constexpr void tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::csr_pattern ( const ArrowheadShape & s,
int * ptr,
int * idx )
inlinestaticconstexprnoexcept

Writes the canonical compressed index arrays of the pattern: CSR (row pointers, column indices) under the row-major layout, CSC (column pointers, row indices) under the column-major one, minor indices in increasing order. Meaningful for the Csr storage.

Parameters
[in]sshape (valid)
[out]ptrn + 1 pointers
[out]idxsize(s) minor indices

◆ d()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::d ( const ArrowheadShape & s,
const int k,
const int i,
const int j )
inlinestaticnodiscardconstexprnoexcept

Entry (i, j) of the diagonal block k.

Parameters
[in]sshape (valid)
[in]kblock
[in]irow of the block
[in]jcolumn of the block
Returns
its index in the storage

◆ in_pattern()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
static TDLS_HOST_DEVICE constexpr bool tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::in_pattern ( const ArrowheadShape & s,
const int r,
const int c )
inlinestaticnodiscardconstexprnoexcept

Whether entry (r, c) of the full matrix belongs to the pattern.

Parameters
[in]sshape (valid)
[in]rrow of the full matrix
[in]ccolumn of the full matrix
Returns
true for a stored entry

◆ size()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
TDLS_HOST_DEVICE static TDLS_FORCE_INLINE_GPU constexpr int tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::size ( const ArrowheadShape & s)
inlinestaticnodiscardconstexprnoexcept

Number of stored entries.

Parameters
[in]sshape (valid)
Returns
the number of entries of the storage

◆ valid()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
static TDLS_HOST_DEVICE constexpr bool tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::valid ( const ArrowheadShape & s)
inlinestaticnodiscardconstexprnoexcept

Whether a shape suits this storage and coupling: positive sizes, coupled rows inside the border (diagonal coupling) or coupling_row = 0 (dense coupling), a border and a coupling_row multiple of the block (Bsr), a dimension and a number of stored entries below 2^31. The checks cannot overflow, whatever the shape.

Parameters
[in]sshape
Returns
true when the solvers accept the shape

◆ wide_size()

template<ArrowheadStorage Storage, ArrowheadCoupling Coupling, MatrixLayout Layout>
static TDLS_HOST_DEVICE constexpr long long tdls::ArrowheadStorageMap< Storage, Coupling, Layout >::wide_size ( const ArrowheadShape & s)
inlinestaticnodiscardconstexprnoexcept

Number of stored entries, in 64-bit arithmetic (the overflow check of valid()).

Parameters
[in]sshape of positive sizes and of dimension below 2^31, which bounds the result by 2 n^2 < 2^63
Returns
the number of entries of the storage

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