UnaryStatistic.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2020 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Util/stat/UnaryStatistic.h
10
11#ifndef __UnaryStatistic_h
12#define __UnaryStatistic_h
13
14#include "Identifiable.h"
15
16#include <algorithm>
17#include <cmath>
18
20class UnaryStatistic : public Identifiable
21{
22public:
23
25 static UnaryStatistic* factory (const std::string& name);
26
28 static const std::vector<UnaryStatistic*>& children ();
29
31 UnaryStatistic (const std::string& name, const std::string& description);
32
34 virtual double get (const std::vector<double>&) = 0;
35
37 virtual UnaryStatistic* clone () const = 0;
38
39private:
40
42 static void build ();
43};
44
46void central_moments (std::vector<double> data, std::vector<double>& mu);
47
48#endif
49
UnaryStatistic(const std::string &name, const std::string &description)
Construct with a name and description.
Definition UnaryStatistic.C:774
static UnaryStatistic * factory(const std::string &name)
Create a new instance of UnaryStatistic based on name.
Definition UnaryStatistic.C:846
virtual UnaryStatistic * clone() const =0
Derived types must also define clone method.
static const std::vector< UnaryStatistic * > & children()
Returns a list of available UnaryStatistic children.
Definition UnaryStatistic.C:836
virtual double get(const std::vector< double > &)=0
Derived types define the value returned.

Generated using doxygen 1.14.0