1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Storage-agnostic vector and matrix access contracts.
//!
//! These traits describe **dimensions and fallible element access only**. They
//! do not define heavy linear-algebra kernels (matrix multiplication,
//! factorization, sparse assembly, BLAS-style routines) and commit to no memory
//! layout: a conforming backend may be row-major, column-major, strided, block,
//! or sparse, and a caller must not infer layout from trait conformance. The
//! module is named `access`, not `linalg`, to make that boundary explicit.
//!
//! Reference implementations live here as borrowed views over caller memory:
//! [`VectorView`] / [`VectorViewMut`] and a simple contiguous row-major
//! [`MatrixView`] / [`MatrixViewMut`]. Advanced views — column-major, strided,
//! and sub-matrix — are not part of this core baseline; they belong to
//! `loeres-backend-static` (RFC 004) and `loeres-backend-std`. An optional
//! contiguous fast path ([`ContiguousVectorAccess`], [`ContiguousMatrixAccess`],
//! and the mutable vector variant) lets a kernel drop into a tight branch-free
//! loop when a backend exposes contiguous storage, and fall back to fallible
//! per-element access when it does not.
//!
//! Defined by RFC 002 (Storage-Agnostic Matrix and Vector Access Contracts).
pub use ;
pub use ;
use crateSolverError;
/// Convert a `usize` extent or index into the `u32` payload that RFC 003 error
/// variants carry, **without silent truncation** (RFC 002 §5.1, patch B4).
///
/// A value that does not fit in `u32` maps to [`SolverError::InvalidDimension`]
/// rather than wrapping to a misleading payload. This path is reachable only
/// from caller-supplied indices or dimensions; library-internal overflow uses
/// [`SolverError::InternalInvariantViolation`] at its own call site.
pub