Non-owning view of a batch of matrices: the argument type of every entry point.
Same layout as Matrix (column-major dense with ld and stride, or strided CSR) over memory it does not own. Copying a view is cheap and aliases the data; the viewed memory must outlive every use, including kernels still in flight. The memory must be USM that the Queue's device can access; entry points check the pointers at the call. A view may be built over raw pointers, a Matrix (every Matrix is a MatrixView), a sub-block (operator()(Slice, Slice)), a single item (batch_item()) or a VectorView.
Members taking a const Queue& enqueue a kernel and return its Event without waiting. The queue-less overloads run on a new Queue() on Device::default_device().
| T | scalar type |
| MType | MatrixFormat::Dense (default) or MatrixFormat::CSR |
#include <batchlas/blas/matrix.hh>
| using batchlas::MatrixView< T, MType >::promoted_type = std::conditional_t<is_std_complex_v<T>, std::complex<double>, double> |
| batchlas::MatrixView< T, MType >::MatrixView | ( | T * | data, |
| int | rows, | ||
| int | cols, | ||
| int | ld = 0, | ||
| int | stride = 0, | ||
| int | batch_size = 1, | ||
| T ** | data_ptrs = nullptr ) |
Dense view over caller memory.
Note the argument order: the batch size is the sixth argument here and the third in Matrix(rows, cols, batch_size).
| data | base of item 0 (may be null for a shape-only view, e.g. a workspace query) |
| rows | rows per item |
| cols | columns per item |
| ld | leading dimension; 0 means rows |
| stride | batch stride; 0 means (resolved ld) * cols. Not a broadcast. |
| batch_size | number of items |
| data_ptrs | optional per-item pointer array for pointer-array backends |
| batchlas::invalid_argument | on a negative argument or a resolved ld < rows (the message names the intended spelling) |
| batchlas::MatrixView< T, MType >::MatrixView | ( | T * | data, |
| int * | row_offsets, | ||
| int * | col_indices, | ||
| int | rows, | ||
| int | cols, | ||
| NonZeros | nnz, | ||
| int | matrix_stride = 0, | ||
| int | offset_stride = 0, | ||
| int | batch_size = 1, | ||
| T ** | data_ptrs = nullptr ) |
CSR view over caller arrays; layout as in the CSR Matrix from-data constructor.
| data_ptrs | optional per-item pointer array to the values |
|
delete |
Deleted so the pre-tag order (nnz before rows, cols) is a compile error.
| batchlas::MatrixView< T, MType >::MatrixView | ( | const VectorView< T > & | vector_view, |
| VectorOrientation | orientation = VectorOrientation::Column ) |
Views a batched vector as n x 1 (Column) or 1 x n (Row) matrices; the stride carries over.
| batchlas::invalid_argument | for Column when the vector's inc != 1 |
| batchlas::MatrixView< T, MType >::MatrixView | ( | const MatrixView< T, MType > & | matrix_view, |
| int | rows = -1, | ||
| int | cols = -1, | ||
| int | ld = -1, | ||
| int | stride = -1, | ||
| int | batch_size = -1 ) |
View of matrix_view with any of its extents or strides overridden; a value <= 0 keeps the view's.
Active extents carry over only when every override is a no-op.
|
default |
An empty 0 x 0 view with batch size 0.
|
default |
|
defaultnoexcept |
|
default |
Releases nothing but the shared backend handle; the viewed memory is untouched.
|
static |
Enqueues dest := src on ctx, honouring each side's ld and stride.
| batchlas::invalid_argument | if rows, cols or batch size differ |
| batchlas::unsupported | for CSR views |
|
default |
|
defaultnoexcept |
| void batchlas::MatrixView< T, MType >::init | ( | ) | const |
Creates the backend descriptor now instead of on first use; idempotent.
| BackendMatrixHandle< T, MType > * batchlas::MatrixView< T, MType >::operator-> | ( | ) | const |
The backend descriptor, created on first use.
| BackendMatrixHandle< T, MType > & batchlas::MatrixView< T, MType >::operator* | ( | ) | const |
The backend descriptor, created on first use.
| MatrixView< T, MType > batchlas::MatrixView< T, MType >::operator[] | ( | int | i | ) | const |
batch_item(i).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Matrix< U, MType > batchlas::MatrixView< T, MType >::astype | ( | ) | const |
|
inlinestatic |
x as promoted_type.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| std::vector< int > batchlas::MatrixView< T, MType >::all_items | ( | ) | const |
Every item index, 0 .. batch_size() - 1.
| std::vector< int > batchlas::MatrixView< T, MType >::default_items | ( | ) | const |
{0, batch_size() / 2, batch_size() - 1}, sorted and de-duplicated ({} for batch 0): what a check reads by default.
| Matrix< U, MType > batchlas::MatrixView< T, MType >::astype | ( | std::span< const int > | items | ) | const |
astype() of items only, packed in that order (item g at g * rows() * cols()).
| batchlas::out_of_range | for an item outside [0, batch_size()) |
| batchlas::invalid_argument | for a heterogeneous view |
|
static |
C := op(A) op(B) per item: one work-item per element of C, the inner sum in order.
The reference product of the checks, independent of gemm's tuned kernels.
| batchlas::invalid_argument | on a shape mismatch |
|
static |
||A0 - L L^H||_F / ||A0||_F (Lower) or ||A0 - U^H U||_F / ||A0||_F (Upper) over the factor's triangle; the other triangle of F is not read.
|
static |
||P A0 - L U||_F / ||A0||_F for an m x n factor with packed 1-based pivots (min(m, n) per item); an out-of-range pivot makes that item NaN.
|
static |
||A0 - Q R||_F / ||A0||_F for F in LAPACK geqrf storage and its min(m, n) tau.
|
static |
The first cols columns of Q = H_0 ... H_{k-1} of item item of a geqrf factor (k = min(m, n)); F's diagonal and upper triangle are not read.
|
static |
form_q() of each of items (empty: default_items()), packed in that order: item g of the result is the first cols columns of Q of item items[g].
|
static |
||A0 - Q triu(R)||_F / ||A0||_F with an explicit m x k Q; the first k rows of R are read on and above the diagonal.
|
static |
||A0 - Q B Q^H||_F / ||A0||_F for square operands of equal order.
|
static |
||A0 - U diag(s) Vh||_F / ||A0||_F for an m x n A0 over the first k = min(m, n) columns of U, values of s and rows of Vh (thin or full factors).
| batchlas::invalid_argument | on a shape mismatch |
|
static |
||op(A0) X - B0||_F / (||A0||_F ||X||_F); an empty B0 (rows() == 0) is the identity.
Above full_limit multiply-adds per item, 8 seeded probe columns of X stand in for all.
|
static |
solve_residual() with op(A0) = A0.
|
static |
solve_residual() with A = P L U formed per item from getrf factors F and pivots piv; full_limit as for solve_residual().
|
static |
Componentwise max |C - (alpha op(A) op(B) + beta C0)| / (|alpha| |op(A)| |op(B)| + |beta| |C0|), over c_triangle of C when given; C0 is not read when beta == 0.
|
static |
The largest denominator of gemm_backward_error() over items (empty: A's default_items(), while gemm_backward_error() defaults to C's: pass both the same span when A's batch differs).
|
static |
gemm_backward_error() of y = alpha op(A) x + beta y0.
|
static |
||op(A) X - alpha B0||_F / (||A||_F ||X||_F + |alpha| ||B0||_F) (Side::Right: X op(A)); only the uplo triangle of A is read, its diagonal only for Diag::NonUnit.
|
static |
gemm_backward_error() with a CSR A; an out-of-range column index makes the result NaN.
|
static |
Componentwise backward error of a rank-2k update over the uplo triangle of C: her2k (hermitian, real beta, C0's diagonal read as real) or syr2k.
|
static |
||Q^H Q - I||_F over Q's columns.
|
static |
||A V - V diag(w)||_F / ||A||_F; A Hermitian, read from its lower triangle.
|
static |
max |w - ref| / scale per item; ref[item] holds w.size() values in the caller's order.
|
static |
max cabs1(L(i,k) U(k,k)) / cabs1(U(k,k)) over a getrf factor: at most 1, up to rounding, for cabs1 partial pivoting (a residual cannot see the pivot rule).
|
static |
True when every pivot of every item lies in [1, n].
|
inline |
|
inline |
|
inline |
|
inline |
Zero-based row offsets, offset_stride() per item.
|
inline |
Column indices, matrix_stride() per item.
|
inline |
Per-item non-zero capacity, not a count; see Matrix::nnz().
|
inline |
Slots allocated per item; see Matrix::nnz_capacity().
|
inline |
|
inline |
|
inline |
|
inline |
Fills the per-item pointer array from this view's base and stride on ctx and waits.
The array may be shared with the parent Matrix and its other views, so it holds whatever the last view to fill it wrote.
| batchlas::invalid_argument | if the view has no pointer array of batch_size() entries |
| T & batchlas::MatrixView< T, MType >::at | ( | int | row, |
| int | col, | ||
| int | batch = 0 ) |
Host reference to element (row, col) of item batch.
| batchlas::out_of_range | outside the item's active extents |
| const T & batchlas::MatrixView< T, MType >::at | ( | int | row, |
| int | col, | ||
| int | batch = 0 ) const |
Host const reference to element (row, col) of item batch.
| batchlas::out_of_range | outside the item's active extents |
|
inline |
|
inline |
|
inline |
View of the sub-block rows x cols of every item; keeps ld and stride, never copies.
| batchlas::invalid_argument | if either slice is empty; batchlas::out_of_range past a dimension |
|
inline |
|
inline |
Part of row row of every item as a batched VectorView (inc = ld(), stride = stride()).
| batchlas::invalid_argument | if the slice is empty; batchlas::out_of_range past a dimension |
|
inline |
Part of column col of every item as a batched VectorView (inc = 1, stride = stride()).
| batchlas::invalid_argument | if the slice is empty; batchlas::out_of_range past a dimension |
| Event batchlas::MatrixView< T, MType >::symmetrize | ( | const Queue & | ctx, |
| Uplo | uplo ) const |
|
inline |
symmetrize() on a new default queue.
| Event batchlas::MatrixView< T, MType >::hermitize | ( | const Queue & | ctx, |
| Uplo | uplo ) const |
|
inline |
hermitize() on a new default queue.
| Event batchlas::MatrixView< T, MType >::transpose | ( | const Queue & | ctx, |
| bool | conjugate = false ) const |
In-place (conjugate) transpose.
|
inline |
transpose() on a new default queue; likewise undefined.
| Event batchlas::MatrixView< T, MType >::triangularize | ( | const Queue & | ctx, |
| Uplo | uplo, | ||
| Diag | diag ) const |
Zeros the strict triangle opposite uplo, keeping the uplo triangle; with Diag::Unit also sets the diagonal to 1.
Uplo::Upper leaves an upper-triangular matrix. Honours rows() != cols().
|
inline |
triangularize() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_random | ( | const Queue & | ctx, |
| bool | hermitian = false, | ||
| unsigned int | seed = 42 ) const |
Fills with values uniform in [-1, 1], deterministic in seed; see Matrix::Random().
| batchlas::invalid_argument | if hermitian and rows() != cols() |
|
inline |
fill_random() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_random_sparse_hermitian | ( | const Queue & | ctx, |
| float | density, | ||
| unsigned int | seed = 42, | ||
| typename base_type< T >::type | diagonal_boost = typename base_type< T >::type(1), | ||
| bool | shared_pattern = true ) const |
CSR: fills this storage with a random diagonally dominant Hermitian pattern and values.
See csr_generators::random_sparse_hermitian_csr() for the construction. Blocks on ctx while building the pattern; the returned Event is the value fill.
| batchlas::invalid_argument | unless the view is square, non-empty, and its nnz() equals the count density implies |
|
inline |
fill_random_sparse_hermitian() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill | ( | const Queue & | ctx, |
| T | value ) const |
|
inline |
|
inline |
| Event batchlas::MatrixView< T, MType >::fill_identity | ( | const Queue & | ctx, |
| T | value = T(1) ) const |
Zeros every item, then sets its main diagonal to value.
| Event batchlas::MatrixView< T, MType >::fill_diagonal | ( | const Queue & | ctx, |
| const Span< T > & | diag_values, | ||
| int64_t | k = 0 ) const |
Writes diagonal k (k > 0 above the main diagonal, k < 0 below).
The diagonal has d = max(0, min(rows() - max(-k, 0), cols() - max(k, 0))) entries. diag_values holds either d values used for every item, or d * batch_size() values, one run per item. Other entries are untouched; d = 0 writes nothing.
| Event batchlas::MatrixView< T, MType >::fill_diagonal | ( | const Queue & | ctx, |
| const VectorView< T > & | diag_values, | ||
| int64_t | k = 0 ) const |
Writes diagonal k from a VectorView: per item when its batch size equals batch_size(), otherwise its item 0 for every item.
|
inline |
fill_diagonal() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_diagonal | ( | const Queue & | ctx, |
| const T & | value ) const |
Sets the main diagonal of every item to value.
|
inline |
fill_diagonal() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_triangular | ( | const Queue & | ctx, |
| Uplo | uplo, | ||
| T | diagonal_value = T(1), | ||
| T | non_diagonal_value = T(0.5) ) const |
Writes a full triangular matrix: diagonal_value on the diagonal, non_diagonal_value in the uplo strict triangle, zero elsewhere.
|
inline |
fill_triangular() on a new default queue.
|
inline |
| Event batchlas::MatrixView< T, MType >::fill_tridiag_toeplitz | ( | const Queue & | ctx, |
| T | diag = T(1), | ||
| T | sub_diag = T(-0.5), | ||
| T | super_diag = T(0.5) ) const |
|
inline |
fill_tridiag_toeplitz() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_triangular_random | ( | const Queue & | ctx, |
| Uplo | uplo, | ||
| Diag | diag = Diag::Unit, | ||
| unsigned int | seed = 42 ) const |
Writes a full random triangular matrix: uniform [-1, 1] in the uplo triangle, 1 on the diagonal for Diag::Unit, zero elsewhere.
seed and the position only).
|
inline |
fill_triangular_random() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_random_spd | ( | const Queue & | ctx, |
| unsigned int | seed = 42 ) const |
Random Hermitian (real T: symmetric) positive definite matrix, a different one per item.
The Hermitian fill_random() values with the shift n (2n for complex T, whose entries reach modulus sqrt(2)) added to the real diagonal: every row is strictly diagonally dominant with a positive diagonal. a_ij == conj(a_ji) holds bitwise. Deterministic in seed, independent of ld() and stride(); writes only the rows() x cols() entries.
| batchlas::invalid_argument | if rows() != cols() |
|
inline |
fill_random_spd() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_random_pivoted | ( | const Queue & | ctx, |
| unsigned int | seed = 42 ) const |
Row-permuted diagonally dominant random matrix, so LU partial pivoting is not the identity.
Item b is P_b D_b: D_b holds uniform [-1, 1) entries plus the fill_random_spd() shift on the diagonal, and P_b is a seeded random n-cycle (no row stays in place for n >= 2), a different one per item. Each column's dominant entry therefore sits in a distinct row. Deterministic in seed; writes only the rows() x cols() entries.
| batchlas::invalid_argument | if rows() != cols(), or if n ints exceed the device's local memory |
|
inline |
fill_random_pivoted() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_graded_hermitian | ( | const Queue & | ctx, |
| double | log10_cond, | ||
| unsigned int | seed = 42 ) const |
Hermitian Q diag(lambda) Q^H with condition number 10^log10_cond, a different Q per item.
lambda_i = 10^(-log10_cond * i / (n - 1)) for i = 0..n-1 (1 when n == 1). Q is the product of n Householder reflectors I - 2 v v^H of seeded random unit vectors (real for real T), applied in T's precision. The result is exactly Hermitian with a real diagonal. Deterministic in seed; writes only the rows() x cols() entries.
| batchlas::invalid_argument | if rows() != cols(), if log10_cond is not finite, or if 2n elements of T exceed the device's local memory |
|
inline |
fill_graded_hermitian() on a new default queue.
| Event batchlas::MatrixView< T, MType >::fill_near_degenerate_hermitian | ( | const Queue & | ctx, |
| double | noise, | ||
| unsigned int | seed = 42 ) const |
Clustered-spectrum Hermitian matrix: diagonal floor(i / 4) + (i % 4) 1e-4 plus noise times a seeded Hermitian perturbation.
Off-diagonal a_ij = noise * z_ij (i > j, z uniform [-1, 1), both parts for complex T) and a_ji = conj(a_ij) bitwise; the diagonal adds noise * Re(z_ii). Groups of four nearly equal eigenvalues exercise deflation and tie-breaking. Deterministic in seed (Philox, the same on every compiler), independent of ld() and stride(); writes only the rows() x cols() entries.
| batchlas::invalid_argument | if rows() != cols() |
| MatrixView< T, MType > batchlas::MatrixView< T, MType >::batch_item | ( | int | batch_index | ) | const |
A batch-size-1 view of item batch_index.
Dense: its active extents, the parent's ld, no pointer array. CSR: the parent's strides.
| batchlas::out_of_range | if batch_index is outside [0, batch_size()) |
|
inline |
A copy of this view with per-item active extents attached (not copied: the spans must outlive the view).
| batchlas::invalid_argument | under the same rules as Matrix::set_active_dims() |
|
static |
True when every element of a and b agrees to relative tolerance tol; waits on ctx.
Elements agree when |x - y| / max(|x|, |y|) <= tol (the denominator is 1 when the larger magnitude is below tol, and two values both below epsilon agree); complex compares the real and imaginary parts separately. Dense only.
| batchlas::invalid_argument | if the shapes or batch sizes differ |
| batchlas::unsupported | for CSR |
|
inline |
|
inline |
stream_formatted_to() without the return value; reads the data on the host.
|
inlinenoexcept |
|
protected |
| int batchlas::MatrixView< T, MType >::rows_ = 0 |
| int batchlas::MatrixView< T, MType >::cols_ = 0 |
| int batchlas::MatrixView< T, MType >::batch_size_ = 0 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
Verification | |
Accuracy checks of a computed result against its inputs (Verification library). Each reads every operand through ld() and stride(), promotes to double / complex<double>, runs on
| |
| using | promoted_type = std::conditional_t<is_std_complex_v<T>, std::complex<double>, double> |
| T's promoted type: double, or complex<double> for complex T. | |
| std::vector< int > | all_items () const |
| Every item index, 0 .. batch_size() - 1. | |
| std::vector< int > | default_items () const |
| {0, batch_size() / 2, batch_size() - 1}, sorted and de-duplicated ({} for batch 0): what a check reads by default. | |
| template<typename U> | |
| Matrix< U, MType > | astype (std::span< const int > items) const |
astype() of items only, packed in that order (item g at g * rows() * cols()). | |
| template<typename U = T> requires (std::is_floating_point_v<U> || is_std_complex_v<U>) | |
| static promoted_type | up (U x) |
x as promoted_type. | |
| template<typename U = T> requires (std::is_floating_point_v<U> || is_std_complex_v<U>) | |
| static U | make (double re, double im=0.0) |
| re + i im rounded to T; the imaginary part is dropped for a real T. | |
| template<typename U = T> requires (std::is_floating_point_v<U> || is_std_complex_v<U>) | |
| static U | conj (U x) |
The complex conjugate of x; x itself for a real T. | |
| template<typename U = T> requires (std::is_floating_point_v<U> || is_std_complex_v<U>) | |
| static double | cabs1 (U x) |
| |re| + |im|, LAPACK's partial-pivoting metric; |x| for a real T. | |
| template<typename U = T> requires (std::is_floating_point_v<U> || is_std_complex_v<U>) | |
| static bool | finite (U x) |
True when every component of x is finite. | |
| static Event | product (const Queue &ctx, const MatrixView &A, Transpose ta, const MatrixView &B, Transpose tb, const MatrixView &C) |
| C := op(A) op(B) per item: one work-item per element of C, the inner sum in order. | |
| static double | potrf_residual (Queue &ctx, const MatrixView &A0, const MatrixView &F, Uplo uplo, std::span< const int > items={}) |
||A0 - L L^H||_F / ||A0||_F (Lower) or ||A0 - U^H U||_F / ||A0||_F (Upper) over the factor's triangle; the other triangle of F is not read. | |
| static double | getrf_residual (Queue &ctx, const MatrixView &A0, const MatrixView &F, const VectorView< std::int32_t > &piv, std::span< const int > items={}) |
| ||P A0 - L U||_F / ||A0||_F for an m x n factor with packed 1-based pivots (min(m, n) per item); an out-of-range pivot makes that item NaN. | |
| static double | qr_residual (Queue &ctx, const MatrixView &A0, const MatrixView &F, const VectorView< T > &tau, std::span< const int > items={}) |
||A0 - Q R||_F / ||A0||_F for F in LAPACK geqrf storage and its min(m, n) tau. | |
| static Matrix< promoted_type, MType > | form_q (Queue &ctx, const MatrixView &F, const VectorView< T > &tau, int item, int cols) |
The first cols columns of Q = H_0 ... H_{k-1} of item item of a geqrf factor (k = min(m, n)); F's diagonal and upper triangle are not read. | |
| static Matrix< promoted_type, MType > | form_q (Queue &ctx, const MatrixView &F, const VectorView< T > &tau, std::span< const int > items, int cols) |
form_q() of each of items (empty: default_items()), packed in that order: item g of the result is the first cols columns of Q of item items[g]. | |
| static double | qr_reconstruction (Queue &ctx, const MatrixView &A0, const MatrixView &Q, const MatrixView &R, std::span< const int > items={}) |
||A0 - Q triu(R)||_F / ||A0||_F with an explicit m x k Q; the first k rows of R are read on and above the diagonal. | |
| static double | similarity_residual (Queue &ctx, const MatrixView &A0, const MatrixView &Q, const MatrixView &B, std::span< const int > items={}) |
| ||A0 - Q B Q^H||_F / ||A0||_F for square operands of equal order. | |
| static double | svd_residual (Queue &ctx, const MatrixView &A0, const MatrixView &U, const VectorView< float_t< T > > &s, const MatrixView &Vh, std::span< const int > items={}) |
||A0 - U diag(s) Vh||_F / ||A0||_F for an m x n A0 over the first k = min(m, n) columns of U, values of s and rows of Vh (thin or full factors). | |
| static double | solve_residual (Queue &ctx, const MatrixView &A0, Transpose ta, const MatrixView &X, const MatrixView &B0, std::span< const int > items={}, double full_limit=double(1<< 28)) |
||op(A0) X - B0||_F / (||A0||_F ||X||_F); an empty B0 (rows() == 0) is the identity. | |
| static double | solve_residual (Queue &ctx, const MatrixView &A0, const MatrixView &X, const MatrixView &B0, std::span< const int > items={}) |
| solve_residual() with op(A0) = A0. | |
| static double | lu_solve_residual (Queue &ctx, const MatrixView &F, const VectorView< std::int32_t > &piv, Transpose ta, const MatrixView &X, const MatrixView &B0, std::span< const int > items={}, double full_limit=double(1<< 28)) |
solve_residual() with A = P L U formed per item from getrf factors F and pivots piv; full_limit as for solve_residual(). | |
| static double | gemm_backward_error (Queue &ctx, const MatrixView &A, Transpose ta, const MatrixView &B, Transpose tb, const MatrixView &C0, const MatrixView &C, promoted_type alpha, promoted_type beta, std::span< const int > items={}, std::optional< Uplo > c_triangle=std::nullopt) |
Componentwise max |C - (alpha op(A) op(B) + beta C0)| / (|alpha| |op(A)| |op(B)| + |beta| |C0|), over c_triangle of C when given; C0 is not read when beta == 0. | |
| static double | gemm_max_denominator (Queue &ctx, const MatrixView &A, Transpose ta, const MatrixView &B, Transpose tb, const MatrixView &C0, promoted_type alpha, promoted_type beta, std::span< const int > items={}) |
The largest denominator of gemm_backward_error() over items (empty: A's default_items(), while gemm_backward_error() defaults to C's: pass both the same span when A's batch differs). | |
| static double | gemv_backward_error (Queue &ctx, const MatrixView &A, Transpose ta, const VectorView< T > &x, const VectorView< T > &y0, const VectorView< T > &y, promoted_type alpha, promoted_type beta, std::span< const int > items={}) |
| gemm_backward_error() of y = alpha op(A) x + beta y0. | |
| static double | trsm_residual (Queue &ctx, const MatrixView &A, Side side, Uplo uplo, Transpose ta, Diag diag, const MatrixView &X, const MatrixView &B0, promoted_type alpha, std::span< const int > items={}) |
||op(A) X - alpha B0||_F / (||A||_F ||X||_F + |alpha| ||B0||_F) (Side::Right: X op(A)); only the uplo triangle of A is read, its diagonal only for Diag::NonUnit. | |
| static double | spmm_backward_error (Queue &ctx, const MatrixView< T, MatrixFormat::CSR > &A, Transpose ta, const MatrixView &B, Transpose tb, const MatrixView &C0, const MatrixView &C, promoted_type alpha, promoted_type beta, std::span< const int > items={}) |
gemm_backward_error() with a CSR A; an out-of-range column index makes the result NaN. | |
| static double | rank2k_backward_error (Queue &ctx, const MatrixView &A, const MatrixView &B, Transpose trans, const MatrixView &C0, const MatrixView &C, Uplo uplo, promoted_type alpha, promoted_type beta, bool hermitian, std::span< const int > items={}) |
Componentwise backward error of a rank-2k update over the uplo triangle of C: her2k (hermitian, real beta, C0's diagonal read as real) or syr2k. | |
| static double | orthogonality (Queue &ctx, const MatrixView &Q, std::span< const int > items={}) |
| ||Q^H Q - I||_F over Q's columns. | |
| static double | eigen_residual (Queue &ctx, const MatrixView &A, const MatrixView &V, const VectorView< float_t< T > > &w, std::span< const int > items={}) |
| ||A V - V diag(w)||_F / ||A||_F; A Hermitian, read from its lower triangle. | |
| static double | values_error (const VectorView< float_t< T > > &w, const std::vector< std::vector< double > > &ref, double scale, std::span< const int > items={}) |
| max |w - ref| / scale per item; ref[item] holds w.size() values in the caller's order. | |
| static double | pivot_ratio (const MatrixView &F, std::span< const int > items={}) |
| max cabs1(L(i,k) U(k,k)) / cabs1(U(k,k)) over a getrf factor: at most 1, up to rounding, for cabs1 partial pivoting (a residual cannot see the pivot rule). | |
| static bool | pivots_valid (const VectorView< std::int32_t > &piv, int n) |
| True when every pivot of every item lies in [1, n]. | |