28inline void l_interval::_allo(
int nprec)
38 cxscthrow(ERROR_LINTERVAL_WRONG_STAGPREC(
"void l_interval::_allo(int nprec)"));
40 data=
new real[(prec)+1];
77 cxscthrow(ERROR_LINTERVAL_EMPTY_INTERVAL(
"inline l_interval::l_interval(const real &a, const real &b)"));
85 catch(
const ERROR_LINTERVAL_WRONG_STAGPREC &) {}
104inline l_interval::~l_interval() noexcept
113 catch(
const ERROR_LINTERVAL_WRONG_STAGPREC &) {}
114 elem(1)=
Inf(a),elem(2)=
Sup(a);
120 catch(
const ERROR_LINTERVAL_WRONG_STAGPREC &) {}
124 elem(prec+1)=a[prec];
132inline interval _interval(
const l_real & a,
const real & b)
noexcept
161 cxscthrow(ERROR_LINTERVAL_IN_EXACT_CH_OR_IS(
"inline l_interval operator|(const l_interval & li1, const l_interval & li2)"));
175 catch(
const EMPTY_INTERVAL &)
177 cxscthrow(ERROR_LINTERVAL_EMPTY_INTERVAL(
"inline l_interval operator&(const l_interval & li1, const l_interval & li2)"));
182 cxscthrow(ERROR_LINTERVAL_IN_EXACT_CH_OR_IS(
"inline l_interval operator&(const l_interval & li1, const l_interval & li2)"));
278inline idotprecision operator |(
const dotprecision &a,
const l_real &b)
noexcept {
return a|dotprecision(b); }
279inline idotprecision operator |(
const l_real &a,
const dotprecision &b)
noexcept {
return dotprecision(a)|b; }
371static const int LI_Min_Exp_ = -1074,
379 int save_stagprec=stagprec;
383 for (
int i=1; i<=stagprec; i++)
384 lr.elem(i)=li.elem(i);
386 stagprec=save_stagprec;
393 int save_stagprec=stagprec;
397 for (
int i=1; i<stagprec; i++)
398 lr.elem(i)=li.elem(i);
400 lr.elem(stagprec)=li.elem(stagprec+1);
402 stagprec=save_stagprec;
418 if (x.prec == stagprec)
420 else if (x.prec > stagprec)
427 for (i = 0; i <= stagprec-x.prec-1; i++)
429 for (i = stagprec-x.prec; i <= stagprec; i++)
430 y.data[i] = x.data[i-(stagprec-x.prec)];
449 li2 =
l_interval(0.0, (inf > sup) ? inf : sup);
460 return _l_real(
diam(_interval(li.elem(li.prec),li.elem(li.prec+1))));
474#if (CXSC_INDEX_CHECK)
480#if (CXSC_INDEX_CHECK)
482 cxscthrow(ERROR_LINTERVAL_ELEMENT_NOT_IN_LONG(
"inline real & l_interval::operator[](int a)"));
487inline void l_interval::_clear(
int p)
noexcept
492 for (i=p; i<=prec+1; i++)
499 return a.elem(k+1) == a.elem(k);
508 if (sign(li.elem(i))!=0) tmp =
false;
510 }
while(tmp && i <= p );
525 int k(1),p(x.prec),ex1,ex2;
527 while (y.elem(k)==0 && k<p) k++;
528 ex1 = expo(y.elem(k));
529 ex2 = expo(y.elem(k+1));
530 if (ex2>ex1) ex1 = ex2;
542 int k(x.prec+1),ex1,ex2;
545 while (y.elem(k)==0 && k>2) k--;
546 ex1 = expo(y.elem(k));
547 ex2 = expo(y.elem(k-1));
550 k = ex1; ex1 = ex2; ex2 = k;
552 if (ex1<-100000) ex1 = ex2;
The Data Type dotprecision.
The Data Type idotprecision.
idotprecision()
Constructor of class idotprecision.
The Scalar Type interval.
interval()
Constructor of class interval.
friend interval _interval(const ivector &) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
The Multiple-Precision Data Type l_interval.
real & operator[](int) noexcept
Access to the single components used to store the long data type value.
friend l_interval operator&(const l_interval &, const l_interval &)
Returns the intersection of the arguments.
friend l_interval & SetInf(l_interval &a, const l_real &b)
Returns the interval with the new given infimum value.
friend l_interval adjust(const l_interval &) noexcept
Sets the precision of a specific long datatype value.
friend l_interval & UncheckedSetInf(l_interval &a, const l_real &b) noexcept
Returns the interval with the unchecked new given infimum value.
friend bool point_intv(const l_interval &)
Checks if the argument is a point interval.
friend bool zero_(const l_interval &) noexcept
Checks if the argument is zero.
friend void Intersection(const l_interval &, const l_interval &, l_interval &, l_interval &)
Allocates the intersection of the arguments to the first argument.
friend l_interval & SetSup(l_interval &a, const l_real &b)
Returns the interval with the new given supremum value.
friend void accumulate(idotprecision &, const real &, const l_interval &) noexcept
The accurate scalar product of the last two arguments added to the value of the first argument.
l_interval() noexcept
Constructor of class l_interval.
friend l_real Sup(const l_interval &) noexcept
Returns the supremum of an interval.
friend l_real Inf(const l_interval &) noexcept
Returns the infimum of an interval.
friend void ConvexHull(const l_interval &, const l_interval &, l_interval &, l_interval &) noexcept
Allocates the convex hull of the arguments to the first argument.
friend l_interval & UncheckedSetSup(l_interval &a, const l_real &b) noexcept
Returns the interval with the unchecked new given supremum value.
friend l_interval operator|(const l_interval &, const l_interval &)
Returns the convex hull of the arguments.
l_interval & operator=(const real &a) noexcept
Implementation of standard assigning operator.
friend int StagPrec(const l_interval &) noexcept
Returns the precision of the long datatype value.
friend l_interval operator+(const l_interval &) noexcept
Implementation of standard algebraic positive sign operation.
The Multiple-Precision Data Type l_real.
l_real(void) noexcept
Constructor of class l_real.
The namespace cxsc, providing all functionality of the class library C-XSC.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation operation.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
int expo_gr(const l_interval &x)
cvector diam(const cimatrix_subv &mv) noexcept
Returns the diameter of the matrix.
l_interval _l_interval(const real &a) noexcept
interval _unchecked_interval(const real &a, const real &b)
idotprecision _idotprecision(const real &a)
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
int expo_sm(const l_interval &x)
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.