josdejong / josdejong/mathjs

Kronecker product needs a SparseMatrix implementation

Open
#1,610 5 comments 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

The current implementation of the Kronecker product #704 silently changes sparse matrices into dense matrices.

Example:

```
v1 = math.matrix([0, 2, 3, 0, 0], 'sparse')
v2 = math.matrix([0, 1, 0 -1], 'sparse')
v = math.kron(v1, v2)
```

Returns `v`, which is a `DenseMatrix` even though `v1` and `v2` are`SparseMatrix`.
I would expect `SparseMatrix` instead.

Is it intended behavior?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.