From 9dee3375d3f04fa006f2140589fdad566c00ff9f Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Fri, 10 Feb 2023 18:21:25 +0100 Subject: [PATCH 1/2] Adjust to `TransposeFactorization` --- Project.toml | 2 +- src/SparseMatrixCSR.jl | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 1a11c06..8145cb7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SparseMatricesCSR" uuid = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" authors = ["VĂ­ctor Sande ", "Francesc Verdugo "] -version = "0.6.7" +version = "0.6.8" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 58f31f0..dc1567e 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -133,27 +133,31 @@ end function LinearAlgebra.lu(a::SparseMatrixCSR{0}) rowptr = _copy_and_increment(a.rowptr) colval = _copy_and_increment(a.colval) - Transpose(lu(SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) + transpose(lu(SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) end function LinearAlgebra.lu(a::SparseMatrixCSR{1}) - Transpose(lu(SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) + transpose(lu(SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) end if Base.USE_GPL_LIBS +const TransposeFact = isdefined(LinearAlgebra, :TransposeFact) ? + LinearAlgebra.TransposeFact : + Transpose + function LinearAlgebra.lu!( - translu::Transpose{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, + translu::TransposeFact{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, a::SparseMatrixCSR{1}) where {T} - Transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) + transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) end function LinearAlgebra.lu!( - translu::Transpose{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, + translu::TransposeFact{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, a::SparseMatrixCSR{0}) where {T} rowptr = _copy_and_increment(a.rowptr) colval = _copy_and_increment(a.colval) - Transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) + transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) end end # Base.USE_GPL_LIBS From f37435f4996b22901738eef6324e44d732d8f92a Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Sat, 11 Feb 2023 18:00:54 +0100 Subject: [PATCH 2/2] fix typo --- src/SparseMatrixCSR.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index dc1567e..ff3af1b 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -142,8 +142,8 @@ end if Base.USE_GPL_LIBS -const TransposeFact = isdefined(LinearAlgebra, :TransposeFact) ? - LinearAlgebra.TransposeFact : +const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? + LinearAlgebra.TransposeFactorization : Transpose function LinearAlgebra.lu!(