@@ -41,9 +41,9 @@ struct LinearInterpolationIntInv{uType, tType, itpType, T} <:
4141 extrapolation_right:: ExtrapolationType.T
4242 iguesser:: Guesser{tType}
4343 itp:: itpType
44- function LinearInterpolationIntInv (u, t, A)
44+ function LinearInterpolationIntInv (u, t, A, extrapolation_left, extrapolation_right )
4545 new {typeof(u), typeof(t), typeof(A), eltype(u)} (
46- u, t, A . extrapolation_left, A . extrapolation_right, Guesser (t), A)
46+ u, t, extrapolation_left, extrapolation_right, Guesser (t), A)
4747 end
4848end
4949
@@ -57,9 +57,14 @@ function get_I(A::AbstractInterpolation)
5757 I
5858end
5959
60- function invert_integral (A:: LinearInterpolation{<:AbstractVector{<:Number}} )
60+ function invert_integral (
61+ A:: LinearInterpolation{<:AbstractVector{<:Number}} ;
62+ extrapolation_left:: ExtrapolationType.T = A. extrapolation_left,
63+ extrapolation_right:: ExtrapolationType.T = A. extrapolation_right)
6164 ! invertible_integral (A) && throw (IntegralNotInvertibleError ())
62- return LinearInterpolationIntInv (A. t, get_I (A), A)
65+
66+ return LinearInterpolationIntInv (
67+ A. t, get_I (A), A, extrapolation_left, extrapolation_right)
6368end
6469
6570function _interpolate (
@@ -92,9 +97,10 @@ struct ConstantInterpolationIntInv{uType, tType, itpType, T} <:
9297 extrapolation_right:: ExtrapolationType.T
9398 iguesser:: Guesser{tType}
9499 itp:: itpType
95- function ConstantInterpolationIntInv (u, t, A)
100+ function ConstantInterpolationIntInv (
101+ u, t, A, extrapolation_left, extrapolation_right)
96102 new {typeof(u), typeof(t), typeof(A), eltype(u)} (
97- u, t, A . extrapolation_left, A . extrapolation_right, Guesser (t), A
103+ u, t, extrapolation_left, extrapolation_right, Guesser (t), A
98104 )
99105 end
100106end
@@ -103,9 +109,12 @@ function invertible_integral(A::ConstantInterpolation{<:AbstractVector{<:Number}
103109 return all (A. u .> 0 )
104110end
105111
106- function invert_integral (A:: ConstantInterpolation{<:AbstractVector{<:Number}} )
112+ function invert_integral (A:: ConstantInterpolation{<:AbstractVector{<:Number}} ;
113+ extrapolation_left:: ExtrapolationType.T = A. extrapolation_left,
114+ extrapolation_right:: ExtrapolationType.T = A. extrapolation_right)
107115 ! invertible_integral (A) && throw (IntegralNotInvertibleError ())
108- return ConstantInterpolationIntInv (A. t, get_I (A), A)
116+ return ConstantInterpolationIntInv (
117+ A. t, get_I (A), A, extrapolation_left, extrapolation_right)
109118end
110119
111120function _interpolate (
0 commit comments