Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
8e0dcd69
Commit
8e0dcd69
authored
May 03, 2019
by
Ayomide Bamidele
Committed by
Martyn Gigg
Mar 23, 2020
Browse files
Refactor list to boost::small_vector with optimised size. Refs: #25642
parent
1d1bfa93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/Geometry/inc/MantidGeometry/Objects/Track.h
View file @
8e0dcd69
...
...
@@ -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
=
st
d
::
vector
<
Link
>
;
using
PType
=
st
d
::
vector
<
IntersectionPoint
>
;
using
LType
=
boo
st
::
container
::
small_
vector
<
Link
,
5
>
;
using
PType
=
boo
st
::
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
...
...
Framework/Geometry/src/Objects/Track.cpp
View file @
8e0dcd69
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment