C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
l_cinterval.hpp
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: l_cinterval.hpp,v 1.20 2014/01/30 17:23:46 cxsc Exp $ */
00025 
00026 #ifndef _CXSC_L_CINTERVAL_HPP_INCLUDED
00027 #define _CXSC_L_CINTERVAL_HPP_INCLUDED
00028 
00029 #include <iostream>
00030 #include <string>
00031 
00032 // Headerfile for l_cinterval.
00033 
00034 #include "except.hpp"
00035 #include "l_real.hpp"
00036 #include "l_complex.hpp"
00037 #include "l_interval.hpp"
00038 #include "cinterval.hpp"
00039 
00040 namespace cxsc {
00041 
00042 // class civector;
00043 // class cimatrix;
00044 // class civector_slice;
00045 // class cimatrix_slice;
00046 
00048 
00053 class l_cinterval
00054 {
00055    private:
00056       // ---- private data ----------------------------------------
00057       l_interval  re;
00058       l_interval  im;
00059 
00060    public:
00061       // ---- implicit constructors  ------------------------------
00063       inline l_cinterval(void)  throw ()           {}
00065       inline l_cinterval(const interval & a,const interval &b) throw();
00067       inline l_cinterval(const l_interval & a,const l_interval &b) throw(); 
00069       inline l_cinterval(const complex & a, const complex & b) 
00070                                      throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
00072       inline l_cinterval(const l_complex & a, const l_complex & b) 
00073                                      throw(ERROR_CINTERVAL_EMPTY_INTERVAL); 
00074 
00075       friend cinterval::cinterval(const l_cinterval &) throw();
00076 
00077       // ---- explicit constructors -------------------------------
00078 
00080       explicit inline l_cinterval(const real       & a)  throw();
00082       explicit inline l_cinterval(const l_real     & a)  throw();
00084       explicit inline l_cinterval(const interval   & a)  throw();
00086       explicit inline l_cinterval(const l_interval & a)  throw();
00088       explicit inline l_cinterval(const complex    & a)  throw();
00090       explicit inline l_cinterval(const l_complex  & a)  throw();
00092       explicit inline l_cinterval(const cinterval  & a)  throw();  
00093 
00095       explicit        l_cinterval(const dotprecision &)   throw();
00097       explicit        l_cinterval(const cdotprecision &)  throw();
00099       explicit        l_cinterval(const idotprecision &)  throw();
00101       explicit        l_cinterval(const cidotprecision &) throw();
00102 
00103       // ---- assignments -----------------------------------------
00104 
00106       inline l_cinterval & operator =(const real        &) throw();
00108       inline l_cinterval & operator =(const l_real      &) throw();
00110       inline l_cinterval & operator =(const interval    &) throw();
00112       inline l_cinterval & operator =(const l_interval  &) throw();
00114       inline l_cinterval & operator =(const complex     &) throw();
00116       inline l_cinterval & operator =(const l_complex   &) throw();
00118       inline l_cinterval & operator =(const cinterval   &) throw();
00120       inline l_cinterval & operator =(const l_cinterval &) throw();
00122              l_cinterval & operator =(const lx_cinterval &) throw();
00123       
00125       inline l_cinterval & operator =(const dotprecision   &) throw();
00127       inline l_cinterval & operator =(const idotprecision  &) throw();
00129       inline l_cinterval & operator =(const cdotprecision  &) throw();
00131       inline l_cinterval & operator =(const cidotprecision &) throw();
00132 
00133     friend cinterval & cinterval::operator = (const l_cinterval &) throw();
00134 
00135       // ---- Input/Output  ---------------------------------------
00136 
00138       friend std::ostream & operator << (std::ostream &,const l_cinterval &) 
00139                                                                     throw();
00141       friend std::string &  operator << (std::string &, const l_cinterval &)  
00142                                                                     throw();
00144       friend std::string &  operator >> (std::string &, l_cinterval &)
00145                                                       throw(EMPTY_INTERVAL);
00147       friend std::istream & operator >>(std::istream &, l_cinterval &) 
00148                                                       throw(EMPTY_INTERVAL);
00150       friend void operator >> (const char *, l_cinterval &) 
00151                                                       throw(EMPTY_INTERVAL);
00153       friend void operator >> (const std::string &, l_cinterval &)  
00154                                                       throw(EMPTY_INTERVAL);
00155 
00156 
00157 // ----------------------------- Std.Operators ------------------------------
00158 
00160       friend inline l_cinterval operator -(const l_cinterval &) throw ();
00162       friend inline l_cinterval operator +(const l_cinterval &) throw ();
00164       friend inline bool operator! (const l_cinterval & a)      throw ();
00165 
00166 // LCI <--> LCI
00167 
00169       friend inline l_cinterval operator +(const l_cinterval &,
00170                                            const l_cinterval &) throw();
00172       friend inline l_cinterval operator -(const l_cinterval &, 
00173                                            const l_cinterval &) throw();
00175       friend        l_cinterval operator *(const l_cinterval &,
00176                                            const l_cinterval &) throw();
00178       friend        l_cinterval operator /(const l_cinterval &,
00179                                            const l_cinterval &) 
00180                                                      throw(DIV_BY_ZERO);
00182       friend inline l_cinterval operator |(const l_cinterval &,
00183                                            const l_cinterval &) throw();
00185       friend inline l_cinterval operator &(const l_cinterval &,
00186                                            const l_cinterval &) 
00187                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
00188       
00190       friend inline l_cinterval & operator +=(l_cinterval &, 
00191                                               const l_cinterval &) throw();
00193       friend inline l_cinterval & operator -=(l_cinterval &, 
00194                                               const l_cinterval &) throw();
00196       friend inline l_cinterval & operator *=(l_cinterval &, 
00197                                               const l_cinterval &) throw();
00199       friend inline l_cinterval & operator /=(l_cinterval &, 
00200                                               const l_cinterval &) throw();
00202       friend inline l_cinterval & operator |=(l_cinterval &, 
00203                                               const l_cinterval &) throw();
00205       friend inline l_cinterval & operator &=(l_cinterval &, 
00206                                               const l_cinterval &) 
00207                                      throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
00208       
00209       // LCI <--> R
00210       
00212       friend inline l_cinterval operator +(const l_cinterval &, const real &) 
00213                                                                      throw();
00215       friend inline l_cinterval operator +(const real &, const l_cinterval &) 
00216                                                                      throw();
00218       friend inline l_cinterval operator -(const l_cinterval &, const real &) 
00219                                                                      throw();
00221       friend inline l_cinterval operator -(const real &, const l_cinterval &) 
00222                                                                      throw();
00224       friend inline l_cinterval operator *(const l_cinterval &, const real &) 
00225                                                                      throw();
00227       friend inline l_cinterval operator *(const real &, const l_cinterval &) 
00228                                                                      throw();
00230       friend inline l_cinterval operator /(const l_cinterval &, const real &) 
00231                                                                      throw();
00233       friend inline l_cinterval operator /(const real &, const l_cinterval &) 
00234                                                                      throw();
00236       friend inline l_cinterval operator |(const l_cinterval &, const real &) 
00237                                                                      throw();
00239       friend inline l_cinterval operator |(const real &, const l_cinterval &) 
00240                                                                      throw();
00242       friend inline l_cinterval operator &(const l_cinterval &, const real &) 
00243                                                                      throw();
00245       friend inline l_cinterval operator &(const real &, const l_cinterval &) 
00246                                                                      throw();
00247       
00249       friend inline l_cinterval & operator +=(l_cinterval &, const real &) 
00250                                                                      throw();
00252       friend inline l_cinterval & operator -=(l_cinterval &, const real &) 
00253                                                                      throw();
00255       friend inline l_cinterval & operator *=(l_cinterval &, const real &) 
00256                                                                      throw();
00258       friend inline l_cinterval & operator /=(l_cinterval &, const real &) 
00259                                                                      throw();
00261       friend inline l_cinterval & operator |=(l_cinterval &, const real &) 
00262                                                                      throw();
00264       friend inline l_cinterval & operator &=(l_cinterval &, const real &) 
00265                                                                      throw();
00266 
00267       // LCI <--> LR
00268       
00270       friend inline l_cinterval operator +(const l_cinterval &, const l_real &)
00271                                                                        throw();
00273       friend inline l_cinterval operator +(const l_real &, const l_cinterval &)
00274                                                                        throw();
00276       friend inline l_cinterval operator -(const l_cinterval &, const l_real &)
00277                                                                        throw();
00279       friend inline l_cinterval operator -(const l_real &, const l_cinterval &)
00280                                                                        throw();
00282       friend inline l_cinterval operator *(const l_cinterval &, const l_real &)
00283                                                                        throw();
00285       friend inline l_cinterval operator *(const l_real &, const l_cinterval &)
00286                                                                        throw();
00288       friend inline l_cinterval operator /(const l_cinterval &, const l_real &)
00289                                                                        throw();
00291       friend inline l_cinterval operator /(const l_real &, const l_cinterval &)
00292                                                                        throw();
00294       friend inline l_cinterval operator |(const l_cinterval &, const l_real &)
00295                                                                        throw();
00297       friend inline l_cinterval operator |(const l_real &, const l_cinterval &)
00298                                                                        throw();
00300       friend inline l_cinterval operator &(const l_cinterval &, const l_real &)
00301                                                                        throw();
00303       friend inline l_cinterval operator &(const l_real &, const l_cinterval &)
00304                                                                        throw();
00305       
00307       friend inline l_cinterval & operator +=(l_cinterval &, const l_real &) 
00308                                                                      throw();
00310       friend inline l_cinterval & operator -=(l_cinterval &, const l_real &) 
00311                                                                      throw();
00313       friend inline l_cinterval & operator *=(l_cinterval &, const l_real &) 
00314                                                                      throw();
00316       friend inline l_cinterval & operator /=(l_cinterval &, const l_real &) 
00317                                                                      throw();
00319       friend inline l_cinterval & operator |=(l_cinterval &, const l_real &) 
00320                                                                      throw();
00322       friend inline l_cinterval & operator &=(l_cinterval &, const l_real &) 
00323                                                                      throw();
00324 
00325       // LCI <--> C
00326 
00328       friend inline l_cinterval operator +(const l_cinterval &,
00329                                            const complex &)     throw();
00331       friend inline l_cinterval operator +(const complex &,
00332                                            const l_cinterval &) throw();
00334       friend inline l_cinterval operator -(const l_cinterval &,
00335                                            const complex &)     throw();
00337       friend inline l_cinterval operator -(const complex &,
00338                                            const l_cinterval &) throw();
00340       friend inline l_cinterval operator *(const l_cinterval &,
00341                                            const complex &)     throw();
00343       friend inline l_cinterval operator *(const complex &,
00344                                            const l_cinterval &) throw();
00346       friend inline l_cinterval operator /(const l_cinterval &,
00347                                            const complex &)     throw();
00349       friend inline l_cinterval operator /(const complex &,
00350                                            const l_cinterval &) throw();
00352       friend inline l_cinterval operator |(const l_cinterval &,
00353                                            const complex &)     throw();
00355       friend inline l_cinterval operator |(const complex &,
00356                                            const l_cinterval &) throw();
00358       friend inline l_cinterval operator &(const l_cinterval &,
00359                                            const complex &)     throw();
00361       friend inline l_cinterval operator &(const complex &,
00362                                            const l_cinterval &) throw();
00363 
00365       friend inline l_cinterval & operator +=(l_cinterval &, const complex &) 
00366                                                                       throw();
00368       friend inline l_cinterval & operator -=(l_cinterval &, const complex &) 
00369                                                                       throw();
00371       friend inline l_cinterval & operator *=(l_cinterval &, const complex &)
00372                                                                       throw();
00374       friend inline l_cinterval & operator /=(l_cinterval &, const complex &) 
00375                                                                       throw();
00377       friend inline l_cinterval & operator |=(l_cinterval &, const complex &) 
00378                                                                       throw();
00380       friend inline l_cinterval & operator &=(l_cinterval &, const complex &) 
00381                                                                       throw();
00382 
00383       // LCI <--> LC
00384 
00386       friend inline l_cinterval operator +(const l_cinterval &,
00387                                            const l_complex &)   throw();
00389       friend inline l_cinterval operator +(const l_complex &,
00390                                            const l_cinterval &) throw();
00392       friend inline l_cinterval operator -(const l_cinterval &,
00393                                            const l_complex &)   throw();
00395       friend inline l_cinterval operator -(const l_complex &,
00396                                            const l_cinterval &) throw();
00398       friend inline l_cinterval operator *(const l_cinterval &,
00399                                            const l_complex &)   throw();
00401       friend inline l_cinterval operator *(const l_complex &,
00402                                            const l_cinterval &) throw();
00404       friend inline l_cinterval operator /(const l_cinterval &,
00405                                            const l_complex &)   throw();
00407       friend inline l_cinterval operator /(const l_complex &,
00408                                            const l_cinterval &) throw();
00410       friend inline l_cinterval operator |(const l_cinterval &,
00411                                            const l_complex &)   throw();
00413       friend inline l_cinterval operator |(const l_complex &,
00414                                            const l_cinterval &) throw();
00416       friend inline l_cinterval operator &(const l_cinterval &,
00417                                            const l_complex &)   throw();
00419       friend inline l_cinterval operator &(const l_complex &,
00420                                            const l_cinterval &) throw();
00421 
00423       friend inline l_cinterval & operator +=(l_cinterval &, const l_complex &)
00424                                                                       throw();
00426       friend inline l_cinterval & operator -=(l_cinterval &, const l_complex &)
00427                                                                       throw();
00429       friend inline l_cinterval & operator *=(l_cinterval &, const l_complex &)
00430                                                                       throw();
00432       friend inline l_cinterval & operator /=(l_cinterval &, const l_complex &)
00433                                                                       throw();
00435       friend inline l_cinterval & operator |=(l_cinterval &, const l_complex &)
00436                                                                       throw();
00438       friend inline l_cinterval & operator &=(l_cinterval &, const l_complex &)
00439                                                                       throw();
00440       
00441       // LCI <--> I
00442 
00444       friend inline l_cinterval operator +(const l_cinterval &,
00445                                            const interval &)    throw(); 
00447       friend inline l_cinterval operator +(const interval &,
00448                                            const l_cinterval &) throw();
00450       friend inline l_cinterval operator -(const l_cinterval &,
00451                                            const interval &)    throw();
00453       friend inline l_cinterval operator -(const interval &,
00454                                            const l_cinterval &) throw();
00456       friend inline l_cinterval operator *(const l_cinterval &,
00457                                            const interval &)    throw();
00459       friend inline l_cinterval operator *(const interval &,
00460                                            const l_cinterval &) throw();
00462       friend inline l_cinterval operator /(const l_cinterval &,
00463                                            const interval &)    throw();
00465       friend inline l_cinterval operator /(const interval &,
00466                                            const l_cinterval &) throw();
00468       friend inline l_cinterval operator |(const l_cinterval &,
00469                                            const interval &)    throw();
00471       friend inline l_cinterval operator |(const interval &,
00472                                            const l_cinterval &) throw();
00474       friend inline l_cinterval operator &(const l_cinterval &,
00475                                            const interval &)    throw();
00477       friend inline l_cinterval operator &(const interval &,
00478                                            const l_cinterval &) throw();
00479 
00481       friend inline l_cinterval & operator +=(l_cinterval &, 
00482                                               const interval &) throw();
00484       friend inline l_cinterval & operator -=(l_cinterval &, 
00485                                               const interval &) throw();
00487       friend inline l_cinterval & operator *=(l_cinterval &, 
00488                                               const interval &) throw();
00490       friend inline l_cinterval & operator /=(l_cinterval &, 
00491                                               const interval &) throw();
00493       friend inline l_cinterval & operator |=(l_cinterval &, 
00494                                               const interval &) throw();
00496       friend inline l_cinterval & operator &=(l_cinterval &, 
00497                                               const interval &) throw();
00498 
00499       // LCI <--> LI
00500 
00502       friend inline l_cinterval operator +(const l_cinterval &,
00503                                            const l_interval &)  throw(); 
00505       friend inline l_cinterval operator +(const l_interval &,
00506                                            const l_cinterval &) throw();
00508       friend inline l_cinterval operator -(const l_cinterval &,
00509                                            const l_interval &)  throw();
00511       friend inline l_cinterval operator -(const l_interval &,
00512                                            const l_cinterval &) throw();
00514       friend inline l_cinterval operator *(const l_cinterval &,
00515                                            const l_interval &)  throw();
00517       friend inline l_cinterval operator *(const l_interval &,
00518                                            const l_cinterval &) throw();
00520       friend inline l_cinterval operator /(const l_cinterval &,
00521                                            const l_interval &)  throw();
00523       friend inline l_cinterval operator /(const l_interval &,
00524                                            const l_cinterval &) throw();
00526       friend inline l_cinterval operator |(const l_cinterval &,
00527                                            const l_interval &)  throw();
00529       friend inline l_cinterval operator |(const l_interval &,
00530                                            const l_cinterval &) throw();
00532       friend inline l_cinterval operator &(const l_cinterval &,
00533                                            const l_interval &)  throw();
00535       friend inline l_cinterval operator &(const l_interval &,
00536                                            const l_cinterval &) throw();
00537 
00539       friend inline l_cinterval & operator +=(l_cinterval &, 
00540                                               const l_interval &) throw();
00542       friend inline l_cinterval & operator -=(l_cinterval &, 
00543                                               const l_interval &) throw();
00545       friend inline l_cinterval & operator *=(l_cinterval &, 
00546                                               const l_interval &) throw();
00548       friend inline l_cinterval & operator /=(l_cinterval &, 
00549                                               const l_interval &) throw();
00551       friend inline l_cinterval & operator |=(l_cinterval &, 
00552                                               const l_interval &) throw();
00554       friend inline l_cinterval & operator &=(l_cinterval &, 
00555                                               const l_interval &) throw();
00556 
00557     // LCI <--> CI
00558 
00560       friend inline l_cinterval operator +(const l_cinterval &,
00561                                            const cinterval &)   throw(); 
00563       friend inline l_cinterval operator +(const cinterval &,
00564                                            const l_cinterval &) throw();
00566       friend inline l_cinterval operator -(const l_cinterval &,
00567                                            const cinterval &)   throw();
00569       friend inline l_cinterval operator -(const cinterval &,
00570                                            const l_cinterval &) throw();
00572       friend inline l_cinterval operator *(const l_cinterval &,
00573                                            const cinterval &)   throw();
00575       friend inline l_cinterval operator *(const cinterval &,
00576                                            const l_cinterval &) throw();
00578       friend inline l_cinterval operator /(const l_cinterval &,
00579                                            const cinterval &)   throw();
00581       friend inline l_cinterval operator /(const cinterval &,
00582                                            const l_cinterval &) throw();
00584       friend inline l_cinterval operator |(const l_cinterval &,
00585                                            const cinterval &)   throw();
00587       friend inline l_cinterval operator |(const cinterval &,
00588                                            const l_cinterval &) throw();
00590       friend inline l_cinterval operator &(const l_cinterval &,
00591                                            const cinterval &)   throw();
00593       friend inline l_cinterval operator &(const cinterval &,
00594                                            const l_cinterval &) throw();
00595 
00597       friend inline l_cinterval & operator +=(l_cinterval &, 
00598                                               const cinterval &) throw();
00600       friend inline l_cinterval & operator -=(l_cinterval &, 
00601                                               const cinterval &) throw();
00603       friend inline l_cinterval & operator *=(l_cinterval &, 
00604                                               const cinterval &) throw();
00606       friend inline l_cinterval & operator /=(l_cinterval &, 
00607                                               const cinterval &) throw();
00609       friend inline l_cinterval & operator |=(l_cinterval &, 
00610                                               const cinterval &) throw();
00612       friend inline l_cinterval & operator &=(l_cinterval &, 
00613                                               const cinterval &) throw();
00614 
00615 
00616 
00617 // Convex Hull: LC <--> R; C <--> LR; LC <--> LR; CI <--> LR; CI <--> LC;
00618 
00620       friend inline l_cinterval operator |(const l_complex &, const real &) 
00621                                                                    throw();
00623       friend inline l_cinterval operator |(const real &, const l_complex &) 
00624                                                                    throw();
00626       friend inline l_cinterval operator |(const complex &, const l_real &) 
00627                                                                    throw();
00629       friend inline l_cinterval operator |(const l_real &, const complex &) 
00630                                                                    throw();
00632       friend inline l_cinterval operator |(const l_complex &, const l_real &) 
00633                                                                      throw();
00635       friend inline l_cinterval operator |(const l_real &, const l_complex &) 
00636                                                                      throw();
00638       friend inline l_cinterval operator |(const cinterval &, const l_real &) 
00639                                                                      throw();
00641       friend inline l_cinterval operator |(const l_real &, const cinterval &) 
00642                                                                      throw();
00644       friend inline l_cinterval operator |(const cinterval &, 
00645                                            const l_complex &) throw();
00647       friend inline l_cinterval operator |(const l_complex &, 
00648                                            const cinterval &) throw();
00649 
00650       // LC <--> I
00651 
00653       friend inline l_cinterval operator +(const l_complex &, const interval &)
00654                                                                        throw();
00656       friend inline l_cinterval operator +(const interval &, const l_complex &)
00657                                                                        throw();
00659       friend inline l_cinterval operator -(const l_complex &, const interval &)
00660                                                                        throw();
00662       friend inline l_cinterval operator -(const interval &, const l_complex &)
00663                                                                        throw();
00665       friend inline l_cinterval operator *(const l_complex &, const interval &)
00666                                                                        throw();
00668       friend inline l_cinterval operator *(const interval &, const l_complex &)
00669                                                                        throw();
00671       friend inline l_cinterval operator /(const l_complex &, const interval &)
00672                                                                        throw();
00674       friend inline l_cinterval operator /(const interval &, const l_complex &)
00675                                                                        throw();
00677       friend inline l_cinterval operator |(const l_complex &, const interval &)
00678                                                                        throw();
00680       friend inline l_cinterval operator |(const interval &, const l_complex &)
00681                                                                        throw();
00683       friend inline l_cinterval operator &(const l_complex &, const interval &)
00684                                                                        throw();
00686       friend inline l_cinterval operator &(const interval &, const l_complex &)
00687                                                                        throw();
00688       
00689       // C <--> LI
00690 
00692       friend inline l_cinterval operator +(const complex &, const l_interval &)
00693                                                                        throw();
00695       friend inline l_cinterval operator +(const l_interval &, const complex &)
00696                                                                        throw();
00698       friend inline l_cinterval operator -(const complex &, const l_interval &)
00699                                                                        throw();
00701       friend inline l_cinterval operator -(const l_interval &, const complex &)
00702                                                                        throw();
00704       friend inline l_cinterval operator *(const complex &, const l_interval &)
00705                                                                        throw();
00707       friend inline l_cinterval operator *(const l_interval &, const complex &)
00708                                                                        throw();
00710       friend inline l_cinterval operator /(const complex &, const l_interval &)
00711                                                                        throw();
00713       friend inline l_cinterval operator /(const l_interval &, const complex &)
00714                                                                        throw();
00716       friend inline l_cinterval operator |(const complex &, const l_interval &)
00717                                                                        throw();
00719       friend inline l_cinterval operator |(const l_interval &, const complex &)
00720                                                                        throw();
00722       friend inline l_cinterval operator &(const complex &, const l_interval &)
00723                                                                        throw();
00725       friend inline l_cinterval operator &(const l_interval &, const complex &)
00726                                                                        throw();
00727       
00728       // LC <--> LI
00729 
00731       friend inline l_cinterval operator +(const l_complex &, 
00732                                            const l_interval &) throw();
00734       friend inline l_cinterval operator +(const l_interval &, 
00735                                            const l_complex &)  throw();
00737       friend inline l_cinterval operator -(const l_complex &, 
00738                                            const l_interval &) throw();
00740       friend inline l_cinterval operator -(const l_interval &, 
00741                                            const l_complex &)  throw();
00743       friend inline l_cinterval operator *(const l_complex &, 
00744                                            const l_interval &) throw();
00746       friend inline l_cinterval operator *(const l_interval &, 
00747                                            const l_complex &)  throw();
00749       friend inline l_cinterval operator /(const l_complex &, 
00750                                            const l_interval &) throw();
00752       friend inline l_cinterval operator /(const l_interval &, 
00753                                            const l_complex &)  throw();
00755       friend inline l_cinterval operator |(const l_complex &, 
00756                                            const l_interval &) throw();
00758       friend inline l_cinterval operator |(const l_interval &, 
00759                                            const l_complex &)  throw();
00761       friend inline l_cinterval operator &(const l_complex &, 
00762                                            const l_interval &) throw();
00764       friend inline l_cinterval operator &(const l_interval &, 
00765                                            const l_complex &)  throw();
00766       
00767 
00768       // LC <--> C; LC <--> LC;  
00769 
00771       friend inline l_cinterval operator |(const l_complex &, const complex &) 
00772                                                                       throw();
00774       friend inline l_cinterval operator |(const complex &, const l_complex &) 
00775                                                                       throw();
00777       friend inline l_cinterval operator |(const l_complex &, 
00778                                            const l_complex &) throw();
00779 
00780 // --------------------- Comp.Operat.  ---------------------------------------
00781       // LCI <--> LCI      
00783       friend inline bool operator== (const l_cinterval & a, 
00784                                      const l_cinterval & b) throw();
00786       friend inline bool operator!= (const l_cinterval & a, 
00787                                      const l_cinterval & b) throw();
00788    
00789       // LCI <--> R
00790       
00792       friend inline bool operator== (const l_cinterval & a, const real & b)
00793                                                                    throw();
00795       friend inline bool operator== (const real & a, const l_cinterval & b)
00796                                                                    throw();
00798       friend inline bool operator!= (const l_cinterval & a, const real & b)
00799                                                                    throw();
00801       friend inline bool operator!= (const real & a, const l_cinterval & b)
00802                                                                    throw();
00803 
00804       // LCI <--> LR
00805       
00807       friend inline bool operator== (const l_cinterval & a, const l_real & b)
00808                                                                      throw();
00810       friend inline bool operator== (const l_real & a, const l_cinterval & b)
00811                                                                      throw();
00813       friend inline bool operator!= (const l_cinterval & a, const l_real & b)
00814                                                                      throw();
00816       friend inline bool operator!= (const l_real & a, const l_cinterval & b)
00817                                                                      throw();
00818 
00819       // LCI <--> I
00820       
00822       friend inline bool operator== (const l_cinterval & a, 
00823                                      const interval & b)    throw();
00825       friend inline bool operator== (const interval & a, 
00826                                      const l_cinterval & b) throw();
00828       friend inline bool operator!= (const l_cinterval & a, 
00829                                      const interval & b)    throw();
00831       friend inline bool operator!= (const interval & a, 
00832                                      const l_cinterval & b) throw();
00833 
00834       // LCI <--> LI
00835       
00837       friend inline bool operator== (const l_cinterval & a, 
00838                                      const l_interval & b)  throw();
00840       friend inline bool operator== (const l_interval & a, 
00841                                      const l_cinterval & b) throw();
00843       friend inline bool operator!= (const l_cinterval & a, 
00844                                      const l_interval & b)  throw();
00846       friend inline bool operator!= (const l_interval & a, 
00847                                      const l_cinterval & b) throw();
00848 
00849       // LCI <--> C
00850       
00852       friend inline bool operator== (const l_cinterval & a, const complex & b)
00853                                                                       throw();
00855       friend inline bool operator== (const complex & a, const l_cinterval & b)
00856                                                                       throw();
00858       friend inline bool operator!= (const l_cinterval & a, const complex & b)
00859                                                                       throw();
00861       friend inline bool operator!= (const complex & a, const l_cinterval & b)
00862                                                                       throw();
00863 
00864       // LCI <--> LC
00865       
00867       friend inline bool operator== (const l_cinterval & a, 
00868                                      const l_complex & b)   throw();
00870       friend inline bool operator== (const l_complex & a, 
00871                                      const l_cinterval & b) throw();
00873       friend inline bool operator!= (const l_cinterval & a, 
00874                                      const l_complex & b)   throw();
00876       friend inline bool operator!= (const l_complex & a, 
00877                                      const l_cinterval & b) throw();
00878 
00879       // LCI <--> CI
00880       
00882       friend inline bool operator== (const l_cinterval & a, 
00883                                      const cinterval & b)   throw();
00885       friend inline bool operator== (const cinterval & a, 
00886                                      const l_cinterval & b) throw();
00888       friend inline bool operator!= (const l_cinterval & a, 
00889                                      const cinterval & b)   throw();
00891       friend inline bool operator!= (const cinterval & a, 
00892                                      const l_cinterval & b) throw();
00893 
00894       // ---- Set Operators ----
00895       
00897       friend inline bool operator  <(const l_cinterval &, const l_cinterval &)
00898                                                                       throw();
00900       friend inline bool operator  >(const l_cinterval &, const l_cinterval &)
00901                                                                       throw();
00903       friend inline bool operator <=(const l_cinterval &, const l_cinterval &)
00904                                                                       throw();
00906       friend inline bool operator >=(const l_cinterval &, const l_cinterval &)
00907                                                                       throw();
00908       // LCI <--> R
00909 
00911       friend inline bool operator  <(const real &, const l_cinterval &)
00912                                                                throw();
00914       friend inline bool operator  >(const real &, const l_cinterval &)
00915                                                                throw();
00917       friend inline bool operator <=(const real &, const l_cinterval &)
00918                                                                throw();
00920       friend inline bool operator >=(const real &, const l_cinterval &) 
00921                                                                throw();
00922 
00924       friend inline bool operator  <(const l_cinterval &, const real &)
00925                                                                throw();
00927       friend inline bool operator  >(const l_cinterval &, const real &)
00928                                                                throw();
00930       friend inline bool operator <=(const l_cinterval &, const real &)
00931                                                                throw();
00933       friend inline bool operator >=(const l_cinterval &, const real &)
00934                                                                throw();
00935 
00936       // LCI <--> LR
00937 
00939       friend inline bool operator  <(const l_real &, const l_cinterval &)
00940                                                                  throw();
00942       friend inline bool operator  >(const l_real &, const l_cinterval &)
00943                                                                  throw();
00945       friend inline bool operator <=(const l_real &, const l_cinterval &)
00946                                                                  throw();
00948       friend inline bool operator >=(const l_real &, const l_cinterval &) 
00949                                                                  throw();
00950 
00952       friend inline bool operator  <(const l_cinterval &, const l_real &)
00953                                                                  throw();
00955       friend inline bool operator  >(const l_cinterval &, const l_real &)
00956                                                                  throw();
00958       friend inline bool operator <=(const l_cinterval &, const l_real &)
00959                                                                  throw();
00961       friend inline bool operator >=(const l_cinterval &, const l_real &)
00962                                                                  throw();
00963 
00964       // LCI <--> I
00965 
00967       friend inline bool operator  <(const interval &, const l_cinterval &)
00968                                                                    throw();
00970       friend inline bool operator  >(const interval &, const l_cinterval &)
00971                                                                    throw();
00973       friend inline bool operator <=(const interval &, const l_cinterval &)
00974                                                                    throw();
00976       friend inline bool operator >=(const interval &, const l_cinterval &)
00977                                                                    throw();
00978 
00980       friend inline bool operator  <(const l_cinterval &, const interval &)
00981                                                                    throw();
00983       friend inline bool operator  >(const l_cinterval &, const interval &)
00984                                                                    throw();
00986       friend inline bool operator <=(const l_cinterval &, const interval &)
00987                                                                    throw();
00989       friend inline bool operator >=(const l_cinterval &, const interval &)
00990                                                                    throw();
00991 
00992       // LCI <--> LI
00993 
00995       friend inline bool operator  <(const l_interval &, const l_cinterval &)
00996                                                                      throw();
00998       friend inline bool operator  >(const l_interval &, const l_cinterval &)
00999                                                                      throw();
01001       friend inline bool operator <=(const l_interval &, const l_cinterval &)
01002                                                                      throw();
01004       friend inline bool operator >=(const l_interval &, const l_cinterval &)
01005                                                                      throw();
01006 
01008       friend inline bool operator  <(const l_cinterval &, const l_interval &)
01009                                                                      throw();
01011       friend inline bool operator  >(const l_cinterval &, const l_interval &)
01012                                                                      throw();
01014       friend inline bool operator <=(const l_cinterval &, const l_interval &)
01015                                                                      throw();
01017       friend inline bool operator >=(const l_cinterval &, const l_interval &)
01018                                                                      throw();
01019 
01020       // LCI <--> C
01021 
01023       friend inline bool operator  <(const complex &, const l_cinterval &)
01024                                                                   throw();
01026       friend inline bool operator  >(const complex &, const l_cinterval &)
01027                                                                   throw();
01029       friend inline bool operator <=(const complex &, const l_cinterval &)
01030                                                                   throw();
01032       friend inline bool operator >=(const complex &, const l_cinterval &)
01033                                                                   throw();
01034 
01036       friend inline bool operator  <(const l_cinterval &, const complex &)
01037                                                                   throw();
01039       friend inline bool operator  >(const l_cinterval &, const complex &)
01040                                                                   throw();
01042       friend inline bool operator <=(const l_cinterval &, const complex &)
01043                                                                   throw();
01045       friend inline bool operator >=(const l_cinterval &, const complex &)
01046                                                                   throw();
01047 
01048       // LCI <--> LC
01049 
01051       friend inline bool operator  <(const l_complex &, const l_cinterval &)
01052                                                                     throw();
01054       friend inline bool operator  >(const l_complex &, const l_cinterval &)
01055                                                                     throw();
01057       friend inline bool operator <=(const l_complex &, const l_cinterval &)
01058                                                                     throw();
01060       friend inline bool operator >=(const l_complex &, const l_cinterval &)
01061                                                                     throw();
01062 
01064       friend inline bool operator  <(const l_cinterval &, const l_complex &)
01065                                                                     throw();
01067       friend inline bool operator  >(const l_cinterval &, const l_complex &)
01068                                                                     throw();
01070       friend inline bool operator <=(const l_cinterval &, const l_complex &)
01071                                                                     throw();
01073       friend inline bool operator >=(const l_cinterval &, const l_complex &)
01074                                                                     throw();
01075 
01076       // LCI <--> CI
01077 
01079       friend inline bool operator  <(const cinterval &, const l_cinterval &)
01080                                                                     throw();
01082       friend inline bool operator  >(const cinterval &, const l_cinterval &)
01083                                                                     throw();
01085       friend inline bool operator <=(const cinterval &, const l_cinterval &)
01086                                                                     throw();
01088       friend inline bool operator >=(const cinterval &, const l_cinterval &)
01089                                                                     throw();
01090 
01092       friend inline bool operator  <(const l_cinterval &, const cinterval &)
01093                                                                     throw();
01095       friend inline bool operator  >(const l_cinterval &, const cinterval &)
01096                                                                     throw();
01098       friend inline bool operator <=(const l_cinterval &, const cinterval &)
01099                                                                     throw();
01101       friend inline bool operator >=(const l_cinterval &, const cinterval &)
01102                                                                     throw();
01103 
01104       // ---- Others   -------------------------------------------
01105 
01107       friend inline l_complex    Inf(const l_cinterval &) throw();
01109       friend inline l_complex    Sup(const l_cinterval &) throw();
01110       
01112       friend inline l_cinterval & SetInf(l_cinterval &, const complex &) 
01113                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01115       friend inline l_cinterval & SetSup(l_cinterval &, const complex &) 
01116                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01118       friend inline l_cinterval & SetInf(l_cinterval &, const l_complex &) 
01119                                     throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01121       friend inline l_cinterval & SetSup(l_cinterval &, const l_complex &) 
01122                                     throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01123 
01125       friend inline l_cinterval & SetInf(l_cinterval &, const real &) 
01126                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01127 
01129       friend inline l_cinterval & SetSup(l_cinterval &, const real &) 
01130                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01132       friend inline l_cinterval & SetInf(l_cinterval &, const l_real &) 
01133                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01134 
01136       friend inline l_cinterval & SetSup(l_cinterval &, const l_real &) 
01137                                   throw(ERROR_CINTERVAL_EMPTY_INTERVAL);
01138 
01140       friend inline l_cinterval & UncheckedSetInf(l_cinterval &, 
01141                                                   const complex &) throw();
01143       friend inline l_cinterval & UncheckedSetInf(l_cinterval &, 
01144                                                   const real &)    throw();
01146       friend inline l_cinterval & UncheckedSetSup(l_cinterval &, 
01147                                                   const complex &) throw();
01149       friend inline l_cinterval & UncheckedSetSup(l_cinterval &, 
01150                                                   const real &)    throw();
01151 
01153       friend inline l_cinterval & UncheckedSetInf(l_cinterval &, 
01154                                                   const l_complex &) throw();
01156       friend inline l_cinterval & UncheckedSetInf(l_cinterval &, 
01157                                                   const l_real &)    throw();
01159       friend inline l_cinterval & UncheckedSetSup(l_cinterval &, 
01160                                                   const l_complex &) throw();
01162       friend inline l_cinterval & UncheckedSetSup(l_cinterval &, 
01163                                                   const l_real &)    throw();
01164      
01166       friend l_interval & Re(l_cinterval & a)       throw() { return a.re; }
01168       friend l_interval   Re(const l_cinterval & a) throw() { return a.re; }
01170       friend l_interval & Im(l_cinterval & a)       throw() { return a.im; }
01172       friend l_interval   Im(const l_cinterval & a) throw() { return a.im; }
01173       
01175       friend l_cinterval & SetRe(l_cinterval & a, const interval & b) 
01176                                                        { a.re=b; return a; }
01178       friend l_cinterval & SetIm(l_cinterval & a, const interval & b) 
01179                                                        { a.im=b; return a; } 
01181       friend l_cinterval & SetRe(l_cinterval & a, const real     & b) 
01182                                                        { a.re=b; return a; }
01184       friend l_cinterval & SetIm(l_cinterval & a, const real     & b) 
01185                                                        { a.im=b; return a; }
01186  
01188       friend l_cinterval & SetRe(l_cinterval & a, const l_interval & b) 
01189                                                        { a.re=b; return a; }
01191       friend l_cinterval & SetIm(l_cinterval & a, const l_interval & b) 
01192                                                        { a.im=b; return a; } 
01194       friend l_cinterval & SetRe(l_cinterval & a, const l_real     & b) 
01195                                                        { a.re=b; return a; }
01197       friend l_cinterval & SetIm(l_cinterval & a, const l_real     & b) 
01198                                                        { a.im=b; return a; } 
01199 
01201       friend inline l_real InfRe(const l_cinterval &a) throw() 
01202                                                      { return Inf(a.re); }
01204       friend inline l_real InfIm(const l_cinterval &a) throw() 
01205                                                      { return Inf(a.im); }
01207       friend inline l_real SupRe(const l_cinterval &a) throw() 
01208                                                      { return Sup(a.re); }
01210       friend inline l_real SupIm(const l_cinterval &a) throw() 
01211                                                      { return Sup(a.im); }
01213     friend inline void times2pown(l_cinterval& x, 
01214                               const int& n) throw(); 
01216     friend inline void Times2pown(l_cinterval& x, 
01217                               const int& n) throw(); 
01218 
01219      
01221     friend        l_interval  abs (const l_cinterval &) throw();
01223     friend inline l_cinterval conj(const l_cinterval &) throw();
01225     friend inline l_complex   mid (const l_cinterval &) throw();
01227     friend inline l_complex   diam(const l_cinterval &) throw();
01228 
01230     friend inline l_cinterval adjust(const l_cinterval &) throw();
01231 
01232 };
01233 
01234 } // namespace cxsc 
01235 
01236 #include "l_cinterval.inl"
01237 #include "l_cimath.hpp"
01238 
01239 #endif // _CXSC_L_CINTERVAL_HPP_INCLUDED