Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize I and E types #19

Closed
matbesancon opened this issue Jun 2, 2018 · 1 comment · Fixed by #36
Closed

Parametrize I and E types #19

matbesancon opened this issue Jun 2, 2018 · 1 comment · Fixed by #36

Comments

@matbesancon
Copy link

Right now the I and E types (returned from QuadGK) seem undefined in Segment:

# integration segment (a,b), estimated integral I, and estimated error E
struct Segment
    a::Number
    b::Number
    I
    E
end
isless(i::Segment, j::Segment) = isless(i.E, j.E)

It could be replaced by something like:

struct Segment{T<:Real}
    a::Number
    b::Number
    I::T
    E::T
end
isless(i::Segment, j::Segment) = isless(i.E, j.E)
@stevengj
Copy link
Member

stevengj commented Jun 2, 2018

The problem is that these depend on the return type of the integrand. Some complicated logic is required to handle the case where the integrand is type-unstable if you want to concretely type these fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants