Skip to content

Calling ncon with a view throws MethodError #119

@votroto

Description

@votroto

Is it possible to support views into arrays? It seems the api might be too specific.

e.g. a Matrix works as expected:

A = [1 2 3; 4 5 6]
B = [0, 1, 0]
C = [1, 1]

@show ncon([A, B, C], [[2,1], [1], [2]])

An equivalent view into a matrix throws a MethodError: no method matching sview error

A = view([1 2 3 1; 4 5 6 1; 7 8 9 1], [1,2], [1,2,3])
B = [0, 1, 0]
C = [1, 1]

@show ncon([A, B, C], [[2,1], [1], [2]])

Simply doing collect works as expected.

A = collect(view([1 2 3 1; 4 5 6 1; 7 8 9 1], [1,2], [1,2,3]))
B = [0, 1, 0]
C = [1, 1]

@show ncon([A, B, C], [[2,1], [1], [2]])

Thank You

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions