Skip to content

Commit

Permalink
Merge pull request #498 from IlianPihlajamaa/patch-1
Browse files Browse the repository at this point in the history
remove Value type requirement from SampledIntegralProblem
  • Loading branch information
ChrisRackauckas authored Sep 20, 2023
2 parents 8d293bf + d70980e commit cb2f739
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/problems/basic_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,18 +426,18 @@ SampledIntegralProblem(y::AbstractArray, x::AbstractVector; dim=ndims(y), kwargs
The fields match the names of the constructor arguments.
"""
struct SampledIntegralProblem{Y, X, D, K} <: AbstractIntegralProblem{false}
struct SampledIntegralProblem{Y, X, K} <: AbstractIntegralProblem{false}
y::Y
x::X
dim::D
dim::Int
kwargs::K
@add_kwonly function SampledIntegralProblem(y::AbstractArray, x::AbstractVector;
dim = ndims(y),
kwargs...)
@assert dim <= ndims(y) "The integration dimension `dim` is larger than the number of dimensions of the integrand `y`"
@assert length(x)==size(y, dim) "The integrand `y` must have the same length as the sampling points `x` along the integrated dimension."
@assert axes(x, 1)==axes(y, dim) "The integrand `y` must obey the same indexing as the sampling points `x` along the integrated dimension."
new{typeof(y), typeof(x), Val{dim}, typeof(kwargs)}(y, x, Val(dim), kwargs)
new{typeof(y), typeof(x), typeof(kwargs)}(y, x, dim, kwargs)
end
end

Expand Down

0 comments on commit cb2f739

Please sign in to comment.