code wiki / (root) / nx_linalg.nx

nx_linalg.nx

buildroot/runtime/nx_linalg.nx

4530 B154 linesdepth 6pulls 6 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_kernel_v2.nx nx_linalg.nx nx_capabilities_test.nx

imports: nx_kernel_v2.nx

imported by: nx_capabilities_test.nx

structs

19struct Vec
79struct Mat

consts

23const NX_VEC_BYTES: nx_int = 16
84const NX_MAT_BYTES: nx_int = 24

functions

25func nx_vec_new(n: nx_int) -> *Vec
32func nx_vec_set(v: *Vec, i: nx_int, x: nx_int) -> nx_int
38func nx_vec_get(v: *Vec, i: nx_int) -> nx_int
43func nx_vec_add(a: *Vec, b: *Vec) -> *Vec
54func nx_vec_scale(a: *Vec, k: nx_int) -> *Vec
64func nx_vec_dot(a: *Vec, b: *Vec) -> nx_int
74func nx_vec_norm_sq(a: *Vec) -> nx_int
calls 1: nx_vec_dot
86func nx_mat_new(rows: nx_int, cols: nx_int) -> *Mat
93func nx_mat_set(m: *Mat, r: nx_int, c: nx_int, x: nx_int) -> nx_int
99func nx_mat_get(m: *Mat, r: nx_int, c: nx_int) -> nx_int
105func nx_mat_mul(a: *Mat, b: *Mat) -> *Mat
126func nx_mat_det2(m: *Mat) -> nx_int
called by 1: t8_matmul calls 1: nx_mat_get
131func nx_mat_det3(m: *Mat) -> nx_int
calls 1: nx_mat_get
142func nx_mat_transpose(m: *Mat) -> *Mat