Skip to content

Commit f878a18

Browse files
get rid of those **** Int64s
1 parent 03e0404 commit f878a18

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

src/coloring/bsc_algo.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"""
66
function color_graph(G::VSafeGraph,::BSCColor)
77
V = nv(G)
8-
F = zeros(Int64, V)
9-
freeColors = [Vector{Int64}() for _ in 1:V] #set of free colors for each vertex
10-
U = zeros(Int64, 0) #stores set of free colors
11-
#F = zeros(Int64, 0) #stores final coloring of vertices
8+
F = zeros(Int, V)
9+
freeColors = [Vector{Int}() for _ in 1:V] #set of free colors for each vertex
10+
U = zeros(Int, 0) #stores set of free colors
11+
#F = zeros(Int, 0) #stores final coloring of vertices
1212

1313
sorted_vertices = order_by_degree(G)
1414
start = 1
@@ -71,15 +71,15 @@ end
7171
7272
Find the degree of the vertex z which belongs to the graph G.
7373
"""
74-
function degree(G::VSafeGraph,z::Int64)
74+
function degree(G::VSafeGraph,z::Int)
7575
return length(inneighbors(G,z))
7676
end
7777

7878

7979
function sorted_vertices(G::VSafeGraph)
8080
V = nv(G)
81-
marked = zeros(Int64,V)
82-
sv = zeros(Int64,0)
81+
marked = zeros(Int,V)
82+
sv = zeros(Int,0)
8383
max_degree = -1
8484
max_degree_vertex = -1
8585
for i = 1:V
@@ -100,8 +100,8 @@ function sorted_vertices(G::VSafeGraph)
100100
end
101101

102102
#find uncolored vertex of maximal degree of saturation
103-
function find_uncolored_vertex(sv::Array{Int64,1}, G::VSafeGraph)
104-
colors = zeros(Int64,0)
103+
function find_uncolored_vertex(sv::Array{Int,1}, G::VSafeGraph)
104+
colors = zeros(Int,0)
105105
max_colors = -1
106106
max_color_index = -1
107107
for i = 1:nv(G)
@@ -116,7 +116,7 @@ function find_uncolored_vertex(sv::Array{Int64,1}, G::VSafeGraph)
116116
max_color_index = i
117117
end
118118
end
119-
colors = zeros(Int64,0)
119+
colors = zeros(Int,0)
120120
end
121121
for i = 1:nv(G)
122122
if A[i] == max_color_index
@@ -127,8 +127,8 @@ function find_uncolored_vertex(sv::Array{Int64,1}, G::VSafeGraph)
127127
end
128128

