Enumerations | Functions
statistics_t.cc File Reference
#include "cetlib/sqlite/Connection.h"
#include "cetlib/sqlite/ConnectionFactory.h"
#include "cetlib/sqlite/Ntuple.h"
#include "cetlib/sqlite/statistics.h"
#include <array>
#include <cassert>
#include <memory>
#include <string>

Go to the source code of this file.

Enumerations

enum  quantity : std::size_t
 

Functions

int main ()
 

Enumeration Type Documentation

enum quantity : std::size_t

Definition at line 15 of file statistics_t.cc.

15 : std::size_t { min = 0, max, mean, median, rms, n };
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
std::void_t< T > n
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:16
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:26

Function Documentation

int main ( void  )

Definition at line 44 of file statistics_t.cc.

45 {
47  unique_ptr<Connection> c{cf.make_connection(":memory:")};
48  std::string const table_name{"workers"};
49  {
51  *c, table_name, {{"Name", "Age", "Experience"}}};
52  workers.insert("Abby", 27, 5);
53  workers.insert("Benny", 48, 10);
54  workers.insert("Cassie", 52, 27);
55  workers.insert("David", 65, 14);
56  workers.insert("Emily", 38, 19);
57  }
58  test_statistics_quantities(
59  *c, table_name, "Age", {{27, 65, 46, 48, 12 /*.649...*/}});
60  test_statistics_quantities(
61  *c, table_name, "Experience", {{5, 27, 15, 14, 7 /*.563...*/}});
62 }
std::string string
Definition: nybbler.cc:12
auto make_connection(std::string const &file_name, PolicyArgs &&...) -> Connection *
workers
Definition: train.py:479