Skip to content

Commit 0d6a94d

Browse files
Revert "Adding support for lu/lu! + SparseMatrixCSR{1}"
This reverts commit 0a708a6.
1 parent 0a708a6 commit 0d6a94d

File tree

5 files changed

+2
-32
lines changed

5 files changed

+2
-32
lines changed

.vscode/settings.json

-2
This file was deleted.

Project.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.6.2"
66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
88
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
9-
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
109

1110
[compat]
1211
julia = "1"

src/SparseMatricesCSR.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ module SparseMatricesCSR
22

33
using SparseArrays
44
using LinearAlgebra
5-
using SuiteSparse
65

76
import Base: convert, copy, size, getindex, show, count, *, IndexStyle
8-
import LinearAlgebra: mul!, lu, lu!
7+
import LinearAlgebra: mul!
98
import SparseArrays: nnz, getnzval, nonzeros, nzrange
109
import SparseArrays: findnz, rowvals, getnzval, issparse
1110

src/SparseMatrixCSR.jl

-14
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,6 @@ function Base.copy(a::SparseMatrixCSR{Bi}) where Bi
118118
SparseMatrixCSR{Bi}(a.m,a.n,copy(a.rowptr),copy(a.colval),copy(a.nzval))
119119
end
120120

121-
function LinearAlgebra.lu(a::SparseMatrixCSR{0})
122-
@assert false "Base.lu(a::SparseMatrixCSR{0}) not yet implemented"
123-
end
124-
125-
function LinearAlgebra.lu(a::SparseMatrixCSR{1})
126-
Transpose(lu(SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval)))
127-
end
128-
129-
function LinearAlgebra.lu!(
130-
translu::Transpose{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}},
131-
a::SparseMatrixCSR{1}) where {T}
132-
Transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval)))
133-
end
134-
135121
size(S::SparseMatrixCSR) = (S.m, S.n)
136122
IndexStyle(::Type{<:SparseMatrixCSR}) = IndexCartesian()
137123
function getindex(A::SparseMatrixCSR{Bi,T}, i0::Integer, i1::Integer) where {Bi,T}

test/SparseMatrixCSR.jl

+1-13
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function test_csr(Bi,Tv,Ti)
8282
@test y z
8383

8484
@test CSR*x CSC*x
85+
8586
end
8687

8788
for Bi in (0,1)
@@ -92,17 +93,4 @@ for Bi in (0,1)
9293
end
9394
end
9495

95-
I = [1,1,2,2,2,3,3]
96-
J = [1,2,1,2,3,2,3]
97-
V = [4.0,1.0,-1.0,4.0,1.0,-1.0,4.0]
98-
CSR=sparsecsr(I,J,V)
99-
CSC=sparse(I,J,V)
100-
x=rand(3)
101-
@test norm(CSR\x-CSC\x) < 1.0e-14
102-
fact=lu(CSR)
103-
lu!(fact,CSR)
104-
y=similar(x)
105-
ldiv!(y,fact,x)
106-
@test norm(y-CSC\x) < 1.0e-14
107-
10896
end # module

0 commit comments

Comments
 (0)