Changeset 1870 in Sophya for trunk/SophyaLib/BaseTools/mutyv.h
- Timestamp:
- Jan 18, 2002, 12:25:29 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/mutyv.h
r1544 r1870 35 35 inline MuTyV(r_4 f) { typ = MTVFloat; dv = (r_8)f; iv = (int_8)f; dv_im = 0.; strv = NULL; } 36 36 inline MuTyV(r_8 d) { typ = MTVFloat; dv = d; iv = (int_8)d; dv_im = 0.; strv = NULL; } 37 inline MuTyV(complex<r_4> z) { typ = MTVComplex; dv = (r_8)z.real(); dv_im = z.imag();37 inline MuTyV(complex<r_4> const& z) { typ = MTVComplex; dv = (r_8)z.real(); dv_im = z.imag(); 38 38 iv = (int_8)dv; strv = NULL; } 39 inline MuTyV(complex<r_8> z) { typ = MTVComplex; dv = z.real(); dv_im = z.imag();39 inline MuTyV(complex<r_8> const& z) { typ = MTVComplex; dv = z.real(); dv_im = z.imag(); 40 40 iv = (int_8)dv; strv = NULL; } 41 41 … … 45 45 ~MuTyV(); 46 46 47 inline MTVType Type() const { return typ; }48 49 47 MuTyV & operator= (MuTyV const & a); 50 inline uint_2 operator= (uint_2 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(v); }51 inline uint_2 operator= (uint_8 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(v); }52 inline int_4 operator= (int_4 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(v); }53 inline int_8 operator= (int_8 v) { typ = MTVInteger; iv = v; dv = (r_8)v; dv_im = 0.; return(v); }54 inline r_4 operator= (r_4 v) { typ = MTVFloat; dv = (r_8)v; iv = (int_8)v; dv_im = 0.; return(v); }55 inline r_8 operator= (r_8 v) { typ = MTVFloat; dv = v; iv = (int_8)v; dv_im = 0.; return(v); }56 inline complex<r_4> operator= (complex<r_4>v) { typ = MTVComplex; dv = (r_8)v.real(); dv_im = v.imag();57 iv = (int_8)dv; return( v); }58 inline complex<r_8> operator= (complex<r_8>v) { typ = MTVComplex; dv = (r_8)v.real(); dv_im = v.imag();59 iv = (int_8)dv; return( v); }48 inline MuTyV & operator= (uint_2 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(*this); } 49 inline MuTyV & operator= (uint_8 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(*this); } 50 inline MuTyV & operator= (int_4 v) { typ = MTVInteger; iv = (int_8)v; dv = (r_8)v; dv_im = 0.; return(*this); } 51 inline MuTyV & operator= (int_8 v) { typ = MTVInteger; iv = v; dv = (r_8)v; dv_im = 0.; return(*this); } 52 inline MuTyV & operator= (r_4 v) { typ = MTVFloat; dv = (r_8)v; iv = (int_8)v; dv_im = 0.; return(*this); } 53 inline MuTyV & operator= (r_8 v) { typ = MTVFloat; dv = v; iv = (int_8)v; dv_im = 0.; return(*this); } 54 inline MuTyV & operator= (complex<r_4> const& v) { typ = MTVComplex; dv = (r_8)v.real(); dv_im = v.imag(); 55 iv = (int_8)dv; return(*this); } 56 inline MuTyV & operator= (complex<r_8> const& v) { typ = MTVComplex; dv = (r_8)v.real(); dv_im = v.imag(); 57 iv = (int_8)dv; return(*this); } 60 58 char* operator= (char* s); 61 59 string& operator= (string& s); … … 72 70 operator string() const ; 73 71 72 /* g++ a du mal avec les operateurs de conversion complex<T> */ 73 /* On definit donc les deux methodes de conversion nommees explicitement */ 74 inline complex<r_4> ToComplexF() const { return(complex<r_4>((r_4)dv, (r_4)dv_im)); } 75 inline complex<r_4> ToComplexD() const { return(complex<r_8>(dv, dv_im)); } 76 77 inline MTVType Type() const { return typ; } 78 inline int_8 GetIntPart() const { return iv; } 79 inline r_8 GetRealPart() const { return dv; } 80 inline r_8 GetImagPart() const { return dv_im; } 81 inline string* GetStringPointer() const { return (strv); } 82 83 protected: 74 84 int_8 iv; 75 85 r_8 dv;
Note:
See TracChangeset
for help on using the changeset viewer.