Skip to content

Commit

Permalink
Add assertion AbstractPanels{TK<:AbstractKernel}; add kernel_multipli…
Browse files Browse the repository at this point in the history
…city(<:AbstractKernel)
  • Loading branch information
EdoAlvarezR committed Oct 3, 2024
1 parent 505910a commit ac78e2a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/fmm/types.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
abstract type AbstractPanels{TK,TF,NK,NS} end

abstract type AbstractKernel{M} end

abstract type AbstractRotatedKernel{M} <: AbstractKernel{M} end

abstract type AbstractUnrotatedKernel{M} <: AbstractKernel{M} end

abstract type AbstractPanels{TK<:AbstractKernel, TF, NK, NS} end

@inline kernel_multiplicity(::AbstractKernel{M}) where M = M

function kernel_multiplicity(type::Type)
if type <: AbstractKernel
return type.parameters[1]
else
error("Requested kernel multiplicity over invalid type $(type)")
end
end

0 comments on commit ac78e2a

Please sign in to comment.