Skip to content

Commit

Permalink
run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner committed Feb 8, 2024
1 parent 29d5aa9 commit ab41468
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ tries to do this with a bump allocator.

- See the [SciML Style Guide](https://github.com/SciML/SciMLStyle) for common coding practices and other style decisions.
- There are a few community forums:

+ The #diffeq-bridged and #sciml-bridged channels in the
[Julia Slack](https://julialang.org/slack/)
+ The #diffeq-bridged and #sciml-bridged channels in the
Expand Down
12 changes: 6 additions & 6 deletions src/PreallocationTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct FixedSizeDiffCache{T <: AbstractArray, S <: AbstractArray}
end

function FixedSizeDiffCache(u::AbstractArray{T}, siz,
::Type{Val{chunk_size}}) where {T, chunk_size}
::Type{Val{chunk_size}}) where {T, chunk_size}
x = ArrayInterface.restructure(u,
zeros(ForwardDiff.Dual{nothing, T, chunk_size},
siz...))
Expand All @@ -25,8 +25,8 @@ and for the `Dual` version of `u`, allowing use of pre-cached vectors with
forward-mode automatic differentiation.
"""
function FixedSizeDiffCache(u::AbstractArray,
::Type{Val{N}} = Val{ForwardDiff.pickchunksize(length(u))}) where {
N,
::Type{Val{N}} = Val{ForwardDiff.pickchunksize(length(u))}) where {
N,
}
FixedSizeDiffCache(u, size(u), Val{N})
end
Expand Down Expand Up @@ -75,7 +75,7 @@ function get_tmp(dc::FixedSizeDiffCache, u::Union{Number, AbstractArray})
end
end

function get_tmp(dc::FixedSizeDiffCache, ::Type{T}) where T <: Number
function get_tmp(dc::FixedSizeDiffCache, ::Type{T}) where {T <: Number}
if promote_type(eltype(dc.du), T) <: eltype(dc.du)
dc.du
else
Expand Down Expand Up @@ -111,7 +111,7 @@ forward-mode automatic differentiation. Supports nested AD via keyword `levels`
or specifying an array of chunk_sizes.
"""
function DiffCache(u::AbstractArray, N::Int = ForwardDiff.pickchunksize(length(u));
levels::Int = 1)
levels::Int = 1)
DiffCache(u, size(u), N * ones(Int, levels))
end
DiffCache(u::AbstractArray, N::AbstractArray{<:Int}) = DiffCache(u, size(u), N)
Expand Down Expand Up @@ -164,7 +164,7 @@ function get_tmp(dc::DiffCache, u::Union{Number, AbstractArray})
end
end

function get_tmp(dc::DiffCache, ::Type{T}) where T <: Number
function get_tmp(dc::DiffCache, ::Type{T}) where {T <: Number}
if promote_type(eltype(dc.du), T) <: eltype(dc.du)
dc.du
else
Expand Down

0 comments on commit ab41468

Please sign in to comment.