Commit 69300dce authored by Davis King's avatar Davis King

Added a stddev() function to the running_stats object.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403411
parent 61ee0640
......@@ -132,6 +132,19 @@ namespace dlib
return 0;
}
T stddev (
) const
{
// make sure requires clause is not broken
DLIB_ASSERT(current_n() > 1,
"\tT running_stats::stddev"
<< "\n\tyou have to add some numbers to this object first"
<< "\n\tthis: " << this
);
return std::sqrt(variance());
}
T scale (
const T& val
) const
......
......@@ -118,6 +118,16 @@ namespace dlib
object so far.
!*/
T stddev (
) const;
/*!
requires
- current_n() > 1
ensures
- returns the standard deviation of all the values presented to this
object so far.
!*/
T max (
) const;
/*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment