Integrands
The design of AutoBZCore.jl uses multiple dispatch to provide multiple interfaces for user integrands that allow various optimizations to be compatible with a common interface for solvers.
AutoBZCore.IntegralFunction
— TypeIntegralFunction(f, [prototype=nothing])
Constructor for an out-of-place integrand of the form f(x, p)
. Optionally, a prototype
can be provided for the output of the function.
AutoBZCore.InplaceIntegralFunction
— TypeInplaceIntegralFunction(f!, prototype::AbstractArray)
Constructor for an inplace integrand of the form f!(y, x, p)
. A prototype
array is required to store the same type and size as the result, y
.
AutoBZCore.InplaceBatchIntegralFunction
— TypeInplaceBatchIntegralFunction(f!, prototype; max_batch::Integer=typemax(Int))
Constructor for an inplace, batched integrand of the form f!(y, x, p)
that accepts an array x
containing a batch of evaluation points stored along the last axis of the array. A prototype
array is required to store the same type and size as the result, y
, however the last axis, which is reserved for batching, which should contain at least one element. The max_batch
keyword sets a soft limit on the number of points batched simultaneously.
AutoBZCore.CommonSolveIntegralFunction
— TypeCommonSolveIntegralFunction(prob, alg, update!, postsolve, [prototype, specialize]; kws...)
Constructor for an integrand that solves a problem defined with the CommonSolve.jl interface, prob
, which is instantiated using init(prob, alg; kws...)
. Helper functions include: update!(cache, x, p)
is called before solve!(cache)
, followed by postsolve(sol, x, p)
, which should return the value of the solution. The prototype
argument can help control how much to specialize
on the type of the problem, which defaults to FullSpecialize()
so that run times are improved. However FunctionWrapperSpecialize()
may help reduce compile times.
AutoBZCore.FourierIntegralFunction
— TypeFourierIntegralFunction(f, s, [prototype=nothing]; alias=false)
Arguments
f
: The integrand, accepting inputsf(x, s(x), p)
s::AbstractFourierSeries
: The Fourier series to evaluateprototype
:alias::Bool
: whether todeepcopy
the series (false) or use the series as-is (true)
AutoBZCore.CommonSolveFourierIntegralFunction
— TypeCommonSolveFourierIntegralFunction(prob, alg, update!, postsolve, s, [prototype, specialize]; alias=false, kws...)
Constructor for an integrand that solves a problem defined with the CommonSolve.jl interface, prob
, which is instantiated using init(prob, alg; kws...)
. Helper functions include: update!(cache, x, s(x), p)
is called before solve!(cache)
, followed by postsolve(sol, x, s(x), p)
, which should return the value of the solution. The prototype
argument can help control how much to specialize
on the type of the problem, which defaults to FullSpecialize()
so that run times are improved. However FunctionWrapperSpecialize()
may help reduce compile times.