nx_linalg.nx
buildroot/runtime/nx_linalg.nx
about
nx_linalg.nx -- vector + matrix engine.
Native NishiLang linear algebra over integer (Q-format) and real
elements. Vectors and matrices stored as flat arrays for tight
memory + cache behaviour. Engine-style: dimensions are runtime
parameters, not types -- one set of functions handles any size.
dependencies 2 imports · 6 importers
imports: nx_kernel_v2.nxnx_fixq30_lib.nx
imported by: nx_capabilities_test.nxnx_identity_space_lib.nxnx_linalg_affine_domain_candidate_t342.nxnx_linalg_affine_factor_candidate_t361.nxnx_linalg_affine_t34.nxnx_linalg_chol_gate.nx
structs
| 20 | struct Vec |
| 80 | struct Mat |
consts
| 24 | const NX_VEC_BYTES: nx_int = 16 |
| 85 | const NX_MAT_BYTES: nx_int = 24 |
| 186 | const LA_CHOL_OK: nx_int = 0 |
| 187 | const LA_CHOL_NOT_SQUARE: nx_int = 1 |
| 188 | const LA_CHOL_NOT_SYMMETRIC: nx_int = 2 |
| 189 | const LA_CHOL_NOT_PD: nx_int = 3 |
| 190 | const LA_CHOL_BAD_DIM: nx_int = 4 |
| 191 | const LA_CHOL_N: nx_int = 5 |
| 193 | const LA_CHOL_MAX_N: nx_int = 32 // the largest dimension whose residual band has been measured here |
| 200 | const LA_CHOL_BAND_Q30: nx_int = 64 // ratchet: worst |A - L L^T| entry the gate permits, in Q30 units |
functions
| 26 | func nx_vec_new(n: nx_int) -> *Vec |
| 33 | func nx_vec_set(v: *Vec, i: nx_int, x: nx_int) -> nx_int |
| 39 | func nx_vec_get(v: *Vec, i: nx_int) -> nx_int |
| 44 | func nx_vec_add(a: *Vec, b: *Vec) -> *Vec |
| 55 | func nx_vec_scale(a: *Vec, k: nx_int) -> *Vec |
| 65 | func nx_vec_dot(a: *Vec, b: *Vec) -> nx_int |
| 75 | func nx_vec_norm_sq(a: *Vec) -> nx_int calls 1: nx_vec_dot |
| 87 | func nx_mat_new(rows: nx_int, cols: nx_int) -> *Mat |
| 94 | func nx_mat_set(m: *Mat, r: nx_int, c: nx_int, x: nx_int) -> nx_int |
| 100 | func nx_mat_get(m: *Mat, r: nx_int, c: nx_int) -> nx_int |
| 106 | func nx_mat_mul(a: *Mat, b: *Mat) -> *Mat |
| 127 | func nx_mat_det2(m: *Mat) -> nx_int |
| 132 | func nx_mat_det3(m: *Mat) -> nx_int calls 1: nx_mat_get |
| 143 | func nx_mat_transpose(m: *Mat) -> *Mat |
| 202 | func la_chol_status_name(s: nx_int) -> *u8 |
| 214 | func la_is_symmetric(a: *Mat) -> nx_int |
| 231 | func la_cholesky_q30(a: *Mat, l: *Mat) -> nx_int |
| 287 | func la_chol_max_resid_q30(a: *Mat, l: *Mat) -> nx_int |