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 10.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/Geometry/Vector3D.h (Version 11.3.0) and /externals/clhep/include/CLHEP/Geometry/Vector3D.h (Version 10.2)


  1 // -*- C++ -*-                                      1 // -*- C++ -*-
                                                   >>   2 // $Id:$
  2 // -------------------------------------------      3 // ---------------------------------------------------------------------------
  3 //                                                  4 //
  4 // This file is a part of the CLHEP - a Class       5 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
  5 //                                                  6 //
  6 // History:                                         7 // History:
  7 // 09.09.96 E.Chernyaev - initial version           8 // 09.09.96 E.Chernyaev - initial version
  8 // 12.06.01 E.Chernyaev - CLHEP-1.7: introduct      9 // 12.06.01 E.Chernyaev - CLHEP-1.7: introduction of BasicVector3D to decouple
  9 //                        the functionality fr     10 //                        the functionality from CLHEP::Hep3Vector
 10 // 01.04.03 E.Chernyaev - CLHEP-1.9: template      11 // 01.04.03 E.Chernyaev - CLHEP-1.9: template version
 11 //                                                 12 //
 12                                                    13 
 13 #ifndef HEP_VECTOR3D_H                             14 #ifndef HEP_VECTOR3D_H
 14 #define HEP_VECTOR3D_H                             15 #define HEP_VECTOR3D_H
 15                                                    16 
 16 #include <iosfwd>                                  17 #include <iosfwd>
 17 #include "CLHEP/Vector/ThreeVector.h"              18 #include "CLHEP/Vector/ThreeVector.h"
 18 #include "CLHEP/Geometry/BasicVector3D.h"          19 #include "CLHEP/Geometry/BasicVector3D.h"
 19                                                    20 
 20 namespace HepGeom {                                21 namespace HepGeom {
 21                                                    22 
 22   class Transform3D;                               23   class Transform3D;
 23                                                    24 
 24   /**                                              25   /**
 25    * Geometrical 3D Vector.                        26    * Geometrical 3D Vector.
 26    * This is just a declaration of the class n     27    * This is just a declaration of the class needed to define
 27    * specializations Vector3D<float> and Vecto     28    * specializations Vector3D<float> and Vector3D<double>.
 28    *                                               29    *
 29    * @ingroup geometry                             30    * @ingroup geometry
 30    * @author Evgeni Chernyaev <Evgueni.Tcherni     31    * @author Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch>
 31    */                                              32    */
 32   template<class T>                                33   template<class T>
 33   class Vector3D : public BasicVector3D<T> {};     34   class Vector3D : public BasicVector3D<T> {};
 34                                                    35 
 35   /**                                              36   /**
 36    * Geometrical 3D Vector with components of      37    * Geometrical 3D Vector with components of float type.
 37    *                                               38    *
 38    * @author Evgeni Chernyaev <Evgueni.Tcherni     39    * @author Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch>
 39    * @ingroup geometry                             40    * @ingroup geometry
 40    */                                              41    */
 41   template<>                                       42   template<>
 42   class Vector3D<float> : public BasicVector3D     43   class Vector3D<float> : public BasicVector3D<float> {
 43   public:                                          44   public:
 44     /**                                            45     /**
 45      * Default constructor. */                     46      * Default constructor. */
 46     Vector3D() = default;                      <<  47     Vector3D() {}
 47                                                    48 
 48     /**                                            49     /**
 49      * Constructor from three numbers. */          50      * Constructor from three numbers. */
 50     Vector3D(float x1, float y1, float z1) : B     51     Vector3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
 51                                                    52 
 52     /**                                            53     /**
 53      * Constructor from array of floats. */        54      * Constructor from array of floats. */
 54     explicit Vector3D(const float * a)             55     explicit Vector3D(const float * a)
 55       : BasicVector3D<float>(a[0],a[1],a[2]) {     56       : BasicVector3D<float>(a[0],a[1],a[2]) {}
 56                                                    57 
 57     /**                                            58     /**
 58      * Copy constructor. */                        59      * Copy constructor. */
 59     Vector3D(const Vector3D<float> &) = defaul <<  60     Vector3D(const Vector3D<float> & v) : BasicVector3D<float>(v) {}
 60                                                << 
 61     /**                                        << 
 62      * Move constructor. */                    << 
 63     Vector3D(Vector3D<float> &&) = default;    << 
 64                                                    61 
 65     /**                                            62     /**
 66      * Constructor from BasicVector3D<float>.      63      * Constructor from BasicVector3D<float>. */
 67     Vector3D(const BasicVector3D<float> & v) :     64     Vector3D(const BasicVector3D<float> & v) : BasicVector3D<float>(v) {}
 68                                                    65 
 69     /**                                            66     /**
 70      * Destructor. */                              67      * Destructor. */
 71     ~Vector3D() = default;                     <<  68     ~Vector3D() {}
 72                                                    69 
 73     /**                                            70     /**
 74      * Assignment. */                              71      * Assignment. */
 75     Vector3D<float> & operator=(const Vector3D <<  72     Vector3D<float> & operator=(const Vector3D<float> & v) {
                                                   >>  73       set(v.x(),v.y(),v.z()); return *this;
                                                   >>  74     }
 76                                                    75 
 77     /**                                            76     /**
 78      * Assignment from BasicVector3D<float>. *     77      * Assignment from BasicVector3D<float>. */
 79     Vector3D<float> & operator=(const BasicVec     78     Vector3D<float> & operator=(const BasicVector3D<float> & v) {
 80       this->BasicVector3D<float>::operator=(v) <<  79       set(v.x(),v.y(),v.z()); return *this;
 81       return *this;                            << 
 82     }                                              80     }
 83                                                    81 
 84     /**                                            82     /**
 85      * Move assignment. */                     << 
 86     Vector3D<float> & operator=(Vector3D<float << 
 87                                                << 
 88     /**                                        << 
 89      * Transformation by Transform3D. */           83      * Transformation by Transform3D. */
 90     Vector3D<float> & transform(const Transfor     84     Vector3D<float> & transform(const Transform3D & m);
 91   };                                               85   };
 92                                                    86 
 93   /**                                              87   /**
 94    * Transformation of Vector<float> by Transf     88    * Transformation of Vector<float> by Transform3D.
 95    * @relates Vector3D                             89    * @relates Vector3D
 96    */                                              90    */
 97   Vector3D<float>                                  91   Vector3D<float>
 98   operator*(const Transform3D & m, const Vecto     92   operator*(const Transform3D & m, const Vector3D<float> & v);
 99                                                    93 
100   /**                                              94   /**
101    * Geometrical 3D Vector with components of      95    * Geometrical 3D Vector with components of double type.
102    *                                               96    *
103    * @author Evgeni Chernyaev <Evgueni.Tcherni     97    * @author Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch>
104    * @ingroup geometry                             98    * @ingroup geometry
105    */                                              99    */
106   template<>                                      100   template<>
107   class Vector3D<double> : public BasicVector3    101   class Vector3D<double> : public BasicVector3D<double> {
108   public:                                         102   public:
109     /**                                           103     /**
110      * Default constructor. */                    104      * Default constructor. */
111     Vector3D() = default;                      << 105     Vector3D() {}
112                                                   106 
113     /**                                           107     /**
114      * Constructor from three numbers. */         108      * Constructor from three numbers. */
115     Vector3D(double x1, double y1, double z1)     109     Vector3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
116                                                   110 
117     /**                                           111     /**
118      * Constructor from array of floats. */       112      * Constructor from array of floats. */
119     explicit Vector3D(const float * a)            113     explicit Vector3D(const float * a)
120       : BasicVector3D<double>(a[0],a[1],a[2])     114       : BasicVector3D<double>(a[0],a[1],a[2]) {}
121                                                   115 
122     /**                                           116     /**
123      * Constructor from array of doubles. */      117      * Constructor from array of doubles. */
124     explicit Vector3D(const double * a)           118     explicit Vector3D(const double * a)
125       : BasicVector3D<double>(a[0],a[1],a[2])     119       : BasicVector3D<double>(a[0],a[1],a[2]) {}
126                                                   120 
127     /**                                           121     /**
128      * Copy constructor. */                       122      * Copy constructor. */
129     Vector3D(const Vector3D<double> &) = defau << 123     Vector3D(const Vector3D<double> & v) : BasicVector3D<double>(v) {}
130                                                << 
131     /**                                        << 
132      * Move constructor. */                    << 
133     Vector3D(Vector3D<double> &&) = default;   << 
134                                                   124 
135     /**                                           125     /**
136      * Constructor from BasicVector3D<float>.     126      * Constructor from BasicVector3D<float>. */
137     Vector3D(const BasicVector3D<float> & v) :    127     Vector3D(const BasicVector3D<float> & v) : BasicVector3D<double>(v) {}
138                                                   128 
139     /**                                           129     /**
140      * Constructor from BasicVector3D<double>.    130      * Constructor from BasicVector3D<double>. */
141     Vector3D(const BasicVector3D<double> & v)     131     Vector3D(const BasicVector3D<double> & v) : BasicVector3D<double>(v) {}
142                                                   132 
143     /**                                           133     /**
144      * Destructor. */                             134      * Destructor. */
145     ~Vector3D() = default;                     << 135     ~Vector3D() {}
146                                                   136 
147     /**                                           137     /**
148      * Constructor from CLHEP::Hep3Vector.        138      * Constructor from CLHEP::Hep3Vector.
149      * This constructor is needed only for bac    139      * This constructor is needed only for backward compatibility and
150      * in principle should be absent.             140      * in principle should be absent.
151      */                                           141      */
152     Vector3D(const CLHEP::Hep3Vector & v)         142     Vector3D(const CLHEP::Hep3Vector & v)
153       : BasicVector3D<double>(v.x(),v.y(),v.z(    143       : BasicVector3D<double>(v.x(),v.y(),v.z()) {}
154                                                   144 
155     /**                                           145     /**
156      * Conversion (cast) to CLHEP::Hep3Vector.    146      * Conversion (cast) to CLHEP::Hep3Vector.
157      * This operator is needed only for backwa    147      * This operator is needed only for backward compatibility and
158      * in principle should not exit.              148      * in principle should not exit.
159      */                                        << 149      */ 
160     operator CLHEP::Hep3Vector () const { retu    150     operator CLHEP::Hep3Vector () const { return CLHEP::Hep3Vector(x(),y(),z()); }
161                                                   151 
162     /**                                           152     /**
163      * Assignment. */                             153      * Assignment. */
164     Vector3D<double> & operator=(const Vector3 << 154     Vector3D<double> & operator=(const Vector3D<double> & v) {
                                                   >> 155       set(v.x(),v.y(),v.z()); return *this;
                                                   >> 156     }
165                                                   157 
166     /**                                           158     /**
167      * Assignment from BasicVector3D<float>. *    159      * Assignment from BasicVector3D<float>. */
168     Vector3D<double> & operator=(const BasicVe    160     Vector3D<double> & operator=(const BasicVector3D<float> & v) {
169       this->BasicVector3D<double>::operator=(v << 161       set(v.x(),v.y(),v.z()); return *this;
170       return *this;                            << 
171     }                                             162     }
172                                                   163 
173     /**                                           164     /**
174      * Assignment from BasicVector3D<double>.     165      * Assignment from BasicVector3D<double>. */
175     Vector3D<double> & operator=(const BasicVe    166     Vector3D<double> & operator=(const BasicVector3D<double> & v) {
176       this->BasicVector3D<double>::operator=(v << 167       set(v.x(),v.y(),v.z()); return *this;
177       return *this;                            << 
178     }                                             168     }
179                                                << 
180     /**                                        << 
181      * Move assignment. */                     << 
182     Vector3D<double> & operator=(Vector3D<doub << 
183                                                   169 
184     /**                                           170     /**
185      * Transformation by Transform3D. */          171      * Transformation by Transform3D. */
186     Vector3D<double> & transform(const Transfo    172     Vector3D<double> & transform(const Transform3D & m);
187   };                                              173   };
188                                                   174 
189   /**                                             175   /**
190    * Transformation of Vector<double> by Trans    176    * Transformation of Vector<double> by Transform3D.
191    * @relates Vector3D                            177    * @relates Vector3D
192    */                                             178    */
193   Vector3D<double>                                179   Vector3D<double>
194   operator*(const Transform3D & m, const Vecto    180   operator*(const Transform3D & m, const Vector3D<double> & v);
195                                                   181 
196 } /* namespace HepGeom */                         182 } /* namespace HepGeom */
197                                                   183 
198 #endif /* HEP_VECTOR3D_H */                       184 #endif /* HEP_VECTOR3D_H */
199                                                   185