C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
lx_cinterval.inl
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_cinterval.inl,v 1.9 2014/01/30 17:23:47 cxsc Exp $ */
00025 
00026 /*
00027 **  F. Blomquist, University of Wuppertal, 19.09.2007;
00028 */
00029 
00030 namespace cxsc {
00031         
00032 // --------------------------------------------------------------------------
00033 // ------ Inline functions and operators related to type lx_cinterval -------
00034 // --------------------------------------------------------------------------
00035 
00036 // --------------------------------------------------------------------------
00037 // -------------------------- Constructors ----------------------------------
00038 // --------------------------------------------------------------------------
00039 
00040 inline lx_cinterval::lx_cinterval(const lx_interval & a, 
00041                                 const lx_interval & b) throw()
00042       : re(a), im(b) { }
00043 
00044 inline lx_cinterval::lx_cinterval(const l_interval & a, 
00045                                 const l_interval & b) throw()
00046       : re(a), im(b) { }
00047 
00048 inline lx_cinterval::lx_cinterval(const interval & a, 
00049                                 const interval & b) throw()
00050       : re(a), im(b) { }
00051 
00052 inline lx_cinterval::lx_cinterval(const l_real & a, 
00053                                 const l_real & b) throw()
00054       : re(a), im(b) { }
00055 
00056 inline lx_cinterval::lx_cinterval(const lx_real & a, 
00057                                 const lx_real & b) throw()
00058       : re(a), im(b) { } 
00059 
00060 inline lx_cinterval::lx_cinterval(const real & a, 
00061                                 const real & b) throw()
00062       : re(a), im(b) { }
00063 
00064 inline lx_cinterval::lx_cinterval(const l_cinterval & a) throw()
00065       : re(Re(a)), im(Im(a)) { }
00066 
00067 inline lx_cinterval::lx_cinterval(const complex & a) throw()
00068       : re(Re(a)), im(Im(a)) { }
00069 
00070 inline lx_cinterval::lx_cinterval(const l_complex & a) throw()
00071       : re(Re(a)), im(Im(a)) { }
00072 
00073 inline lx_cinterval::lx_cinterval(const lx_complex & a) throw()
00074       : re(Re(a)), im(Im(a)) { }
00075 
00076 inline lx_cinterval::lx_cinterval(const lx_complex & a, const lx_complex & b)
00077     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
00078     : re(Re(a),Re(b)),
00079       im(Im(a),Im(b))
00080 {
00081    if(Inf(re)>Sup(re) || Inf(im)>Sup(im))
00082       cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval::lx_cinterval(const lx_complex & a,const lx_complex & b)"));
00083 }
00084 
00085 inline lx_cinterval::lx_cinterval(const l_complex & a, const l_complex & b)
00086     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
00087     : re(Re(a),Re(b)),
00088       im(Im(a),Im(b))
00089 {
00090    if(Inf(re)>Sup(re) || Inf(im)>Sup(im))
00091       cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval::lx_cinterval(const l_complex & a,const l_complex & b)"));
00092 }
00093 
00094 inline lx_cinterval::lx_cinterval(const complex & a, const complex & b)
00095     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
00096     : re(Re(a),Re(b)),
00097       im(Im(a),Im(b))
00098 {
00099    if(Inf(re)>Sup(re) || Inf(im)>Sup(im))
00100       cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval::lx_cinterval(const complex & a,const complex & b)"));
00101 }
00102 
00103 inline lx_cinterval::lx_cinterval(const cinterval & a) throw()
00104       : re(Re(a)), im(Im(a)) { }
00105 
00106 inline lx_cinterval::lx_cinterval(const real& na, const l_interval &la, 
00107                                   const real& nb, const l_interval &lb) 
00108                                   throw() : re(na,la), im(nb,lb) { }
00109 
00110 inline lx_cinterval::lx_cinterval(const real &n, const l_interval &a, 
00111                                          const lx_interval &b) 
00112                                          throw() : re(n,a), im(b) { }
00113 
00114 inline lx_cinterval::lx_cinterval(const lx_interval &a,
00115                                   const real &n, const l_interval &b) 
00116                                         throw() : re(a), im(n,b) { }
00117 
00118 inline lx_cinterval::lx_cinterval(const real &nr, const string &sr, 
00119                                   const real &ni, const string &si) 
00120           throw() : re(lx_interval(nr,sr)), im(lx_interval(ni,si)) { }
00121 
00122 inline lx_cinterval::lx_cinterval(const lx_interval & a) throw()
00123                                                   : re(a), im(0) { }
00124 
00125 inline lx_cinterval::lx_cinterval(const l_interval & a) throw()
00126                                                   : re(a), im(0) { }
00127 
00128 inline lx_cinterval::lx_cinterval(const interval & a) throw()
00129                                                   : re(a), im(0) { }
00130 
00131 inline lx_cinterval::lx_cinterval(const lx_real & a) throw()
00132                                                   : re(a), im(0) { }
00133 
00134 inline lx_cinterval::lx_cinterval(const l_real & a) throw()
00135                                                   : re(a), im(0) { }
00136 
00137 inline lx_cinterval::lx_cinterval(const real & a) throw()
00138                                                   : re(a), im(0) { }
00139 
00140 inline lx_cinterval::lx_cinterval(const real& n, const l_interval &a) throw()
00141                                                   : re(n,a), im(0) { }
00142 
00143 
00144 
00145 // -----------------------------------------------------------------------
00146 // ------------------------------ Assignments ----------------------------
00147 // -----------------------------------------------------------------------
00148 
00149 inline lx_cinterval & lx_cinterval::operator = (const lx_cinterval & a) throw()
00150 {
00151     re = a.re;
00152     im = a.im;
00153     return *this;
00154 } 
00155 
00156 inline lx_cinterval & lx_cinterval::operator = (const l_cinterval & a) throw()
00157 {
00158     re = Re(a);
00159     im = Im(a);
00160     return *this;
00161 } 
00162 
00163 inline lx_cinterval & lx_cinterval::operator = (const cinterval & a) throw()
00164 {
00165     re = Re(a);
00166     im = Im(a);
00167     return *this;
00168 } 
00169 
00170 inline lx_cinterval & lx_cinterval::operator = (const lx_interval & a) throw()
00171 {
00172     re = a;
00173     im = 0.0;
00174     return *this;
00175 } 
00176 
00177 inline lx_cinterval & lx_cinterval::operator = (const l_interval & a) throw()
00178 {
00179     re = a;
00180     im = 0.0;
00181     return *this;
00182 } 
00183 
00184 inline lx_cinterval & lx_cinterval::operator = (const interval & a) throw()
00185 {
00186     re = a;
00187     im = 0.0;
00188     return *this;
00189 } 
00190 
00191 inline lx_cinterval & lx_cinterval::operator = (const lx_real & a) throw()
00192 {
00193     re = a;
00194     im = 0.0;
00195     return *this;
00196 } 
00197 
00198 inline lx_cinterval & lx_cinterval::operator = (const l_real & a) throw()
00199 {
00200     re = a;
00201     im = 0.0;
00202     return *this;
00203 } 
00204 
00205 inline lx_cinterval & lx_cinterval::operator = (const real & a) throw()
00206 {
00207     re = a;
00208     im = 0.0;
00209     return *this;
00210 } 
00211 
00212 inline lx_cinterval & lx_cinterval::operator = (const lx_complex & a ) throw()
00213 {
00214     re = Re(a);
00215     im = Im(a);
00216     return *this;
00217 }
00218 
00219 inline lx_cinterval & lx_cinterval::operator = (const l_complex & a ) throw()
00220 {
00221     re = Re(a);
00222     im = Im(a);
00223     return *this;
00224 }
00225 
00226 inline lx_cinterval & lx_cinterval::operator = (const complex & a ) throw()
00227 {
00228     re = Re(a);
00229     im = Im(a);
00230     return *this;
00231 }
00232 
00233 
00234 
00235 // -----------------------------------------------------------------------
00236 // ---------------------------- Functions --------------------------------
00237 // -----------------------------------------------------------------------
00238 
00239 inline lx_complex Inf(const lx_cinterval &a) throw()
00240 { return lx_complex(Inf(a.re),Inf(a.im)); }
00241 
00242 inline lx_complex Sup(const lx_cinterval &a) throw()
00243 { return lx_complex(Sup(a.re),Sup(a.im)); }
00244 
00245 inline lx_interval Re(const lx_cinterval &a) throw() 
00246 { return a.re; }
00247 
00248 inline lx_interval Im(const lx_cinterval &a) throw() 
00249 { return a.im; }
00250 
00251 
00252 inline lx_cinterval & SetRe(lx_cinterval &a, const lx_interval &b) 
00253 { a.re=b; return a; }
00254 inline lx_cinterval & SetRe(lx_cinterval &a, const l_interval &b) 
00255 { a.re=b; return a; }
00256 inline lx_cinterval & SetRe(lx_cinterval &a, const interval &b) 
00257 { a.re=b; return a; }
00258 inline lx_cinterval & SetRe(lx_cinterval &a, const lx_real &b) 
00259 { a.re=b; return a; }
00260 inline lx_cinterval & SetRe(lx_cinterval &a, const l_real &b) 
00261 { a.re=b; return a; }
00262 inline lx_cinterval & SetRe(lx_cinterval &a, const real &b) 
00263 { a.re=b; return a; }
00264 
00265 inline lx_cinterval & SetIm(lx_cinterval &a, const lx_interval &b) 
00266 { a.im=b; return a; }
00267 inline lx_cinterval & SetIm(lx_cinterval &a, const l_interval &b) 
00268 { a.im=b; return a; }
00269 inline lx_cinterval & SetIm(lx_cinterval &a, const interval &b) 
00270 { a.im=b; return a; }
00271 inline lx_cinterval & SetIm(lx_cinterval &a, const lx_real &b) 
00272 { a.im=b; return a; }
00273 inline lx_cinterval & SetIm(lx_cinterval &a, const l_real &b) 
00274 { a.im=b; return a; }
00275 inline lx_cinterval & SetIm(lx_cinterval &a, const real &b) 
00276 { a.im=b; return a; }
00277 
00278 
00279 inline lx_real InfRe(const lx_cinterval &a) throw() 
00280 { return Inf(a.re); }
00281 inline lx_real InfIm(const lx_cinterval &a) throw()
00282 { return Inf(a.im); }
00283 inline lx_real SupRe(const lx_cinterval &a) throw()
00284 { return Sup(a.re); }
00285 inline lx_real SupIm(const lx_cinterval &a) throw()
00286 { return Sup(a.im); }
00287 
00288 inline lx_complex mid(const lx_cinterval &a) throw()
00289 { return lx_complex(mid(a.re),mid(a.im)); }
00290 
00291 inline lx_complex diam(const lx_cinterval &a) throw()
00292 { return lx_complex(diam(a.re),diam(a.im)); }
00293 
00294 inline real expo_Re(const lx_cinterval &a) throw()
00295 { return expo(a.re); }
00296 
00297 inline real expo_Im(const lx_cinterval &a) throw() 
00298 { return expo(a.im); }
00299 
00300 inline l_interval li_part_Re(const lx_cinterval &a) throw()
00301 { return li_part(a.re); }
00302 
00303 inline l_interval li_part_Im(const lx_cinterval &a) throw()
00304 { return li_part(a.im); }
00305 
00306 inline lx_cinterval adjust(const lx_cinterval &a) throw()
00307 { return lx_cinterval(adjust(a.re),adjust(a.im)); }
00308 
00309 inline lx_cinterval conj(const lx_cinterval &a) throw()
00310 { return lx_cinterval(a.re,-a.im); }
00311 
00312 inline void times2pown(lx_cinterval& x, const real &n) throw()
00313 { 
00314     lx_interval a(x.re),b(x.im);
00315     times2pown(a,n);
00316     times2pown(b,n);
00317     x = lx_cinterval(a,b);      
00318 }
00319 
00320 inline lx_interval abs(const lx_cinterval &a) throw()
00321 { 
00322         return sqrtx2y2(a.re,a.im); 
00323 }
00324 
00325 // -----------------------------------------------------------------------
00326 // ------------------------ Monadic Operators ----------------------------
00327 // -----------------------------------------------------------------------
00328 
00329 inline lx_cinterval operator-(const lx_cinterval & a) throw()
00330 {  return lx_cinterval(-a.re,-a.im); }
00331 
00332 inline lx_cinterval operator+(const lx_cinterval & a) throw()
00333 {  return a; }
00334 
00335 
00336 // -----------------------------------------------------------------------
00337 // ----------------------- Arithmetic Operators --------------------------
00338 // -----------------------------------------------------------------------
00339 
00340 inline lx_cinterval operator + (const lx_cinterval &a, const lx_cinterval &b) 
00341        throw()
00342        { return lx_cinterval(a.re + b.re, a.im + b.im); }
00343 
00344 inline lx_cinterval operator + (const lx_cinterval &a, const l_cinterval &b) 
00345        throw()
00346        { return lx_cinterval(a.re + Re(b), a.im + Im(b)); }
00347 
00348 inline lx_cinterval operator + (const l_cinterval &a, const lx_cinterval &b) 
00349        throw()
00350        { return lx_cinterval(Re(a) + b.re, Im(a) + b.im); }
00351 
00352 inline lx_cinterval operator + (const lx_cinterval &a, const cinterval &b) 
00353        throw()
00354        { return lx_cinterval(a.re + Re(b), a.im + Im(b)); }
00355  
00356 inline lx_cinterval operator + (const cinterval &a, const lx_cinterval &b) 
00357        throw()
00358        { return lx_cinterval(Re(a) + b.re, Im(a) + b.im); }
00359 
00360 inline lx_cinterval operator + (const lx_cinterval &a, const lx_interval &b) 
00361        throw()
00362        { return lx_cinterval(a.re + b, a.im); }
00363 
00364 inline lx_cinterval operator + (const lx_interval &a, const lx_cinterval &b) 
00365        throw()
00366        { return lx_cinterval(a + b.re, b.im); }
00367 
00368 inline lx_cinterval operator + (const lx_cinterval &a, const l_interval &b) 
00369        throw()
00370        { return lx_cinterval(a.re + b, a.im); }
00371 
00372 inline lx_cinterval operator + (const l_interval &a, const lx_cinterval &b) 
00373        throw()
00374        { return lx_cinterval(a + b.re, b.im); }
00375 
00376 inline lx_cinterval operator + (const lx_cinterval &a, const lx_real &b) throw()
00377        { return lx_cinterval(a.re + b, a.im); }
00378 
00379 inline lx_cinterval operator + (const lx_real &a, const lx_cinterval &b) throw()
00380        { return lx_cinterval(a + b.re, b.im); }
00381 
00382 inline lx_cinterval operator + (const lx_cinterval &a, const l_real &b) throw()
00383        { return lx_cinterval(a.re + b, a.im); }
00384 
00385 inline lx_cinterval operator + (const l_real &a, const lx_cinterval &b) throw()
00386        { return lx_cinterval(a + b.re, b.im); } 
00387 
00388 inline lx_cinterval operator + (const lx_cinterval &a, const real &b) throw()
00389        { return lx_cinterval(a.re + b, a.im); }
00390 
00391 inline lx_cinterval operator + (const real &a, const lx_cinterval &b) throw()
00392        { return lx_cinterval(a + b.re, b.im); }
00393 
00394 inline lx_cinterval operator + (const lx_cinterval &a, const complex &b) throw()
00395        { return lx_cinterval(a.re + Re(b), a.im + Im(b)); }
00396 inline lx_cinterval operator + (const complex &a, const lx_cinterval &b) throw()
00397        { return lx_cinterval(Re(a) + b.re, Im(a) + b.im); } 
00398 
00399 inline lx_cinterval operator + (const lx_cinterval &a, const l_complex &b) 
00400     throw() { return lx_cinterval(a.re + Re(b), a.im + Im(b)); }
00401 inline lx_cinterval operator + (const l_complex &a, const lx_cinterval &b) 
00402     throw() { return lx_cinterval(Re(a) + b.re, Im(a) + b.im); }
00403 
00404 inline lx_cinterval operator + (const lx_cinterval &a, const lx_complex &b) 
00405     throw() { return lx_cinterval(a.re + Re(b), a.im + Im(b)); }
00406 inline lx_cinterval operator + (const lx_complex &a, const lx_cinterval &b) 
00407     throw() { return lx_cinterval(Re(a) + b.re, Im(a) + b.im); }
00408 
00409 
00410 inline lx_cinterval & operator +=(lx_cinterval &a, const lx_cinterval &b) throw()
00411 {  return a = a+b; }
00412 
00413 inline lx_cinterval & operator +=(lx_cinterval &a, const lx_interval &b) throw()
00414 {  return a = a+b; }
00415 
00416 inline lx_cinterval & operator +=(lx_cinterval &a, const l_interval &b) throw()
00417 {  return a = a+b; }
00418 
00419 inline lx_cinterval & operator +=(lx_cinterval &a, const l_cinterval &b) throw()
00420 {  return a = a+b; }
00421 
00422 inline lx_cinterval & operator +=(lx_cinterval &a, const l_real &b) throw()
00423 {  return a = a+b; }
00424 
00425 inline lx_cinterval & operator +=(lx_cinterval &a, const lx_real &b) throw()
00426 {  return a = a+b; }
00427 
00428 inline lx_cinterval & operator +=(lx_cinterval &a, const real &b) throw()
00429 {  return a = a+b; }
00430 
00431 inline lx_cinterval & operator +=(lx_cinterval &a, const interval &b) throw()
00432 {  return a = a+b; }
00433 
00434 inline lx_cinterval & operator +=(lx_cinterval &a, const cinterval &b) throw()
00435 {  return a = a+b; }
00436 
00437 inline lx_cinterval & operator +=(lx_cinterval &a, const complex &b) throw()
00438 {  return a = a+b; }
00439 
00440 inline lx_cinterval & operator +=(lx_cinterval &a, const l_complex &b) throw()
00441 {  return a = a+b; }
00442 
00443 inline lx_cinterval & operator +=(lx_cinterval &a, const lx_complex &b) throw()
00444 {  return a = a+b; }
00445 
00446 
00447 inline lx_cinterval operator - (const lx_cinterval &a, const lx_cinterval &b) 
00448        throw() { return lx_cinterval(a.re - b.re, a.im - b.im); }
00449 
00450 inline lx_cinterval operator - (const lx_cinterval &a, const l_cinterval &b) 
00451        throw() { return lx_cinterval(a.re - Re(b), a.im - Im(b)); }
00452 
00453 inline lx_cinterval operator - (const l_cinterval &a, const lx_cinterval &b) 
00454        throw() { return lx_cinterval(Re(a) - b.re, Im(a) - b.im); }
00455 
00456 inline lx_cinterval operator - (const lx_cinterval &a, const cinterval &b) 
00457        throw() { return lx_cinterval(a.re - Re(b), a.im - Im(b)); }
00458  
00459 inline lx_cinterval operator - (const cinterval &a, const lx_cinterval &b) 
00460        throw() { return lx_cinterval(Re(a) - b.re, Im(a) - b.im); }
00461 
00462 inline lx_cinterval operator - (const lx_cinterval &a, const lx_interval &b) 
00463        throw() { return lx_cinterval(a.re - b, a.im); }
00464 
00465 inline lx_cinterval operator - (const lx_interval &a, const lx_cinterval &b) 
00466        throw() { return lx_cinterval(a - b.re, -b.im); }
00467 
00468 inline lx_cinterval operator - (const lx_cinterval &a, const l_interval &b) 
00469        throw() { return lx_cinterval(a.re - b, a.im); }
00470 
00471 inline lx_cinterval operator - (const l_interval &a, const lx_cinterval &b) 
00472        throw() { return lx_cinterval(a - b.re, -b.im); }
00473 
00474 inline lx_cinterval operator - (const lx_cinterval &a, const lx_real &b) throw()
00475 { return lx_cinterval(a.re - b, a.im); }
00476 
00477 inline lx_cinterval operator - (const lx_real &a, const lx_cinterval &b) throw()
00478 { return lx_cinterval(a - b.re, -b.im); }
00479 
00480 inline lx_cinterval operator - (const lx_cinterval &a, const l_real &b) throw()
00481 { return lx_cinterval(a.re - b, a.im); }
00482 
00483 inline lx_cinterval operator - (const l_real &a, const lx_cinterval &b) throw()
00484 { return lx_cinterval(a - b.re, -b.im); } 
00485 
00486 inline lx_cinterval operator - (const lx_cinterval &a, const real &b) throw()
00487 { return lx_cinterval(a.re - b, a.im); }
00488 
00489 inline lx_cinterval operator - (const real &a, const lx_cinterval &b) throw()
00490 { return lx_cinterval(a - b.re, -b.im); } 
00491 
00492 inline lx_cinterval operator - (const lx_cinterval &a, const complex &b) throw()
00493        { return lx_cinterval(a.re - Re(b), a.im - Im(b)); }
00494 inline lx_cinterval operator - (const complex &a, const lx_cinterval &b) throw()
00495        { return lx_cinterval(Re(a) - b.re, Im(a) - b.im); }
00496 inline lx_cinterval operator - (const lx_cinterval &a, const l_complex &b) 
00497     throw() { return lx_cinterval(a.re - Re(b), a.im - Im(b)); }
00498 inline lx_cinterval operator - (const l_complex &a, const lx_cinterval &b) 
00499     throw() { return lx_cinterval(Re(a) - b.re, Im(a) - b.im); }
00500 inline lx_cinterval operator - (const lx_cinterval &a, const lx_complex &b) 
00501     throw() { return lx_cinterval(a.re - Re(b), a.im - Im(b)); }
00502 inline lx_cinterval operator - (const lx_complex &a, const lx_cinterval &b) 
00503     throw() { return lx_cinterval(Re(a) - b.re, Im(a) - b.im); }
00504 
00505 
00506 inline lx_cinterval & operator -=(lx_cinterval &a, const lx_cinterval &b) throw()
00507 {  return a = a-b; }
00508 
00509 inline lx_cinterval & operator -=(lx_cinterval &a, const lx_interval &b) throw()
00510 {  return a = a-b; }
00511 
00512 inline lx_cinterval & operator -=(lx_cinterval &a, const l_interval &b) throw()
00513 {  return a = a-b; }
00514 
00515 inline lx_cinterval & operator -=(lx_cinterval &a, const l_cinterval &b) throw()
00516 {  return a = a-b; }
00517 
00518 inline lx_cinterval & operator -=(lx_cinterval &a, const l_real &b) throw()
00519 {  return a = a-b; }
00520 
00521 inline lx_cinterval & operator -=(lx_cinterval &a, const lx_real &b) throw()
00522 {  return a = a-b; }
00523 
00524 inline lx_cinterval & operator -=(lx_cinterval &a, const real &b) throw()
00525 {  return a = a-b; }
00526 
00527 inline lx_cinterval & operator -=(lx_cinterval &a, const interval &b) throw()
00528 {  return a = a-b; }
00529 
00530 inline lx_cinterval & operator -=(lx_cinterval &a, const cinterval &b) throw()
00531 {  return a = a-b; }
00532 inline lx_cinterval & operator -=(lx_cinterval &a, const complex &b) throw()
00533 {  return a = a-b; }
00534 inline lx_cinterval & operator -=(lx_cinterval &a, const l_complex &b) throw()
00535 {  return a = a-b; }
00536 inline lx_cinterval & operator -=(lx_cinterval &a, const lx_complex &b) throw()
00537 {  return a = a-b; }
00538 
00539 
00540 inline lx_cinterval operator * (const lx_cinterval &a,const lx_cinterval &b) 
00541 throw()
00542 { return lx_cinterval(a.re*b.re - a.im*b.im, a.im*b.re + a.re*b.im); }
00543 
00544 inline lx_cinterval operator * (const lx_cinterval &a, const l_cinterval &b) 
00545 throw()
00546 { return a * lx_cinterval(b); }
00547 
00548 inline lx_cinterval operator * (const l_cinterval &a, const lx_cinterval &b) 
00549 throw()
00550 { return lx_cinterval(a) * b; }
00551 
00552 inline lx_cinterval operator * (const lx_cinterval &a, const cinterval &b) 
00553 throw()
00554 { return a * lx_cinterval(b); }
00555  
00556 inline lx_cinterval operator * (const cinterval &a, const lx_cinterval &b) 
00557 throw()
00558 { return lx_cinterval(a) * b; }
00559 
00560 
00561 inline lx_cinterval operator * (const lx_cinterval &a, const lx_interval &b) 
00562 throw()
00563 { return lx_cinterval(a.re*b, a.im*b); }
00564 
00565 inline lx_cinterval operator * (const lx_interval &a, const lx_cinterval &b) 
00566 throw()
00567 { return lx_cinterval(a*b.re, a*b.im); }
00568 
00569 inline lx_cinterval operator * (const lx_cinterval &a, const l_interval &b) 
00570 throw()
00571 { return lx_cinterval(a.re*b, a.im*b); }
00572 
00573 inline lx_cinterval operator * (const l_interval &a, const lx_cinterval &b) 
00574 throw() 
00575 { return lx_cinterval(a*b.re, a*b.im); }
00576 
00577 inline lx_cinterval operator * (const lx_cinterval &a, const lx_real &b) throw()
00578 { return lx_cinterval(a.re*b, a.im*b); }
00579 
00580 inline lx_cinterval operator * (const lx_real &a, const lx_cinterval &b) throw()
00581 { return lx_cinterval(a*b.re, a*b.im); }
00582 
00583 inline lx_cinterval operator * (const lx_cinterval &a, const l_real &b) throw()
00584 { return lx_cinterval(a.re*b, a.im*b); }
00585 
00586 inline lx_cinterval operator * (const l_real &a, const lx_cinterval &b) throw()
00587 { return lx_cinterval(a*b.re, a*b.im); } 
00588 
00589 inline lx_cinterval operator * (const lx_cinterval &a, const real &b) throw()
00590 { return lx_cinterval(a.re*b, a.im*b); }
00591 
00592 inline lx_cinterval operator * (const real &a, const lx_cinterval &b) throw()
00593 { return lx_cinterval(a*b.re, a*b.im); } 
00594 
00595 inline lx_cinterval operator * (const lx_cinterval &a, const complex &b) throw()
00596 { return a * lx_cinterval(b); }
00597 inline lx_cinterval operator * (const complex &a, const lx_cinterval &b) throw()
00598 { return lx_cinterval(a) * b; }
00599 inline lx_cinterval operator * (const lx_cinterval &a, const l_complex &b) 
00600     throw() { return a * lx_cinterval(b); }
00601 inline lx_cinterval operator * (const l_complex &a, const lx_cinterval &b) 
00602     throw() { return lx_cinterval(a) * b; } 
00603 inline lx_cinterval operator * (const lx_cinterval &a, const lx_complex &b) 
00604     throw() { return a * lx_cinterval(b); }
00605 inline lx_cinterval operator * (const lx_complex &a, const lx_cinterval &b) 
00606     throw() { return lx_cinterval(a) * b; } 
00607 
00608 
00609 inline lx_cinterval & operator *=(lx_cinterval &a, const lx_cinterval &b) throw()
00610 {  return a = a*b; }
00611 
00612 inline lx_cinterval & operator *=(lx_cinterval &a, const lx_interval &b) throw()
00613 {  return a = a*b; }
00614 
00615 inline lx_cinterval & operator *=(lx_cinterval &a, const l_interval &b) throw()
00616 {  return a = a*b; }
00617 
00618 inline lx_cinterval & operator *=(lx_cinterval &a, const l_cinterval &b) throw()
00619 {  return a = a*b; }
00620 
00621 inline lx_cinterval & operator *=(lx_cinterval &a, const l_real &b) throw()
00622 {  return a = a*b; }
00623 
00624 inline lx_cinterval & operator *=(lx_cinterval &a, const lx_real &b) throw()
00625 {  return a = a*b; }
00626 
00627 inline lx_cinterval & operator *=(lx_cinterval &a, const real &b) throw()
00628 {  return a = a*b; }
00629 
00630 inline lx_cinterval & operator *=(lx_cinterval &a, const interval &b) throw()
00631 {  return a = a*b; }
00632 
00633 inline lx_cinterval & operator *=(lx_cinterval &a, const cinterval &b) throw()
00634 {  return a = a*b; }
00635 
00636 inline lx_cinterval & operator *=(lx_cinterval &a, const complex &b) throw()
00637 {  return a = a*b; }
00638 
00639 inline lx_cinterval & operator *=(lx_cinterval &a, const l_complex &b) throw()
00640 {  return a = a*b; }
00641 
00642 inline lx_cinterval & operator *=(lx_cinterval &a, const lx_complex &b) throw()
00643 {  return a = a*b; }
00644 
00645 
00646 inline lx_cinterval operator / (const lx_cinterval &a, const lx_cinterval &b) 
00647 throw()
00648 {
00649     lx_interval Ne(sqr(b.re) + sqr(b.im));
00650 
00651     return lx_cinterval( (a.re*b.re + a.im*b.im)/Ne, 
00652                         (a.im*b.re - a.re*b.im)/Ne );
00653 }
00654 
00655 inline lx_cinterval operator / (const lx_cinterval &a, const l_cinterval &b) 
00656 throw()
00657 { return a / lx_cinterval(b); }
00658 
00659 inline lx_cinterval operator / (const l_cinterval &a, const lx_cinterval &b) 
00660 throw()
00661 { return lx_cinterval(a) / b; }
00662 
00663 inline lx_cinterval operator / (const lx_cinterval &a, const cinterval &b) 
00664 throw()
00665 { return a / lx_cinterval(b); }
00666  
00667 inline lx_cinterval operator / (const cinterval &a, const lx_cinterval &b) 
00668 throw()
00669 { return lx_cinterval(a) / b; }
00670 
00671 inline lx_cinterval operator / (const lx_cinterval &a, const lx_interval &b) 
00672 throw()
00673 { return lx_cinterval(a.re/b, a.im/b); }
00674 
00675 inline lx_cinterval operator / (const lx_interval &a, const lx_cinterval &b) 
00676 throw()
00677 { return lx_cinterval(a) / b; }
00678 
00679 inline lx_cinterval operator / (const lx_cinterval &a, const l_interval &b) 
00680 throw()
00681 { return lx_cinterval(a.re/b, a.im/b); }
00682 
00683 inline lx_cinterval operator / (const l_interval &a, const lx_cinterval &b) 
00684 throw()
00685 { return lx_cinterval(a) / b; }
00686 
00687 inline lx_cinterval operator / (const lx_cinterval &a, const l_real &b) throw()
00688 { return lx_cinterval(a.re/b, a.im/b); }
00689 
00690 inline lx_cinterval operator / (const l_real &a, const lx_cinterval &b) throw()
00691 { return lx_cinterval(a) / b; }
00692 
00693 inline lx_cinterval operator / (const lx_cinterval &a, const lx_real &b) throw()
00694 { return lx_cinterval(a.re/b, a.im/b); }
00695 
00696 inline lx_cinterval operator / (const lx_real &a, const lx_cinterval &b) throw()
00697 { return lx_cinterval(a) / b; } 
00698 
00699 inline lx_cinterval operator / (const lx_cinterval &a, const real &b) throw()
00700 { return lx_cinterval(a.re/b, a.im/b); }
00701 
00702 inline lx_cinterval operator / (const real &a, const lx_cinterval &b) throw()
00703 { return lx_cinterval(a) / b; } 
00704 
00705 inline lx_cinterval operator / (const lx_cinterval &a, const complex &b) throw()
00706 { return a / lx_cinterval(b); }
00707 inline lx_cinterval operator / (const complex &a, const lx_cinterval &b) throw()
00708 { return lx_cinterval(a) / b; }
00709 
00710 inline lx_cinterval operator / (const lx_cinterval &a, const l_complex &b) 
00711     throw() { return a / lx_cinterval(b); }
00712 inline lx_cinterval operator / (const l_complex &a, const lx_cinterval &b) 
00713     throw() { return lx_cinterval(a) / b; }
00714 
00715 inline lx_cinterval operator / (const lx_cinterval &a, const lx_complex &b) 
00716     throw() { return a / lx_cinterval(b); }
00717 inline lx_cinterval operator / (const lx_complex &a, const lx_cinterval &b) 
00718     throw() { return lx_cinterval(a) / b; } 
00719 
00720 
00721 inline lx_cinterval & operator /=(lx_cinterval &a, const lx_cinterval &b) throw()
00722 {  return a = a/b; }
00723 
00724 inline lx_cinterval & operator /=(lx_cinterval &a, const lx_interval &b) throw()
00725 {  return a = a/b; }
00726 
00727 inline lx_cinterval & operator /=(lx_cinterval &a, const l_interval &b) throw()
00728 {  return a = a/b; }
00729 
00730 inline lx_cinterval & operator /=(lx_cinterval &a, const l_cinterval &b) throw()
00731 {  return a = a/b; }
00732 
00733 inline lx_cinterval & operator /=(lx_cinterval &a, const l_real &b) throw()
00734 {  return a = a/b; }
00735 
00736 inline lx_cinterval & operator /=(lx_cinterval &a, const lx_real &b) throw()
00737 {  return a = a/b; }
00738 
00739 inline lx_cinterval & operator /=(lx_cinterval &a, const real &b) throw()
00740 {  return a = a/b; }
00741 
00742 inline lx_cinterval & operator /=(lx_cinterval &a, const interval &b) throw()
00743 {  return a = a/b; }
00744 
00745 inline lx_cinterval & operator /=(lx_cinterval &a, const cinterval &b) throw()
00746 {  return a = a/b; }
00747 
00748 inline lx_cinterval & operator /=(lx_cinterval &a, const complex &b) throw()
00749 {  return a = a/b; }
00750 
00751 inline lx_cinterval & operator /=(lx_cinterval &a, const l_complex &b) throw()
00752 {  return a = a/b; }
00753 
00754 inline lx_cinterval & operator /=(lx_cinterval &a, const lx_complex &b) throw()
00755 {  return a = a/b; }
00756 
00757 
00758 
00759 inline bool operator ! (const lx_cinterval & a) throw()
00760 { return !a.re && !a.im; }
00761 
00762 
00763 inline bool operator == (const lx_cinterval &a, const lx_cinterval &b) throw()
00764 { return a.re == b.re && a.im == b.im; }
00765 
00766 inline bool operator == (const lx_cinterval &a, const l_cinterval &b) throw()
00767 { return a == lx_cinterval(b); }
00768 inline bool operator == (const l_cinterval &a, const lx_cinterval &b) throw()
00769 { return lx_cinterval(a) == b; }
00770 
00771 inline bool operator == (const lx_cinterval &a, const lx_interval &b) throw()
00772 { return a == lx_cinterval(b); }
00773 inline bool operator == (const lx_interval &a, const lx_cinterval &b) throw()
00774 { return lx_cinterval(a) == b; }
00775 
00776 inline bool operator == (const lx_cinterval &a, const l_interval &b) throw()
00777 { return a == lx_cinterval(b); }
00778 inline bool operator == (const l_interval &a, const lx_cinterval &b) throw()
00779 { return lx_cinterval(a) == b; }
00780 
00781 inline bool operator == (const lx_cinterval &a, const l_real &b) throw()
00782 { return a == lx_cinterval(b); }
00783 inline bool operator == (const l_real &a, const lx_cinterval &b) throw()
00784 { return lx_cinterval(a) == b; }
00785 
00786 inline bool operator == (const lx_cinterval &a, const lx_real &b) throw()
00787 { return a == lx_cinterval(b); }
00788 inline bool operator == (const lx_real &a, const lx_cinterval &b) throw()
00789 { return lx_cinterval(a) == b; }
00790 
00791 inline bool operator == (const lx_cinterval &a, const real &b) throw()
00792 { return a == lx_cinterval(b); }
00793 inline bool operator == (const real &a, const lx_cinterval &b) throw()
00794 { return lx_cinterval(a) == b; }
00795 
00796 inline bool operator == (const lx_cinterval &a, const interval &b) throw()
00797 { return a == lx_cinterval(b); }
00798 inline bool operator == (const interval &a, const lx_cinterval &b) throw()
00799 { return lx_cinterval(a) == b; }
00800 
00801 inline bool operator == (const lx_cinterval &a, const cinterval &b) throw()
00802 { return a == lx_cinterval(b); }
00803 inline bool operator == (const cinterval &a, const lx_cinterval &b) throw()
00804 { return lx_cinterval(a) == b; }
00805 
00806 inline bool operator == (const lx_cinterval &a, const complex &b) throw()
00807 { return a == lx_cinterval(b); }
00808 inline bool operator == (const complex &a, const lx_cinterval &b) throw()
00809 { return lx_cinterval(a) == b; }
00810 
00811 inline bool operator == (const lx_cinterval &a, const l_complex &b) throw()
00812 { return a == lx_cinterval(b); }
00813 inline bool operator == (const l_complex &a, const lx_cinterval &b) throw()
00814 { return lx_cinterval(a) == b; }
00815 
00816 inline bool operator == (const lx_cinterval &a, const lx_complex &b) throw()
00817 { return a == lx_cinterval(b); }
00818 inline bool operator == (const lx_complex &a, const lx_cinterval &b) throw()
00819 { return lx_cinterval(a) == b; }
00820 
00821 
00822 inline bool operator != (const lx_cinterval &a, const lx_cinterval &b) throw()
00823 { return a.re != b.re || a.im != b.im; }
00824 
00825 inline bool operator != (const lx_cinterval &a, const l_cinterval &b) throw()
00826 { return !(a == b); }
00827 inline bool operator != (const l_cinterval &a, const lx_cinterval &b) throw()
00828 { return !(a == b); }
00829 
00830 inline bool operator != (const lx_cinterval &a, const lx_interval &b) throw()
00831 { return !(a == b); }
00832 inline bool operator != (const lx_interval &a, const lx_cinterval &b) throw()
00833 { return !(a == b); }
00834 
00835 inline bool operator != (const lx_cinterval &a, const l_interval &b) throw()
00836 { return !(a == b); }
00837 inline bool operator != (const l_interval &a, const lx_cinterval &b) throw()
00838 { return !(a == b); }
00839 
00840 inline bool operator != (const lx_cinterval &a, const l_real &b) throw()
00841 { return !(a == b); }
00842 inline bool operator != (const l_real &a, const lx_cinterval &b) throw()
00843 { return !(a == b); }
00844 
00845 inline bool operator != (const lx_cinterval &a, const lx_real &b) throw()
00846 { return !(a == b); }
00847 inline bool operator != (const lx_real &a, const lx_cinterval &b) throw()
00848 { return !(a == b); }
00849 
00850 inline bool operator != (const lx_cinterval &a, const real &b) throw()
00851 { return !(a == b); }
00852 inline bool operator != (const real &a, const lx_cinterval &b) throw()
00853 { return !(a == b); }
00854 
00855 inline bool operator != (const lx_cinterval &a, const interval &b) throw()
00856 { return !(a == b); }
00857 inline bool operator != (const interval &a, const lx_cinterval &b) throw()
00858 { return !(a == b); }
00859 
00860 inline bool operator != (const lx_cinterval &a, const cinterval &b) throw()
00861 { return !(a == b); }
00862 inline bool operator != (const cinterval &a, const lx_cinterval &b) throw()
00863 { return !(a == b); }
00864 
00865 inline bool operator != (const lx_cinterval &a, const complex &b) throw()
00866 { return !(a == b); }
00867 inline bool operator != (const complex &a, const lx_cinterval &b) throw()
00868 { return !(a == b); }
00869 
00870 inline bool operator != (const lx_cinterval &a, const l_complex &b) throw()
00871 { return !(a == b); }
00872 inline bool operator != (const l_complex &a, const lx_cinterval &b) throw()
00873 { return !(a == b); }
00874 
00875 inline bool operator != (const lx_cinterval &a, const lx_complex &b) throw()
00876 { return !(a == b); }
00877 inline bool operator != (const lx_complex &a, const lx_cinterval &b) throw()
00878 { return !(a == b); }
00879 
00880 
00881 
00882 // ------------------------- Set Operators -----------------------------------
00883 
00884 inline bool operator < (const lx_cinterval & a, const lx_cinterval & b) throw()
00885 {
00886    if (Inf(a.re) <= Inf(b.re) || Sup(a.re) >= Sup(b.re)) 
00887       return false;
00888    if (Inf(a.im) <= Inf(b.im) || Sup(a.im) >= Sup(b.im)) 
00889       return false;
00890       
00891    return true; 
00892 }
00893 
00894 inline bool operator > (const lx_cinterval & a, const lx_cinterval & b) throw() 
00895 { return b < a; }
00896 
00897 inline bool operator <= (const lx_cinterval & a, const lx_cinterval & b) throw()
00898 {
00899    if (Inf(a.re) < Inf(b.re) || Sup(a.re) > Sup(b.re)) 
00900       return false;
00901    if (Inf(a.im) < Inf(b.im) || Sup(a.im) > Sup(b.im)) 
00902       return false;
00903       
00904    return true; 
00905 }
00906 
00907 inline bool operator >= (const lx_cinterval & a, const lx_cinterval & b) throw()
00908 { return b <= a; }
00909 
00910 
00911 inline bool operator  <(const l_cinterval & a, const lx_cinterval & b) throw() 
00912                                              { return lx_cinterval(a) < b; }
00913 inline bool operator  >(const l_cinterval & a, const lx_cinterval & b) throw()
00914                                              { return lx_cinterval(a) > b; }
00915 inline bool operator <=(const l_cinterval & a, const lx_cinterval & b) throw()
00916                                             { return lx_cinterval(a) <= b; }
00917 inline bool operator >=(const l_cinterval & a, const lx_cinterval & b) throw()
00918                                             { return lx_cinterval(a) >= b; }
00919 
00920 inline bool operator  <(const lx_cinterval & a, const l_cinterval & b) throw()
00921                                              { return a < lx_cinterval(b); }
00922 inline bool operator  >(const lx_cinterval & a, const l_cinterval & b) throw() 
00923                                              { return a > lx_cinterval(b); }
00924 inline bool operator <=(const lx_cinterval & a, const l_cinterval & b) throw() 
00925                                             { return a <= lx_cinterval(b); }
00926 inline bool operator >=(const lx_cinterval & a, const l_cinterval & b) throw()
00927                                             { return a >= lx_cinterval(b); }
00928 
00929 inline bool operator  <(const cinterval & a, const lx_cinterval & b) throw() 
00930                                              { return lx_cinterval(a) < b; }
00931 inline bool operator  >(const cinterval & a, const lx_cinterval & b) throw()
00932                                              { return lx_cinterval(a) > b; }
00933 inline bool operator <=(const cinterval & a, const lx_cinterval & b) throw()
00934                                             { return lx_cinterval(a) <= b; }
00935 inline bool operator >=(const cinterval & a, const lx_cinterval & b) throw()
00936                                             { return lx_cinterval(a) >= b; }
00937 
00938 inline bool operator  <(const lx_cinterval & a, const cinterval & b) throw()
00939                                              { return a < lx_cinterval(b); }
00940 inline bool operator  >(const lx_cinterval & a, const cinterval & b) throw() 
00941                                              { return a > lx_cinterval(b); }
00942 inline bool operator <=(const lx_cinterval & a, const cinterval & b) throw() 
00943                                             { return a <= lx_cinterval(b); }
00944 inline bool operator >=(const lx_cinterval & a, const cinterval & b) throw()
00945                                             { return a >= lx_cinterval(b); }
00946 
00947 inline bool operator  <(const lx_interval & a, const lx_cinterval & b) throw() 
00948                                               { return lx_cinterval(a) < b; }
00949 inline bool operator  >(const lx_interval & a, const lx_cinterval & b) throw()
00950                                               { return lx_cinterval(a) > b; }
00951 inline bool operator <=(const lx_interval & a, const lx_cinterval & b) throw()
00952                                              { return lx_cinterval(a) <= b; }
00953 inline bool operator >=(const lx_interval & a, const lx_cinterval & b) throw()
00954                                              { return lx_cinterval(a) >= b; }
00955 
00956 inline bool operator  <(const lx_cinterval & a, const lx_interval & b) throw()
00957                                              { return a < lx_cinterval(b); }
00958 inline bool operator  >(const lx_cinterval & a, const lx_interval & b) throw() 
00959                                              { return a > lx_cinterval(b); }
00960 inline bool operator <=(const lx_cinterval & a, const lx_interval & b) throw() 
00961                                             { return a <= lx_cinterval(b); }
00962 inline bool operator >=(const lx_cinterval & a, const lx_interval & b) throw()
00963                                             { return a >= lx_cinterval(b); }
00964 
00965 inline bool operator  <(const l_interval & a, const lx_cinterval & b) throw() 
00966                                               { return lx_cinterval(a) < b; }
00967 inline bool operator  >(const l_interval & a, const lx_cinterval & b) throw()
00968                                               { return lx_cinterval(a) > b; }
00969 inline bool operator <=(const l_interval & a, const lx_cinterval & b) throw()
00970                                              { return lx_cinterval(a) <= b; }
00971 inline bool operator >=(const l_interval & a, const lx_cinterval & b) throw()
00972                                              { return lx_cinterval(a) >= b; }
00973 
00974 inline bool operator  <(const lx_cinterval & a, const l_interval & b) throw()
00975                                              { return a < lx_cinterval(b); }
00976 inline bool operator  >(const lx_cinterval & a, const l_interval & b) throw() 
00977                                              { return a > lx_cinterval(b); }
00978 inline bool operator <=(const lx_cinterval & a, const l_interval & b) throw() 
00979                                             { return a <= lx_cinterval(b); }
00980 inline bool operator >=(const lx_cinterval & a, const l_interval & b) throw()
00981                                             { return a >= lx_cinterval(b); }
00982 
00983 inline bool operator  <(const interval & a, const lx_cinterval & b) throw() 
00984                                             { return lx_cinterval(a) < b; }
00985 inline bool operator  >(const interval & a, const lx_cinterval & b) throw()
00986                                             { return lx_cinterval(a) > b; }
00987 inline bool operator <=(const interval & a, const lx_cinterval & b) throw()
00988                                            { return lx_cinterval(a) <= b; }
00989 inline bool operator >=(const interval & a, const lx_cinterval & b) throw()
00990                                            { return lx_cinterval(a) >= b; }
00991 
00992 inline bool operator  <(const lx_cinterval & a, const interval & b) throw()
00993                                             { return a < lx_cinterval(b); }
00994 inline bool operator  >(const lx_cinterval & a, const interval & b) throw() 
00995                                             { return a > lx_cinterval(b); }
00996 inline bool operator <=(const lx_cinterval & a, const interval & b) throw() 
00997                                            { return a <= lx_cinterval(b); }
00998 inline bool operator >=(const lx_cinterval & a, const interval & b) throw()
00999                                            { return a >= lx_cinterval(b); }
01000 
01001 inline bool operator  <(const lx_real & a, const lx_cinterval & b) throw() 
01002                                             { return lx_cinterval(a) < b; }
01003 inline bool operator <=(const lx_real & a, const lx_cinterval & b) throw()
01004                                            { return lx_cinterval(a) <= b; }
01005 inline bool operator  >(const lx_cinterval & a, const lx_real & b) throw() 
01006                                             { return a > lx_cinterval(b); }
01007 inline bool operator >=(const lx_cinterval & a, const lx_real & b) throw()
01008                                            { return a >= lx_cinterval(b); }
01009 
01010 inline bool operator  <(const l_real & a, const lx_cinterval & b) throw() 
01011                                             { return lx_cinterval(a) < b; }
01012 inline bool operator <=(const l_real & a, const lx_cinterval & b) throw()
01013                                            { return lx_cinterval(a) <= b; }
01014 inline bool operator  >(const lx_cinterval & a, const l_real & b) throw() 
01015                                             { return a > lx_cinterval(b); }
01016 inline bool operator >=(const lx_cinterval & a, const l_real & b) throw()
01017                                            { return a >= lx_cinterval(b); }
01018 
01019 inline bool operator  <(const real & a, const lx_cinterval & b) throw() 
01020                                             { return lx_cinterval(a) < b; }
01021 inline bool operator <=(const real & a, const lx_cinterval & b) throw()
01022                                            { return lx_cinterval(a) <= b; }
01023 inline bool operator  >(const lx_cinterval & a, const real & b) throw() 
01024                                             { return a > lx_cinterval(b); }
01025 inline bool operator >=(const lx_cinterval & a, const real & b) throw()
01026                                            { return a >= lx_cinterval(b); }
01027 
01028 inline bool operator  <(const complex & a, const lx_cinterval & b) throw() 
01029                                             { return lx_cinterval(a) < b; }
01030 inline bool operator <=(const complex & a, const lx_cinterval & b) throw()
01031                                            { return lx_cinterval(a) <= b; }
01032 inline bool operator  >(const lx_cinterval & a, const complex & b) throw() 
01033                                             { return a > lx_cinterval(b); }
01034 inline bool operator >=(const lx_cinterval & a, const complex & b) throw()
01035                                            { return a >= lx_cinterval(b); }
01036 
01037 inline bool operator  <(const l_complex & a, const lx_cinterval & b) throw() 
01038                                             { return lx_cinterval(a) < b; }
01039 inline bool operator <=(const l_complex & a, const lx_cinterval & b) throw()
01040                                            { return lx_cinterval(a) <= b; }
01041 inline bool operator  >(const lx_cinterval & a, const l_complex & b) throw() 
01042                                             { return a > lx_cinterval(b); }
01043 inline bool operator >=(const lx_cinterval & a, const l_complex & b) throw()
01044                                            { return a >= lx_cinterval(b); }
01045 
01046 inline bool operator  <(const lx_complex & a, const lx_cinterval & b) throw() 
01047                                             { return lx_cinterval(a) < b; }
01048 inline bool operator <=(const lx_complex & a, const lx_cinterval & b) throw()
01049                                            { return lx_cinterval(a) <= b; }
01050 inline bool operator  >(const lx_cinterval & a, const lx_complex & b) throw() 
01051                                             { return a > lx_cinterval(b); }
01052 inline bool operator >=(const lx_cinterval & a, const lx_complex & b) throw()
01053                                            { return a >= lx_cinterval(b); }
01054 
01055 // ------------------------- Intersection ------------------------------------
01056 
01057 inline lx_cinterval operator & (const lx_cinterval& a, 
01058                                const lx_cinterval& b) throw()
01059 {
01060     lx_cinterval tmp = a;
01061     SetInf(tmp.re, max(Inf(a.re),Inf(b.re)));
01062     SetInf(tmp.im, max(Inf(a.im),Inf(b.im)));
01063     SetSup(tmp.re, min(Sup(a.re),Sup(b.re)));
01064     SetSup(tmp.im, min(Sup(a.im),Sup(b.im)));
01065     if (Inf(tmp.re) > Sup(tmp.re) || Inf(tmp.im) > Sup(tmp.im))
01066         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01067       "lx_cinterval operator &(const lx_cinterval& a,const lx_cinterval& b)")); 
01068     return tmp;
01069 }
01070 
01071 inline lx_cinterval & operator &= (lx_cinterval& a, const lx_cinterval& b) 
01072     throw(ERROR_CINTERVAL_EMPTY_INTERVAL) { return a = a&b; }
01073 
01074 inline lx_cinterval operator & (const lx_cinterval& a, const lx_real& b) 
01075     throw() { return a & lx_cinterval(b,lx_real(0.0)); }
01076 inline lx_cinterval operator & (const lx_real& a, const lx_cinterval& b ) 
01077     throw() { return lx_cinterval(a,lx_real(0.0)) & b; }
01078 inline lx_cinterval & operator &= (lx_cinterval& a, const lx_real& b) 
01079     throw() { return a = a & lx_cinterval(b); }
01080 inline lx_cinterval operator & (const lx_cinterval& a, const l_real& b) 
01081     throw() { return a & lx_cinterval(b); }
01082 inline lx_cinterval operator & (const l_real& a, const lx_cinterval& b ) 
01083     throw() { return lx_cinterval(a) & b; }
01084 inline lx_cinterval & operator &= (lx_cinterval& a, const l_real& b) 
01085     throw() { return a = a & lx_cinterval(b); }
01086 inline lx_cinterval operator & (const lx_cinterval& a, const real& b) 
01087     throw() { return a & lx_cinterval(b); }
01088 inline lx_cinterval operator & (const real& a, const lx_cinterval& b ) 
01089     throw() { return lx_cinterval(a) & b; }
01090 inline lx_cinterval & operator &= (lx_cinterval& a, const real& b) 
01091     throw() { return a = a & lx_cinterval(b); }
01092 inline lx_cinterval operator & (const lx_cinterval& a, const l_cinterval& b) 
01093     throw() { return a & lx_cinterval(b); }
01094 inline lx_cinterval operator & (const l_cinterval& a, const lx_cinterval& b) 
01095     throw() { return lx_cinterval(a) & b; }
01096 inline lx_cinterval & operator &= (lx_cinterval& a, const l_cinterval& b) 
01097     throw() { return a = a & lx_cinterval(b); }
01098 inline lx_cinterval operator & (const lx_cinterval& a, const cinterval& b) 
01099     throw() { return a & lx_cinterval(b); }
01100 inline lx_cinterval operator & (const cinterval& a, const lx_cinterval& b) 
01101     throw() { return lx_cinterval(a) & b; }
01102 inline lx_cinterval & operator &= (lx_cinterval& a, const cinterval& b) 
01103     throw() { return a = a & lx_cinterval(b); }
01104 inline lx_cinterval operator & (const lx_cinterval& a, const lx_interval& b) 
01105     throw() { return a & lx_cinterval(b); }
01106 inline lx_cinterval operator & (const lx_interval& a, const lx_cinterval& b) 
01107     throw() { return lx_cinterval(a) & b; }
01108 inline lx_cinterval & operator &= (lx_cinterval& a, const lx_interval& b) 
01109     throw() { return a = a & lx_cinterval(b); }
01110 inline lx_cinterval operator & (const lx_cinterval& a, const l_interval& b) 
01111     throw() { return a & lx_cinterval(b); }
01112 inline lx_cinterval operator & (const l_interval& a, const lx_cinterval& b) 
01113     throw() { return lx_cinterval(a) & b; }
01114 inline lx_cinterval & operator &= (lx_cinterval& a, const l_interval& b) 
01115     throw() { return a = a & lx_cinterval(b); }
01116 inline lx_cinterval operator & (const lx_cinterval& a, const interval& b) 
01117     throw() { return a & lx_cinterval(b); }
01118 inline lx_cinterval operator & (const interval& a, const lx_cinterval& b) 
01119     throw() { return lx_cinterval(a) & b; }
01120 inline lx_cinterval & operator &= (lx_cinterval& a, const interval& b) 
01121     throw() { return a = a & lx_cinterval(b); }
01122 inline lx_cinterval operator & (const lx_cinterval& a, const lx_complex& b) 
01123     throw() { return a & lx_cinterval(b); }
01124 inline lx_cinterval operator & (const lx_complex& a, const lx_cinterval& b) 
01125     throw() { return lx_cinterval(a) & b; }
01126 inline lx_cinterval & operator &= (lx_cinterval& a, const lx_complex& b) 
01127     throw() { return a = a & lx_cinterval(b); }
01128 inline lx_cinterval operator & (const lx_cinterval& a, const l_complex& b) 
01129     throw() { return a & lx_cinterval(b); }
01130 inline lx_cinterval operator & (const l_complex& a, const lx_cinterval& b) 
01131     throw() { return lx_cinterval(a) & b; }
01132 inline lx_cinterval & operator &= (lx_cinterval& a, const l_complex& b) 
01133     throw() { return a = a & lx_cinterval(b); }
01134 inline lx_cinterval operator & (const lx_cinterval& a, const complex& b) 
01135     throw() { return a & lx_cinterval(b); }
01136 inline lx_cinterval operator & (const complex& a, const lx_cinterval& b) 
01137     throw() { return lx_cinterval(a) & b; }
01138 inline lx_cinterval & operator &= (lx_cinterval& a, const complex& b) 
01139     throw() { return a = a & lx_cinterval(b); }
01140 
01141 inline lx_cinterval operator & (const lx_interval& a, const complex& b) 
01142     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01143 inline lx_cinterval operator & ( const complex& a, const lx_interval& b) 
01144     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01145 inline lx_cinterval operator & (const lx_interval& a, const l_complex& b) 
01146     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01147 inline lx_cinterval operator & ( const l_complex& a, const lx_interval& b) 
01148     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01149 inline lx_cinterval operator & (const lx_interval& a, const lx_complex& b) 
01150     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01151 inline lx_cinterval operator & ( const lx_complex& a, const lx_interval& b) 
01152     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01153 inline lx_cinterval operator & (const lx_real& a, const cinterval& b) 
01154     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01155 inline lx_cinterval operator & (const cinterval& a, const lx_real& b) 
01156     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01157 inline lx_cinterval operator & (const lx_real& a, const l_cinterval& b) 
01158     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01159 inline lx_cinterval operator & (const l_cinterval& a, const lx_real& b) 
01160     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01161 inline lx_cinterval operator & (const lx_interval& a, const cinterval& b) 
01162     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01163 inline lx_cinterval operator & (const cinterval& a, const lx_interval& b) 
01164     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01165 inline lx_cinterval operator & (const lx_interval& a, const l_cinterval& b) 
01166     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01167 inline lx_cinterval operator & (const l_cinterval& a, const lx_interval& b) 
01168     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01169 
01170 inline lx_cinterval operator & (const l_interval& a, const lx_complex& b) 
01171     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01172 inline lx_cinterval operator & ( const lx_complex& a, const l_interval& b) 
01173     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01174 inline lx_cinterval operator & (const l_cinterval& a, const lx_complex& b) 
01175     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01176 inline lx_cinterval operator & ( const lx_complex& a, const l_cinterval& b) 
01177     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01178 
01179 inline lx_cinterval operator & (const interval& a, const lx_complex& b) 
01180     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01181 inline lx_cinterval operator & ( const lx_complex& a, const interval& b) 
01182     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01183 inline lx_cinterval operator & (const cinterval& a, const lx_complex& b) 
01184     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01185 inline lx_cinterval operator & ( const lx_complex& a, const cinterval& b) 
01186     throw() { return lx_cinterval(a) & lx_cinterval(b); }
01187 
01188 
01189 // -------------------------- Convex Hull ------------------------------------
01190 
01191 inline lx_cinterval operator | (const lx_cinterval& a,
01192                                 const lx_cinterval& b) throw()
01193 {
01194    lx_cinterval tmp = a;
01195    SetInf(tmp.re, min(Inf(a.re), Inf(b.re)));
01196    SetInf(tmp.im, min(Inf(a.im), Inf(b.im)));
01197    SetSup(tmp.re, max(Sup(a.re), Sup(b.re)));
01198    SetSup(tmp.im, max(Sup(a.im), Sup(b.im)));
01199    return tmp;
01200 }
01201 
01202 inline lx_cinterval & operator |= (lx_cinterval& a, const lx_cinterval& b) 
01203     throw() { return a = a|b; }
01204 inline lx_cinterval operator | (const lx_cinterval& a, const lx_real& b) 
01205     throw() { return a | lx_cinterval(b); }
01206 inline lx_cinterval operator | (const lx_real& a, const lx_cinterval& b) 
01207     throw() { return lx_cinterval(a) | b; }
01208 inline lx_cinterval & operator |= (lx_cinterval& a, const lx_real& b) 
01209     throw() { return a = a|lx_cinterval(b); }
01210 inline lx_cinterval operator | (const lx_cinterval& a, const l_real& b) 
01211     throw() { return a | lx_cinterval(b); }
01212 inline lx_cinterval operator | (const l_real& a, const lx_cinterval& b) 
01213     throw() { return lx_cinterval(a) | b; }
01214 inline lx_cinterval & operator |= (lx_cinterval& a, const l_real& b) 
01215     throw() { return a = a|lx_cinterval(b); }
01216 inline lx_cinterval operator | (const lx_cinterval& a, const real& b) 
01217     throw() { return a | lx_cinterval(b); }
01218 inline lx_cinterval operator | (const real& a, const lx_cinterval& b) 
01219     throw() { return lx_cinterval(a) | b; }
01220 inline lx_cinterval & operator |= (lx_cinterval& a, const real& b) 
01221     throw() { return a = a|lx_cinterval(b); }
01222 inline lx_cinterval operator | (const lx_cinterval& a, const l_cinterval& b) 
01223     throw() { return a | lx_cinterval(b); }
01224 inline lx_cinterval operator | (const l_cinterval& a, const lx_cinterval& b) 
01225     throw() { return lx_cinterval(a) | b; }
01226 inline lx_cinterval & operator |= (lx_cinterval& a, const l_cinterval& b) 
01227     throw() { return a = a|lx_cinterval(b); }
01228 inline lx_cinterval operator | (const lx_cinterval& a, const cinterval& b) 
01229     throw() { return a | lx_cinterval(b); }
01230 inline lx_cinterval operator | (const cinterval& a, const lx_cinterval& b) 
01231     throw() { return lx_cinterval(a) | b; }
01232 inline lx_cinterval & operator |= (lx_cinterval& a, const cinterval& b) 
01233     throw() { return a = a | lx_cinterval(b); }
01234 inline lx_cinterval operator | (const lx_cinterval& a, const lx_interval& b) 
01235     throw() { return a | lx_cinterval(b); }
01236 inline lx_cinterval operator | (const lx_interval& a, const lx_cinterval& b) 
01237     throw() { return lx_cinterval(a) | b; }
01238 inline lx_cinterval & operator |= (lx_cinterval& a, const lx_interval& b) 
01239     throw() { return a = a | lx_cinterval(b); }
01240 inline lx_cinterval operator | (const lx_cinterval& a, const l_interval& b) 
01241     throw() { return a | lx_cinterval(b); }
01242 inline lx_cinterval operator | (const l_interval& a, const lx_cinterval& b) 
01243     throw() { return lx_cinterval(a) | b; }
01244 inline lx_cinterval & operator |= (lx_cinterval& a, const l_interval& b) 
01245     throw() { return a = a | lx_cinterval(b); }
01246 inline lx_cinterval operator | (const lx_cinterval& a, const interval& b) 
01247     throw() { return a | lx_cinterval(b); }
01248 inline lx_cinterval operator | (const interval& a, const lx_cinterval& b) 
01249     throw() { return lx_cinterval(a) | b; }
01250 inline lx_cinterval & operator |= (lx_cinterval& a, const interval& b) 
01251     throw() { return a = a | lx_cinterval(b); }
01252 inline lx_cinterval operator | (const lx_cinterval& a, const lx_complex& b) 
01253     throw() { return a | lx_cinterval(b); }
01254 inline lx_cinterval operator | (const lx_complex& a, const lx_cinterval& b) 
01255     throw() { return lx_cinterval(a) | b; }
01256 inline lx_cinterval & operator |= (lx_cinterval& a, const lx_complex& b) 
01257     throw() { return a = a | lx_cinterval(b); }
01258 inline lx_cinterval operator | (const lx_cinterval& a, const l_complex& b) 
01259     throw() { return a | lx_cinterval(b); }
01260 inline lx_cinterval operator | (const l_complex& a, const lx_cinterval& b) 
01261     throw() { return lx_cinterval(a) | b; }
01262 inline lx_cinterval & operator |= (lx_cinterval& a, const l_complex& b) 
01263     throw() { return a = a | lx_cinterval(b); }
01264 inline lx_cinterval operator | (const lx_cinterval& a, const complex& b) 
01265     throw() { return a | lx_cinterval(b); }
01266 inline lx_cinterval operator | (const complex& a, const lx_cinterval& b) 
01267     throw() { return lx_cinterval(a) | b; }
01268 inline lx_cinterval & operator |= (lx_cinterval& a, const complex& b) 
01269     throw() { return a = a | lx_cinterval(b); }
01270 
01271 inline lx_cinterval operator | (const lx_interval& a, const complex& b) 
01272     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01273 inline lx_cinterval operator | ( const complex& a, const lx_interval& b) 
01274     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01275 inline lx_cinterval operator | (const lx_interval& a, const l_complex& b) 
01276     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01277 inline lx_cinterval operator | ( const l_complex& a, const lx_interval& b) 
01278     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01279 inline lx_cinterval operator | (const lx_interval& a, const lx_complex& b) 
01280     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01281 inline lx_cinterval operator | ( const lx_complex& a, const lx_interval& b) 
01282     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01283 inline lx_cinterval operator | (const lx_real& a, const cinterval& b) 
01284     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01285 inline lx_cinterval operator | (const cinterval& a, const lx_real& b) 
01286     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01287 inline lx_cinterval operator | (const lx_real& a, const l_cinterval& b) 
01288     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01289 inline lx_cinterval operator | (const l_cinterval& a, const lx_real& b) 
01290     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01291 inline lx_cinterval operator | (const lx_interval& a, const cinterval& b) 
01292     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01293 inline lx_cinterval operator | (const cinterval& a, const lx_interval& b) 
01294     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01295 inline lx_cinterval operator | (const lx_interval& a, const l_cinterval& b) 
01296     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01297 inline lx_cinterval operator | (const l_cinterval& a, const lx_interval& b) 
01298     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01299 
01300 
01301 inline lx_cinterval operator | (const lx_real& a, const complex& b) 
01302     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01303 inline lx_cinterval operator | (const complex& a, const lx_real& b) 
01304     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01305 inline lx_cinterval operator | (const lx_real& a, const l_complex& b) 
01306     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01307 inline lx_cinterval operator | (const l_complex& a, const lx_real& b) 
01308     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01309 inline lx_cinterval operator | (const lx_real& a, const lx_complex& b) 
01310     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01311 inline lx_cinterval operator | (const lx_complex& a, const lx_real& b) 
01312     throw() { return lx_cinterval(a) | lx_cinterval(b); }
01313 
01314 
01315 // ------------------------- Others --------------------------------------
01316 
01317 inline lx_cinterval & SetInf(lx_cinterval& a, const lx_complex& b) 
01318     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01319 {
01320     Inf(a.re) = Re(b);
01321     Inf(a.im) = Im(b);
01322 
01323     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01324         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval & SetInf(lx_cinterval& a, const lx_complex& b)"));
01325    
01326     return a;
01327 }
01328 
01329 inline lx_cinterval & SetInf(lx_cinterval& a, const l_complex& b) 
01330     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01331 {
01332     Inf(a.re) = Re(b);
01333     Inf(a.im) = Im(b);
01334 
01335     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01336         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval & SetInf(lx_cinterval& a, const l_complex& b)"));
01337    
01338     return a;
01339 }
01340 
01341 inline lx_cinterval & SetInf(lx_cinterval& a, const complex& b) 
01342     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01343 {
01344     Inf(a.re) = Re(b);
01345     Inf(a.im) = Im(b);
01346 
01347     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01348         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("lx_cinterval & SetInf(lx_cinterval& a, const complex& b)"));
01349    
01350     return a;
01351 }
01352 
01353 inline lx_cinterval & SetInf(lx_cinterval& a, const lx_real & b) 
01354     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01355 {
01356     Inf(a.re)=b;
01357     Inf(a.im)=0.0;
01358 
01359     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01360         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL("inline lx_cinterval & SetInf(lx_cinterval& a,const lx_real & b)"));
01361    
01362    return a;
01363 }
01364 
01365 inline lx_cinterval & SetInf(lx_cinterval& a, const l_real & b) 
01366     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01367 {
01368     Inf(a.re)=b;
01369     Inf(a.im)=0.0;
01370 
01371     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01372         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01373                 "inline lx_cinterval & SetInf(lx_cinterval& a,const l_real & b)"));
01374    
01375    return a;
01376 }
01377 
01378 inline lx_cinterval & SetInf(lx_cinterval& a, const real & b) 
01379     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01380 {
01381     Inf(a.re)=b;
01382     Inf(a.im)=0.0;
01383 
01384     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01385         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01386                 "inline lx_cinterval & SetInf(lx_cinterval& a,const real & b)"));
01387    
01388    return a;
01389 }
01390 
01391 inline lx_cinterval & SetSup(lx_cinterval& a, const lx_complex& b) 
01392     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01393 {
01394     Sup(a.re) = Re(b);
01395     Sup(a.im) = Im(b);
01396 
01397     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01398         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01399                 "inline lx_cinterval & SetSup(lx_cinterval& a, const lx_complex& b)"));
01400    
01401     return a;
01402 }
01403 
01404 
01405 inline lx_cinterval & SetSup(lx_cinterval& a, const l_complex& b) 
01406     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01407 {
01408     Sup(a.re) = Re(b);
01409     Sup(a.im) = Im(b);
01410 
01411     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01412         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01413                 "inline lx_cinterval & SetSup(lx_cinterval& a, const l_complex& b)"));
01414    
01415     return a;
01416 }
01417 
01418 inline lx_cinterval & SetSup(lx_cinterval& a, const complex& b) 
01419     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01420 {
01421     Sup(a.re) = Re(b);
01422     Sup(a.im) = Im(b);
01423 
01424     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01425         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01426                 "inline lx_cinterval & SetSup(lx_cinterval& a, const complex& b)"));
01427    
01428     return a;
01429 }
01430 
01431 inline lx_cinterval & SetSup(lx_cinterval& a, const lx_real & b) 
01432     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01433 {
01434     Sup(a.re) = b;
01435     Sup(a.im) = 0.0;
01436 
01437     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01438         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01439                 "inline lx_cinterval & SetSup(lx_cinterval& a, const lx_real& b)"));
01440    
01441     return a;
01442 }
01443 
01444 inline lx_cinterval & SetSup(lx_cinterval& a, const l_real & b) 
01445     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01446 {
01447     Sup(a.re) = b;
01448     Sup(a.im) = 0.0;
01449 
01450     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01451         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01452                 "inline lx_cinterval & SetSup(lx_cinterval& a, const l_real& b)"));
01453    
01454     return a;
01455 }
01456 
01457 inline lx_cinterval & SetSup(lx_cinterval& a, const real & b) 
01458     throw(ERROR_CINTERVAL_EMPTY_INTERVAL)
01459 {
01460     Sup(a.re) = b;
01461     Sup(a.im) = 0.0;
01462 
01463     if (Inf(a.re) > Sup(a.re) || Inf(a.im) > Sup(a.im)) 
01464         cxscthrow(ERROR_CINTERVAL_EMPTY_INTERVAL(
01465                 "inline lx_cinterval & SetSup(lx_cinterval& a, const real& b)"));
01466    
01467     return a;
01468 }
01469 
01470 inline bool IsEmpty(const lx_cinterval& a) throw()
01471 { return (IsEmpty(a.re) || IsEmpty(a.im)); }
01472 
01473 
01474 // -----------------------------------------------------------------------
01475 // ----------------------- Output ----------------------------------------
01476 // -----------------------------------------------------------------------
01477 
01478 inline std::ostream& operator << (std::ostream& s,const lx_cinterval& a) 
01479     throw()
01480 // A value a of type lx_cinterval is written to the output channel.
01481 {     
01482     s << '('          
01483     << a.re << ", "   
01484     << a.im       
01485     << ')';
01486     return s;
01487 }
01488 
01489 inline std::string & operator << (std::string &s,const lx_cinterval& a) 
01490     throw()
01491 // The value of a variable a of type lx_cinterval is copied to a string s.
01492 // s has the form:  {ex,li}
01493 {  
01494     string str;
01495     s+='(';
01496     s << a.re; 
01497     s+=',';
01498     s << a.im; 
01499     s+=')';
01500     return s;
01501 }
01502 
01503 } // end namespace cxsc