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
59f288fe
Commit
59f288fe
authored
6 years ago
by
Antti Soininen
Browse files
Options
Downloads
Patches
Plain Diff
Use BinEdgeAxis correctly, improve performance test. Re #24492
parent
ccce6825
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
Framework/Algorithms/test/Rebin2DTest.h
+11
-7
11 additions, 7 deletions
Framework/Algorithms/test/Rebin2DTest.h
with
11 additions
and
7 deletions
Framework/Algorithms/test/Rebin2DTest.h
+
11
−
7
View file @
59f288fe
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
#ifndef MANTID_ALGORITHMS_REBIN2DTEST_H_
#ifndef MANTID_ALGORITHMS_REBIN2DTEST_H_
#define MANTID_ALGORITHMS_REBIN2DTEST_H_
#define MANTID_ALGORITHMS_REBIN2DTEST_H_
#include
"MantidAPI/NumericAxis.h"
#include
"MantidAlgorithms/Rebin2D.h"
#include
"MantidAlgorithms/Rebin2D.h"
#include
"MantidAPI/BinEdgeAxis.h"
#include
"MantidTestHelpers/WorkspaceCreationHelper.h"
#include
"MantidTestHelpers/WorkspaceCreationHelper.h"
#include
<cxxtest/TestSuite.h>
#include
<cxxtest/TestSuite.h>
...
@@ -49,7 +49,7 @@ MatrixWorkspace_sptr makeInputWS(const bool distribution,
...
@@ -49,7 +49,7 @@ MatrixWorkspace_sptr makeInputWS(const bool distribution,
int
(
nhist
),
int
(
nbins
),
x0
,
deltax
);
int
(
nhist
),
int
(
nbins
),
x0
,
deltax
);
// We need something other than a spectrum axis, call this one theta
// We need something other than a spectrum axis, call this one theta
Numeric
Axis
*
const
thetaAxis
=
new
Numeric
Axis
(
nhist
+
1
);
BinEdge
Axis
*
const
thetaAxis
=
new
BinEdge
Axis
(
nhist
+
1
);
for
(
size_t
i
=
0
;
i
<
nhist
+
1
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
nhist
+
1
;
++
i
)
{
thetaAxis
->
setValue
(
i
,
-
0.5
+
static_cast
<
double
>
(
i
));
thetaAxis
->
setValue
(
i
,
-
0.5
+
static_cast
<
double
>
(
i
));
}
}
...
@@ -259,19 +259,23 @@ public:
...
@@ -259,19 +259,23 @@ public:
static
void
destroySuite
(
Rebin2DTestPerformance
*
suite
)
{
delete
suite
;
}
static
void
destroySuite
(
Rebin2DTestPerformance
*
suite
)
{
delete
suite
;
}
Rebin2DTestPerformance
()
{
Rebin2DTestPerformance
()
{
constexpr
bool
distribution
=
false
;
constexpr
bool
perf_test
=
true
;
constexpr
bool
small_bins
=
false
;
m_inputWS
=
makeInputWS
(
distribution
,
perf_test
,
small_bins
);
m_inputWS
=
makeInputWS
(
distribution
,
perf_test
,
small_bins
);
}
}
void
test_On_Large_Workspace
()
{
void
test_On_Large_Workspace
()
{
runAlgorithm
(
m_inputWS
,
"100,200,41000"
,
"-0.5,2,499.5"
);
runAlgorithm
(
m_inputWS
,
"100,10,41000"
,
"-0.5,0.5,499.5"
);
}
void
test_Use_Fractional_Area
()
{
constexpr
bool
useFractionalArea
=
true
;
runAlgorithm
(
m_inputWS
,
"100,10,41000"
,
"-0.5,0.5,499.5"
,
useFractionalArea
);
}
}
private
:
private
:
MatrixWorkspace_sptr
m_inputWS
;
MatrixWorkspace_sptr
m_inputWS
;
const
bool
distribution
=
false
;
const
bool
perf_test
=
true
;
const
bool
small_bins
=
false
;
};
};
#endif
/* MANTID_ALGORITHMS_REBIN2DTEST_H_ */
#endif
/* MANTID_ALGORITHMS_REBIN2DTEST_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