API
Main interface
IntervalRootFinding.branch_and_prune
— Methodbranch_and_prune(X, contractor, search_order, tol)
Generic branch and prune routine for finding isolated roots using the given contractor to determine the status of a given box X
.
See the documentation of the roots
function for explanation of the other arguments.
Polynomials.roots
— Methodroots(f, X, contractor=Newton, search_order=BreadthFirst, tol=1e-15)
+API · IntervalRootFinding.jl API
Main interface
IntervalRootFinding.branch_and_prune
— Methodbranch_and_prune(X, contractor, search_order, tol)
Generic branch and prune routine for finding isolated roots using the given contractor to determine the status of a given box X
.
See the documentation of the roots
function for explanation of the other arguments.
sourcePolynomials.roots
— Methodroots(f, X, contractor=Newton, search_order=BreadthFirst, tol=1e-15)
roots(f, deriv, X, contractor=Newton, search_order=BreadthFirst, tol=1e-15)
roots(f, X, contractor, tol)
-roots(f, deriv, X, contractor, tol)
Uses a generic branch and prune routine to find in principle all isolated roots of a function f:R^n → R^n
in a region X
, if the number of roots is finite.
Inputs:
f
: function whose roots will be foundX
: Interval
or IntervalBox
in which roots are searchedcontractor
: function that, when applied to the function f
, determines the status of a given box X
. It returns the new box and a symbol indicating the status. Current possible values are Bisection
, Newton
and Krawczyk
deriv
: explicit derivative of f
for Newton
and Krawczyk
search_order
: SearchStrategy
determining the order in which regions are processed.tol
: Absolute tolerance. If a region has a diameter smaller than tol
, it is returned with status :unknown
.
sourceRoot
object
IntervalRootFinding.Root
— TypeRoot
Object representing a possible root inside a given region. The field status
is either :unknown
or :unique
. If status
is :unique
then we know that there is a unique root of the function in question inside the given region.
Internally the status may also be :empty
for region guaranteed to contain no root, however such Root
s are discarded by default and thus never returned by the roots
function.
Fields
interval
: a region (either Interval
of IntervalBox
) searched for roots.status
: the status of the region, valid values are :empty
, unknown
and :unique
.
sourceIntervalRootFinding.isunique
— Methodisunique(rt)
Return whether a Root
is unique.
sourceIntervalRootFinding.root_region
— Methodroot_region(rt)
Return the region associated to a Root
.
sourceIntervalRootFinding.root_status
— Methodroot_status(rt)
Return the status of a Root
.
sourceContractors
IntervalRootFinding.AbstractContractor
— TypeAbstractContractor{F}
Abstract type for contractors.
sourceIntervalRootFinding.Bisection
— TypeBisection{F} <: AbstractContractor{F}
AbstractContractor type for the bisection method.
sourceIntervalRootFinding.Krawczyk
— TypeKrawczyk{F, FP} <: AbstractContractor{F}
AbstractContractor type for the interval Krawczyk method.
Fields
- `f::F`: function whose roots are searched
+roots(f, deriv, X, contractor, tol)
Uses a generic branch and prune routine to find in principle all isolated roots of a function f:R^n → R^n
in a region X
, if the number of roots is finite.
Inputs:
f
: function whose roots will be foundX
: Interval
or IntervalBox
in which roots are searchedcontractor
: function that, when applied to the function f
, determines the status of a given box X
. It returns the new box and a symbol indicating the status. Current possible values are Bisection
, Newton
and Krawczyk
deriv
: explicit derivative of f
for Newton
and Krawczyk
search_order
: SearchStrategy
determining the order in which regions are processed.tol
: Absolute tolerance. If a region has a diameter smaller than tol
, it is returned with status :unknown
.
sourceRoot
object
IntervalRootFinding.Root
— TypeRoot
Object representing a possible root inside a given region. The field status
is either :unknown
or :unique
. If status
is :unique
then we know that there is a unique root of the function in question inside the given region.
Internally the status may also be :empty
for region guaranteed to contain no root, however such Root
s are discarded by default and thus never returned by the roots
function.
Fields
interval
: a region (either Interval
of IntervalBox
) searched for roots.status
: the status of the region, valid values are :empty
, unknown
and :unique
.
sourceIntervalRootFinding.isunique
— Methodisunique(rt)
Return whether a Root
is unique.
sourceIntervalRootFinding.root_region
— Methodroot_region(rt)
Return the region associated to a Root
.
sourceIntervalRootFinding.root_status
— Methodroot_status(rt)
Return the status of a Root
.
sourceContractors
IntervalRootFinding.AbstractContractor
— TypeAbstractContractor{F}
Abstract type for contractors.
sourceIntervalRootFinding.Bisection
— TypeBisection{F} <: AbstractContractor{F}
AbstractContractor type for the bisection method.
sourceIntervalRootFinding.Krawczyk
— TypeKrawczyk{F, FP} <: AbstractContractor{F}
AbstractContractor type for the interval Krawczyk method.
Fields
- `f::F`: function whose roots are searched
- `f::FP`: derivative or jacobian of `f`
(K::Krawczyk)(X ; α=where_bisect)
Contract an interval X
using Krawczyk operator and return the contracted interval together with its status.
Inputs
- `R`: Root object containing the interval to contract.
-- `α`: Point of bisection of intervals.
sourceIntervalRootFinding.Newton
— TypeNewton{F, FP} <: AbstractContractor{F}
AbstractContractor type for the interval Newton method.
Fields
- `f::F`: function whose roots are searched
+- `α`: Point of bisection of intervals.
sourceIntervalRootFinding.Newton
— TypeNewton{F, FP} <: AbstractContractor{F}
AbstractContractor type for the interval Newton method.
Fields
- `f::F`: function whose roots are searched
- `f::FP`: derivative or jacobian of `f`
(N::Newton)(X, α=where_bisect)
Contract an interval X
using Newton operator and return the contracted interval together with its status.
Inputs
- `R`: Root object containing the interval to contract.
-- `α`: Point of bisection of intervals.
sourceIntervalRootFinding.contract
— Methodcontract(contractor, R)
Contract the region R using the given contractor.
sourceIntervalRootFinding.refine
— Methodrefine(op, X::Tuple{Symbol, Region}, tol)
Wrap the refine method to leave unchanged intervals that are not guaranteed to contain an unique solution.
sourceIntervalRootFinding.refine
— Methodrefine(C, X::Region, tol)
Refine a interval known to contain a solution.
This function assumes that it is already known that X
contains a unique root.
sourceIntervalRootFinding.safe_isempty
— Methodsafe_isempty(X)
Similar to isempty
function for IntervalBox
, but also works for SVector
of Interval
.
sourceBranch-and-bound search interface
Others
IntervalRootFinding.Compl
— TypeComplex numbers as 2-vectors, enough for polynomials.
sourceIntervalRootFinding.realify
— MethodTakes a complex (polynomial) function f and returns a function g:R^2 -> R^2 that implements it.
sourceIntervalRootFinding.realify_derivative
— MethodTakes the derivative of a complex function and returns the real jacobian that implements it.
sourceIntervalRootFinding.gauss_elimination_interval!
— MethodSolves the system of linear equations using Gaussian Elimination. Preconditioning is used when the precondition
keyword argument is true
.
REF: Luc Jaulin et al., Applied Interval Analysis, pg. 72
sourceIntervalRootFinding.gauss_elimination_interval1!
— MethodUsing Base.
`
sourceIntervalRootFinding.gauss_seidel_interval!
— MethodIteratively solves the system of interval linear equations and returns the solution set. Uses the Gauss-Seidel method (Hansen-Sengupta version) to solve the system. Keyword precondition
to turn preconditioning off. Eldon Hansen and G. William Walster : Global Optimization Using Interval Analysis - Chapter 5 - Page 115
sourceIntervalRootFinding.preconditioner
— MethodPreconditions the matrix A and b with the inverse of mid(A)
sourceIntervalRootFinding.newton1d
— Methodnewton1d
performs the interval Newton method on the given function f
with its derivative f′
and initial interval x
. Optional keyword arguments give the tolerances reltol
and abstol
. reltol
is the tolerance on the relative error whereas abstol
is the tolerance on |f(X)|, and a debug
boolean argument that prints out diagnostic information.
sourceIntervalRootFinding.newton1d
— Methodnewton1d
performs the interval Newton method on the given function f
and initial interval x
. Optional keyword arguments give the tolerances reltol
and abstol
. reltol
is the tolerance on the relative error whereas abstol
is the tolerance on |f(X)|, and a debug
boolean argument that prints out diagnostic information.
sourceIntervalRootFinding.quadratic_helper!
— MethodHelper function for quadratic_interval that computes roots of a real quadratic using interval arithmetic to bound rounding errors.
sourceIntervalRootFinding.quadratic_roots
— MethodFunction to solve a quadratic equation where the coefficients are intervals. Returns an array of intervals of the roots. Arguments a
, b
and c
are interval coefficients of x²
, x
and 1
respectively. The interval case differs from the non-interval case in that there might be three disjoint interval roots. In the third case, one interval root extends to −∞ and another extends to +∞. This algorithm finds the set of points where F.lo(x) ≥ 0
and the set of points where F.hi(x) ≤ 0
and takes the intersection of these two sets. Eldon Hansen and G. William Walster : Global Optimization Using Interval Analysis - Chapter 8
sourceSettings
This document was generated with Documenter.jl version 1.4.1 on Thursday 30 May 2024. Using Julia version 1.10.3.
+- `α`: Point of bisection of intervals.
IntervalRootFinding.contract
— Methodcontract(contractor, R)
Contract the region R using the given contractor.
IntervalRootFinding.refine
— Methodrefine(op, X::Tuple{Symbol, Region}, tol)
Wrap the refine method to leave unchanged intervals that are not guaranteed to contain an unique solution.
IntervalRootFinding.refine
— Methodrefine(C, X::Region, tol)
Refine a interval known to contain a solution.
This function assumes that it is already known that X
contains a unique root.
IntervalRootFinding.safe_isempty
— Methodsafe_isempty(X)
Similar to isempty
function for IntervalBox
, but also works for SVector
of Interval
.
Branch-and-bound search interface
Others
IntervalRootFinding.Compl
— TypeComplex numbers as 2-vectors, enough for polynomials.
IntervalRootFinding.realify
— MethodTakes a complex (polynomial) function f and returns a function g:R^2 -> R^2 that implements it.
IntervalRootFinding.realify_derivative
— MethodTakes the derivative of a complex function and returns the real jacobian that implements it.
IntervalRootFinding.gauss_elimination_interval!
— MethodSolves the system of linear equations using Gaussian Elimination. Preconditioning is used when the precondition
keyword argument is true
.
REF: Luc Jaulin et al., Applied Interval Analysis, pg. 72
IntervalRootFinding.gauss_elimination_interval1!
— MethodUsing Base.
`
IntervalRootFinding.gauss_seidel_interval!
— MethodIteratively solves the system of interval linear equations and returns the solution set. Uses the Gauss-Seidel method (Hansen-Sengupta version) to solve the system. Keyword precondition
to turn preconditioning off. Eldon Hansen and G. William Walster : Global Optimization Using Interval Analysis - Chapter 5 - Page 115
IntervalRootFinding.preconditioner
— MethodPreconditions the matrix A and b with the inverse of mid(A)
IntervalRootFinding.newton1d
— Methodnewton1d
performs the interval Newton method on the given function f
with its derivative f′
and initial interval x
. Optional keyword arguments give the tolerances reltol
and abstol
. reltol
is the tolerance on the relative error whereas abstol
is the tolerance on |f(X)|, and a debug
boolean argument that prints out diagnostic information.
IntervalRootFinding.newton1d
— Methodnewton1d
performs the interval Newton method on the given function f
and initial interval x
. Optional keyword arguments give the tolerances reltol
and abstol
. reltol
is the tolerance on the relative error whereas abstol
is the tolerance on |f(X)|, and a debug
boolean argument that prints out diagnostic information.
IntervalRootFinding.quadratic_helper!
— MethodHelper function for quadratic_interval that computes roots of a real quadratic using interval arithmetic to bound rounding errors.
IntervalRootFinding.quadratic_roots
— MethodFunction to solve a quadratic equation where the coefficients are intervals. Returns an array of intervals of the roots. Arguments a
, b
and c
are interval coefficients of x²
, x
and 1
respectively. The interval case differs from the non-interval case in that there might be three disjoint interval roots. In the third case, one interval root extends to −∞ and another extends to +∞. This algorithm finds the set of points where F.lo(x) ≥ 0
and the set of points where F.hi(x) ≤ 0
and takes the intersection of these two sets. Eldon Hansen and G. William Walster : Global Optimization Using Interval Analysis - Chapter 8