Skip to content

Commit 805b989

Browse files
authored
Merge pull request #63 from JuliaLinearAlgebra/compathelper
Add compat and compathelper, shift to project toml
2 parents aba3184 + 44350e7 commit 805b989

File tree

10 files changed

+255
-106
lines changed

10 files changed

+255
-106
lines changed

.travis.yml

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,16 @@
1-
## Documentation: http://docs.travis-ci.com/user/languages/julia/
1+
# Documentation: http://docs.travis-ci.com/user/languages/julia/
22
language: julia
3+
julia:
4+
- 1
35
os:
46
- linux
5-
julia:
6-
- 0.6
7-
- 0.7
8-
- 1.0
9-
- 1.1
10-
- nightly
7+
branches:
8+
only:
9+
- master
1110
notifications:
1211
email: false
13-
git:
14-
depth: 99999999
15-
16-
## uncomment the following lines to allow failures on nightly julia
17-
## (tests will run but not make your overall status red)
18-
matrix:
19-
allow_failures:
20-
- julia: nightly
21-
22-
## uncomment and modify the following lines to manually install system packages
23-
addons:
24-
apt: # apt-get for linux
25-
packages:
26-
- hdf5-tools
27-
#before_script: # homebrew for mac
28-
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi
29-
30-
## uncomment the following lines to override the default test script
31-
script:
32-
- julia -e 'VERSION >= v"0.7-" && using Pkg; Pkg.clone(pwd()); Pkg.build("AlgebraicMultigrid"); Pkg.test("AlgebraicMultigrid"; coverage=true)'
3312
after_success:
34-
# push coverage results to Coveralls
35-
- julia -e 'cd(Pkg.dir("AlgebraicMultigrid")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
36-
# push coverage results to Codecov
37-
- julia -e 'cd(Pkg.dir("AlgebraicMultigrid")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
13+
- julia -e 'using Pkg;
14+
Pkg.add("Coverage");
15+
using Coverage;
16+
Coveralls.submit(Coveralls.process_folder())'

