Skip to content

Commit a51f1f8

Browse files
Cleanup Code (#11)
1 parent dc536c0 commit a51f1f8

28 files changed

+134
-171
lines changed

src/Enums.jl

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Interface/Interface.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import Base:
88
import SuiteSparseGraphBLAS:
99
GrB_Matrix, GrB_Vector, GrB_Descriptor
1010

11-
include("Utils.jl")
12-
include("./Object_Methods/Matrix_Methods.jl")
13-
include("./Object_Methods/Vector_Methods.jl")
14-
include("./Object_Methods/Descriptor_Methods.jl")
11+
include("utils.jl")
12+
include("./object_methods/matrix.jl")
13+
include("./object_methods/vector.jl")
14+
include("./object_methods/descriptor.jl")
1515
export findnz, nnz, LowerTriangular, UpperTriangular, Diagonal, dropzeros!
1616

1717
end # end of module

src/Interface/Object_Methods/Descriptor_Methods.jl renamed to src/Interface/object_methods/descriptor.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
GrB_Descriptor(d::Dict{GrB_Desc_Field, GrB_Desc_Value})
2+
GrB_Descriptor(::Pair{GrB_Desc_Field, GrB_Desc_Value}...)
33
4-
Create a new GraphBLAS descriptor from a dictionary of descriptor field and value pairs.
4+
Create a new GraphBLAS descriptor.
55
66
# Examples
77
```jldoctest
@@ -10,11 +10,11 @@ julia> using SuiteSparseGraphBLAS
1010
julia> GrB_init(GrB_NONBLOCKING)
1111
GrB_SUCCESS::GrB_Info = 0
1212
13-
julia> desc = GrB_Descriptor(Dict(GrB_INP0 => GrB_TRAN, GrB_OUTP => GrB_REPLACE))
13+
julia> desc = GrB_Descriptor(GrB_INP0 => GrB_TRAN, GrB_OUTP => GrB_REPLACE)
1414
GrB_Descriptor
1515
```
1616
"""
17-
function GrB_Descriptor(d::Dict{GrB_Desc_Field, GrB_Desc_Value})
17+
function GrB_Descriptor(d::Pair{GrB_Desc_Field, GrB_Desc_Value}...)
1818
desc = GrB_Descriptor()
1919
res = GrB_Descriptor_new(desc)
2020
if res != GrB_SUCCESS

src/Interface/Object_Methods/Matrix_Methods.jl renamed to src/Interface/object_methods/matrix.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function GrB_Matrix(
1010
I::Vector{U},
1111
J::Vector{U},
1212
X::Vector{T};
13-
nrows::Union{Int64, UInt64} = maximum(I).x,
14-
ncols::Union{Int64, UInt64} = maximum(J).x,
13+
nrows::Union{Int64, UInt64} = maximum(I)[],
14+
ncols::Union{Int64, UInt64} = maximum(J)[],
1515
nvals::Union{Int64, UInt64} = min(length(I), length(J)),
1616
dup::GrB_BinaryOp = default_dup(T)) where {T, U <: Abstract_GrB_Index}
1717

@@ -88,7 +88,7 @@ function ==(A::GrB_Matrix{T}, B::GrB_Matrix{U}) where {T, U}
8888
end
8989

9090
"""
91-
findnz(A, [index_type])
91+
findnz(A,[ index_type])
9292
9393
Return a tuple (I, J, X) where I and J are the row and column indices of the stored values in GraphBLAS matrix A,
9494
and X is a vector of the values. Indices are zero based by default if not specified.

src/Interface/Object_Methods/Vector_Methods.jl renamed to src/Interface/object_methods/vector.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ nvals is set to length(I) if not specified.
99
function GrB_Vector(
1010
I::Vector{U},
1111
X::Vector{T};
12-
n::Union{Int64, UInt64} = maximum(I).x,
12+
n::Union{Int64, UInt64} = maximum(I)[],
1313
nvals::Union{Int64, UInt64} = length(I),
1414
dup::GrB_BinaryOp = default_dup(T)) where {T, U <: Abstract_GrB_Index}
1515

@@ -127,7 +127,7 @@ function nnz(V::GrB_Vector)
127127
end
128128

129129
"""
130-
findnz(V, [index_type])
130+
findnz(V,[ index_type])
131131
132132
Return a tuple (I, X) where I is the indices of the stored values in GraphBLAS vector V and X is a vector of the values.
133133
Indices are zero based by default if not specified.
File renamed without changes.

src/Object_Methods/Print_Objects.jl

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/SuiteSparseGraphBLAS.jl

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ if !isfile(depsjl_path)
99
end
1010

1111
include(depsjl_path)
12-
include("Structures.jl")
13-
include("Global_Variables.jl")
14-
include("Utils.jl")
12+
include("structures.jl")
13+
include("global_variables.jl")
14+
include("utils.jl")
1515

1616
const valid_matrix_mask_types = Union{GrB_Matrix, GrB_NULL_Type}
1717
const valid_vector_mask_types = Union{GrB_Vector, GrB_NULL_Type}
@@ -38,24 +38,23 @@ function __init__()
3838
end
3939
end
4040

41-
include("Enums.jl")
42-
include("Context_Methods.jl")
43-
include("Sequence_Termination.jl")
44-
include("Object_Methods/Matrix_Methods.jl")
45-
include("Object_Methods/Vector_Methods.jl")
46-
include("Object_Methods/Algebra_Methods.jl")
47-
include("Object_Methods/Descriptor_Methods.jl")
48-
include("Object_Methods/Print_Objects.jl")
49-
include("Object_Methods/Free_Objects.jl")
50-
include("Operations/Multiplication.jl")
51-
include("Operations/Element_wise_multiplication.jl")
52-
include("Operations/Element_wise_addition.jl")
53-
include("Operations/Extract.jl")
54-
include("Operations/Apply.jl")
55-
include("Operations/Assign.jl")
56-
include("Operations/Reduce.jl")
57-
include("Operations/Transpose.jl")
58-
include("Operations/Select.jl")
41+
include("context_methods.jl")
42+
include("sequence_termination.jl")
43+
include("object_methods/matrix.jl")
44+
include("object_methods/vector.jl")
45+
include("object_methods/algebraic.jl")
46+
include("object_methods/descriptor.jl")
47+
include("object_methods/print.jl")
48+
include("object_methods/free.jl")
49+
include("operations/multiply.jl")
50+
include("operations/ewise_multiply.jl")
51+
include("operations/ewise_add.jl")
52+
include("operations/extract.jl")
53+
include("operations/apply.jl")
54+
include("operations/assign.jl")
55+
include("operations/reduce.jl")
56+
include("operations/transpose.jl")
57+
include("operations/select.jl")
5958

6059
# Higher-level interface
6160
include("Interface/Interface.jl")
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)