mir.sparse

Modules

blas
module mir.sparse.blas

Public Imports

mir.ndslice.field
public import mir.ndslice.field : SparseField;
mir.ndslice.iterator
public import mir.ndslice.iterator : ChopIterator, FieldIterator;
mir.series
public import mir.series : isSeries, Series, mir_series, series;
mir.ndslice.slice
public import mir.ndslice.slice : CoordinateValue, Slice, mir_slice;
mir.ndslice.topology
public import mir.ndslice.topology : chopped;

Members

Aliases

CompressedMatrix
alias CompressedMatrix(T, I = uint) = Slice!(ChopIterator!(J*, Series!(T*, I*)))
CompressedTensor
alias CompressedTensor(T, size_t N, I = uint, J = size_t) = Slice!(ChopIterator!(J*, Series!(T*, I*)), N - 1)
alias CompressedTensor(T, size_t N : 1, I = uint) = Series!(I*, T*)
CompressedVector
alias CompressedVector(T, I = uint) = Series!(T*, I*)
Sparse
alias Sparse(T, size_t N = 1) = Slice!(FieldIterator!(SparseField!T), N)

Sparse Slice in Dictionary of Keys (DOK) format.

Functions

byCoordinate
auto byCoordinate(Slice!(FieldIterator!(SparseField!T), N) slice)

Returns unsorted forward range of coordinates.

byCoordinateValue
auto byCoordinateValue(Slice!(FieldIterator!(SparseField!T), N) slice)

Returns unsorted forward range of (coordinate, value) pairs.

compress
auto compress(Slice!(Iterator, N, kind) slice)

Returns compressed tensor. Note: allocates using GC.

compressWithType
Slice!(ChopIterator!(J*, Series!(I*, V*)), N - 1) compressWithType(Slice!(FieldIterator!(SparseField!T), N) slice)
Slice!(ChopIterator!(J*, Series!(I*, V*)), N - 1) compressWithType(Slice!(Iterator, N, kind) slice)

Returns compressed tensor with different element type. Note: allocates using GC.

onlyByValue
auto onlyByValue(Slice!(FieldIterator!(SparseField!T), N) slice)

Returns unsorted forward range of values.

recompress
Slice!(ChopIterator!(J*, Series!(I*, V*)), N) recompress(Slice!(Iterator, N, kind) sparseSlice)

Re-compresses a compressed tensor. Makes all values, indeces and pointers consequent in memory.

sparse
Sparse!(T, N) sparse(size_t[N] lengths...)

Sparse tensors represented in Dictionary of Keys (DOK) format.

Meta

Authors

Ilya Yaroshenko