Commit bd8b096b authored by Lynn Garren's avatar Lynn Garren
Browse files

Merge branch 'release/CLHEP_2_4_1_3'

parents 7062c532 daac2fa5
......@@ -31,7 +31,7 @@ clhep_ensure_out_of_source_build()
# use cmake 3.2 or later
cmake_minimum_required(VERSION 3.2)
# Project setup
project(CLHEP VERSION 2.4.1.2)
project(CLHEP VERSION 2.4.1.3)
# - needed for (temporary) back compatibility
set(VERSION ${PROJECT_VERSION})
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
2019-10-18 Evgueni Tcherniaev <evgueni.tcherniaev.@cern.ch>
* Vector/Vector/*.h: added move constructor and move assignment
* Geometry/Geometry/*.h: added move constructor and move assignment
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
......@@ -13,6 +13,7 @@
#define BASIC_VECTOR3D_H
#include <iosfwd>
#include <type_traits>
#include "CLHEP/Geometry/defs.h"
#include "CLHEP/Vector/ThreeVector.h"
......@@ -52,19 +53,24 @@ namespace HepGeom {
BasicVector3D(T x1, T y1, T z1) { v_[0] = x1; v_[1] = y1; v_[2] = z1; }
/**
* Copy constructor.
* Note: BasicVector3D<double> has constructors
* from BasicVector3D<double> (provided by compiler) and
* from BasicVector3D<float> (defined in this file);
* BasicVector3D<float> has only the last one.
*/
* Copy constructor. */
BasicVector3D(const BasicVector3D<T> &) = default;
/**
* Constructor for BasicVector3D<double> from BasicVector3D<float>. */
template<typename U = T,
typename = typename std::enable_if<!std::is_same<U,float>::value >::type>
BasicVector3D(const BasicVector3D<float> & v) {
v_[0] = v.x(); v_[1] = v.y(); v_[2] = v.z();
}
/**
* Move constructor. */
BasicVector3D(BasicVector3D<T> &&) = default;
/**
* Destructor. */
virtual ~BasicVector3D() {}
virtual ~BasicVector3D() = default;
// -------------------------
// Interface to "good old C"
......@@ -92,6 +98,9 @@ namespace HepGeom {
/**
* Assignment. */
BasicVector3D<T> & operator= (const BasicVector3D<T> &) = default;
/**
* Move assignment. */
BasicVector3D<T> & operator= (BasicVector3D<T> &&) = default;
/**
* Addition. */
BasicVector3D<T> & operator+=(const BasicVector3D<T> & v) {
......@@ -246,7 +255,7 @@ namespace HepGeom {
// ---------------
/**
* Gets pseudo-rapidity: -ln(std::tan(theta/2)) */
* Gets pseudo-rapidity: -ln(tan(theta/2)) */
T pseudoRapidity() const;
/**
* Gets pseudo-rapidity. */
......
......@@ -45,7 +45,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Normal3D() {}
Normal3D() = default;
/**
* Constructor from three numbers. */
......@@ -58,7 +58,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Normal3D(const Normal3D<float> & v) : BasicVector3D<float>(v) {}
Normal3D(const Normal3D<float> &) = default;
/**
* Move constructor. */
Normal3D(Normal3D<float> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -66,20 +70,23 @@ namespace HepGeom {
/**
* Destructor. */
~Normal3D() {}
~Normal3D() = default;
/**
* Assignment. */
Normal3D<float> & operator=(const Normal3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Normal3D<float> & operator=(const Normal3D<float> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Normal3D<float> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<float>::operator=(v);
return *this;
}
/**
* Move assignment. */
Normal3D<float> & operator=(Normal3D<float> &&) = default;
/**
* Transformation by Transform3D. */
Normal3D<float> & transform(const Transform3D & m);
......@@ -103,7 +110,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Normal3D() {}
Normal3D() = default;
/**
* Constructor from three numbers. */
......@@ -121,7 +128,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Normal3D(const Normal3D<double> & v) : BasicVector3D<double>(v) {}
Normal3D(const Normal3D<double> &) = default;
/**
* Move constructor. */
Normal3D(Normal3D<double> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -133,7 +144,7 @@ namespace HepGeom {
/**
* Destructor. */
~Normal3D() {}
~Normal3D() = default;
/**
* Constructor from CLHEP::Hep3Vector.
......@@ -152,22 +163,26 @@ namespace HepGeom {
/**
* Assignment. */
Normal3D<double> & operator=(const Normal3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Normal3D<double> & operator=(const Normal3D<double> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Normal3D<double> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Assignment from BasicVector3D<double>. */
Normal3D<double> & operator=(const BasicVector3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Move assignment. */
Normal3D<double> & operator=(Normal3D<double> &&) = default;
/**
* Transformation by Transform3D. */
Normal3D<double> & transform(const Transform3D & m);
......
......@@ -54,23 +54,33 @@ namespace HepGeom {
a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
}
/** Copy constructor.
* Plane3D<double> has two constructors:
* from Plane3D<double> (provided by compiler) and
* from Plane3D<float> (defined in this file).
* Plane3D<float> has only the last one.
*/
/**
* Copy constructor. */
Plane3D(const Plane3D<T> &) = default;
/**
* Constructor for Plane3D<double> from Plane3D<float>. */
template<typename U = T,
typename = typename std::enable_if<!std::is_same<U,float>::value >::type>
Plane3D(const Plane3D<float> & p)
: a_(p.a_), b_(p.b_), c_(p.c_), d_(p.d_) {}
/**
* Move constructor. */
Plane3D(Plane3D<T> &&) = default;
/**
* Destructor. */
~Plane3D() {};
~Plane3D() = default;
/**
* Assignment. */
Plane3D<T> & operator=(const Plane3D<T> &) = default;
/**
* Move assignment. */
Plane3D<T> & operator=(Plane3D<T> &&) = default;
/**
* Returns the a-coefficient in the plane equation: a*x+b*y+c*z+d=0. */
T a() const { return a_; }
......
......@@ -45,7 +45,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Point3D() {}
Point3D() = default;
/**
* Constructor from three numbers. */
......@@ -58,7 +58,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Point3D(const Point3D<float> & v) : BasicVector3D<float>(v) {}
Point3D(const Point3D<float> &) = default;
/**
* Move constructor. */
Point3D(Point3D<float> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -66,20 +70,23 @@ namespace HepGeom {
/**
* Destructor. */
~Point3D() {}
~Point3D() = default;
/**
* Assignment. */
Point3D<float> & operator=(const Point3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Point3D<float> & operator=(const Point3D<float> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Point3D<float> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<float>::operator=(v);
return *this;
}
/**
* Move assignment. */
Point3D<float> & operator=(Point3D<float> &&) = default;
/**
* Returns distance to the origin squared. */
float distance2() const { return mag2(); }
......@@ -124,7 +131,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Point3D() {}
Point3D() = default;
/**
* Constructor from three numbers. */
......@@ -142,7 +149,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Point3D(const Point3D<double> & v) : BasicVector3D<double>(v) {}
Point3D(const Point3D<double> &) = default;
/**
* Move constructor. */
Point3D(Point3D<double> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -154,7 +165,7 @@ namespace HepGeom {
/**
* Destructor. */
~Point3D() {}
~Point3D() = default;
/**
* Constructor from CLHEP::Hep3Vector.
......@@ -173,22 +184,26 @@ namespace HepGeom {
/**
* Assignment. */
Point3D<double> & operator=(const Point3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Point3D<double> & operator=(const Point3D<double> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Point3D<double> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Assignment from BasicVector3D<double>. */
Point3D<double> & operator=(const BasicVector3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Move assignment. */
Point3D<double> & operator=(Point3D<double> &&) = default;
/**
* Returns distance to the origin squared. */
double distance2() const { return mag2(); }
......@@ -224,7 +239,6 @@ namespace HepGeom {
} /* namespace HepGeom */
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// backwards compatibility will be enabled ONLY in CLHEP 1.9
#include "CLHEP/config/CLHEP.h"
......
......@@ -229,17 +229,23 @@ namespace HepGeom {
/**
* Copy constructor. */
Transform3D(const Transform3D & mt)
: xx_(mt.xx_), xy_(mt.xy_), xz_(mt.xz_), dx_(mt.dx_),
yx_(mt.yx_), yy_(mt.yy_), yz_(mt.yz_), dy_(mt.dy_),
zx_(mt.zx_), zy_(mt.zy_), zz_(mt.zz_), dz_(mt.dz_) {}
Transform3D(const Transform3D & mt) = default;
/**
* Destructor.
* Virtual for now as some persistency mechanism needs that,
* in future releases this might go away again.
*/
~Transform3D() { /* nop */ }
* Move constructor. */
Transform3D(Transform3D && mt) = default;
/**
* Destructor. */
~Transform3D() = default;
/**
* Assignment. */
Transform3D & operator=(const Transform3D & mt) = default;
/**
* Move assignment. */
Transform3D & operator=(Transform3D && mt) = default;
/**
* Returns object of the helper class for C-style subscripting r[i][j] */
......@@ -285,15 +291,6 @@ namespace HepGeom {
* Gets dz-element of the transformation matrix. */
double dz() const { return dz_; }
/**
* Assignment. */
Transform3D & operator=(const Transform3D &mt) {
xx_= mt.xx_; xy_= mt.xy_; xz_= mt.xz_; dx_= mt.dx_;
yx_= mt.yx_; yy_= mt.yy_; yz_= mt.yz_; dy_= mt.dy_;
zx_= mt.zx_; zy_= mt.zy_; zz_= mt.zz_; dz_= mt.dz_;
return *this;
}
/**
* Sets the Identity transformation. */
void setIdentity() {
......
......@@ -45,7 +45,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Vector3D() {}
Vector3D() = default;
/**
* Constructor from three numbers. */
......@@ -58,7 +58,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Vector3D(const Vector3D<float> & v) : BasicVector3D<float>(v) {}
Vector3D(const Vector3D<float> &) = default;
/**
* Move constructor. */
Vector3D(Vector3D<float> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -66,20 +70,23 @@ namespace HepGeom {
/**
* Destructor. */
~Vector3D() {}
~Vector3D() = default;
/**
* Assignment. */
Vector3D<float> & operator=(const Vector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Vector3D<float> & operator=(const Vector3D<float> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Vector3D<float> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<float>::operator=(v);
return *this;
}
/**
* Move assignment. */
Vector3D<float> & operator=(Vector3D<float> &&) = default;
/**
* Transformation by Transform3D. */
Vector3D<float> & transform(const Transform3D & m);
......@@ -103,7 +110,7 @@ namespace HepGeom {
public:
/**
* Default constructor. */
Vector3D() {}
Vector3D() = default;
/**
* Constructor from three numbers. */
......@@ -121,7 +128,11 @@ namespace HepGeom {
/**
* Copy constructor. */
Vector3D(const Vector3D<double> & v) : BasicVector3D<double>(v) {}
Vector3D(const Vector3D<double> &) = default;
/**
* Move constructor. */
Vector3D(Vector3D<double> &&) = default;
/**
* Constructor from BasicVector3D<float>. */
......@@ -133,7 +144,7 @@ namespace HepGeom {
/**
* Destructor. */
~Vector3D() {}
~Vector3D() = default;
/**
* Constructor from CLHEP::Hep3Vector.
......@@ -152,22 +163,26 @@ namespace HepGeom {
/**
* Assignment. */
Vector3D<double> & operator=(const Vector3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
}
Vector3D<double> & operator=(const Vector3D<double> &) = default;
/**
* Assignment from BasicVector3D<float>. */
Vector3D<double> & operator=(const BasicVector3D<float> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Assignment from BasicVector3D<double>. */
Vector3D<double> & operator=(const BasicVector3D<double> & v) {
set(v.x(),v.y(),v.z()); return *this;
this->BasicVector3D<double>::operator=(v);
return *this;
}
/**
* Move assignment. */
Vector3D<double> & operator=(Vector3D<double> &&) = default;
/**
* Transformation by Transform3D. */
Vector3D<double> & transform(const Transform3D & m);
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
==============================
21.10.19 Release CLHEP-2.4.1.3
==============================
==============================
20.06.19 Release CLHEP-2.4.1.2
==============================
==============================
......
......@@ -50,10 +50,12 @@ public:
// Default constructor. Gives a boost of 0.
inline HepBoost(const HepBoost & m);
// Copy constructor.
inline HepBoost(HepBoost && m) = default;
// Copy and move constructors.
inline HepBoost & operator = (const HepBoost & m);
// Assignment.
inline HepBoost & operator = (HepBoost && m) = default;
// Copy and move assignment operators.