Commit 6a75e5f5 authored by Jason Rhinelander's avatar Jason Rhinelander

New right/tolerance argument syntax; remove domain_t deduction

This changes the `right` and `tolerance` argument into more complex
objects that allow both a literal, or special objects returned by
`search_right()`, `absolute_tolerance(.001)`, or

This allows the much more descriptive syntax:

    constrained_maximum_search(f, 0, search_right(), relative_tolerance(.001))

This also reintroduces the ability to specify an absolute tolerance
level, which was there once (as a separate argument) but got lost along
the way.

This commit also changes the `domain_t` argument to be no longer
deduced.  Previously it was deduced from `left`, which would have made
the above example rather broken: `domain_t` would have been `int` (from
the 0) rather than `double` (which would require 0.0).  Overriding
`domain_t` now requires an explicitly template parameter:

    constrained_maximum_search<float>(f, 0, search_right(), relative_tolerance(.001))
parent 512cdae1
This diff is collapsed.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment