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
7758ded3
Commit
7758ded3
authored
8 years ago
by
Antti Soininen
Browse files
Options
Downloads
Patches
Plain Diff
Re #17584 Code beautification.
parent
b91bc295
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Algorithms/src/CalculateFlatBackground.cpp
+6
-6
6 additions, 6 deletions
Framework/Algorithms/src/CalculateFlatBackground.cpp
with
6 additions
and
6 deletions
Framework/Algorithms/src/CalculateFlatBackground.cpp
+
6
−
6
View file @
7758ded3
...
...
@@ -419,13 +419,13 @@ double CalculateFlatBackground::Mean(const API::MatrixWorkspace_sptr WS,
// is taken as the sqrt the total number counts. To get the the error on the
// counts in each bin just divide this by the number of bins. The variance =
// error^2 that is the total variance divide by the number of bins _squared_.
const
double
variance
=
std
::
accumulate
(
ES
.
begin
()
+
startInd
,
ES
.
begin
()
+
endInd
+
1
,
0.0
,
VectorHelper
::
SumSquares
<
double
>
())
/
(
numBins
*
numBins
);
const
double
variance
=
std
::
accumulate
(
ES
.
begin
()
+
startInd
,
ES
.
begin
()
+
endInd
+
1
,
0.0
,
VectorHelper
::
SumSquares
<
double
>
())
/
(
numBins
*
numBins
);
// adjust the errors using the variance (variance = error^2)
std
::
transform
(
ES
.
begin
(),
ES
.
end
(),
ES
.
begin
(),
std
::
bind2nd
(
VectorHelper
::
AddVariance
<
double
>
(),
variance
));
std
::
transform
(
ES
.
begin
(),
ES
.
end
(),
ES
.
begin
(),
std
::
bind2nd
(
VectorHelper
::
AddVariance
<
double
>
(),
variance
));
// return mean number of counts in each bin, the sum of the number of counts
// in all the bins divided by the number of bins used in that sum
return
background
;
...
...
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