Skip to content

Commit 116496b

Browse files
author
Wimmerer
committed
missing function
1 parent efdd0bf commit 116496b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

docs/src/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ SuiteSparse:GraphBLAS takes advantage of this by storing matrices in one of four
5555
!!! warning "Default Orientation"
5656
The default orientation of a `GBMatrix` is by-row, the opposite of Julia arrays, for greater speed
5757
in certain operations. However, a `GBMatrix` constructed from a `SparseMatrixCSC` or
58-
`Matrix` will be stored by-column. This can be changed using `gbset(A, :format, :byrow)`.
58+
`Matrix` will be stored by-column. The orientation of a `GBMatrix` can be modified using
59+
`gbset(A, :format, :byrow)` or `gbset(A, :format, :bycol)`.
5960

6061
The matrix and vector in the graphic above can be constructed as follows:
6162

src/operations/reduce.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,5 @@ Base.maximum(f::Function, A::GBArray) = reduce(max, map(f, A))
105105

106106
Base.minimum(A::GBArray) = reduce(min, A)
107107
Base.minimum(f::Function, A::GBArray) = reduce(min, map(f, A))
108+
109+
Base.sum(A::GBArray) = reduce(+, A)

src/vector.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ function Base.setindex!(
273273
subassign!(u, x, ALL; mask, accum, desc)
274274
return nothing
275275
end
276+
# silly overload to help a bit with broadcasting.
277+
function Base.setindex!(
278+
u::GBVector, x, I::Union{Vector, UnitRange, StepRange, Colon}, ::Colon;
279+
mask = nothing, accum = nothing, desc = nothing
280+
)
281+
Base.setindex!(u, x, I; mask, accum, desc)
282+
end
276283
function Base.setindex!(
277284
u::GBVector, x, I::Union{Vector, UnitRange, StepRange};
278285
mask = nothing, accum = nothing, desc = nothing

0 commit comments

Comments
 (0)