Changeset 3750 in Sophya for trunk/SophyaLib/BaseTools/mutyv.h


Ignore:
Timestamp:
Mar 3, 2010, 9:44:38 PM (16 years ago)
Author:
ansari
Message:

Prise en charge de float 128 bits (r_16, complex<r_16>) par les NDataBlock<T> et PPersist, controlee par le flag de compilation SO_LDBLE128 defini ds machdefs.h , Reza 03/03/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/mutyv.h

    r3661 r3750  
    6464  inline MuTyV & operator= (r_4 v)  { typ = MTVFloat; dv = (r_8)v; iv = (int_8)v;  dv_im = 0.;  return(*this); }
    6565  inline MuTyV & operator= (r_8 v) { typ = MTVFloat; dv = v; iv = (int_8)v;  dv_im = 0.;  return(*this); }
    66   inline MuTyV & operator= (complex<r_4> const& v) { typ = MTVComplex; dv = (r_8)v.real();  dv_im = v.imag();
     66  inline MuTyV & operator= (complex<r_4> const& v) { typ = MTVComplex; dv = (r_8)v.real();  dv_im = (r_8)v.imag();
    6767                                                    iv = (int_8)dv;  return(*this); }
    6868  inline MuTyV & operator= (complex<r_8> const& v) { typ = MTVComplex; dv = (r_8)v.real();  dv_im = v.imag();
    6969                                                    iv = (int_8)dv;  return(*this); }
    70          const char*  operator= (const char* s);
    71          string const& operator= (string const & s);
    72          TimeStamp const& operator= (TimeStamp const & s);
     70#ifdef SO_LDBLE128
     71  inline MuTyV & operator= (r_16 v) { typ = MTVFloat; dv = (r_8)v; iv = (int_8)v;  dv_im = 0.;  return(*this); }
     72  inline MuTyV & operator= (complex<r_16> const& v) { typ = MTVComplex; dv = (r_8)v.real();  dv_im = (r_8)v.imag();
     73                                                    iv = (int_8)dv;  return(*this); }
     74#endif
     75  const char*  operator= (const char* s);
     76  string const& operator= (string const & s);
     77  TimeStamp const& operator= (TimeStamp const & s);
    7378
    7479  inline operator uint_1() const { return((uint_1)iv); }
     
    8489  inline operator complex<r_4>() const { return(complex<r_4>((r_4)dv, (r_4)dv_im)); }
    8590  inline operator complex<r_8>() const { return(complex<r_8>(dv, dv_im)); }
     91#ifdef SO_LDBLE128
     92  inline operator r_16() const  { return((r_16)dv); }
     93  inline operator complex<r_16>() const { return(complex<r_16>((r_16)dv, (r_16)dv_im)); }
     94#endif
    8695
    87          operator string() const ;
    88          operator TimeStamp() const ;
     96  operator string() const ;
     97  operator TimeStamp() const ;
    8998
    9099  inline uint_1 Convert(uint_1& x) const { x = (uint_1)iv; return x; }
     
    102111  inline complex<r_8> Convert(complex<r_8> & x) const
    103112    { x = complex< r_8 > (dv, dv_im); return x; }
    104  
     113#ifdef SO_LDBLE128
     114  inline r_16 Convert(r_16& x) const { x = (r_16)dv; return x; }
     115  inline complex<r_16> Convert(complex<r_16> & x) const
     116    { x = complex< r_16 > ((r_16)dv, (r_16)dv_im); return x; }
     117#endif 
    105118  string&  Convert(string& x) const ;
    106119  TimeStamp& Convert(TimeStamp& x) const ;
Note: See TracChangeset for help on using the changeset viewer.