Changeset 1870 in Sophya for trunk/SophyaLib/BaseTools


Ignore:
Timestamp:
Jan 18, 2002, 12:25:29 PM (24 years ago)
Author:
ansari
Message:

Adaptations pour compil avec g++ 3.0 - Reza 18/01/2002

Location:
trunk/SophyaLib/BaseTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/dvlist.cc

    r1607 r1870  
    163163    {
    164164    case MuTyV::MTVInteger :
    165       SetI((*it).first, (*it).second.elval.iv);
     165      SetI((*it).first, (*it).second.elval.GetIntPart());
    166166      break;
    167167    case  MuTyV::MTVFloat :
    168       SetD((*it).first, (*it).second.elval.dv);
     168      SetD((*it).first, (*it).second.elval.GetRealPart());
    169169      break;
    170170    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()));
    172172      break;
    173173    case MuTyV::MTVString :
    174       SetS((*it).first, *((*it).second.elval.strv));
     174      SetS((*it).first, *((*it).second.elval.GetStringPointer()));
    175175      break;
    176176    default :
     
    223223if (it == mvlist.end())  return(def);
    224224#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;
     227return((*it).second.elval.ToComplexD());
    228228#else
    229229return( (complex<r_8>)(*it).second.elval );
     
    407407    case MuTyV::MTVInteger :
    408408      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());
    410410      break;
    411411    case MuTyV::MTVFloat :
    412412      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());
    414414      break;
    415415    case MuTyV::MTVComplex :
    416416      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());
    418418      break;
    419419    case MuTyV::MTVString :
    420420      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());
    422422      break;
    423423    default :
     
    490490  switch ((*it).second.elval.Type()) {
    491491    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()) );
    493493      sfw = buf;  s.PutStr(sfw);
    494494      break;
    495495    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() );
    497497      sfw = buf;  s.PutStr(sfw);
    498498      break;
    499499    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());
    502502      sfw = buf;  s.PutStr(sfw);
    503503      break;
    504504    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() );
    506506      sfw = buf;  s.PutStr(sfw);
    507507      break;
  • trunk/SophyaLib/BaseTools/machdefs_ac.h

    r1396 r1870  
    204204#define ANSI_TEMPLATES
    205205#endif
    206 /* Standard C++ library classes are in the namespace std  */
    207 #ifdef __cplusplus
    208 namespace std { }
    209 using namespace std;
    210 #endif
    211206#endif
    212207
    213208#if defined(__SGICC__)
    214 /* Standard C++ library classes are in the namespace std  */
    215209#define HAS_STR_NPOS
    216210#ifndef ANSI_TEMPLATES
    217211#define ANSI_TEMPLATES
    218 #endif
    219 #ifdef __cplusplus
    220 namespace std { }
    221 using namespace std;
    222212#endif
    223213#endif
     
    294284
    295285#ifdef __cplusplus
     286/* Standard C++ library classes are in the namespace std  */
     287namespace std { }
     288using namespace std;
     289/*  SOPHYA classes are in namespace SOPHYA  */
    296290namespace SOPHYA {}
    297291using namespace SOPHYA;
  • trunk/SophyaLib/BaseTools/machdefs_mkmf.h

    r1783 r1870  
    301301#define ANSI_TEMPLATES
    302302#endif
    303 /* Standard C++ library classes are in the namespace std  */
    304 #ifdef __cplusplus
    305 namespace std { }
    306 using namespace std;
    307 #endif
    308303#endif
    309304
    310305#if defined(__SGICC__)
    311 /* Standard C++ library classes are in the namespace std  */
    312306#define HAS_STR_NPOS
    313307#ifndef ANSI_TEMPLATES
    314308#define ANSI_TEMPLATES
    315 #endif
    316 #ifdef __cplusplus
    317 namespace std { }
    318 using namespace std;
    319309#endif
    320310#endif
     
    397387
    398388#ifdef __cplusplus
     389/* Standard C++ library classes are in the namespace std  */
     390namespace std { }
     391using namespace std;
     392/*  SOPHYA classes are in namespace SOPHYA  */
    399393namespace SOPHYA {}
    400394using namespace SOPHYA;
  • trunk/SophyaLib/BaseTools/mutyv.h

    r1544 r1870  
    3535  inline MuTyV(r_4 f) { typ = MTVFloat; dv = (r_8)f; iv = (int_8)f;  dv_im = 0.;  strv = NULL; }
    3636  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(); 
    3838                                 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(); 
    4040                                 iv = (int_8)dv;  strv = NULL; }
    4141
     
    4545         ~MuTyV();
    4646 
    47   inline MTVType Type() const { return typ; }
    48 
    4947         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); }
    6058         char*  operator= (char* s);
    6159         string& operator= (string& s);
     
    7270         operator string() const ;
    7371
     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
     83protected:
    7484  int_8 iv;
    7585  r_8 dv;
  • trunk/SophyaLib/BaseTools/sversion.h

    r1837 r1870  
    33
    44#define SOPHYA_VERSION   1.3
    5 #define SOPHYA_REVISION  50
    6 #define SOPHYA_TAG       "V_Dec2001"
     5#define SOPHYA_REVISION  52
     6#define SOPHYA_TAG       "V_Jan2002"
    77
    88#endif
Note: See TracChangeset for help on using the changeset viewer.