root_dup_tol Function

private pure function root_dup_tol(x1, x2) result(tol)

Tolerance for removing duplicate roots in db1root: two roots closer than this are the same root (found twice, e.g. at a knot).

It is relative to the width of the domain (the resolution of the roots found in the knot intervals), plus one unit in the last place of the coordinates. It is not relative to the coordinates themselves, which would merge distinct roots for a narrow domain far from zero.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x1

left end of the domain: t(k)

real(kind=wp), intent(in) :: x2

right end of the domain: t(n+1)

Return Value real(kind=wp)

the duplicate tolerance


Called by

proc~~root_dup_tol~~CalledByGraph proc~root_dup_tol root_dup_tol proc~db1root db1root proc~db1root->proc~root_dup_tol proc~spline_roots spline_roots proc~db1root->proc~spline_roots proc~spline_roots->proc~root_dup_tol proc~db1extremum db1extremum proc~db1extremum->proc~spline_roots proc~roots_1d bspline_1d%roots_1d proc~roots_1d->proc~db1root proc~db1max db1max proc~db1max->proc~db1extremum proc~db1min db1min proc~db1min->proc~db1extremum proc~inverse_1d bspline_1d%inverse_1d proc~inverse_1d->proc~roots_1d proc~maximum_1d bspline_1d%maximum_1d proc~maximum_1d->proc~db1max proc~minimum_1d bspline_1d%minimum_1d proc~minimum_1d->proc~db1min

Source Code

    pure function root_dup_tol(x1,x2) result(tol)

    implicit none

    real(wp),intent(in) :: x1   !! left end of the domain: `t(k)`
    real(wp),intent(in) :: x2   !! right end of the domain: `t(n+1)`
    real(wp)            :: tol  !! the duplicate tolerance

    ! (the domain width is scaled before the subtraction, so it does not overflow)
    tol = (root_xtol*x2 - root_xtol*x1) + spacing(max(abs(x1),abs(x2)))

    end function root_dup_tol