Skip to content

Commit

Permalink
Merge pull request #170 from JuliaDiff/fixtests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
ChrisRackauckas authored May 12, 2023
2 parents 48023de + a4a9b26 commit 5afccd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ StaticArrays = "1.0"
julia = "1.6"

[extras]
ArrayInterfaceBlockBandedMatrices = "5331f1e9-51c7-46b0-a9b0-df4434785e0a"
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "ArrayInterfaceBlockBandedMatrices", "BlockBandedMatrices", "BandedMatrices", "Pkg", "SafeTestsets"]
test = ["Test", "BlockBandedMatrices", "BandedMatrices", "Pkg", "SafeTestsets"]
9 changes: 4 additions & 5 deletions test/coloring_tests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using FiniteDiff, LinearAlgebra, SparseArrays, Test, LinearAlgebra,
BlockBandedMatrices, ArrayInterfaceCore, BandedMatrices,
ArrayInterfaceBlockBandedMatrices
BlockBandedMatrices, ArrayInterface, BandedMatrices

fcalls = 0
function f(dx, x)
Expand Down Expand Up @@ -110,12 +109,12 @@ end
x = rand(10000)
Jbbb = BandedBlockBandedMatrix(Ones(10000, 10000), fill(100, 100), fill(100, 100), (1, 1), (1, 1))
Jsparse = sparse(Jbbb)
colorsbbb = ArrayInterfaceCore.matrix_colors(Jbbb)
colorsbbb = ArrayInterface.matrix_colors(Jbbb)
FiniteDiff.finite_difference_jacobian!(Jbbb, f, x, colorvec=colorsbbb)
FiniteDiff.finite_difference_jacobian!(Jsparse, f, x, colorvec=colorsbbb)
@test Jbbb Jsparse
Jbb = BlockBandedMatrix(similar(Jsparse), fill(100, 100), fill(100, 100), (1, 1));
colorsbb = ArrayInterfaceCore.matrix_colors(Jbb)
colorsbb = ArrayInterface.matrix_colors(Jbb)
FiniteDiff.finite_difference_jacobian!(Jbb, f, x, colorvec=colorsbb)
@test Jbb Jsparse

Expand Down Expand Up @@ -164,7 +163,7 @@ end
A = [[1 1; 0 1], [1 1 1], [1.0 1.0; 1.0 1.0; 1.0 1.0], [true true; true true]]
for a in A
rows_index, cols_index = FiniteDiff._findstructralnz(a)
rows_index2, cols_index2 = ArrayInterfaceCore.findstructralnz(sparse(a))
rows_index2, cols_index2 = ArrayInterface.findstructralnz(sparse(a))
@test (rows_index, cols_index) == (rows_index2, cols_index2)
end

Expand Down

0 comments on commit 5afccd9

Please sign in to comment.