Skip to content

Documentation missing for sparse() #3519

@gwhitney

Description

@gwhitney

Describe the bug
There is no link to the documentation page for the function sparse that coerces an array or Matrix into a SparseMatrix; and nowhere is it documented that unlike DenseMatrix, a SparseMatrix may only contain numerical entries (e.g., a DenseMatrix [['fred', 0, null]] can perfectly well be created, but there is no SparseMatrix with these entries).

To Reproduce
While you can directly go to https://mathjs.org/docs/reference/functions/sparse.html if you guess that it exists, I have been unable to find any link to this page; nor do any of the web pages which mention SparseMatrix (e.g., the general Matrices page or the specific SparseMatrix page, nor the sparse() documentation) appear to mention that such a matrix can only contain numeric entries. (The sticking point appears to be that for each entry a, equalScalar(0, a) must return true or false, but it throws an error when a is not numeric.)

The missing documentation link may be a duplicate of #3368.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationConcerns about or enhancements to the mathjs documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions