Skip to content

Indexing GBMatrix with a list of indices mutates the parameter #79

@andreyz4k

Description

@andreyz4k
julia> i = [1, 2]
2-element Vector{Int64}:
 1
 2

julia> A = GBMatrix([1,1,2,2,3,4,4,5,6,7,7,7], [2,4,5,7,6,1,3,6,3,3,4,5], [1:12...])
7x7 GraphBLAS int64_t matrix, bitmap by row
  12 entries, memory: 649 bytes

    (1,2)   1
    (1,4)   2
    (2,5)   3
    (2,7)   4
    (3,6)   5
    (4,1)   6
    (4,3)   7
    (5,6)   8
    (6,3)   9
    (7,3)   10
    (7,4)   11
    (7,5)   12


julia> A[i, :]
2x7 GraphBLAS int64_t matrix, bitmap by row
  4 entries, memory: 334 bytes

    (1,2)   1
    (1,4)   2
    (2,5)   3
    (2,7)   4


julia> i
2-element Vector{Int64}:
 0
 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions