Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository 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
schwede
openstructure
Commits
b1e7f06c
Commit
b1e7f06c
authored
11 years ago
by
Andreas Schenk
Browse files
Options
Downloads
Patches
Plain Diff
added min max caclulation to stat_acuumulator
parent
283438ee
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
modules/img/alg/src/stat_accumulator.hh
+19
-1
19 additions, 1 deletion
modules/img/alg/src/stat_accumulator.hh
with
19 additions
and
1 deletion
modules/img/alg/src/stat_accumulator.hh
+
19
−
1
View file @
b1e7f06c
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#ifndef OST_STAT_ACCUMULATOR_HH
#ifndef OST_STAT_ACCUMULATOR_HH
#define OST_STAT_ACCUMULATOR_HH
#define OST_STAT_ACCUMULATOR_HH
#include
<limits>
#include
<boost/math/special_functions/binomial.hpp>
#include
<boost/math/special_functions/binomial.hpp>
#include
<ost/base.hh>
#include
<ost/base.hh>
#include
<ost/message.hh>
#include
<ost/message.hh>
...
@@ -35,6 +36,8 @@ public:
...
@@ -35,6 +36,8 @@ public:
StatAccumulator
()
:
StatAccumulator
()
:
sum_
(
0.0
),
sum_
(
0.0
),
sum2_
(
0.0
),
sum2_
(
0.0
),
max_
(
-
std
::
numeric_limits
<
Real
>::
max
()),
min_
(
std
::
numeric_limits
<
Real
>::
max
()),
m_
(),
m_
(),
w_
(
0.0
),
w_
(
0.0
),
n_
(
0
)
n_
(
0
)
...
@@ -48,6 +51,8 @@ public:
...
@@ -48,6 +51,8 @@ public:
StatAccumulator
(
Real
val
,
Real
w
=
1.0
)
:
StatAccumulator
(
Real
val
,
Real
w
=
1.0
)
:
sum_
(
val
),
sum_
(
val
),
sum2_
(
val
*
val
),
sum2_
(
val
*
val
),
max_
(
val
),
min_
(
val
),
m_
(),
m_
(),
w_
(
w
),
w_
(
w
),
n_
(
1
)
n_
(
1
)
...
@@ -86,7 +91,8 @@ public:
...
@@ -86,7 +91,8 @@ public:
sum_
+=
acc
.
sum_
;
sum_
+=
acc
.
sum_
;
sum2_
+=
acc
.
sum2_
;
sum2_
+=
acc
.
sum2_
;
max_
=
std
::
max
<
Real
>
(
max_
,
acc
.
max_
);
min_
=
std
::
min
<
Real
>
(
min_
,
acc
.
min_
);
if
(
MAX_MOMENT
>
0
){
if
(
MAX_MOMENT
>
0
){
Real
delta
=
acc
.
m_
[
0
]
-
m_
[
0
];
Real
delta
=
acc
.
m_
[
0
]
-
m_
[
0
];
Real
delta_w
=
delta
/
wn
;
Real
delta_w
=
delta
/
wn
;
...
@@ -132,6 +138,16 @@ public:
...
@@ -132,6 +138,16 @@ public:
return
n_
;
return
n_
;
}
}
Real
GetMaximum
()
const
{
return
max_
;
}
Real
GetMinimum
()
const
{
return
min_
;
}
Real
GetWeight
()
const
Real
GetWeight
()
const
{
{
return
w_
;
return
w_
;
...
@@ -212,6 +228,8 @@ public:
...
@@ -212,6 +228,8 @@ public:
private
:
private
:
Real
sum_
;
Real
sum_
;
Real
sum2_
;
Real
sum2_
;
Real
max_
;
Real
min_
;
Real
m_
[
MAX_MOMENT
];
Real
m_
[
MAX_MOMENT
];
Real
w_
;
Real
w_
;
unsigned
int
n_
;
unsigned
int
n_
;
...
...
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