High performance extension for sparse matrices.
- General Permutation Matrix
PermMatrix
, - Identity Matrix
IMatrix
, - Coordinate Format Matrix
SparseMatrixCOO
, - Static Matrices
SSparseMatrixCSC
,SPermMatrix
et. al.
with high performance type convertion
, kron
and multiplication
operations.
Install with the package manager, pkg> add LuxurySparse
.
Here is a simple example
using SparseArrays
using LuxurySparse
using BenchmarkTools
pm = pmrand(7) # a random permutation matrix
id = IMatrix(3) # an identity matrix
@benchmark kron(pm, id) # kronecker product
Spm = pm |> SparseMatrixCSC # convertion to SparseMatrixCSC
Sid = id |> SparseMatrixCSC
@benchmark kron(Spm, Sid) # compare the performance.
spm = pm |> staticize # convertion to static matrices, notice `id` is already static.
@benchmark kron(spm, spm) # compare the performance.
@benchmark kron(pm, pm) # compare the performance.
For more information, please refer the latest document.
- Change
PermMatrix
to column major - Better support to static matrices.