Sparse Matrices API Reference
The sparse module provides sparse matrix data structures.
CSRMatrix
Compressed Sparse Row matrix.
zig
pub fn CSRMatrix(comptime T: type) typeinit
Initialize a sparse matrix.
zig
pub fn init(allocator: Allocator, rows: usize, cols: usize) !Selfdeinit
Deinitialize the matrix.
zig
pub fn deinit(self: *Self, allocator: Allocator) voidfromDense
Convert a dense array to a CSR matrix.
zig
pub fn fromDense(allocator: Allocator, arr: NDArray(T)) !SelftoDense
Convert the CSR matrix to a dense array.
zig
pub fn toDense(self: Self, allocator: Allocator) !NDArray(T)