Skip to content

Commit

Permalink
Simplify overly specific methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tkemmer committed Sep 10, 2024
1 parent c005e6d commit 72a5c76
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/base/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ Exponent ``1/Λ`` for the fundamental solution of the yukawa operator
# Return type
`T`
"""
@inline yukawa(opt::Option{T}) where T = (opt.εΣ/opt.ε∞)/opt.λ
@inline yukawa(opt::Option) = (opt.εΣ/opt.ε∞)/opt.λ
6 changes: 3 additions & 3 deletions src/base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and area. Returns the completely initialized Triangle as a copy.
# Return type
`Triangle`
"""
function props(elem::Triangle{T}) where T
function props(elem::Triangle)
# reject degenerate triangles
@assert !isdegenerate(elem) "Degenerate triangle $(elem)"

Expand Down Expand Up @@ -397,7 +397,7 @@ Fast Euclidean norm for 3-element vectors.
# Return type
`T`
"""
@inline function _norm(u::AbstractVector{T}) where T
@inline function _norm(u::AbstractVector)
_dot(u, u)
end

Expand All @@ -412,7 +412,7 @@ IDs of the vector elements to the corresponding position in the vector.
# Return type
`Dict{UInt, UInt}`
"""
@inline function reverseindex(v::AbstractVector{T}) where T
@inline function reverseindex(v::AbstractVector)
Dict{UInt, UInt}(objectid(e) => i for (i,e) in enumerate(v))
end

Expand Down
2 changes: 1 addition & 1 deletion src/bem/local.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct LocalSystemMatrix{T} <: AbstractArray{T, 2}
params::Option{T}
end

Base.size(A::LocalSystemMatrix{T}) where T = size(A.K)
@inline Base.size(A::LocalSystemMatrix) = size(A.K)

function LinearAlgebra.diag(
A::LocalSystemMatrix{T},
Expand Down
2 changes: 1 addition & 1 deletion src/bem/nonlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct NonlocalSystemMatrix{T} <: AbstractArray{T, 2}
end
end

Base.size(A::NonlocalSystemMatrix{T}) where T = 3 .* size(A.K)
@inline Base.size(A::NonlocalSystemMatrix) = 3 .* size(A.K)

function LinearAlgebra.diag(A::NonlocalSystemMatrix{T}, k::Int = 0) where T
k != 0 && error("diag not defined for k != 0 on ", typeof(A))
Expand Down

0 comments on commit 72a5c76

Please sign in to comment.