TDLS 0.4.0
Tiny Device-callable Linear Solvers
Loading...
Searching...
No Matches
storage_map.hpp File Reference

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

Include dependency graph for storage_map.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tdls::ArrowheadStorageMap< Storage, Coupling, Layout >
 Index of every entry of an arrowhead matrix in its storage. More...
 

Detailed Description

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

Author
Tristan Chenaille

The pattern of an arrowhead matrix follows from its shape, so the index of every entry in a storage is a function of the shape, the storage, the coupling and the layout: ArrowheadStorageMap computes it. The caller fills its matrix through it, and the solvers read through the same functions. With a compile-time shape every index folds to a constant.

Row-major storages compress or order by rows, column-major ones by columns:

  • Full: (r, c) at r * n + c, or c * n + r;
  • Packed: Abb, then the couplings (border x block per block, or one entry per unknown of the block under the diagonal coupling), then the A_kb (block x border each), then the D_k (block x block each), every stored block by rows or by columns;
  • Csr: border row r holds Abb(r, :) then its coupling entries; block row (k, i) holds A_kb(i, :) then D_k(i, :). CSC: border column c holds Abb(:, c) then A_kb(:, c) of every block; block column (k, j) holds its coupling entries (one under the diagonal coupling, border otherwise) then D_k(:, j);
  • Bsr / BSC: square blocks of block entries, stored by rows or by columns, block rows (block columns) in increasing order.

Indices are ints: the dimension and the number of stored entries must stay below 2^31, which valid() checks.