|
TDLS 0.4.0
Tiny Device-callable Linear Solvers
|
Arrowhead solver with a runtime shape. More...
#include <solver_dynamic.hpp>
Classes | |
| struct | RecomputedBlock |
| Block k of a recomputed solve (solve_inplace_recomputed, solve_inplace_recomputed_or_tangent): a StreamedBlock, the same view and accessors, and whether the solver asks for the block again, in its recovery. A provider taking a StreamedBlock& serves too; one taking a RecomputedBlock&, or auto&, reads the flag. The streamed entry points keep the StreamedBlock alone, so that their code is that of a solver without the recomputed ones. More... | |
| struct | StreamedBlock |
| Block k of a streamed solve: a view of the areas of the workspace where the solver factors and solves the block, which the caller fills through the accessors when the solver asks for it; the factorization and the solve then run in place; only a save, after the areas of the stored path, is copied to store a refused block as given. The accessors are those of ArrowheadLUppSolverStatic::StreamedBlock, so that one provider serves both solvers. Entries in logical order whatever the layout and the storage. The areas hold the previous block: the caller writes every entry, zeros included, by assignment. More... | |
Public Types | |
| enum class | StreamedOutcome { solved , tangent , singular } |
| Outcome of solve_inplace_streamed_or_tangent. More... | |
| enum class | RecomputedOutcome { solved , tangent , singular , deferred } |
| Outcome of solve_inplace_recomputed and solve_inplace_recomputed_or_tangent. More... | |
| using | storage_map = ArrowheadStorageMap<Config.storage, Config.coupling, Config.layout> |
| Index of every entry of the matrix in its storage. | |
Static Public Member Functions | |
| static TDLS_HOST_DEVICE constexpr bool | valid (const ArrowheadShape &shape, const int nrhs=1) noexcept |
| Whether the solver accepts a shape, with nrhs right-hand sides (unit columns, tangent columns): storage_map::valid(shape), nrhs in [1, 2^30], and the workspaces of the entry points below 2^31 entries, their offsets being ints. The entry points return false on a shape they reject, before any access, and the sizes are 0 for it. The checks cannot overflow, whatever the shape. | |
| static TDLS_HOST_DEVICE constexpr int | workspace_size (const ArrowheadShape &shape) noexcept |
| Entries of the workspace of solve_inplace and solve. | |
| static TDLS_HOST_DEVICE constexpr int | workspace_size (const ArrowheadShape &shape, const int nrhs) noexcept |
| Entries of the workspace of the entry points with nrhs right-hand sides: the temporaries of the right-hand sides and one column of the front per right-hand side. | |
| static TDLS_HOST_DEVICE constexpr int | streamed_workspace_size (const ArrowheadShape &shape) noexcept |
| Entries of the workspace of solve_inplace_streamed: those of solve_inplace, then A_bk of a block under the dense coupling and the copies that restore a refused block. | |
| static TDLS_HOST_DEVICE constexpr int | streamed_workspace_size (const ArrowheadShape &shape, const int nrhs) noexcept |
| Entries of the workspace of solve_border_canonical_multirhs_streamed with nrhs unit columns, and of solve_inplace_streamed_or_tangent with nrhs tangent columns. | |
| static TDLS_HOST_DEVICE constexpr int | pivot_size (const ArrowheadShape &shape) noexcept |
| Entries of the pivot array: the pivots of a block, then of the border system, reuse it. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_inplace (const ArrowheadShape &shape, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, int &refused_count) noexcept |
| Solves A x = y in place, counting the refused blocks. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_inplace (const ArrowheadShape &shape, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride) noexcept |
| Solves A x = y in place. | |
| static TDLS_HOST_DEVICE constexpr bool | solve (const ArrowheadShape &shape, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const T *TDLS_RESTRICT b, T *TDLS_RESTRICT x, const int rhs_stride, int &refused_count) noexcept |
| Solves A x = b, b left untouched, counting the refused blocks: b is copied into x, then solved in place. | |
| static TDLS_HOST_DEVICE constexpr bool | solve (const ArrowheadShape &shape, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const T *TDLS_RESTRICT b, T *TDLS_RESTRICT x, const int rhs_stride) noexcept |
| Solves A x = b, b left untouched. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_inplace_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| Solves A X = Y in place for nrhs right-hand sides, counting the refused blocks. The right-hand sides ride along the condensation, which runs once. Column m comes out bitwise identical to solve_inplace on it alone under the default rhs_pass_width, within rounding errors under another (see ArrowheadLUppConfig::rhs_pass_width), and bitwise identical to the compile-time solver (the same contraction of multiply-adds assumed, see the file documentation). | |
| static TDLS_HOST_DEVICE constexpr bool | solve_inplace_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, const std::size_t xcol_stride) noexcept |
| Solves A X = Y in place for nrhs right-hand sides. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const T *TDLS_RESTRICT b, T *TDLS_RESTRICT x, const int rhs_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| Solves A X = B for nrhs right-hand sides, B left untouched, counting the refused blocks: B is copied into X, then solved in place. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const T *TDLS_RESTRICT b, T *TDLS_RESTRICT x, const int rhs_stride, const std::size_t xcol_stride) noexcept |
| Solves A X = B for nrhs right-hand sides, B left untouched. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_border_canonical_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const int col0, T *TDLS_RESTRICT x, const int rhs_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| Columns col0 .. col0 + nrhs - 1 of the border block of A^-1 (col0 + nrhs <= border), counting the refused blocks; see ArrowheadLUppSolverStatic::solve_border_canonical_multirhs. | |
| static TDLS_HOST_DEVICE constexpr bool | solve_border_canonical_multirhs (const ArrowheadShape &shape, const int nrhs, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const int col0, T *TDLS_RESTRICT x, const int rhs_stride, const std::size_t xcol_stride) noexcept |
| Columns col0 .. col0 + nrhs - 1 of the border block of A^-1 (col0 + nrhs <= border). | |
| template<typename Provider > | |
| static TDLS_HOST_DEVICE constexpr bool | solve_inplace_streamed (const ArrowheadShape &shape, Provider &&provider, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, int &refused_count) noexcept |
| Solves A x = y in place, the blocks streamed: provider(k, blk) fills block k (StreamedBlock) when the solver needs it, k = 0, 1, ... in order, exactly once, and the solver condenses it at once. The caller writes beforehand only the border: A_bb in A and the border rows of y. An accepted block leaves its recovery data in its storage; a refused one is stored as given for the second pass. Bit for bit the results of solve_inplace, and of ArrowheadLUppSolverStatic::solve_inplace_streamed (the same contraction of multiply-adds assumed, see the file documentation). | |
| template<typename Provider > | |
| static TDLS_HOST_DEVICE constexpr bool | solve_border_canonical_multirhs_streamed (const ArrowheadShape &shape, const int nrhs, Provider &&provider, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, const int col0, T *TDLS_RESTRICT x, const int rhs_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| solve_border_canonical_multirhs with the blocks streamed (see solve_inplace_streamed; blk.y is not read). | |
| template<typename Provider , typename Converged > | |
| static TDLS_HOST_DEVICE constexpr StreamedOutcome | solve_inplace_streamed_or_tangent (const ArrowheadShape &shape, const int ntan, Provider &&provider, Converged &&converged, T *TDLS_RESTRICT A, const int A_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, const int col0, T *TDLS_RESTRICT x, const int x_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| One streamed pass of a Newton iteration: the blocks condensed as solve_inplace_streamed does, then converged() is called (the provider may compute the residual meanwhile). When it returns false, the pass ends as solve_inplace_streamed (y holds the correction). When it returns true, the correction is not computed: the border system condensed by the pass gives instead columns col0 .. col0 + ntan - 1 of the border block of A^-1 in x (the consistent tangent of a behaviour loaded through the border), refused blocks included. The provider is called exactly once per block, in order, and converged() once, after the last block. Bit for bit the results of solve_inplace_streamed and of ArrowheadLUppSolverStatic::solve_inplace_streamed_or_tangent, and those of solve_border_canonical_multirhs_streamed under the default rhs_pass_width (within rounding errors under another, see ArrowheadLUppConfig::rhs_pass_width), the same contraction of multiply-adds assumed (see the file documentation). | |
| static TDLS_HOST_DEVICE constexpr bool | valid_recomputed (const ArrowheadShape &shape, const int capacity, const int nrhs=1) noexcept |
| Whether the recomputed entry points accept a shape, a capacity and nrhs tangent columns: valid(shape, nrhs), capacity in [0, blocks], their workspace below 2^31 entries, and every block index exact in T (2^24 blocks at most in float), the store keeping the index of the block of each of its places in the workspace. | |
| static TDLS_HOST_DEVICE constexpr int | recomputed_workspace_size (const ArrowheadShape &shape, const int capacity, const int nrhs=1) noexcept |
| Entries of the workspace of solve_inplace_recomputed with a store of capacity refused blocks, and of solve_inplace_recomputed_or_tangent with nrhs tangent columns: the areas of a streamed block and of its condensation, the front of the second pass, and the refused blocks in the storage of a matrix of capacity blocks with their right-hand sides. It does not grow with the number of blocks of the matrix. | |
| template<typename Provider > | |
| static TDLS_HOST_DEVICE constexpr RecomputedOutcome | solve_inplace_recomputed (const ArrowheadShape &shape, const int capacity, Provider &&provider, const T *TDLS_RESTRICT Abb, const int Abb_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, int &refused_count) noexcept |
| Solves A x = y in place, the blocks recomputed: the runtime counterpart of ArrowheadLUppSolverStatic::solve_inplace_recomputed, bit for bit (the same contraction of multiply-adds assumed). provider(k, blk) fills block k once while the solver condenses it, k = 0, 1, ... in order, and once more, blk.recovery set, while it recovers the unknowns of the block, in decreasing k. Nothing of an accepted block is stored, and the matrix is never stored: the caller gives the border block A_bb, entry (r, c) at (r * border + c) * Abb_stride, or (c * border + r) * Abb_stride under the column-major layout, and the border rows of y. The workspace holds the refused blocks, at most capacity of them; beyond, the solve stops, deferred. Nothing is written to y until the solution: y is untouched when the solve is deferred or the matrix singular. | |
| template<typename Provider , typename Converged > | |
| static TDLS_HOST_DEVICE constexpr RecomputedOutcome | solve_inplace_recomputed_or_tangent (const ArrowheadShape &shape, const int ntan, const int capacity, Provider &&provider, Converged &&converged, const T *TDLS_RESTRICT Abb, const int Abb_stride, int *TDLS_RESTRICT piv, const int piv_stride, T *TDLS_RESTRICT work, const int work_stride, T *TDLS_RESTRICT y, const int rhs_stride, const int col0, T *TDLS_RESTRICT x, const int x_stride, const std::size_t xcol_stride, int &refused_count) noexcept |
| One recomputed pass of a Newton iteration: the runtime counterpart of ArrowheadLUppSolverStatic::solve_inplace_recomputed_or_tangent, bit for bit (the same contraction of multiply-adds assumed). The blocks are condensed as solve_inplace_recomputed condenses them, then converged() is called: false, the pass ends as solve_inplace_recomputed; true, x receives columns col0 .. col0 + ntan - 1 of the border block of A^-1, refused blocks included, y is untouched, and the provider is called once per block. When more than capacity blocks are refused, the pass stops there, deferred, before converged() is called. | |
Arrowhead solver with a runtime shape.
| T | scalar type (float, double or long double) |
| Config | configuration (see ArrowheadLUppConfig) |
|
strong |
Outcome of solve_inplace_recomputed and solve_inplace_recomputed_or_tangent.
|
strong |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the pivot array: the pivots of a block, then of the border system, reuse it.
| [in] | shape | shape of the matrix |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the workspace of solve_inplace_recomputed with a store of capacity refused blocks, and of solve_inplace_recomputed_or_tangent with nrhs tangent columns: the areas of a streamed block and of its condensation, the front of the second pass, and the refused blocks in the storage of a matrix of capacity blocks with their right-hand sides. It does not grow with the number of blocks of the matrix.
| [in] | shape | shape of the matrix |
| [in] | capacity | number of refused blocks the workspace holds |
| [in] | nrhs | number of tangent columns, 1 without tangent |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = b, b left untouched.
| [in] | shape | shape of the matrix (valid) |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape) entries |
| [in] | work_stride | element stride of work |
| [in] | b | right-hand side |
| [out] | x | solution |
| [in] | rhs_stride | element stride of b and x |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = b, b left untouched, counting the refused blocks: b is copied into x, then solved in place.
| [in] | shape | shape of the matrix (valid) |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape) entries |
| [in] | work_stride | element stride of work |
| [in] | b | right-hand side |
| [out] | x | solution |
| [in] | rhs_stride | element stride of b and x |
| [out] | refused_count | number of blocks refused by the pivot check |
|
inlinestaticnodiscardconstexprnoexcept |
Columns col0 .. col0 + nrhs - 1 of the border block of A^-1 (col0 + nrhs <= border).
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of unit columns, in [1, border] |
| [in,out] | A | matrix in its storage; unchanged on exit, but under schur_in_place |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in] | col0 | first unit column, col0 + nrhs <= border |
| [out] | x | the border rows, border entries per column |
| [in] | rhs_stride | element stride of x |
| [in] | xcol_stride | element stride between columns of x |
|
inlinestaticnodiscardconstexprnoexcept |
Columns col0 .. col0 + nrhs - 1 of the border block of A^-1 (col0 + nrhs <= border), counting the refused blocks; see ArrowheadLUppSolverStatic::solve_border_canonical_multirhs.
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of unit columns, in [1, border] |
| [in,out] | A | matrix in its storage; unchanged on exit, but under schur_in_place |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in] | col0 | first unit column, col0 + nrhs <= border |
| [out] | x | the border rows, border entries per column |
| [in] | rhs_stride | element stride of x |
| [in] | xcol_stride | element stride between columns of x |
| [out] | refused_count | number of blocks refused by the pivot check |
|
inlinestaticnodiscardconstexprnoexcept |
solve_border_canonical_multirhs with the blocks streamed (see solve_inplace_streamed; blk.y is not read).
| Provider | callable (int k, StreamedBlock& blk) |
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of unit columns, in [1, border] |
| [in] | provider | the source of the blocks |
| [in,out] | A | storage: A_bb on entry; on exit the refused blocks as given, the accepted ones not written |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of streamed_workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in] | col0 | first unit column, col0 + nrhs <= border |
| [out] | x | the border rows, border entries per column |
| [in] | rhs_stride | element stride of x |
| [in] | xcol_stride | element stride between columns of x |
| [out] | refused_count | number of refused blocks |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = y in place.
| [in] | shape | shape of the matrix (valid) |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | right-hand side on entry, solution on exit |
| [in] | rhs_stride | element stride of y |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = y in place, counting the refused blocks.
| [in] | shape | shape of the matrix (valid) |
| [in,out] | A | matrix in its storage (pattern entries only); recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | right-hand side on entry, solution on exit |
| [in] | rhs_stride | element stride of y |
| [out] | refused_count | number of blocks refused by the pivot check, eliminated by the second pass |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A X = Y in place for nrhs right-hand sides.
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of right-hand sides, >= 1 |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | nrhs right-hand-side columns on entry, the solutions on exit |
| [in] | rhs_stride | element stride of y |
| [in] | xcol_stride | element stride between columns of y |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A X = Y in place for nrhs right-hand sides, counting the refused blocks. The right-hand sides ride along the condensation, which runs once. Column m comes out bitwise identical to solve_inplace on it alone under the default rhs_pass_width, within rounding errors under another (see ArrowheadLUppConfig::rhs_pass_width), and bitwise identical to the compile-time solver (the same contraction of multiply-adds assumed, see the file documentation).
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of right-hand sides, >= 1 |
| [in,out] | A | matrix in its storage (pattern entries only); recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | nrhs right-hand-side columns on entry, the solutions on exit |
| [in] | rhs_stride | element stride of y |
| [in] | xcol_stride | element stride between columns of y |
| [out] | refused_count | number of blocks refused by the pivot check, eliminated by the second pass |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = y in place, the blocks recomputed: the runtime counterpart of ArrowheadLUppSolverStatic::solve_inplace_recomputed, bit for bit (the same contraction of multiply-adds assumed). provider(k, blk) fills block k once while the solver condenses it, k = 0, 1, ... in order, and once more, blk.recovery set, while it recovers the unknowns of the block, in decreasing k. Nothing of an accepted block is stored, and the matrix is never stored: the caller gives the border block A_bb, entry (r, c) at (r * border + c) * Abb_stride, or (c * border + r) * Abb_stride under the column-major layout, and the border rows of y. The workspace holds the refused blocks, at most capacity of them; beyond, the solve stops, deferred. Nothing is written to y until the solution: y is untouched when the solve is deferred or the matrix singular.
| Provider | callable (int k, StreamedBlock& blk) |
| [in] | shape | shape of the matrix |
| [in] | capacity | number of refused blocks the workspace holds, in [0, blocks] |
| [in] | provider | the source of the blocks |
| [in] | Abb | the border block A_bb, B x B in the layout of the configuration |
| [in] | Abb_stride | element stride of Abb |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of recomputed_workspace_size(shape, capacity) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | border rows of the right-hand side on entry, the solution on exit when solved |
| [in] | rhs_stride | element stride of y |
| [out] | refused_count | number of refused blocks |
|
inlinestaticnodiscardconstexprnoexcept |
One recomputed pass of a Newton iteration: the runtime counterpart of ArrowheadLUppSolverStatic::solve_inplace_recomputed_or_tangent, bit for bit (the same contraction of multiply-adds assumed). The blocks are condensed as solve_inplace_recomputed condenses them, then converged() is called: false, the pass ends as solve_inplace_recomputed; true, x receives columns col0 .. col0 + ntan - 1 of the border block of A^-1, refused blocks included, y is untouched, and the provider is called once per block. When more than capacity blocks are refused, the pass stops there, deferred, before converged() is called.
| Provider | callable (int k, StreamedBlock& blk) |
| Converged | callable () returning bool |
| [in] | shape | shape of the matrix |
| [in] | ntan | number of tangent columns, in [1, border] |
| [in] | capacity | number of refused blocks the workspace holds, in [0, blocks] |
| [in] | provider | the source of the blocks |
| [in] | converged | called after the last block: whether the tangent replaces the correction |
| [in] | Abb | the border block A_bb, B x B in the layout of the configuration |
| [in] | Abb_stride | element stride of Abb |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of recomputed_workspace_size(shape, capacity, ntan) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | border rows of the right-hand side on entry, the correction on exit when solved |
| [in] | rhs_stride | element stride of y |
| [in] | col0 | first tangent column, col0 + ntan <= border |
| [out] | x | the tangent columns (tangent), border entries per column |
| [in] | x_stride | element stride of x |
| [in] | xcol_stride | element stride between columns of x |
| [out] | refused_count | number of refused blocks |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A x = y in place, the blocks streamed: provider(k, blk) fills block k (StreamedBlock) when the solver needs it, k = 0, 1, ... in order, exactly once, and the solver condenses it at once. The caller writes beforehand only the border: A_bb in A and the border rows of y. An accepted block leaves its recovery data in its storage; a refused one is stored as given for the second pass. Bit for bit the results of solve_inplace, and of ArrowheadLUppSolverStatic::solve_inplace_streamed (the same contraction of multiply-adds assumed, see the file documentation).
| Provider | callable (int k, StreamedBlock& blk) |
| [in] | shape | shape of the matrix (valid) |
| [in] | provider | the source of the blocks |
| [in,out] | A | storage: A_bb on entry; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of streamed_workspace_size(shape) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | border rows of the right-hand side on entry, the solution on exit |
| [in] | rhs_stride | element stride of y |
| [out] | refused_count | number of refused blocks |
|
inlinestaticnodiscardconstexprnoexcept |
One streamed pass of a Newton iteration: the blocks condensed as solve_inplace_streamed does, then converged() is called (the provider may compute the residual meanwhile). When it returns false, the pass ends as solve_inplace_streamed (y holds the correction). When it returns true, the correction is not computed: the border system condensed by the pass gives instead columns col0 .. col0 + ntan - 1 of the border block of A^-1 in x (the consistent tangent of a behaviour loaded through the border), refused blocks included. The provider is called exactly once per block, in order, and converged() once, after the last block. Bit for bit the results of solve_inplace_streamed and of ArrowheadLUppSolverStatic::solve_inplace_streamed_or_tangent, and those of solve_border_canonical_multirhs_streamed under the default rhs_pass_width (within rounding errors under another, see ArrowheadLUppConfig::rhs_pass_width), the same contraction of multiply-adds assumed (see the file documentation).
| Provider | callable (int k, StreamedBlock& blk) |
| Converged | callable () returning bool |
| [in] | shape | shape of the matrix (valid) |
| [in] | ntan | number of tangent columns, in [1, border] |
| [in] | provider | the source of the blocks |
| [in] | converged | called after the last block: whether the tangent replaces the correction |
| [in,out] | A | storage: A_bb on entry; overwritten |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of streamed_workspace_size(shape, ntan) entries |
| [in] | work_stride | element stride of work |
| [in,out] | y | border rows of the right-hand side on entry, the correction on exit (solved), intermediate values otherwise |
| [in] | rhs_stride | element stride of y |
| [in] | col0 | first tangent column, col0 + ntan <= border |
| [out] | x | the tangent columns (tangent), border entries per column |
| [in] | x_stride | element stride of x |
| [in] | xcol_stride | element stride between columns of x |
| [out] | refused_count | number of refused blocks |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A X = B for nrhs right-hand sides, B left untouched.
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of right-hand sides, >= 1 |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in] | b | nrhs right-hand-side columns |
| [out] | x | the nrhs solutions |
| [in] | rhs_stride | element stride of b and x |
| [in] | xcol_stride | element stride between columns of b and x |
|
inlinestaticnodiscardconstexprnoexcept |
Solves A X = B for nrhs right-hand sides, B left untouched, counting the refused blocks: B is copied into X, then solved in place.
| [in] | shape | shape of the matrix (valid) |
| [in] | nrhs | number of right-hand sides, >= 1 |
| [in,out] | A | matrix in its storage; recovery data on exit |
| [in] | A_stride | element stride of A |
| [out] | piv | pivot array of pivot_size(shape) ints |
| [in] | piv_stride | element stride of piv |
| [out] | work | workspace of workspace_size(shape, nrhs) entries |
| [in] | work_stride | element stride of work |
| [in] | b | nrhs right-hand-side columns |
| [out] | x | the nrhs solutions |
| [in] | rhs_stride | element stride of b and x |
| [in] | xcol_stride | element stride between columns of b and x |
| [out] | refused_count | number of blocks refused by the pivot check |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the workspace of solve_inplace_streamed: those of solve_inplace, then A_bk of a block under the dense coupling and the copies that restore a refused block.
| [in] | shape | shape of the matrix |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the workspace of solve_border_canonical_multirhs_streamed with nrhs unit columns, and of solve_inplace_streamed_or_tangent with nrhs tangent columns.
| [in] | shape | shape of the matrix |
| [in] | nrhs | number of columns |
|
inlinestaticnodiscardconstexprnoexcept |
Whether the solver accepts a shape, with nrhs right-hand sides (unit columns, tangent columns): storage_map::valid(shape), nrhs in [1, 2^30], and the workspaces of the entry points below 2^31 entries, their offsets being ints. The entry points return false on a shape they reject, before any access, and the sizes are 0 for it. The checks cannot overflow, whatever the shape.
| [in] | shape | shape of the matrix |
| [in] | nrhs | number of right-hand sides |
|
inlinestaticnodiscardconstexprnoexcept |
Whether the recomputed entry points accept a shape, a capacity and nrhs tangent columns: valid(shape, nrhs), capacity in [0, blocks], their workspace below 2^31 entries, and every block index exact in T (2^24 blocks at most in float), the store keeping the index of the block of each of its places in the workspace.
| [in] | shape | shape of the matrix |
| [in] | capacity | number of refused blocks the workspace holds |
| [in] | nrhs | number of tangent columns, 1 without tangent |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the workspace of solve_inplace and solve.
| [in] | shape | shape of the matrix |
|
inlinestaticnodiscardconstexprnoexcept |
Entries of the workspace of the entry points with nrhs right-hand sides: the temporaries of the right-hand sides and one column of the front per right-hand side.
| [in] | shape | shape of the matrix |
| [in] | nrhs | number of right-hand sides |