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.IntegralFunctionType
IntegralFunction(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.InplaceIntegralFunctionType
InplaceIntegralFunction(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.InplaceBatchIntegralFunctionType
InplaceBatchIntegralFunction(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.CommonSolveIntegralFunctionType
CommonSolveIntegralFunction(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.FourierIntegralFunctionType
FourierIntegralFunction(f, s, [prototype=nothing]; alias=false)

Arguments

  • f: The integrand, accepting inputs f(x, s(x), p)
  • s::AbstractFourierSeries: The Fourier series to evaluate
  • prototype:
  • alias::Bool: whether to deepcopy the series (false) or use the series as-is (true)
AutoBZCore.CommonSolveFourierIntegralFunctionType
CommonSolveFourierIntegralFunction(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.