-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move the
BandedArrays
extension
- Loading branch information
Showing
6 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
lib/NonlinearSolveBase/ext/NonlinearSolveBaseBandedMatricesExt.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module NonlinearSolveBaseBandedMatricesExt | ||
|
||
using BandedMatrices: BandedMatrix | ||
using LinearAlgebra: Diagonal | ||
using NonlinearSolveBase: NonlinearSolveBase, Utils | ||
|
||
# This is used if we vcat a Banded Jacobian with a Diagonal Matrix in Levenberg | ||
@inline function Utils.faster_vcat(B::BandedMatrix, D::Diagonal) | ||
if Utils.is_extension_loaded(Val(:SparseArrays)) | ||
@warn "Load `SparseArrays` for an optimized vcat for BandedMatrices." | ||
return vcat(B, D) | ||
end | ||
return vcat(Utils.make_sparse(B), D) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,4 +144,6 @@ function evaluate_f!!(f::NonlinearFunction, fu, u, p) | |
return f(u, p) | ||
end | ||
|
||
function make_sparse end | ||
|
||
end |