Page
Library
Module
Module type
Parameter
Class
Class type
Source
Spurs.CsvecSourceA sparse vector, storing the indices of its non-zero data.
It contains a sorted indices array and a corresponding data array.
val pp :
'a. (Ppx_deriving_runtime.Format.formatter ->
'a ->
Ppx_deriving_runtime.unit) ->
Ppx_deriving_runtime.Format.formatter ->
'a t ->
Ppx_deriving_runtime.unitval show :
'a. (Ppx_deriving_runtime.Format.formatter ->
'a ->
Ppx_deriving_runtime.unit) ->
'a t ->
Ppx_deriving_runtime.stringval equal :
'a. ('a -> 'a -> Ppx_deriving_runtime.bool) ->
'a t ->
'a t ->
Ppx_deriving_runtime.boolCreate a sparse vector.
Returns an error:
indices and data lengths differnSame as try_new_csvec, but raises an error if invalid
Creates a CsVec, sorting indices and data if necessary.
Returns an error if the lengths mismatch.
Try to index a vector at a specific index. Returns Some nnz if index exists.
Access element at given NNZ index, with constant complexity.
Set element at given NNZ index, with constant complexity.
Set element at given index, with logarithmic complexity. Returns None if the index does not exist already as a non-zero..
fold f acc v calls f acc index data, through each index-data pair in v
iter f v calls f index data on each index-data pair in v
Append an element to the sparse vector. The append should preserve the structure.
Raises an exception if:
ind is lower or equal to the last element of v.indicesind is greater than v.dimCheck the sparse structure, namely that:
indices are sortedindices are less than dimConvert this vector into a dense array.
The rest of the vector is filled with zeroes.