129129
#set of free colors of x, which are < optColorNumber
130-
function free_colors(x::Int64, F::Array{Int64,1}, G::VSafeGraph, max_color::Int64)
131-
colors = zeros(Int64,0)
130+
function free_colors(x::Int, F::Array{Int,1}, G::VSafeGraph, max_color::Int)
131+
colors = zeros(Int,0)
132132
for color in 1:max_color
133133
present = true
134134
for y in inneighbors(G,x)
@@ -145,7 +145,7 @@ function free_colors(x::Int64, F::Array{Int64,1}, G::VSafeGraph, max_color::Int6
145145
end
146146

147147
#least index with F(A[i]) = optColorNumber
148-
function least_index(A::Array{Int64, 1}, F::Array{Int64,1}, optColorNumber::Int64, G::VSafeGraph)
148+
function least_index(A::Array{Int, 1}, F::Array{Int,1}, optColorNumber::Int, G::VSafeGraph)
149149
for i = 1:nv(G)
150150
if F[A[i]] == optColorNumber
151151
return i
@@ -154,15 +154,15 @@ function least_index(A::Array{Int64, 1}, F::Array{Int64,1}, optColorNumber::Int6
154154
end
155155

156156
#uncolor all vertices A[i] with i >= start
157-
function uncolor_all(F::Array{Int64,1}, A::Array{Int64,1}, start::Int64, G::VSafeGraph)
157+
function uncolor_all(F::Array{Int,1}, A::Array{Int,1}, start::Int, G::VSafeGraph)
158158
for i = start:nv(G)
159159
F[A[i]] = 0
160160
end
161161
end
162162

163163
#remove from U all colors >= optColorNumber
164-
function remove_colors(U::Array{Int64,1}, optColorNumber::Int64)
165-
modified_U = zeros(Int64,0)
164+
function remove_colors(U::Array{Int,1}, optColorNumber::Int)
165+
modified_U = zeros(Int,0)
166166
for i = 1:length(U)
167167
if U[i] < optColorNumber
168168
push!(mmodified_U, U[i])

src/coloring/contraction_coloring.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function color_graph(G::VSafeGraph,::ContractionColor)
88

99
colornumber = 0
1010
V = nv(G)
11-
colors = zeros(Int64,V)
11+
colors = zeros(Int,V)
1212

1313
while (V > 0)
1414
x = max_degree_vertex(G)
@@ -47,7 +47,7 @@ end
4747
Find the vertex in the group nn of vertices belonging to the
4848
graph G which has the highest degree.
4949
"""
50-
function max_degree_vertex(G::VSafeGraph,nn::Array{Int64,1})
50+
function max_degree_vertex(G::VSafeGraph,nn::Array{Int,1})
5151

5252
max_degree = -1
5353
max_degree_vertex = -1
@@ -90,9 +90,9 @@ end
9090
Find the set of vertices belonging to the graph G which do
9191
not share an edge with the vertex x.
9292
"""
93-
function non_neighbors(G::VSafeGraph, x::Int64)
93+
function non_neighbors(G::VSafeGraph, x::Int)
9494

95-
nn = zeros(Int64, 0)
95+
nn = zeros(Int, 0)
9696
for v in vertices(G)
9797
if v == x
9898
continue
@@ -112,7 +112,7 @@ end
112112
Find the number of vertices that share an edge with both the
113113
vertices z and x belonging to the graph G.
114114
"""
115-
function length_common_neighbor(G::VSafeGraph,z::Int64, x::Int64)
115+
function length_common_neighbor(G::VSafeGraph,z::Int, x::Int)
116116

117117
z_neighbors = inneighbors(G,z)
118118
x_neighbors = inneighbors(G,x)
@@ -133,7 +133,7 @@ end
133133
134134
Find the degree of the vertex z which belongs to the graph G.
135135
"""
136-
function vertex_degree(G::VSafeGraph,z::Int64)
136+
function vertex_degree(G::VSafeGraph,z::Int)
137137

138138
return length(inneighbors(G,z))
139139

@@ -147,7 +147,7 @@ Contract the vertex y to x, both of which belong to graph G, that is
147147
delete vertex y and join x with the neighbors of y if they are not
148148
already connected with an edge.
149149
"""
150-
function contract!(G::VSafeGraph,y::Int64, x::Int64)
150+
function contract!(G::VSafeGraph,y::Int, x::Int)
151151

152152
for v in inneighbors(G,y)
153153
if has_edge(G,v,x) == false

src/coloring/greedy_d1_coloring.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ number χ(G) of the graph.
99
"""
1010
function color_graph(g::VSafeGraph, alg::GreedyD1Color)
1111
v = nv(g)
12-
result = zeros(Int64, v)
12+
result = zeros(Int, v)
1313
result[1] = 1
1414
available = BitArray(undef, v)
1515
for i = 2:v

src/coloring/greedy_star1_coloring.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"""
2424
function color_graph(g::LightGraphs.AbstractGraph, ::GreedyStar1Color)
2525
v = nv(g)
26-
color = zeros(Int64, v)
26+
color = zeros(Int, v)
2727

28-
forbidden_colors = zeros(Int64, v+1)
28+
forbidden_colors = zeros(Int, v+1)
2929

3030
for vertex_i = vertices(g)
3131

src/coloring/greedy_star2_coloring.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"""
2727
function color_graph(g::LightGraphs.AbstractGraph, :: GreedyStar2Color)
2828
v = nv(g)
29-
color = zeros(Int64, v)
29+
color = zeros(Int, v)
3030

31-
forbidden_colors = zeros(Int64, v+1)
31+
forbidden_colors = zeros(Int, v+1)
3232

3333
for vertex_i = vertices(g)
3434

src/differentiation/compute_jacobian_ad.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ end
4646
generate_chunked_partials(x,color,N::Integer) = generate_chunked_partials(x,color,Val(N))
4747
function generate_chunked_partials(x,color,::Val{chunksize}) where chunksize
4848

49-
num_of_chunks = Int64(ceil(maximum(color) / chunksize))
49+
num_of_chunks = Int(ceil(maximum(color) / chunksize))
5050

5151
padding_size = (chunksize - (maximum(color) % chunksize)) % chunksize
5252

0 commit comments

Comments
 (0)