Skip to content

Usage of \times and .. symbols in documentation #212

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

Closed
cmdenis opened this issue Dec 2, 2024 · 3 comments
Closed

Usage of \times and .. symbols in documentation #212

cmdenis opened this issue Dec 2, 2024 · 3 comments

Comments

@cmdenis
Copy link

cmdenis commented Dec 2, 2024

I've been trying to go through the examples in the documentation here https://juliaintervals.github.io/IntervalRootFinding.jl/stable/

julia> function g( (x1, x2, x3) )
           return SVector(x1^2 + x2^2 + x3^2 - 1,
                          x1^2 + x3^2 - 0.25,
                          x1^2 + x2^2 - 4x3
                         )
       end
g (generic function with 1 method)

julia> X = -5..5
[-5, 5]

julia> rts = roots(g, X × X × X)
4-element Array{Root{IntervalBox{3,Float64}},1}:
 Root([0.440762, 0.440763] × [0.866025, 0.866026] × [0.236067, 0.236068], :unique)
 Root([0.440762, 0.440763] × [-0.866026, -0.866025] × [0.236067, 0.236068], :unique)
 Root([-0.440763, -0.440762] × [0.866025, 0.866026] × [0.236067, 0.236068], :unique)
 Root([-0.440763, -0.440762] × [-0.866026, -0.866025] × [0.236067, 0.236068], :unique)

However, it seems like the notation for the interval .. doesn't work "right out of the box" for me at least. I need to import it via

using IntervalArithmetic.Symbols

Perhaps the documentation could use the function interval instead of the .. notation?

Furthermore, I am unsure where the × operator comes from, but I can't seem to use it either. When trying to use it, I get the error message: UndefVarError: '×' not defined in 'Main.var"workspace#24"'.

I'm running my this code in a Pluto notebook (on MacBook Pro M3), using IntervalArithmetic v0.22.19, IntervalRootFinding v0.6.0 and Pluto v0.20.3 on Julia Version 1.11.1 (2024-10-16).

Is this perhaps a problem on my end?

(Edit: I now see that the × operator comes from the IntervalBoxes package)

@cmdenis
Copy link
Author

cmdenis commented Dec 2, 2024

Similarly, it seems like the IntervalBox function (used here)
belongs to the IntervalBoxes package and not to the IntervalArithmetic package. I get an UndefVarError for IntervalBox when trying

using IntervalArithmetic
IntervalBox(interval(1, 3), interval(1, 3))

but none with

using IntervalArithmetic, IntervalBoxes
IntervalBox(interval(1, 3), interval(1, 3))

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 2, 2024

Somehow, the docs was not updated correctly with the latest release.

While I am investigating the issue (any idea @lucaferranti ?), the doc for v0.6 can be found here https://juliaintervals.github.io/IntervalRootFinding.jl/dev/

You need to load the IntervalArithmetics.Symbols package, as you already noticed, but otherwise everything should be working (I just tested it). In particular, you don't need IntervalBoxes, the example don't use them anymore.

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 2, 2024

I have now pushed a new version of the doc, and the stable doc now is up-to-date.

Thanks a lot for reporting, and feel free to open a new issue if something else is not clear or not working with the example or the doc.

@Kolaru Kolaru closed this as completed Dec 2, 2024
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

No branches or pull requests

2 participants