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);
119 try { _allo(StagPrec(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
157 ConvexHull(li1, li2, li3, li4);
161 cxscthrow(ERROR_LINTERVAL_IN_EXACT_CH_OR_IS(
"inline l_interval operator|(const l_interval & li1, const l_interval & li2)"));
173 Intersection(li1, li2, li3, li4);
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)"));
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;
407inline int StagPrec(
const l_interval &a)
noexcept {
return a.prec; }
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)];
443 l_real i = Inf(li1), s = Sup(li1);
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);
504 int i=1, p=StagPrec(li)+1;
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.
The Scalar Type interval.
The Multiple-Precision Data Type l_interval.
real & operator[](int) noexcept
Access to the single components used to store the long data type value.
l_interval() noexcept
Constructor of class l_interval.
The Multiple-Precision Data Type 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.