FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
template<class T >
StateMachineSmartFACT::Statistics::Statistics
(
const T &
t
,
size_t
offset_min
=
0
,
size_t
offset_max
=
0
)
inline
Definition at line
775
of file
smartfact.cc
.
776
:
min
(0),
max
(0),
med
(0),
avg
(0)
777
{
778
if
(
t
.empty())
779
return
;
780
781
T copy(
t
);
782
sort(copy.begin(), copy.end());
783
784
if
(offset_min>
t
.size())
785
offset_min = 0;
786
if
(offset_max>
t
.size())
787
offset_max = 0;
788
789
min
= copy[offset_min];
790
max
= copy[copy.size()-1-offset_max];
791
avg
= accumulate (
t
.begin(),
t
.end(), 0.)/
t
.size();
792
793
const
size_t
p = copy.size()/2;
794
med
= copy.size()%2 ? copy[p] : (copy[p-1]+copy[p])/2.;
795
}
StateMachineSmartFACT::Statistics::med
float med
Definition:
smartfact.cc:770
StateMachineSmartFACT::Statistics::max
float max
Definition:
smartfact.cc:769
StateMachineSmartFACT::Statistics::avg
float avg
Definition:
smartfact.cc:771
t
TT t
Definition:
test_client.c:26
StateMachineSmartFACT::Statistics::min
float min
Definition:
smartfact.cc:768
StateMachineSmartFACT
Statistics
Generated on Sun Sep 18 2016 20:51:03 for FACT++ by
1.8.11