Changeset 1870 in Sophya for trunk/SophyaLib/BaseTools
- Timestamp:
- Jan 18, 2002, 12:25:29 PM (24 years ago)
- Location:
- trunk/SophyaLib/BaseTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/dvlist.cc
r1607 r1870 163 163 { 164 164 case MuTyV::MTVInteger : 165 SetI((*it).first, (*it).second.elval. iv);165 SetI((*it).first, (*it).second.elval.GetIntPart()); 166 166 break; 167 167 case MuTyV::MTVFloat : 168 SetD((*it).first, (*it).second.elval. dv);168 SetD((*it).first, (*it).second.elval.GetRealPart()); 169 169 break; 170 170 case MuTyV::MTVComplex : 171 SetZ((*it).first, complex<r_8>((*it).second.elval. dv, (*it).second.elval.dv_im));171 SetZ((*it).first, complex<r_8>((*it).second.elval.GetRealPart(), (*it).second.elval.GetImagPart())); 172 172 break; 173 173 case MuTyV::MTVString : 174 SetS((*it).first, *((*it).second.elval. strv));174 SetS((*it).first, *((*it).second.elval.GetStringPointer())); 175 175 break; 176 176 default : … … 223 223 if (it == mvlist.end()) return(def); 224 224 #if defined(__GNUG__) 225 complex<r_8> z;226 z = (*it).second.elval;227 return( z);225 // complex<r_8> z; 226 // z = (*it).second.elval; 227 return((*it).second.elval.ToComplexD()); 228 228 #else 229 229 return( (complex<r_8>)(*it).second.elval ); … … 407 407 case MuTyV::MTVInteger : 408 408 sprintf(buff, "%s = %ld (int) %s\n", (*it).first.substr(0,64).c_str(), 409 (long)((*it).second.elval. iv), (*it).second.elcomm.substr(0,128).c_str());409 (long)((*it).second.elval.GetIntPart()), (*it).second.elcomm.substr(0,128).c_str()); 410 410 break; 411 411 case MuTyV::MTVFloat : 412 412 sprintf(buff, "%s = %.20g (double) %s\n", (*it).first.substr(0,64).c_str(), 413 (*it).second.elval. dv, (*it).second.elcomm.substr(0,128).c_str());413 (*it).second.elval.GetRealPart(), (*it).second.elcomm.substr(0,128).c_str()); 414 414 break; 415 415 case MuTyV::MTVComplex : 416 416 sprintf(buff, "%s = %.20g %.20g i (complex) %s\n", (*it).first.substr(0,64).c_str(), 417 (*it).second.elval. dv, (*it).second.elval.dv_im, (*it).second.elcomm.substr(0,128).c_str());417 (*it).second.elval.GetRealPart(), (*it).second.elval.GetImagPart(), (*it).second.elcomm.substr(0,128).c_str()); 418 418 break; 419 419 case MuTyV::MTVString : 420 420 sprintf(buff, "%s = %s (string) %s\n", (*it).first.substr(0,64).c_str(), 421 (*it).second.elval. strv->substr(0,800).c_str(), (*it).second.elcomm.substr(0,128).c_str());421 (*it).second.elval.GetStringPointer()->substr(0,800).c_str(), (*it).second.elcomm.substr(0,128).c_str()); 422 422 break; 423 423 default : … … 490 490 switch ((*it).second.elval.Type()) { 491 491 case MuTyV::MTVInteger : 492 sprintf(buf,"I %s %ld\n", (*it).first.substr(0,64).c_str(), (long)((*it).second.elval. iv) );492 sprintf(buf,"I %s %ld\n", (*it).first.substr(0,64).c_str(), (long)((*it).second.elval.GetIntPart()) ); 493 493 sfw = buf; s.PutStr(sfw); 494 494 break; 495 495 case MuTyV::MTVFloat : 496 sprintf(buf,"F %s %.20g\n", (*it).first.substr(0,64).c_str(), (*it).second.elval. dv);496 sprintf(buf,"F %s %.20g\n", (*it).first.substr(0,64).c_str(), (*it).second.elval.GetRealPart() ); 497 497 sfw = buf; s.PutStr(sfw); 498 498 break; 499 499 case MuTyV::MTVComplex : 500 sprintf(buf,"Z %s %.20g %.20g\n", (*it).first.substr(0,64).c_str(), (*it).second.elval. dv,501 (*it).second.elval. dv_im);500 sprintf(buf,"Z %s %.20g %.20g\n", (*it).first.substr(0,64).c_str(), (*it).second.elval.GetRealPart(), 501 (*it).second.elval.GetImagPart()); 502 502 sfw = buf; s.PutStr(sfw); 503 503 break; 504 504 case MuTyV::MTVString : 505 sprintf(buf,"S %s %s\n", (*it).first.substr(0,64).c_str(), (*it).second.elval. strv->substr(0,960).c_str() );505 sprintf(buf,"S %s %s\n", (*it).first.substr(0,64).c_str(), (*it).second.elval.GetStringPointer()->substr(0,960).c_str() ); 506 506 sfw = buf; s.PutStr(sfw); 507 507 break; -
trunk/SophyaLib/BaseTools/machdefs_ac.h
r1396 r1870 204 204 #define ANSI_TEMPLATES 205 205 #endif 206 /* Standard C++ library classes are in the namespace std */207 #ifdef __cplusplus208 namespace std { }209 using namespace std;210 #endif211 206 #endif 212 207 213 208 #if defined(__SGICC__) 214 /* Standard C++ library classes are in the namespace std */215 209 #define HAS_STR_NPOS 216 210 #ifndef ANSI_TEMPLATES 217 211 #define ANSI_TEMPLATES 218 #endif219 #ifdef __cplusplus220 namespace std { }221 using namespace std;222 212 #endif 223 213 #endif … … 294 284 295 285 #ifdef __cplusplus 286 /* Standard C++ library classes are in the namespace std */ 287 namespace std { } 288 using namespace std; 289 /* SOPHYA classes are in namespace SOPHYA */ 296 290 namespace SOPHYA {} 297 291 using namespace SOPHYA; -
trunk/SophyaLib/BaseTools/machdefs_mkmf.h
r1783 r1870 301 301 #define ANSI_TEMPLATES 302 302 #endif 303 /* Standard C++ library classes are in the namespace std */304 #ifdef __cplusplus305 namespace std { }306 using namespace std;307 #endif308 303 #endif 309 304 310 305 #if defined(__SGICC__) 311 /* Standard C++ library classes are in the namespace std */312 306 #define HAS_STR_NPOS 313 307 #ifndef ANSI_TEMPLATES 314 308 #define ANSI_TEMPLATES 315 #endif316 #ifdef __cplusplus317 namespace std { }318 using namespace std;319 309 #endif 320 310 #endif … … 397 387 398 388 #ifdef __cplusplus 389 /* Standard C++ library classes are in the namespace std */ 390 namespace std { } 391 using namespace std; 392 /* SOPHYA classes are in namespace SOPHYA */ 399 393 namespace SOPHYA {} 400 394 using namespace SOPHYA; -
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; -
trunk/SophyaLib/BaseTools/sversion.h
r1837 r1870 3 3 4 4 #define SOPHYA_VERSION 1.3 5 #define SOPHYA_REVISION 5 06 #define SOPHYA_TAG "V_ Dec2001"5 #define SOPHYA_REVISION 52 6 #define SOPHYA_TAG "V_Jan2002" 7 7 8 8 #endif
Note:
See TracChangeset
for help on using the changeset viewer.