Skip to content

reduce fails when dims=1 and no descriptor provided #82

@andreyz4k

Description

@andreyz4k
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> reduce(+, A, dims=1)
ERROR: type Nothing has no field transpose_input1
Stacktrace:
 [1] setproperty!(x::Nothing, f::Symbol, v::Bool)
   @ Base ./Base.jl:43
 [2] #reduce#169
   @ ~/.julia/packages/SuiteSparseGraphBLAS/5AOj3/src/operations/reduce.jl:35 [inlined]
 [3] top-level scope
   @ REPL[62]:1

julia> reduce(+, A, dims=1; desc=Descriptor())
7x1 GraphBLAS int64_t matrix, full by col
  7 entries, memory: 264 bytes

    (1,1)   6
    (2,1)   1
    (3,1)   26
    (4,1)   13
    (5,1)   15
    (6,1)   13
    (7,1)   4

julia> reduce(+, A, dims=2)
7x1 GraphBLAS int64_t matrix, full by col
  7 entries, memory: 264 bytes

    (1,1)   3
    (2,1)   7
    (3,1)   5
    (4,1)   13
    (5,1)   8
    (6,1)   9
    (7,1)   33

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