Manifest.toml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[Base64]]
4+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
5+
6+
[[BinaryProvider]]
7+
deps = ["Libdl", "SHA"]
8+
git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c"
9+
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
10+
version = "0.5.8"
11+
12+
[[Compat]]
13+
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
14+
git-tree-sha1 = "0198d18b28c093bef39872a22f1a897218a925f5"
15+
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
16+
version = "3.8.0"
17+
18+
[[CompatHelper]]
19+
deps = ["Dates", "GitHub", "JSON", "Pkg", "Printf", "TimeZones", "UUIDs"]
20+
git-tree-sha1 = "62fbe2af475ec6b141d16f7b12f83b38864f6fd1"
21+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
22+
version = "1.3.0"
23+
24+
[[Dates]]
25+
deps = ["Printf"]
26+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
27+
28+
[[DelimitedFiles]]
29+
deps = ["Mmap"]
30+
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
31+
32+
[[Distributed]]
33+
deps = ["Random", "Serialization", "Sockets"]
34+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
35+
36+
[[ExprTools]]
37+
git-tree-sha1 = "08c1f74d9ad03acf0ee84c12c9e665ab1a9a6e33"
38+
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
39+
version = "0.1.0"
40+
41+
[[EzXML]]
42+
deps = ["Printf", "XML2_jll"]
43+
git-tree-sha1 = "0fa3b52a04a4e210aeb1626def9c90df3ae65268"
44+
uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
45+
version = "1.1.0"
46+
47+
[[GitHub]]
48+
deps = ["Base64", "Dates", "HTTP", "JSON", "MbedTLS", "Sockets"]
49+
git-tree-sha1 = "f8f9c05004861b6680c1bd363e7e2fcff602a283"
50+
uuid = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
51+
version = "5.1.4"
52+
53+
[[HTTP]]
54+
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
55+
git-tree-sha1 = "cd60d9a575d3b70c026d7e714212fd4ecf86b4bb"
56+
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
57+
version = "0.8.13"
58+
59+
[[IniFile]]
60+
deps = ["Test"]
61+
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
62+
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
63+
version = "0.5.0"
64+
65+
[[InteractiveUtils]]
66+
deps = ["Markdown"]
67+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
68+
69+
[[IterativeSolvers]]
70+
deps = ["LinearAlgebra", "Printf", "Random", "RecipesBase", "SparseArrays"]
71+
git-tree-sha1 = "f272a02b57a1a1d2150a1a6cc4a3441ee806ab96"
72+
uuid = "42fd0dbc-a981-5370-80f2-aaf504508153"
73+
version = "0.8.3"
74+
75+
[[JSON]]
76+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
77+
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
78+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
79+
version = "0.21.0"
80+
81+
[[LibGit2]]
82+
deps = ["Printf"]
83+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
84+
85+
[[Libdl]]
86+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
87+
88+
[[Libiconv_jll]]
89+
deps = ["Libdl", "Pkg"]
90+
git-tree-sha1 = "e5256a3b0ebc710dbd6da0c0b212164a3681037f"
91+
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
92+
version = "1.16.0+2"
93+
94+
[[LinearAlgebra]]
95+
deps = ["Libdl"]
96+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
97+
98+
[[Logging]]
99+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
100+
101+
[[Markdown]]
102+
deps = ["Base64"]
103+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
104+
105+
[[MbedTLS]]
106+
deps = ["BinaryProvider", "Dates", "Libdl", "Random", "Sockets"]
107+
git-tree-sha1 = "85f5947b53c8cfd53ccfa3f4abae31faa22c2181"
108+
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
109+
version = "0.7.0"
110+
111+
[[Mmap]]
112+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
113+
114+
[[Mocking]]
115+
deps = ["ExprTools"]
116+
git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed"
117+
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
118+
version = "0.7.1"
119+
120+
[[Parsers]]
121+
deps = ["Dates", "Test"]
122+
git-tree-sha1 = "75d07cb840c300084634b4991761886d0d762724"
123+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
124+
version = "1.0.1"
125+
126+
[[Pkg]]
127+
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
128+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
129+
130+
[[Printf]]
131+
deps = ["Unicode"]
132+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
133+
134+
[[REPL]]
135+
deps = ["InteractiveUtils", "Markdown", "Sockets"]
136+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
137+
138+
[[Random]]
139+
deps = ["Serialization"]
140+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
141+
142+
[[RecipesBase]]
143+
git-tree-sha1 = "b4ed4a7f988ea2340017916f7c9e5d7560b52cae"
144+
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
145+
version = "0.8.0"
146+
147+
[[SHA]]
148+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
149+
150+
[[Serialization]]
151+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
152+
153+
[[SharedArrays]]
154+
deps = ["Distributed", "Mmap", "Random", "Serialization"]
155+
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
156+
157+
[[Sockets]]
158+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
159+
160+
[[SparseArrays]]
161+
deps = ["LinearAlgebra", "Random"]
162+
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
163+
164+
[[Statistics]]
165+
deps = ["LinearAlgebra", "SparseArrays"]
166+
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
167+
168+
[[Test]]
169+
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
170+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
171+
172+
[[TimeZones]]
173+
deps = ["Dates", "EzXML", "Mocking", "Printf", "Serialization", "Unicode"]
174+
git-tree-sha1 = "f60a33649ef8380bafe6be7d1af1eeb8a3a3ea92"
175+
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
176+
version = "1.0.1"
177+
178+
[[UUIDs]]
179+
deps = ["Random", "SHA"]
180+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
181+
182+
[[Unicode]]
183+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
184+
185+
[[XML2_jll]]
186+
deps = ["Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
187+
git-tree-sha1 = "39a309feb51413d39bdf544cf2fd09357bae37d2"
188+
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
189+
version = "2.9.9+2"
190+
191+
[[Zlib_jll]]
192+
deps = ["Libdl", "Pkg"]
193+
git-tree-sha1 = "2f6c3e15e20e036ee0a0965879b31442b7ec50fa"
194+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
195+
version = "1.2.11+9"

Project.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name = "AlgebraicMultigrid"
2+
uuid = "2169fc97-5a83-5252-b627-83903c6c433c"
3+
4+
[deps]
5+
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
6+
CompatHelper = "aa819f21-2bde-4658-8897-bab36330d9b7"
7+
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
8+
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
9+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
10+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
11+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
12+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
15+
[compat]
16+
Compat = "≥ 1.0.0"
17+
IterativeSolvers = "≥ 0.6.0"
18+
julia = "≥ 1.0.0"
19+
20+
[extras]
21+
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
22+
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
23+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
24+
25+
[targets]
26+
test = ["FileIO", "JLD2", "Random"]

src/AlgebraicMultigrid.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
module AlgebraicMultigrid
22

33
import IterativeSolvers: gauss_seidel!
4-
using Compat, Compat.LinearAlgebra
5-
using Compat.SparseArrays, Compat.Printf
4+
using LinearAlgebra
5+
using SparseArrays, Printf
66
using Base.Threads
77

8-
using Compat: rmul!
8+
using LinearAlgebra: rmul!
99

10-
if VERSION < v"0.7-"
11-
const mul! = A_mul_B!
12-
end
10+
# const mul! = A_mul_B!
1311

1412
const MT = false
1513
const AMG = AlgebraicMultigrid

src/aggregation.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ function smoothed_aggregation(A::TA,
2828
# agg = [aggregate for _ in 1:max_levels - 1]
2929
# sm = [smooth for _ in 1:max_levels]
3030

31-
@static if VERSION < v"0.7-"
32-
levels = Vector{Level{TA, TA, TA}}()
33-
else
34-
levels = Vector{Level{TA, TA, Adjoint{T, TA}}}()
35-
end
31+
levels = Vector{Level{TA, TA, Adjoint{T, TA}}}()
3632
bsr_flag = false
3733
w = MultiLevelWorkspace(Val{bs}, eltype(A))
3834
residual!(w, size(A, 1))

src/classical.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,12 @@ function ruge_stuben(_A::Union{TA, Symmetric{Ti, TA}, Hermitian{Ti, TA}},
2424
A = _A.data
2525
At = A
2626
symmetric = true
27-
@static if VERSION < v"0.7-"
28-
levels = Vector{Level{TA, TA}}()
29-
else
30-
levels = Vector{Level{TA, Adjoint{Ti, TA}, TA}}()
31-
end
27+
levels = Vector{Level{TA, Adjoint{Ti, TA}, TA}}()
3228
else
3329
symmetric = false
3430
A = _A
3531
At = adjoint(A)
36-
@static if VERSION < v"0.7-"
37-
levels = Vector{Level{TA, TA, TA}}()
38-
else
39-
levels = Vector{Level{TA, Adjoint{Ti, TA}, TA}}()
40-
end
32+
levels = Vector{Level{TA, Adjoint{Ti, TA}, TA}}()
4133
end
4234
w = MultiLevelWorkspace(Val{bs}, eltype(A))
4335
residual!(w, size(A, 1))

src/multilevel.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,8 @@ function Base.show(io::IO, ml::MultiLevel)
8080
lstr = lstr *
8181
@sprintf " %2d %10d %10d [%5.2f%%]" length(ml.levels) + 1 size(ml.final_A, 1) nnz(ml.final_A) (100 * nnz(ml.final_A) / total_nnz)
8282

83-
@static if VERSION < v"0.7-"
84-
opround = round(op, 3)
85-
ground = round(op, 3)
86-
else
87-
opround = round(op, digits = 3)
88-
ground = round(op, digits = 3)
89-
end
83+
opround = round(op, digits = 3)
84+
ground = round(op, digits = 3)
9085

9186
str = """
9287
Multilevel Solver

src/preconditioner.jl

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,17 @@ Preconditioner(ml) = Preconditioner(ml, :zero)
66

77
aspreconditioner(ml::MultiLevel) = Preconditioner(ml)
88

9-
@static if VERSION < v"0.7-"
10-
import Base: \, *, A_ldiv_B!, A_mul_B!
11-
function A_ldiv_B!(x, p::Preconditioner, b)
12-
if p.init == :zero
13-
x .= 0
14-
else
15-
x .= b
16-
end
17-
solve!(x, p.ml, b, maxiter = 1, calculate_residual = false)
9+
import LinearAlgebra: \, *, ldiv!, mul!
10+
ldiv!(p::Preconditioner, b) = copyto!(b, p \ b)
11+
function ldiv!(x, p::Preconditioner, b)
12+
if p.init == :zero
13+
x .= 0
14+
else
15+
x .= b
1816
end
19-
A_mul_B!(b, p::Preconditioner, x) = A_mul_B!(b, p.ml.levels[1].A, x)
20-
else
21-
import Compat.LinearAlgebra: \, *, ldiv!, mul!
22-
ldiv!(p::Preconditioner, b) = copyto!(b, p \ b)
23-
function ldiv!(x, p::Preconditioner, b)
24-
if p.init == :zero
25-
x .= 0
26-
else
27-
x .= b
28-
end
29-
solve!(x, p.ml, b, maxiter = 1, calculate_residual = false)
30-
end
31-
mul!(b, p::Preconditioner, x) = mul!(b, p.ml.levels[1].A, x)
17+
solve!(x, p.ml, b, maxiter = 1, calculate_residual = false)
3218
end
19+
mul!(b, p::Preconditioner, x) = mul!(b, p.ml.levels[1].A, x)
3320

3421
function \(p::Preconditioner, b)
3522
ldiv!(similar(b), p, b)

0 commit comments

Comments
 (0)