Skip to content

Commit

Permalink
Eliminate speye from miscellaneous tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 committed Oct 27, 2017
1 parent a1e0217 commit de94506
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ end
@test m[1,2] == ([2,4],)

# issue #21123
@test mapslices(nnz, speye(3), 1) == [1 1 1]
@test mapslices(nnz, sparse(1.0I, 3), 1) == [1 1 1]
end

@testset "single multidimensional index" begin
Expand Down
2 changes: 1 addition & 1 deletion test/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ vals = Any[
Dict(x => x for x in 1:10),
Dict(7=>7,9=>9,4=>4,10=>10,2=>2,3=>3,8=>8,5=>5,6=>6,1=>1),
[], [1], [2], [1, 1], [1, 2], [1, 3], [2, 2], [1, 2, 2], [1, 3, 3],
zeros(2, 2), spzeros(2, 2), eye(2, 2), speye(2, 2),
zeros(2, 2), spzeros(2, 2), eye(2, 2), sparse(1.0I, 2),
sparse(ones(2, 2)), ones(2, 2), sparse([0 0; 1 0]), [0 0; 1 0],
[-0. 0; -0. 0.], SparseMatrixCSC(2, 2, [1, 3, 3], [1, 2], [-0., -0.])
]
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/arnoldi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let
# Adjust the tolerance a bit since matrices with repeated eigenvalues
# can be very stressful to ARPACK and this may therefore fail with
# info = 3 if the tolerance is too small
@test eigs(speye(50), nev=10, tol = 5e-16)[1] ones(10) #Issue 4246
@test eigs(sparse(1.0I, 50), nev=10, tol = 5e-16)[1] ones(10) #Issue 4246
end

@testset "real svds" begin
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ end
annotations = testfull ? (triannotations..., symannotations...) : (LowerTriangular, Symmetric)
# Concatenations involving these types, un/annotated, should yield sparse arrays
spvec = spzeros(N)
spmat = speye(N)
spmat = sparse(1.0I, N)
diagmat = Diagonal(ones(N))
bidiagmat = Bidiagonal(ones(N), ones(N-1), :U)
tridiagmat = Tridiagonal(ones(N-1), ones(N), ones(N-1))
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/uniformscaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let
@test B + I == B + eye(B)
@test I + B == B + eye(B)
AA = randn(2, 2)
for SS in (sprandn(3,3, 0.5), speye(Int, 3))
for SS in (sprandn(3,3, 0.5), sparse(Int(1)I, 3))
for (A, S) in ((AA, SS), (view(AA, 1:2, 1:2), view(SS, 1:3, 1:3)))
@test @inferred(A + I) == A + eye(A)
@test @inferred(I + A) == A + eye(A)
Expand Down
6 changes: 3 additions & 3 deletions test/perf/kernel/getdivgrad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#----------------- Get the A matrix
function getDivGrad(n1,n2,n3)
# the Divergence
D1 = kron(speye(n3),kron(speye(n2),ddx(n1)))
D2 = kron(speye(n3),kron(ddx(n2),speye(n1)))
D3 = kron(ddx(n3),kron(speye(n2),speye(n1)))
D1 = kron(sparse(1.0I, n3), kron(sparse(1.0I, n2), ddx(n1)))
D2 = kron(sparse(1.0I, n3), kron(ddx(n2), sparse(1.0I, n1)))
D3 = kron(ddx(n3), kron(sparse(1.0I, n2), sparse(1.0I, n1)))
# DIV from faces to cell-centers
Div = [D1 D2 D3]

Expand Down
2 changes: 1 addition & 1 deletion test/perf/sparse/fem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function fdlaplacian(N)
# create a 1D laplacian and a sparse identity
fdl1 = spdiagm(-1 => ones(N-1), 0 => -2*ones(N), 1 => ones(N-1))
# laplace operator on the full grid
return kron(speye(N), fdl1) + kron(fdl1, speye(N))
return kron(sparse(1.0I, N), fdl1) + kron(fdl1, sparse(1.0I, N))
end

# get the list of boundary dof-indices
Expand Down
2 changes: 1 addition & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ end
# issue #12960
mutable struct T12960 end
let
A = speye(3)
A = sparse(1.0I, 3)
B = similar(A, T12960)
@test sprint(show, B) == "\n [1, 1] = #undef\n [2, 2] = #undef\n [3, 3] = #undef"
@test sprint(print, B) == "\n [1, 1] = #undef\n [2, 2] = #undef\n [3, 3] = #undef"
Expand Down

0 comments on commit de94506

Please sign in to comment.