From b485aab7e71c1625cfc27e0f92c9509f42378458 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 13:19:16 +0200 Subject: Adding upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- ml/dlib/examples/running_stats_ex.cpp | 58 ----------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 ml/dlib/examples/running_stats_ex.cpp (limited to 'ml/dlib/examples/running_stats_ex.cpp') diff --git a/ml/dlib/examples/running_stats_ex.cpp b/ml/dlib/examples/running_stats_ex.cpp deleted file mode 100644 index d94faf35b..000000000 --- a/ml/dlib/examples/running_stats_ex.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt -/* - This is an example illustrating the use of the running_stats object from the dlib C++ - Library. It is a simple tool for computing basic statistics on a stream of numbers. - In this example, we sample 100 points from the sinc function and then then compute the - unbiased sample mean, variance, skewness, and excess kurtosis. - -*/ -#include -#include -#include - -using namespace std; -using namespace dlib; - -// Here we define the sinc function so that we may generate sample data. We compute the mean, -// variance, skewness, and excess kurtosis of this sample data. - -double sinc(double x) -{ - if (x == 0) - return 1; - return sin(x)/x; -} - -int main() -{ - running_stats rs; - - double tp1 = 0; - double tp2 = 0; - - // We first generate the data and add it sequentially to our running_stats object. We - // then print every fifth data point. - for (int x = 1; x <= 100; x++) - { - tp1 = x/100.0; - tp2 = sinc(pi*x/100.0); - rs.add(tp2); - - if(x % 5 == 0) - { - cout << " x = " << tp1 << " sinc(x) = " << tp2 << endl; - } - } - - // Finally, we compute and print the mean, variance, skewness, and excess kurtosis of - // our data. - - cout << endl; - cout << "Mean: " << rs.mean() << endl; - cout << "Variance: " << rs.variance() << endl; - cout << "Skewness: " << rs.skewness() << endl; - cout << "Excess Kurtosis " << rs.ex_kurtosis() << endl; - - return 0; -} - -- cgit v1.2.3