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(
"RealExpanderEstimator::RealExpanderEstimator(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 real image under the function to be estimated by this of the mid-point of the box associated with the node pointed to by spn.
- Parameters:
-
spn | a pointer to a SPnode to be visited. |
- Returns:
- the real image under the function to be estimated by this of the mid-point of the box associated with the node pointed to by spn.
Implements subpavings::SPExpandVisitor< cxsc::real >.
{
#ifdef MYDEBUG
std::cout << "in RealExpanderEstimator::visit, for " << spn->getNodeName() << std::endl;
#endif
ivector box = spn->getBox();
#ifdef MYDEBUG
std::cout << "this box is " << box << std::endl;
#endif
real thisMidImage = fobj.imageMid(box);
#ifdef MYDEBUG
std::cout << "this midImage is " << thisMidImage << std::endl;
#endif
interval thisRange = fobj(box);
#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 thisMidImage;
}
The documentation for this class was generated from the following files:
- realexpander_estimate.hpp
- realexpander_estimate.cpp