JuliaSparse / SuiteSparseGraphBLAS.jl

Sparse, General Linear Algebra for Graphs!
MIT License
102 stars 17 forks source link

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

Closed andreyz4k closed 2 years ago

andreyz4k commented 2 years ago
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