Library
Module
Module type
Parameter
Class
Class type
Complex sparse matrix: this module supports the operations on sparse matrices of complex numbers. Becuase GSL does not support complex sparse matrices, herein I provided a pure OCaml implementation.
The implementation provides both triplet and compressed row storage (CRS) format. Note that only triplet format allows adding and updating elements. Most operations are the same to Sparse.Real module, therefore please refer to the documentation of Sparse.Real module.
val zeros : int -> int -> spmat
val ones : int -> int -> spmat
val eye : int -> spmat
val binary : int -> int -> spmat
val uniform : ?scale:float -> int -> int -> spmat
val uniform_int : ?a:int -> ?b:int -> int -> int -> spmat
val shape : spmat -> int * int
val row_num : spmat -> int
val col_num : spmat -> int
val row_num_nz : spmat -> int
val col_num_nz : spmat -> int
val numel : spmat -> int
val nnz : spmat -> int
val nnz_rows : spmat -> int array
val nnz_cols : spmat -> int array
val density : spmat -> float
val reset : spmat -> unit
val is_zero : spmat -> bool
val is_positive : spmat -> bool
val is_negative : spmat -> bool
val is_nonnegative : spmat -> bool
val permutation_matrix : int -> spmat
val to_dense : spmat -> Owl_dense_complex.mat
val of_dense : Owl_dense_complex.mat -> spmat
val print : spmat -> unit
val pp_spmat : spmat -> unit
val save : spmat -> string -> unit
val load : string -> spmat
val _triplet2crs : spmat -> unit