28 inline void l_interval::_allo(
int nprec)
29 #if (CXSC_INDEX_CHECK) 30 throw(ERROR_LINTERVAL_WRONG_STAGPREC)
36 #if (CXSC_INDEX_CHECK) 38 cxscthrow(ERROR_LINTERVAL_WRONG_STAGPREC(
"void l_interval::_allo(int nprec)"));
40 data=
new real[(prec)+1];
46 #if (CXSC_INDEX_CHECK) 47 throw(ERROR_LINTERVAL_WRONG_STAGPREC)
56 #if (CXSC_INDEX_CHECK) 57 throw(ERROR_LINTERVAL_WRONG_STAGPREC)
69 #if (CXSC_INDEX_CHECK) 70 throw(ERROR_LINTERVAL_WRONG_STAGPREC,ERROR_LINTERVAL_EMPTY_INTERVAL)
72 throw(ERROR_LINTERVAL_EMPTY_INTERVAL)
77 cxscthrow(ERROR_LINTERVAL_EMPTY_INTERVAL(
"inline l_interval::l_interval(const real &a, const real &b)"));
85 catch(
const ERROR_LINTERVAL_WRONG_STAGPREC &) {}
104 inline l_interval::~l_interval() throw()
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];
132 inline interval _interval(
const l_real & a,
const real & b)
throw()
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)"));
371 static 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;
407 inline int StagPrec(
const l_interval &a)
throw() {
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))));
473 inline real & l_interval::operator[](
int a)
474 #if (CXSC_INDEX_CHECK) 475 throw(ERROR_LINTERVAL_ELEMENT_NOT_IN_LONG)
480 #if (CXSC_INDEX_CHECK) 482 cxscthrow(ERROR_LINTERVAL_ELEMENT_NOT_IN_LONG(
"inline real & l_interval::operator[](int a)"));
487 inline void l_interval::_clear(
int p)
throw()
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 Multiple-Precision Data Type l_interval.
int expo_sm(const l_interval &x)
cimatrix & operator/=(cimatrix &m, const cinterval &c)
Implementation of division and allocation operation.
The Data Type idotprecision.
The Multiple-Precision Data Type l_real.
The Data Type dotprecision.
interval _unchecked_interval(const real &a, const real &b)
The namespace cxsc, providing all functionality of the class library C-XSC.
The Scalar Type interval.
cimatrix & operator *=(cimatrix &m, const cinterval &c)
Implementation of multiplication and allocation operation.
l_interval()
Constructor of class l_interval.
civector operator *(const cimatrix_subv &rv, const cinterval &s)
Implementation of multiplication operation.
l_interval & operator=(const real &a)
Implementation of standard assigning operator.
cvector diam(const cimatrix_subv &mv)
Returns the diameter of the matrix.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc)
Implementation of standard algebraic addition and allocation operation.
int expo_gr(const l_interval &x)
idotprecision _idotprecision(const real &a)
l_interval _l_interval(const real &a)
civector operator/(const cimatrix_subv &rv, const cinterval &s)
Implementation of division operation.
ivector abs(const cimatrix_subv &mv)
Returns the absolute value of the matrix.