Skip to content

Commit

Permalink
Change to ArrayInterfaceCore
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed May 22, 2022
1 parent dc47f79 commit 4abd093
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["Kanav Gupta <[email protected]>"]
version = "0.3.16"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
Expand All @@ -18,7 +18,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
ArrayInterface = "3, 4, 5"
ArrayInterfaceCore = "0.1.1"
FiniteDiff = "2"
ForwardDiff = "0.10.3"
IterativeSolvers = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Setfield
using StaticArrays
using RecursiveArrayTools
using LinearAlgebra
import ArrayInterface
import ArrayInterfaceCore
import IterativeSolvers
import RecursiveFactorization

Expand Down
6 changes: 3 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function (p::DefaultLinSolve)(x,A,b,update_matrix=false;tol=nothing, kwargs...)
#
# RecursiveFactorization seems to be consistantly winning below 100
# https://discourse.julialang.org/t/ann-recursivefactorization-jl/39213
if ArrayInterface.can_setindex(x) && (size(A,1) <= 100 || ((blasvendor === :openblas || blasvendor === :openblas64) && size(A,1) <= 500))
if ArrayInterfaceCore.can_setindex(x) && (size(A,1) <= 100 || ((blasvendor === :openblas || blasvendor === :openblas64) && size(A,1) <= 500))
p.A = RecursiveFactorization.lu!(A)
else
p.A = lu!(A)
Expand All @@ -141,7 +141,7 @@ function (p::DefaultLinSolve)(x,A,b,update_matrix=false;tol=nothing, kwargs...)
p.A = bunchkaufman!(A)
elseif typeof(A) <: SparseMatrixCSC
p.A = lu(A)
elseif ArrayInterface.isstructured(A)
elseif ArrayInterfaceCore.isstructured(A)
p.A = factorize(A)
elseif !(typeof(A) <: AbstractDiffEqOperator)
# Most likely QR is the one that is overloaded
Expand All @@ -156,7 +156,7 @@ function (p::DefaultLinSolve)(x,A,b,update_matrix=false;tol=nothing, kwargs...)
# Missing a little bit of efficiency in a rare case
#elseif typeof(A) <: DiffEqArrayOperator
# ldiv!(x,p.A,b)
elseif ArrayInterface.isstructured(A) || A isa SparseMatrixCSC
elseif ArrayInterfaceCore.isstructured(A) || A isa SparseMatrixCSC
ldiv!(x,p.A,b)
elseif typeof(A) <: AbstractDiffEqOperator
# No good starting guess, so guess zero
Expand Down

0 comments on commit 4abd093

Please sign in to comment.