SparseArrayQ

SparseArrayQ[s]

yields True if s is a valid SparseArray object and False otherwise.

Examples

open allclose all

Basic Examples  (1)

Test whether an object is a valid SparseArray object:

Scope  (4)

SparseArrayQ works with sparse vectors:

SparseArrayQ works with sparse arrays of any depth:

SparseArrayQ works with large sparse arrays:

SparseArrayQ gives False for anything that is not a SparseArray:

Properties & Relations  (2)

When SparseArrayQ is True, ArrayQ will also be True but not the converse:

SparseArrayQ is equivalent to (ArrayQ[#] && MatchQ[#,_SparseArray])&:

Wolfram Research (2021), SparseArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SparseArrayQ.html.

Text

Wolfram Research (2021), SparseArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SparseArrayQ.html.

CMS

Wolfram Language. 2021. "SparseArrayQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SparseArrayQ.html.

APA

Wolfram Language. (2021). SparseArrayQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SparseArrayQ.html

BibTeX

@misc{reference.wolfram_2022_sparsearrayq, author="Wolfram Research", title="{SparseArrayQ}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/SparseArrayQ.html}", note=[Accessed: 03-July-2022 ]}

BibLaTeX

@online{reference.wolfram_2022_sparsearrayq, organization={Wolfram Research}, title={SparseArrayQ}, year={2021}, url={https://reference.wolfram.com/language/ref/SparseArrayQ.html}, note=[Accessed: 03-July-2022 ]}