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
5f92c87f
Commit
5f92c87f
authored
10 years ago
by
Owen Arnold
Browse files
Options
Downloads
Patches
Plain Diff
refs #9954. Faster multiply range.
parent
83f796b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
+59
-30
59 additions, 30 deletions
...ntid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
+467
-415
467 additions, 415 deletions
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
with
526 additions
and
445 deletions
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
+
59
−
30
View file @
5f92c87f
...
...
@@ -12,41 +12,59 @@ namespace Mantid
/** Stitch1D : Stitches two Matrix Workspaces together into a single output.
Copyright © 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Copyright © 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class
DLLExport
Stitch1D
:
public
API
::
Algorithm
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class
DLLExport
Stitch1D
:
public
API
::
Algorithm
{
public:
/// Default constructor
Stitch1D
(){};
Stitch1D
()
{
}
;
/// Destructor
virtual
~
Stitch1D
(){};
virtual
~
Stitch1D
()
{
}
;
/// Algorithm's name for identification. @see Algorithm::name
virtual
const
std
::
string
name
()
const
{
return
"Stitch1D"
;}
virtual
const
std
::
string
name
()
const
{
return
"Stitch1D"
;
}
/// Algorithm's version for identification. @see Algorithm::version
virtual
int
version
()
const
{
return
3
;}
virtual
int
version
()
const
{
return
3
;
}
/// Algorithm's category for identification. @see Algorithm::category
virtual
const
std
::
string
category
()
const
{
return
"Reflectometry"
;}
virtual
const
std
::
string
category
()
const
{
return
"Reflectometry"
;
}
///Summary of algorithm's purpose
virtual
const
std
::
string
summary
()
const
{
return
"Stitches single histogram matrix workspaces together"
;}
virtual
const
std
::
string
summary
()
const
{
return
"Stitches single histogram matrix workspaces together"
;
}
/// Does the x-axis have non-zero errors
bool
hasNonzeroErrors
(
Mantid
::
API
::
MatrixWorkspace_sptr
ws
);
private
:
...
...
@@ -60,27 +78,38 @@ namespace Mantid
double
getEndOverlap
(
const
double
&
intesectionMin
,
const
double
&
intesectionMax
)
const
;
/// Get the rebin parameters
Mantid
::
MantidVec
getRebinParams
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
lhsWS
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
rhsWS
,
const
bool
scaleRHSWS
)
const
;
Mantid
::
MantidVec
getRebinParams
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
lhsWS
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
rhsWS
,
const
bool
scaleRHSWS
)
const
;
/// Perform rebin
Mantid
::
API
::
MatrixWorkspace_sptr
rebin
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
Mantid
::
MantidVec
&
params
);
Mantid
::
API
::
MatrixWorkspace_sptr
rebin
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
Mantid
::
MantidVec
&
params
);
/// Perform integration
Mantid
::
API
::
MatrixWorkspace_sptr
specialIntegration
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
double
&
start
,
const
double
&
stop
);
Mantid
::
API
::
MatrixWorkspace_sptr
specialIntegration
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
double
&
start
,
const
double
&
stop
);
/// Perform multiplication over a range
Mantid
::
API
::
MatrixWorkspace_sptr
multiplyRange
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
int
&
startBin
,
const
int
&
endBin
,
const
double
&
factor
);
Mantid
::
API
::
MatrixWorkspace_sptr
multiplyRange
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
int
&
startBin
,
const
int
&
endBin
,
const
double
&
factor
);
/// Perform multiplication over a range
Mantid
::
API
::
MatrixWorkspace_sptr
multiplyRange
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
int
&
startBin
,
const
double
&
factor
);
Mantid
::
API
::
MatrixWorkspace_sptr
multiplyRange
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
input
,
const
int
&
startBin
,
const
double
&
factor
);
/// Create a single valued workspace
Mantid
::
API
::
MatrixWorkspace_sptr
singleValueWS
(
double
val
);
/// Calclate the weighted mean
Mantid
::
API
::
MatrixWorkspace_sptr
weightedMean
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
inOne
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
inTwo
);
Mantid
::
API
::
MatrixWorkspace_sptr
weightedMean
(
Mantid
::
API
::
MatrixWorkspace_sptr
&
inOne
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
inTwo
);
/// Find the start and end indexes
boost
::
tuple
<
int
,
int
>
findStartEndIndexes
(
double
startOverlap
,
double
endOverlap
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
workspace
);
boost
::
tuple
<
int
,
int
>
findStartEndIndexes
(
double
startOverlap
,
double
endOverlap
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
workspace
);
/// Mask out everything but the data in the ranges
Mantid
::
API
::
MatrixWorkspace_sptr
maskAllBut
(
int
a1
,
int
a2
,
Mantid
::
API
::
MatrixWorkspace_sptr
&
source
);
/// Mask out everything but the data in the ranges, but do it inplace.
void
maskInPlace
(
int
a1
,
int
a2
,
Mantid
::
API
::
MatrixWorkspace_sptr
source
);
/// Range tolerance
static
const
double
range_tolerance
;
};
}
// namespace Algorithms
}
// namespace Mantid
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
+
467
−
415
View file @
5f92c87f
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