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 1 imports · 1 importers
imports: nx_kernel_v2.nx
imported by: nx_capabilities_test.nx
structs
| 19 | struct Vec |
| 79 | struct Mat |
consts
| 23 | const NX_VEC_BYTES: nx_int = 16 |
| 84 | const NX_MAT_BYTES: nx_int = 24 |
functions
| 25 | func nx_vec_new(n: nx_int) -> *Vec |
| 32 | func nx_vec_set(v: *Vec, i: nx_int, x: nx_int) -> nx_int |
| 38 | func nx_vec_get(v: *Vec, i: nx_int) -> nx_int |
| 43 | func nx_vec_add(a: *Vec, b: *Vec) -> *Vec |
| 54 | func nx_vec_scale(a: *Vec, k: nx_int) -> *Vec |
| 64 | func nx_vec_dot(a: *Vec, b: *Vec) -> nx_int |
| 74 | func nx_vec_norm_sq(a: *Vec) -> nx_int calls 1: nx_vec_dot |
| 86 | func nx_mat_new(rows: nx_int, cols: nx_int) -> *Mat |
| 93 | func nx_mat_set(m: *Mat, r: nx_int, c: nx_int, x: nx_int) -> nx_int |
| 99 | func nx_mat_get(m: *Mat, r: nx_int, c: nx_int) -> nx_int |
| 105 | func nx_mat_mul(a: *Mat, b: *Mat) -> *Mat |
| 126 | func nx_mat_det2(m: *Mat) -> nx_int |
| 131 | func nx_mat_det3(m: *Mat) -> nx_int calls 1: nx_mat_get |
| 142 | func nx_mat_transpose(m: *Mat) -> *Mat |