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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/clhep/include/CLHEP/Random/DoubConv.h (Version 11.3.0) and /externals/clhep/include/CLHEP/Random/DoubConv.h (Version 10.1.p2)


  1 // -*- C++ -*-                                 <<   1 // $Id:$
  2 //                                             <<   2 // -*- C++ -*-
  3 // ------------------------------------------- <<   3 //
  4 //                           Hep Random        <<   4 // -----------------------------------------------------------------------
  5 //                        --- DoubConv ---     <<   5 //                           Hep Random
  6 //                        class header file    <<   6 //                        --- DoubConv ---
  7 // ------------------------------------------- <<   7 //                        class header file
  8 //                                             <<   8 // -----------------------------------------------------------------------
  9 #ifndef DOUBCONV_HH                            <<   9 //                  
 10 #define DOUBCONV_HH                            <<  10 #ifndef DOUBCONV_HH
 11                                                <<  11 #define DOUBCONV_HH
 12 #include <string>                              <<  12 
 13 #include <vector>                              <<  13 #include <string>
 14 #include <exception>                           <<  14 #include <vector>
 15 #include "CLHEP/Utility/thread_local.h"        <<  15 #include <exception>
 16                                                <<  16 #include "CLHEP/Utility/thread_local.h"
 17 namespace CLHEP {                              <<  17 
 18                                                <<  18 namespace CLHEP {
 19 class DoubConvException  : public std::excepti <<  19 
 20 public:                                        <<  20 class DoubConvException  : public std::exception {
 21   DoubConvException(const std::string & w) thr <<  21 public:
 22   ~DoubConvException() throw() {}              <<  22   DoubConvException(const std::string & w) throw() : msg(w) {}
 23   const char* what() const throw() { return ms <<  23   ~DoubConvException() throw() {}
 24 private:                                       <<  24   const char* what() const throw() { return msg.c_str(); }
 25   std::string msg;                             <<  25 private:
 26 };                                             <<  26   std::string msg;
 27                                                <<  27 };
 28 class DoubConv {                               <<  28 
 29 public:                                        <<  29 class DoubConv {
 30                                                <<  30 public:
 31   // dto2longs(d) returns (in a vector) two un <<  31 
 32   // representation of its double input.  This <<  32   // dto2longs(d) returns (in a vector) two unsigned longs string containing the
 33   // independant, and depends for complete por <<  33   // representation of its double input.  This is byte-ordering 
 34   // to the IEEE 754 standard for 64-bit float <<  34   // independant, and depends for complete portability ONLY on adherance 
 35   // The first unsigned long contains the high <<  35   // to the IEEE 754 standard for 64-bit floating point representation.
 36   // 1.0 will always be 0x3FF00000, 00000000   <<  36   // The first unsigned long contains the high-order bits in IEEE; thus
 37   static std::vector<unsigned long> dto2longs( <<  37   // 1.0 will always be 0x3FF00000, 00000000
 38                                                <<  38   static std::vector<unsigned long> dto2longs(double d);
 39   // longs2double (v) returns a double contain <<  39 
 40   // input, which must be a vector containing  <<  40   // longs2double (v) returns a double containing the value represented by its  
 41   // The input is taken to be the representati <<  41   // input, which must be a vector containing 2 unsigned longs.  
 42   // the IEEE 754 standard for a 64-bit floati <<  42   // The input is taken to be the representation according to
 43   // is returned as a double.  The byte-orderi <<  43   // the IEEE 754 standard for a 64-bit floating point number, whose value
 44   // of course, tailored to the proper byte-or <<  44   // is returned as a double.  The byte-ordering of the double result is, 
 45   static double longs2double (const std::vecto <<  45   // of course, tailored to the proper byte-ordering for the system.
 46                                                <<  46   static double longs2double (const std::vector<unsigned long> & v);
 47   // dtox(d) returns a 16-character string con <<  47 
 48   // representation of its double input.  This <<  48   // dtox(d) returns a 16-character string containing the (zero-filled) hex 
 49   // independant, and depends for complete por <<  49   // representation of its double input.  This is byte-ordering 
 50   // to the IEEE 754 standard for 64-bit float <<  50   // independant, and depends for complete portability ONLY on adherance 
 51   static std::string d2x(double d);            <<  51   // to the IEEE 754 standard for 64-bit floating point representation.
 52                                                <<  52   static std::string d2x(double d);
 53 private:                                       <<  53  
 54   union DB8 {                                  <<  54 private:
 55     unsigned char b[8];                        <<  55   union DB8 {
 56     double d;                                  <<  56     unsigned char b[8];
 57   };                                           <<  57     double d;
 58   static void fill_byte_order ();              <<  58   };
 59   static CLHEP_THREAD_LOCAL bool byte_order_kn <<  59   static void fill_byte_order ();
 60   static CLHEP_THREAD_LOCAL int  byte_order[8] <<  60   static CLHEP_THREAD_LOCAL bool byte_order_known;
 61     // Meaning of byte_order:  The first (high <<  61   static CLHEP_THREAD_LOCAL int  byte_order[8];
 62     // output (or the high-order byte of the f <<  62     // Meaning of byte_order:  The first (high-order in IEEE 754) byte to
 63     // is  of db.b[byte_order[0]].  Thus the i <<  63     // output (or the high-order byte of the first unsigned long)
 64     // is a position in the IEEE representatio <<  64     // is  of db.b[byte_order[0]].  Thus the index INTO byte_order
 65     // of byte_order[k] is an offset in the me <<  65     // is a position in the IEEE representation of the double, and the value
 66     // double.                                 <<  66     // of byte_order[k] is an offset in the memory representation of the 
 67 };                                             <<  67     // double.  
 68                                                <<  68 };
 69                                                <<  69 
 70 }                                              <<  70 
 71                                                <<  71 }
 72 #endif // DOUBCONV_HH                          <<  72 
                                                   >>  73 #endif // DOUBCONV_HH
 73                                                    74