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
f3a8e432
Commit
f3a8e432
authored
7 years ago
by
Simon Heybrock
Browse files
Options
Downloads
Patches
Plain Diff
Re #21128. Check storage mode in Indexing::extract.
parent
68fdebed
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/Indexing/src/Extract.cpp
+11
-0
11 additions, 0 deletions
Framework/Indexing/src/Extract.cpp
with
11 additions
and
0 deletions
Framework/Indexing/src/Extract.cpp
+
11
−
0
View file @
f3a8e432
...
...
@@ -6,6 +6,15 @@
namespace
Mantid
{
namespace
Indexing
{
namespace
{
void
checkStorageMode
(
const
IndexInfo
&
indexInfo
)
{
using
namespace
Parallel
;
if
(
indexInfo
.
storageMode
()
==
StorageMode
::
Distributed
)
throw
std
::
runtime_error
(
"extract() does not support "
+
Parallel
::
toString
(
StorageMode
::
Distributed
));
}
}
/// Extracts IndexInfo from source IndexInfo, extracting data for all indices
/// specified by index set.
IndexInfo
extract
(
const
IndexInfo
&
source
,
const
SpectrumIndexSet
&
indices
)
{
...
...
@@ -15,6 +24,7 @@ IndexInfo extract(const IndexInfo &source, const SpectrumIndexSet &indices) {
/// Extracts IndexInfo from source IndexInfo, extracting data for all indices
/// specified by vector.
IndexInfo
extract
(
const
IndexInfo
&
source
,
const
std
::
vector
<
size_t
>
&
indices
)
{
checkStorageMode
(
source
);
std
::
vector
<
SpectrumNumber
>
specNums
;
std
::
vector
<
SpectrumDefinition
>
specDefs
;
const
auto
&
sourceDefs
=
source
.
spectrumDefinitions
();
...
...
@@ -31,6 +41,7 @@ IndexInfo extract(const IndexInfo &source, const std::vector<size_t> &indices) {
/// specified by range.
IndexInfo
extract
(
const
IndexInfo
&
source
,
const
size_t
minIndex
,
const
size_t
maxIndex
)
{
checkStorageMode
(
source
);
std
::
vector
<
SpectrumNumber
>
specNums
;
std
::
vector
<
SpectrumDefinition
>
specDefs
;
const
auto
&
sourceDefs
=
source
.
spectrumDefinitions
();
...
...
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