Skip to content

Commit

Permalink
add additional assert
Browse files Browse the repository at this point in the history
  • Loading branch information
IlianPihlajamaa committed Sep 16, 2023
1 parent cdc3663 commit d3619db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/problems/basic_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ struct DataIntegralProblem{Y, X, D, K} <: AbstractIntegralProblem{false}
@add_kwonly function DataIntegralProblem(y::AbstractArray, x::AbstractVector;
dim = 1,
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)
Expand Down

0 comments on commit d3619db

Please sign in to comment.