List of all members.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
f | describes a function to be estimated. |
tol | describes the tolerance to be used in making the estimate. |
- Precondition:
- tol >= cxsc::MinReal.
: fobj(f), tolerance(tol)
{
if (tolerance < cxsc::MinReal)
throw std::invalid_argument(
"IntervalExpanderEstimator::IntervalExpanderEstimator(MappedFobj&, cxsc::real) : tol < cxsc::MinReal");
}
Member Function Documentation
The visit operation.
Expands the node pointed to by spn if the interval image tolerance requirement is not met and returns the interval image under the function to be estimated by this of the box associated with the node pointed to by spn.
- Parameters:
-
spn | a pointer to an SPnode to be visited. |
- Returns:
- the interval image under the function to be estimated by this of the box associated with the node pointed to by spn.
Implements subpavings::SPExpandVisitor< cxsc::interval >.
{
#ifdef MYDEBUG
std::cout << "in IntervalExpanderEstimator::visit, for " << spn->getNodeName() << std::endl;
#endif
ivector box = spn->getBox();
#ifdef MYDEBUG
std::cout << "this box is " << box << std::endl;
#endif
interval thisRange = fobj(box);
real thisMidImage = fobj.imageMid(box);
#ifdef MYDEBUG
std::cout << "this midImage is " << thisMidImage << std::endl;
#endif
#ifdef MYDEBUG
std::cout << "this range is " << thisRange << std::endl;
#endif
#ifdef MYDEBUG
std::cout << "this tolerance is " << tolerance << std::endl;
#endif
if (max(Sup(thisRange) - thisMidImage, thisMidImage - Inf(thisRange)) > tolerance) {
spn->nodeExpand();
}
#ifdef MYDEBUG_MIN
if (!(max(Sup(thisRange) - thisMidImage, thisMidImage - Inf(thisRange)) > tolerance)) {
std::cout << "no need to expand further: interval image <= tolerance " << std::endl;
}
#endif
return thisRange;
}
The documentation for this class was generated from the following files:
- intervalexpander_estimate.hpp
- intervalexpander_estimate.cpp