Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
c0c10a05
Commit
c0c10a05
authored
9 years ago
by
Michael Wedel
Browse files
Options
Downloads
Patches
Plain Diff
Refs #13537. Remove performance tests from HKLGeneratorTest
parent
93cda8a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/Geometry/test/HKLGeneratorTest.h
+0
-102
0 additions, 102 deletions
Code/Mantid/Framework/Geometry/test/HKLGeneratorTest.h
with
0 additions
and
102 deletions
Code/Mantid/Framework/Geometry/test/HKLGeneratorTest.h
+
0
−
102
View file @
c0c10a05
...
...
@@ -2,13 +2,7 @@
#define MANTID_GEOMETRY_HKLGENERATORTEST_H_
#include
<cxxtest/TestSuite.h>
#include
<iostream>
#include
"MantidGeometry/Crystal/HKLGenerator.h"
#include
"MantidGeometry/Crystal/BasicHKLFilters.h"
#include
"MantidGeometry/Crystal/SpaceGroupFactory.h"
#include
"MantidKernel/Timer.h"
using
namespace
Mantid
::
Geometry
;
using
namespace
Mantid
::
Kernel
;
...
...
@@ -99,102 +93,6 @@ public:
TS_ASSERT_EQUALS
(
std
::
distance
(
it
,
end
),
27
);
}
void
test_speed
()
{
size_t
N
=
1000
;
Timer
t
;
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
HKLGenerator
gen
(
20
,
20
,
20
);
std
::
vector
<
V3D
>
hkls
;
hkls
.
reserve
(
gen
.
size
());
for
(
auto
it
=
gen
.
begin
(),
end
=
gen
.
end
();
it
!=
end
;
++
it
)
{
hkls
.
push_back
(
*
it
);
}
TS_ASSERT_EQUALS
(
hkls
.
size
(),
41
*
41
*
41
);
}
float
e
=
t
.
elapsed
();
std
::
cout
<<
"T: "
<<
e
/
static_cast
<
float
>
(
N
)
<<
std
::
endl
;
}
void
test_speed_filter_constructor
()
{
size_t
N
=
1000
;
Timer
t
;
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
HKLGenerator
gen
(
20
,
20
,
20
);
std
::
vector
<
V3D
>
hkls
;
hkls
.
reserve
(
gen
.
size
());
std
::
copy
(
gen
.
begin
(),
gen
.
end
(),
std
::
back_inserter
(
hkls
));
// TS_ASSERT_EQUALS(hkls.size(), gen.size());
TS_ASSERT_EQUALS
(
hkls
.
size
(),
41
*
41
*
41
);
}
float
e
=
t
.
elapsed
();
std
::
cout
<<
"T: "
<<
e
/
static_cast
<
float
>
(
N
)
<<
std
::
endl
;
}
void
test_speed_filter
()
{
size_t
N
=
1000
;
Timer
t
;
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
double
dMin
=
0.5
;
UnitCell
cell
(
8
,
8
,
8
);
HKLGenerator
gen
(
cell
,
dMin
);
std
::
vector
<
V3D
>
hkls
;
hkls
.
reserve
(
gen
.
size
());
HKLFilterDRange
dFilter
(
cell
,
dMin
,
200.0
);
for
(
auto
it
=
gen
.
begin
();
it
!=
gen
.
end
();
++
it
)
{
if
(
dFilter
.
isAllowed
(
*
it
))
{
hkls
.
push_back
(
*
it
);
}
}
// TS_ASSERT_EQUALS(hkls.size(), gen.size());
TS_ASSERT_DIFFERS
(
hkls
.
size
(),
0
);
}
float
e
=
t
.
elapsed
();
std
::
cout
<<
"T: "
<<
e
/
static_cast
<
float
>
(
N
)
<<
std
::
endl
;
}
void
test_speed_filter_stl
()
{
size_t
N
=
1000
;
Timer
t
;
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
double
dMin
=
0.5
;
UnitCell
cell
(
8
,
8
,
8
);
HKLGenerator
gen
(
cell
,
dMin
);
std
::
vector
<
V3D
>
hkls
;
hkls
.
reserve
(
gen
.
size
());
HKLFilter_const_sptr
dFilter
=
boost
::
make_shared
<
HKLFilterDRange
>
(
cell
,
dMin
,
200.0
);
std
::
remove_copy_if
(
gen
.
begin
(),
gen
.
end
(),
std
::
back_inserter
(
hkls
),
(
~
dFilter
)
->
fn
());
// TS_ASSERT_EQUALS(hkls.size(), gen.size());
TS_ASSERT_DIFFERS
(
hkls
.
size
(),
0
);
}
float
e
=
t
.
elapsed
();
std
::
cout
<<
"T: "
<<
e
/
static_cast
<
float
>
(
N
)
<<
std
::
endl
;
}
};
#endif
/* MANTID_GEOMETRY_HKLGENERATORTEST_H_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment