C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: lx_interval.hpp,v 1.10 2014/01/30 17:23:47 cxsc Exp $ */ 00025 00026 00027 /* 00028 ** F. Blomquist, University of Wuppertal, 19.09.2007; 00029 */ 00030 00031 /* 00032 ** Implementation of the classes 00033 ** 00034 ** lx_interval with all tools and elementary functions for real 00035 ** point and interval aruments 00036 ** 00037 */ 00038 00039 #ifndef _CXSC_LX_INTERVAL_HPP_INCLUDED 00040 #define _CXSC_LX_INTERVAL_HPP_INCLUDED 00041 00042 #include <l_imath.hpp> 00043 #include <lx_real.hpp> 00044 #include <sstream> 00045 #include <cmath> 00046 #include <iostream> 00047 00048 namespace cxsc { 00049 00050 class lx_interval { 00051 00052 private: 00053 // ------------- Data Elements ------------------------------------------- 00054 real ex; 00055 l_interval li; 00056 // The mathematical value of an object of type lx_interval is 00057 // interpreted as: 2^(ex) * li; 00058 00059 public: 00060 // ------------- Constructors -------------------------------------------- 00061 00063 lx_interval(void) throw() {} 00064 00066 lx_interval(const real& n, const l_interval& a) throw() 00067 { 00068 if ( !(Is_Integer(n)) ) 00069 cxscthrow(REAL_NOT_ALLOWED("lx_interval(const real&, const l_interval&)")); 00070 else 00071 { 00072 ex = n; li = a; 00073 } 00074 } 00075 00077 lx_interval(const real& n, const l_real& a) throw() 00078 { 00079 if ( !(Is_Integer(n)) ) 00080 cxscthrow(REAL_NOT_ALLOWED("lx_interval(const real& n, const l_real& a)")); 00081 else 00082 { 00083 ex = n; li = a; 00084 } 00085 } 00086 00088 lx_interval(const real& n, const interval& a) throw() 00089 { 00090 if ( !(Is_Integer(n)) ) 00091 cxscthrow(REAL_NOT_ALLOWED("lx_interval(const real&, const interval&)")); 00092 else 00093 { 00094 ex = n; li = a; 00095 } 00096 } 00097 00099 explicit lx_interval(const real& n, const real& a) throw() 00100 { 00101 if ( !(Is_Integer(n)) ) 00102 cxscthrow(REAL_NOT_ALLOWED("lx_interval(const real&, const real&)")); 00103 else 00104 { 00105 ex = n; li = a; 00106 } 00107 } 00109 explicit lx_interval(const l_interval& a) throw() : ex(0), li(a) { } 00111 explicit lx_interval(const l_real& a) throw() : ex(0), li(a) { } 00113 lx_interval(const l_real& a, const l_real& b) throw() : ex(0),li(a,b) { } 00115 explicit lx_interval(const interval& a) throw() : ex(0), li(a) { } 00117 explicit lx_interval(const real& a) throw() : ex(0), li(a) { } 00119 lx_interval(const lx_real&, const lx_real&) throw(); 00121 explicit lx_interval(const lx_real& a) 00122 throw() : ex(expo(a)), li(lr_part(a)) { } 00124 lx_interval(const real&, const string&) throw(); 00125 00126 // ------------- Assignments --------------------------------------------- 00127 00129 inline lx_interval & operator = (const lx_interval & a) throw(); 00131 inline lx_interval & operator = (const l_interval & a) throw(); 00133 inline lx_interval & operator = (const l_real & a) throw(); 00135 inline lx_interval & operator = (const real & a) throw(); 00137 inline lx_interval & operator = (const interval & a) throw(); 00139 inline lx_interval & operator = (const lx_real & a) throw(); 00140 00141 // l_interval & operator = (const lx_interval &a) throw(); declared 00142 // in l_interval.hpp and implemented in lx_interval.cpp; 00143 00144 // interval & operator = (const lx_interval &a) throw(); declared 00145 // in interval.hpp and implemented in lx_interval.cpp; 00146 00147 // ------------- Functions ----------------------------------------------- 00148 00150 friend inline int StagPrec(const lx_interval&) throw(); 00152 friend inline real expo(const lx_interval&) throw(); 00154 friend inline l_interval li_part(const lx_interval&) throw(); 00156 friend void scale_down(lx_interval &a); 00158 friend void scale_up (lx_interval &a); 00159 00161 friend inline lx_interval adjust(const lx_interval &) throw(); 00163 friend inline lx_interval abs(const lx_interval &) throw(); 00165 friend inline bool point_intv(const lx_interval &); 00167 friend inline bool operator ! (const lx_interval &) throw(); 00169 friend inline bool IsEmpty(const lx_interval &) throw(); 00171 friend inline void times2pown(lx_interval &, const real &) throw(); 00173 friend inline lx_interval Blow(const lx_interval &) throw(); 00175 friend inline void times2pown_neg(lx_interval &, const real&) throw(); 00177 friend inline lx_real RelDiam( const lx_interval &); 00179 friend inline lx_real diam(const lx_interval &) throw(); 00181 friend inline lx_real mid(const lx_interval &) throw(); 00183 friend inline lx_real Inf(const lx_interval &) throw(); 00185 friend inline lx_real Sup(const lx_interval &) throw(); 00186 00187 // ---------------- Monadic arithmetic operator --------------------- 00188 00190 friend inline lx_interval operator-(const lx_interval & a) throw(); 00191 00192 00193 // ----------------------- Output ----------------------------------- 00194 00196 friend std::ostream& operator << (std::ostream&, const lx_interval&) 00197 throw(); 00198 00200 friend std::string & operator << (std::string&, const lx_interval&) 00201 throw(); 00202 00203 }; // end of class lx_interval 00204 00205 00206 // ------------------------------------------------------------------- 00207 // Declaration of friend functions outside the class lx_interval 00208 // ------------------------------------------------------------------- 00209 00210 inline int StagPrec(const lx_interval &a) throw(); 00211 inline real expo(const lx_interval &a) throw(); 00212 inline l_interval li_part(const lx_interval &a) throw(); 00213 00214 void scale_down(lx_interval &); 00215 void scale_up (lx_interval &); 00216 inline bool point_intv(const lx_interval &); 00217 inline bool IsEmpty(const lx_interval &) throw(); 00218 inline void times2pown(lx_interval &, const real &) throw(); 00219 inline lx_interval Blow(const lx_interval &) throw(); 00220 inline void times2pown_neg(lx_interval &, const real&) throw(); 00221 inline lx_real RelDiam(const lx_interval &); 00222 inline lx_real Inf(const lx_interval &) throw(); 00223 inline lx_real Sup(const lx_interval &) throw(); 00224 inline lx_interval abs(const lx_interval &) throw(); 00225 inline lx_interval adjust(const lx_interval &) throw(); 00226 inline lx_real diam(const lx_interval &) throw(); 00227 inline lx_real mid(const lx_interval &) throw(); 00228 00229 // ------------------------ Input -------------------------------------- 00230 00232 std::string & operator >> (std::string &s, lx_interval &a) throw(); 00234 void operator >> (const std::string &s, lx_interval &a) throw(); 00236 void operator >> (const char *s, lx_interval&) throw(); 00237 00239 std::istream & operator >> (std::istream&, lx_interval&) throw(); 00240 00241 // ------------------------ Output -------------------------------------- 00242 00243 std::ostream& operator << (std::ostream& s,const lx_interval& a) throw(); 00244 // A value a of type lx_interval is written to the 00245 // output channel as decimal number in the form: 00246 // { exponent p to base 10, interval mantissa m } = 10^p * m; 00247 00248 std::string & operator << (std::string &s,const lx_interval& a) throw(); 00249 // The value of a variable a of type lx_interval is copied to a string s. 00250 // s has the form: {2**(ex), li} = 2^ex * li; 00251 00252 00253 // ------------------------------------------------------------------- 00254 // ------- Function declarations outside the class lx_interval -------- 00255 // ------------------------------------------------------------------- 00256 00257 void Bin2Dec(const lx_interval& a, real& p, l_interval& m); 00258 00260 lx_interval expo2zero(const lx_interval &) throw(OVERFLOW_ERROR); 00262 inline int Disjoint(const lx_interval &, const lx_interval &); 00264 inline int in (const lx_interval&, const lx_interval&); 00266 inline int in (const l_interval&, const lx_interval&); 00268 inline int in (const interval&, const lx_interval&); 00269 00271 inline int in (const lx_real&, const lx_interval&); 00273 inline int in (const l_real&, const lx_interval&); 00275 inline int in (const real&, const lx_interval&); 00276 00278 inline lx_interval Blow( const lx_interval&, const real& ); 00280 inline lx_real AbsMin (const lx_interval&); 00282 inline lx_real AbsMax (const lx_interval&); 00283 00284 // ----------------------------------------------------------------------- 00285 // ------------- set comparisons ----------------------------------------- 00286 // ----------------------------------------------------------------------- 00287 00288 // ---- lx_interval--lx_interval 00289 00291 inline bool operator < (const lx_interval&, const lx_interval&) throw(); 00293 inline bool operator <= (const lx_interval&, const lx_interval&) throw(); 00295 inline bool operator > (const lx_interval&, const lx_interval&) throw(); 00297 inline bool operator >= (const lx_interval&, const lx_interval&) throw(); 00298 00299 // ---- lx_interval--l_interval 00300 00302 inline bool operator < (const lx_interval&, const l_interval&) throw(); 00304 inline bool operator <= (const lx_interval&, const l_interval&) throw(); 00306 inline bool operator < (const l_interval&, const lx_interval&) throw(); 00308 inline bool operator <= (const l_interval&, const lx_interval&) throw(); 00310 inline bool operator > (const lx_interval&, const l_interval&) throw(); 00311 inline bool operator >= (const lx_interval&, const l_interval&) throw(); 00313 inline bool operator > (const l_interval&, const lx_interval&) throw(); 00315 inline bool operator >= (const l_interval&, const lx_interval&) throw(); 00316 00317 // ---- lx_interval--interval 00318 00320 inline bool operator < (const lx_interval&, const interval&) throw(); 00322 inline bool operator <= (const lx_interval&, const interval&) throw(); 00324 inline bool operator < (const interval&, const lx_interval&) throw(); 00326 inline bool operator <= (const interval&, const lx_interval&) throw(); 00328 inline bool operator > (const lx_interval&, const interval&) throw(); 00330 inline bool operator >= (const lx_interval&, const interval&) throw(); 00332 inline bool operator > (const interval&, const lx_interval&) throw(); 00334 inline bool operator >= (const interval&, const lx_interval&) throw(); 00335 00336 // ---- lx_interval--real 00337 00339 inline bool operator < (const real &, const lx_interval &) throw(); 00341 inline bool operator <= (const real &, const lx_interval &) throw(); 00343 inline bool operator > (const lx_interval &, const real &) throw(); 00345 inline bool operator >= (const lx_interval &, const real &) throw(); 00346 00347 // ---- lx_interval--l_real 00348 00350 inline bool operator < (const l_real &, const lx_interval &) throw(); 00352 inline bool operator <= (const l_real &, const lx_interval &) throw(); 00354 inline bool operator > (const lx_interval &, const l_real &) throw(); 00356 inline bool operator >= (const lx_interval &, const l_real &) throw(); 00357 00358 // ---- lx_interval--lx_real 00359 00361 inline bool operator < (const lx_real &, const lx_interval &) throw(); 00363 inline bool operator <= (const lx_real &, const lx_interval &) throw(); 00365 inline bool operator > (const lx_interval &, const lx_real &) throw(); 00367 inline bool operator >= (const lx_interval &, const lx_real &) throw(); 00368 00369 00370 // -------------------------- comparisons -------------------------------- 00371 00373 inline bool operator ! (const lx_interval &) throw(); 00374 00376 inline bool operator == (const lx_interval &, const lx_interval &) throw(); 00378 inline bool operator == (const lx_interval &, const l_interval &) throw(); 00380 inline bool operator == (const l_interval &, const lx_interval &) throw(); 00382 inline bool operator == (const lx_interval &, const interval &) throw(); 00384 inline bool operator == (const interval &, const lx_interval &) throw(); 00386 inline bool operator == (const lx_interval &, const real &) throw(); 00388 inline bool operator == (const real &, const lx_interval &) throw(); 00390 inline bool operator == (const lx_interval &, const l_real &) throw(); 00392 inline bool operator == (const l_real &, const lx_interval &) throw(); 00394 inline bool operator == (const lx_interval &, const lx_real &) throw(); 00396 inline bool operator == (const lx_real &, const lx_interval &) throw(); 00397 00399 inline bool operator != (const lx_interval &, const lx_interval &) throw(); 00401 inline bool operator != (const lx_interval &, const l_interval &) throw(); 00403 inline bool operator != (const l_interval &, const lx_interval &) throw(); 00405 inline bool operator != (const lx_interval &, const interval &) throw(); 00407 inline bool operator != (const interval &, const lx_interval &) throw(); 00409 inline bool operator != (const lx_interval &, const real &) throw(); 00411 inline bool operator != (const real &, const lx_interval &) throw(); 00413 inline bool operator != (const lx_interval &, const l_real &) throw(); 00415 inline bool operator != (const l_real &, const lx_interval &) throw(); 00417 inline bool operator != (const lx_interval &, const lx_real &) throw(); 00419 inline bool operator != (const lx_real &, const lx_interval &) throw(); 00420 00422 inline lx_interval operator+(const lx_interval &) throw(); 00424 inline lx_interval operator-(const lx_interval &) throw(); 00425 00427 lx_interval operator + (const lx_interval &, const lx_interval &) throw(); 00428 00430 inline lx_interval operator + (const lx_interval &, const l_interval &) 00431 throw(); 00433 inline lx_interval operator + (const l_interval &, const lx_interval &) 00434 throw(); 00436 inline lx_interval operator + (const lx_interval &, const l_real &) 00437 throw(); 00439 inline lx_interval operator + (const l_real &, const lx_interval &) 00440 throw(); 00442 inline lx_interval operator + (const lx_interval &, const lx_real &) 00443 throw(); 00445 inline lx_interval operator + (const lx_real &, const lx_interval &) 00446 throw(); 00448 inline lx_interval operator + (const lx_interval &, const real &) 00449 throw(); 00451 inline lx_interval operator + (const real &, const lx_interval &) 00452 throw(); 00454 inline lx_interval operator + (const lx_interval &, const interval &) 00455 throw(); 00457 inline lx_interval operator + (const interval &, const lx_interval &) 00458 throw(); 00459 00461 inline lx_interval & operator +=(lx_interval &, const lx_interval &) throw(); 00463 inline lx_interval & operator +=(lx_interval &, const l_interval &) throw(); 00465 inline lx_interval & operator +=(lx_interval &, const l_real &) throw(); 00467 inline lx_interval & operator +=(lx_interval &, const lx_real &) throw(); 00469 inline lx_interval & operator +=(lx_interval &, const real &) throw(); 00471 inline lx_interval & operator +=(lx_interval &, const interval &) throw(); 00472 00474 inline lx_interval operator - (const lx_interval &, const lx_interval &) 00475 throw(); 00477 inline lx_interval operator - (const lx_interval &, const l_interval &) 00478 throw(); 00480 inline lx_interval operator - (const l_interval &, const lx_interval &) 00481 throw(); 00483 inline lx_interval operator - (const lx_interval &, const l_real &) 00484 throw(); 00486 inline lx_interval operator - (const l_real &, const lx_interval &) 00487 throw(); 00489 inline lx_interval operator - (const lx_interval &, const lx_real &) 00490 throw(); 00492 inline lx_interval operator - (const lx_real &, const lx_interval &) 00493 throw(); 00495 inline lx_interval operator - (const lx_interval &, const real &) 00496 throw(); 00498 inline lx_interval operator - (const real &, const lx_interval &) 00499 throw(); 00501 inline lx_interval operator - (const lx_interval &, const interval &) 00502 throw(); 00504 inline lx_interval operator - (const interval &, const lx_interval &) 00505 throw(); 00506 00508 inline lx_interval & operator -=(lx_interval &, const lx_interval &) throw(); 00510 inline lx_interval & operator -=(lx_interval &, const l_interval &) throw(); 00512 inline lx_interval & operator -=(lx_interval &, const l_real &) throw(); 00514 inline lx_interval & operator -=(lx_interval &, const lx_real &) throw(); 00516 inline lx_interval & operator -=(lx_interval &, const real &) throw(); 00518 inline lx_interval & operator -=(lx_interval &, const interval &) throw(); 00519 00521 lx_interval operator * (const lx_interval &, const lx_interval &) 00522 throw(); 00523 00525 inline lx_interval operator * (const lx_interval &, const l_interval &) 00526 throw(); 00528 inline lx_interval operator * (const l_interval &, const lx_interval &) 00529 throw(); 00531 inline lx_interval operator * (const lx_interval &, const l_real &) 00532 throw(); 00534 inline lx_interval operator * (const l_real &, const lx_interval &) 00535 throw(); 00537 inline lx_interval operator * (const lx_interval &, const lx_real &) 00538 throw(); 00540 inline lx_interval operator * (const lx_real &, const lx_interval &) 00541 throw(); 00543 inline lx_interval operator * (const lx_interval &, const real &) 00544 throw(); 00546 inline lx_interval operator * (const real &, const lx_interval &) 00547 throw(); 00549 inline lx_interval operator * (const lx_interval &, const interval &) 00550 throw(); 00552 inline lx_interval operator * (const interval &, const lx_interval &) 00553 throw(); 00554 00556 inline lx_interval & operator *=(lx_interval &, const lx_interval &) throw(); 00558 inline lx_interval & operator *=(lx_interval &, const l_interval &) throw(); 00560 inline lx_interval & operator *=(lx_interval &, const l_real &) throw(); 00562 inline lx_interval & operator *=(lx_interval &, const lx_real &) throw(); 00564 inline lx_interval & operator *=(lx_interval &, const real &) throw(); 00566 inline lx_interval & operator *=(lx_interval &, const interval &) throw(); 00567 00569 lx_interval operator / (const lx_interval &, const lx_interval &) 00570 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00571 00573 inline lx_interval operator / (const lx_interval &, const l_interval &) 00574 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00576 inline lx_interval operator / (const l_interval &, const lx_interval &) 00577 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00579 inline lx_interval operator / (const lx_interval &, const l_real &) 00580 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00582 inline lx_interval operator / (const l_real &, const lx_interval &) 00583 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00585 inline lx_interval operator / (const lx_interval &, const real &) 00586 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00588 inline lx_interval operator / (const real &, const lx_interval &) 00589 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00591 inline lx_interval operator / (const lx_interval &, const interval &) 00592 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00594 inline lx_interval operator / (const interval &, const lx_interval &) 00595 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00597 inline lx_interval operator / (const lx_interval &, const lx_real &) 00598 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00600 inline lx_interval operator / (const lx_real &, const lx_interval &) 00601 throw(ERROR_LINTERVAL_DIV_BY_ZERO); 00602 00604 inline lx_interval & operator /=(lx_interval &, const lx_interval &) throw(); 00606 inline lx_interval & operator /=(lx_interval &, const l_interval &) throw(); 00608 inline lx_interval & operator /=(lx_interval &, const l_real &) throw(); 00610 inline lx_interval & operator /=(lx_interval &, const lx_real &) throw(); 00612 inline lx_interval & operator /=(lx_interval &, const real &) throw(); 00614 inline lx_interval & operator /=(lx_interval &, const interval &) throw(); 00615 00616 // ----------------------------- Convex hull ------------------------------- 00617 00619 inline lx_interval operator | (const lx_interval&, const lx_interval&) 00620 throw(); 00622 inline lx_interval operator | (const lx_interval&, const l_interval&) 00623 throw(); 00625 inline lx_interval operator | (const l_interval&, const lx_interval&) 00626 throw(); 00628 inline lx_interval operator | (const lx_interval&, const interval&) 00629 throw(); 00631 inline lx_interval operator | (const interval&, const lx_interval&) 00632 throw(); 00634 inline lx_interval & operator |= (lx_interval&, const lx_interval&) 00635 throw(); 00637 inline lx_interval & operator |= (lx_interval&, const l_interval&) 00638 throw(); 00640 inline lx_interval & operator |= (lx_interval&, const interval&) 00641 throw(); 00643 inline lx_interval operator | (const lx_real&, const lx_interval&) 00644 throw(); 00646 inline lx_interval operator | (const real&, const lx_interval&) 00647 throw(); 00649 inline lx_interval operator | (const lx_interval&, const lx_real&) 00650 throw(); 00652 inline lx_interval operator | (const lx_interval&, const real&) 00653 throw(); 00655 inline lx_interval operator | (const lx_interval&, const l_real&) 00656 throw(); 00658 inline lx_interval operator | (const l_real&, const lx_interval&) 00659 throw(); 00661 inline lx_interval & operator |= (lx_interval&, const real&) 00662 throw(); 00664 inline lx_interval & operator |= (lx_interval&, const l_real&) 00665 throw(); 00667 inline lx_interval & operator |= (lx_interval&, const lx_real&) 00668 throw(); 00670 inline lx_interval operator | (const lx_real&, const lx_real&) 00671 throw(); 00672 00673 // --------------------------- Intersection ----------------------------- 00674 00676 inline lx_interval operator & (const lx_interval&, const lx_interval&) 00677 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00679 inline lx_interval operator & (const lx_interval&, const l_interval&) 00680 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00682 inline lx_interval & operator &= (lx_interval&, const l_interval&) 00683 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00685 inline lx_interval operator & (const l_interval&, const lx_interval&) 00686 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00688 inline lx_interval operator & (const lx_interval&, const interval&) 00689 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00691 inline lx_interval & operator &= (lx_interval &a, const interval &b) 00692 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00694 inline lx_interval operator & (const interval&, const lx_interval&) 00695 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00697 inline lx_interval & operator &= (lx_interval&, const lx_interval&) 00698 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00700 inline lx_interval operator & (const lx_interval&, const lx_real&) 00701 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00703 inline lx_interval operator & (const lx_interval&, const l_real&) 00704 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00706 inline lx_interval operator & (const lx_interval&, const real&) 00707 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00709 inline lx_interval operator & (const lx_real&, const lx_interval&) 00710 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00712 inline lx_interval operator & (const l_real&, const lx_interval&) 00713 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00715 inline lx_interval operator & (const real&, const lx_interval&) 00716 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00718 inline lx_interval & operator &= (lx_interval&, const lx_real&) 00719 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00721 inline lx_interval & operator &= (lx_interval&, const l_real&) 00722 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00724 inline lx_interval & operator &= (lx_interval&, const real&) 00725 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00726 00727 // ------------------------- SetInf, SetSup ----------------------------- 00728 00730 inline lx_interval & SetInf(lx_interval&, const lx_real&) 00731 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00733 inline lx_interval & SetInf(lx_interval&, const l_real&) 00734 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00736 inline lx_interval & SetInf(lx_interval&, const real&) 00737 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00738 00740 inline lx_interval & SetSup(lx_interval&, const lx_real&) 00741 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00743 inline lx_interval & SetSup(lx_interval&, const l_real&) 00744 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00746 inline lx_interval & SetSup(lx_interval&, const real&) 00747 throw(ERROR_LINTERVAL_EMPTY_INTERVAL); 00748 00749 // ------------------------- Help Functions: ---------------------------- 00750 00751 // ----------------- Intervals for test calculations -------------------- 00752 00754 l_interval point_max(void); 00755 // returns a staggered point interval with maximum exponent 1020, 00756 // whereby nearly all mantissa bits are set. 00757 00759 l_interval point_any(int n); 00760 // returns a staggered point interval with exponent n, 00761 // whereby nearly all mantissa bits are set. 00762 // -1074 <= n <= +1020; 00763 00765 l_interval wide_max(void); 00766 // returns a staggered interval a with maximum exponent 1020 00767 // and diam(a)>0, whereby nearly all mantissa bits are set. 00768 00770 l_interval wide_any(int n); 00771 // returns a wide staggered interval a with exponent n, 00772 // and diam(a)>0, whereby nearly all mantissa bits are set. 00773 // -1074 <= n <= +1020; 00774 00775 00776 // -------------------------------------------------------------------- 00777 // ----------------- lx_interval Constants ---------------------------- 00778 // -------------------------------------------------------------------- 00779 00781 lx_interval Pi_lx_interval() throw(); // pi 00783 lx_interval Pip2_lx_interval() throw(); // pi^2 00785 lx_interval Pi2_lx_interval() throw(); // 2*pi 00787 lx_interval Pi2r_lx_interval() throw(); // 1/(2*pi) 00789 lx_interval Pid4_lx_interval() throw(); // pi/4 00791 lx_interval Pid2_lx_interval() throw(); // pi/2 00793 lx_interval Ln2_lx_interval() throw(); // ln(2) 00795 lx_interval Ln10_lx_interval() throw(); // ln(10) 00797 lx_interval Ln10r_lx_interval() throw(); // 1/ln(10) 00799 lx_interval Pir_lx_interval() throw(); // 1/pi 00801 lx_interval SqrtPi_lx_interval() throw(); // sqrt(pi) 00803 lx_interval Sqrt2Pi_lx_interval() throw(); // sqrt(2pi) 00805 lx_interval Sqrt2_lx_interval() throw(); // sqrt(2) 00807 lx_interval Sqrt2r_lx_interval() throw(); // sqrt(2) 00809 lx_interval Sqrt3_lx_interval() throw(); // sqrt(3) 00811 lx_interval Sqrt3d2_lx_interval() throw(); // sqrt(3)/2 00813 lx_interval Sqrt3r_lx_interval() throw(); // 1/sqrt(3) 00815 lx_interval Ln2r_lx_interval() throw(); // 1/ln(2) 00817 lx_interval Pid3_lx_interval() throw(); // pi/3 00819 lx_interval SqrtPir_lx_interval() throw(); // 1/sqrt(pi) 00821 lx_interval Sqrt2Pir_lx_interval() throw(); // 1/sqrt(2pi) 00823 lx_interval LnPi_lx_interval() throw(); // ln(pi) 00825 lx_interval Ln2Pi_lx_interval() throw(); // ln(2pi) 00827 lx_interval E_lx_interval() throw(); // e 00829 lx_interval Ep2_lx_interval() throw(); // e^2 00831 lx_interval Ep2r_lx_interval() throw(); // 1/e^2 00833 lx_interval Er_lx_interval() throw(); // 1/e 00835 lx_interval EpPi_lx_interval() throw(); // e^pi 00837 lx_interval EpPid2_lx_interval() throw(); // e^(pi/2) 00839 lx_interval EpPid4_lx_interval() throw(); // e^(pi/4) 00841 lx_interval Ep2Pi_lx_interval() throw(); // e^(2*pi) 00843 lx_interval EulerGamma_lx_interval() throw(); 00845 lx_interval Catalan_lx_interval() throw(); 00847 lx_interval sqrt5_lx_interval() throw(); // sqrt(5) 00849 lx_interval sqrt7_lx_interval() throw(); // sqrt(7) 00851 lx_interval One_m_lx_interval() throw(); 00853 lx_interval One_p_lx_interval() throw(); 00854 00855 // ------------------------------------------------------------------------- 00856 // ---------------- lx_interval: elementary functions ---------------------- 00857 // ------------------------------------------------------------------------- 00858 00860 lx_interval sqrt(const lx_interval&) throw(); 00862 lx_interval sqr(const lx_interval&) throw(); 00864 lx_interval ln(const lx_interval &) throw(); 00866 lx_interval log2(const lx_interval &) throw(); 00868 lx_interval log10(const lx_interval &) throw(); 00870 lx_interval lnp1(const lx_interval &) throw(); 00872 lx_interval exp(const lx_interval &) throw(); 00874 lx_interval exp2(const lx_interval &) throw(); // 2^x 00876 lx_interval exp10(const lx_interval &) throw(); // 10^x 00878 lx_interval expm1(const lx_interval &x) throw(); 00880 lx_interval power(const lx_interval &, const real &) throw(); 00882 lx_interval pow(const lx_interval &, const lx_interval &) throw(); 00884 lx_interval xp1_pow_y(const lx_interval &, const lx_interval &) throw(); 00886 lx_interval sin(const lx_interval &)throw(); 00888 lx_interval sin_n(const lx_interval &x, const real& n) throw(); 00890 lx_interval cos(const lx_interval &) throw(); 00892 lx_interval cos_n(const lx_interval &x, const real& n) throw(); 00894 lx_interval tan(const lx_interval &) throw(); 00896 lx_interval cot(const lx_interval &) throw(); 00898 lx_interval sqrt1px2(const lx_interval &) throw(); 00900 lx_interval atan(const lx_interval &) throw(); 00902 lx_interval sqrt1mx2(const lx_interval &) throw(); 00904 lx_interval sqrtx2m1(const lx_interval &) throw(); 00906 lx_interval asin(const lx_interval & ) throw(); 00908 lx_interval acos(const lx_interval &) throw(); 00910 lx_interval acot(const lx_interval &) throw(); 00912 lx_interval sinh(const lx_interval &) throw(); 00914 lx_interval cosh(const lx_interval &) throw(); 00916 lx_interval tanh(const lx_interval &) throw(); 00918 lx_interval coth(const lx_interval &) throw(); 00920 lx_interval sqrtp1m1(const lx_interval &) throw(); 00922 lx_interval asinh(const lx_interval &) throw(); 00924 lx_interval acosh(const lx_interval &) throw(); 00926 lx_interval acoshp1(const lx_interval &) throw(); 00928 lx_interval atanh(const lx_interval &) throw(); 00930 lx_interval atanh1m(const lx_interval &) throw(); 00932 lx_interval atanhm1p(const lx_interval &) throw(); 00934 lx_interval acoth(const lx_interval &) throw(); 00936 lx_interval acothp1(const lx_interval &) throw(); 00938 lx_interval acothm1m(const lx_interval &) throw(); 00940 lx_interval sqrtx2y2(const lx_interval &, const lx_interval &) throw(); 00942 lx_interval ln_sqrtx2y2(const lx_interval &, const lx_interval &) throw(); 00944 lx_interval sqrt(const lx_interval &, int) throw(); 00945 00946 } // end namespace cxsc 00947 00948 #include "lx_interval.inl" 00949 00950 #endif // _CXSC_LX_INTERVAL_HPP_INCLUDED