\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.11.3 - Algebraic Kernel
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
AlgebraicKernel_d_1::ApproximateRelative_1 Concept Reference

Definition

A model of AlgebraicKernel_d_1::ApproximateRelative_1 is an AdaptableBinaryFunction that computes an approximation of an AlgebraicKernel_d_1::Algebraic_real_1 value with respect to a given relative precision.

Refines:
AdaptableBinaryFunction
See Also
AlgebraicKernel_d_1::ApproximateAbsolute_1

Types

typedef std::pair
< AlgebraicKernel_d_1::Bound,
AlgebraicKernel_d_1::Bound
result_type
 
typedef
AlgebraicKernel_d_1::Algebraic_real_1 
first_argument_type
 
typedef int second_argument_type
 

Operations

result_type operator() (const first_argument_type &x, const second_argument_type &r)
 The function computes a pair \( p\) of AlgebraicKernel_d_1::Bound, where \( p.first\) represents the lower approximation and \( p.second\) represents the upper approximation. More...
 

Member Function Documentation

result_type AlgebraicKernel_d_1::ApproximateRelative_1::operator() ( const first_argument_type x,
const second_argument_type r 
)

The function computes a pair \( p\) of AlgebraicKernel_d_1::Bound, where \( p.first\) represents the lower approximation and \( p.second\) represents the upper approximation.

The pair \( p\) approximates the given value \( x\) with respect to the given relative precision \( r\).

Postcondition
\( p.first <= x \)
\( x <= p.second \)
\( (x - p.first) <= 2^{-r} *|x|\)
\( (p.second - x) <= 2^{-r} *|x|\)