Skip to content

issparse is not defined but is requested for a view's parent #486

@bertini97

Description

@bertini97

Describe the bug 🐞

On certain operations, issparse(::SubArray) is called, and it calls issparse on the parent, but it's not defined in the case of AbstractVectorOfArray.

Expected behavior

issparse(::SubArray) is defined, to false.

Error & Stacktrace ⚠️

> U = mapreduce(u -> view(u, :, :), hcat, us)
MethodError: no method matching issparse(::ODESolution{...})

Additional context

Solution:

import SparseArrays: issparse
issparse(::AbstractVectorOfArray) = false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions