diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Track.h b/Framework/Geometry/inc/MantidGeometry/Objects/Track.h index f05b0e1e400f5052bdcd9770df7615cab09bbf48..4cc7519d51854c0972527fad15fcef00b3348cdc 100644 --- a/Framework/Geometry/inc/MantidGeometry/Objects/Track.h +++ b/Framework/Geometry/inc/MantidGeometry/Objects/Track.h @@ -14,6 +14,9 @@ #include "MantidGeometry/Objects/IObject.h" #include "MantidGeometry/Surfaces/Line.h" #include "MantidKernel/Tolerance.h" + +#include <boost/container/small_vector.hpp> + #include <iosfwd> #include <list> @@ -141,8 +144,8 @@ struct IntersectionPoint { */ class MANTID_GEOMETRY_DLL Track { public: - using LType = std::vector<Link>; - using PType = std::vector<IntersectionPoint>; + using LType = boost::container::small_vector<Link, 5>; + using PType = boost::container::small_vector<IntersectionPoint, 5>; public: /// Default constructor @@ -160,7 +163,6 @@ public: void removeCojoins(); /// Construct links between added points void buildLink(); - /// Set a starting point and direction void reset(const Kernel::V3D &startPoint, const Kernel::V3D &direction); /// Clear the current set of intersection results diff --git a/Framework/Geometry/src/Objects/Track.cpp b/Framework/Geometry/src/Objects/Track.cpp index 6ce2cacb786c3c3e8a58c44bd446e546f6aa675c..09b3f8be093ccaa0d7de1ca4d15280ee6c6a4d0a 100644 --- a/Framework/Geometry/src/Objects/Track.cpp +++ b/Framework/Geometry/src/Objects/Track.cpp @@ -9,6 +9,7 @@ #include "MantidKernel/Matrix.h" #include "MantidKernel/Tolerance.h" #include "MantidKernel/V3D.h" +#include <boost/iterator/distance.hpp> #include <algorithm> #include <cmath> @@ -77,7 +78,7 @@ int Track::nonComplete() const { while (bc != m_links.end()) { if ((ac->exitPoint).distance(bc->entryPoint) > Tolerance) { - return (static_cast<int>(distance(m_links.begin(), bc)) + 1); + return (static_cast<int>(boost::distance(m_links.begin(), bc)) + 1); } ++ac; ++bc;