Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
026b6647
Commit
026b6647
authored
Aug 04, 2016
by
Dimitar Tasev
Browse files
Re #16959 applied feedback
parent
db46fac6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/Algorithms/src/GeneralisedSecondDifference.cpp
View file @
026b6647
...
...
@@ -143,7 +143,7 @@ void GeneralisedSecondDifference::computePrefactors() {
m_Cij
.
resize
(
3
);
m_Cij
.
assign
(
previous
.
begin
(),
previous
.
end
());
m_Cij2
.
resize
(
3
);
std
::
transform
(
m_Cij
.
begin
(),
m_Cij
.
end
(),
m_Cij2
.
begin
(),
std
::
transform
(
m_Cij
.
c
begin
(),
m_Cij
.
c
end
(),
m_Cij2
.
begin
(),
VectorHelper
::
Squares
<
double
>
());
return
;
}
...
...
@@ -163,9 +163,7 @@ void GeneralisedSecondDifference::computePrefactors() {
next
[
i
]
+=
previous
[
index
];
}
}
previous
.
resize
(
n_el
);
std
::
copy
(
next
.
begin
(),
next
.
end
(),
previous
.
begin
());
previous
.
assign
(
next
.
begin
(),
next
.
end
());
previous
=
next
;
max_index_prev
=
max_index
;
n_el_prev
=
n_el
;
}
while
(
zz
!=
m_z
);
...
...
@@ -173,7 +171,7 @@ void GeneralisedSecondDifference::computePrefactors() {
m_Cij
.
resize
(
2
*
m_z
*
m_m
+
3
);
m_Cij
.
assign
(
previous
.
begin
(),
previous
.
end
());
m_Cij2
.
resize
(
2
*
m_z
*
m_m
+
3
);
std
::
transform
(
m_Cij
.
begin
(),
m_Cij
.
end
(),
m_Cij2
.
begin
(),
std
::
transform
(
m_Cij
.
c
begin
(),
m_Cij
.
c
end
(),
m_Cij2
.
begin
(),
VectorHelper
::
Squares
<
double
>
());
}
...
...
Framework/Algorithms/src/GetEi.cpp
View file @
026b6647
...
...
@@ -377,9 +377,12 @@ void GetEi::getPeakEstimates(double &height, int64_t ¢reInd,
height
=
Y
[
0
];
centreInd
=
0
;
background
=
std
::
accumulate
(
Y
.
begin
(),
Y
.
end
(),
0.0
);
// then loop through all the Y values and find the tallest peak
std
::
accumulate
(
Y
.
begin
(),
Y
.
end
(),
background
);
std
::
max
(
Y
.
begin
(),
Y
.
end
(),
height
);
// Todo use std::max to find max element and record index?
auto
maxHeight
=
std
::
max_element
(
Y
.
begin
(),
Y
.
end
());
height
=
*
maxHeight
;
centreInd
=
std
::
distance
(
Y
.
begin
(),
maxHeight
);
background
=
background
/
static_cast
<
double
>
(
Y
.
size
());
if
(
height
<
PEAK_THRESH_H
*
background
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment