BinaryStatistic.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/More/General/BinaryStatistic.h
10 
11 #ifndef __BinaryStatistic_h
12 #define __BinaryStatistic_h
13 
14 #include "Identifiable.h"
15 
17 class BinaryStatistic : public Identifiable
18 {
19 public:
20 
22  static BinaryStatistic* factory (const std::string& name);
23 
25  static const std::vector<BinaryStatistic*>& children ();
26 
28  BinaryStatistic (const std::string& name, const std::string& description);
29 
31 
33  virtual double get (const std::vector<double>& data1,
34  const std::vector<double>& data2) = 0;
35 
37  virtual BinaryStatistic* clone () const = 0;
38 
40  void set_file (FILE* f) { fptr = f; }
41 
42 protected:
43 
45  FILE* fptr;
46 
47 private:
48 
50  static void build ();
51 };
52 
53 #endif
54 
virtual long double frequency(const MJD &t) const =0
Return the spin frequency, given the epoch.
FILE * fptr
The file to which auxiliary data will be printed.
Definition: BinaryStatistic.h:50
virtual void set_time_span(const MJD &start, const MJD &finish)=0
Set the range of epochs over which to generate.
virtual double get(const std::vector< double > &data1, const std::vector< double > &data2)=0
Derived types define the value returned.
virtual void set_observing_frequency(long double MHz)=0
Set the observing frequency at which phase and time are related.
A convenient exception handling class.
Definition: Error.h:54
virtual std::string get_value(const std::string &keyword) const
Retrieve a string from the text.
Definition: Parameters.C:41
static Generator * factory(const Parameters *)
Return a pointer to a new Generator that can best handle the parameters.
Definition: Generator_factory.C:63
BinaryStatistic(const std::string &name, const std::string &description)
Construct with a name and description.
Definition: BinaryStatistic.C:123
Computes the generalized squared interpoint distance between vectors.
Definition: GeneralizedChiSquared.h:24
void set_file(FILE *f)
Set the file to which auxiliary data will be printed.
Definition: BinaryStatistic.h:45
virtual void set_site(const std::string &)=0
Set the site at which the signal is observed.
Computes the Gaussian mixture probability density of the difference.
Definition: GaussianMixtureProbabilityDensity.h:27
Generator of functions that predict pulse phase.
Definition: Generator.h:31
virtual BinaryStatistic * clone() const =0
Derived types must also define clone method.
virtual void set_parameters(const Parameters *)=0
Set the parameters used to generate the predictor.
Functions that predict pulse phase.
Definition: Predictor.h:33
virtual void set_frequency_span(long double low, long double high)=0
Set the range of frequencies over which to generate.
Commmon statistics that can be derived from two arrays of floats.
Definition: BinaryStatistic.h:17
virtual Predictor * generate() const =0
Return a new Predictor instance.
Class for representing modified Julian dates with high precision.
Definition: MJD.h:27
Storage of pulsar parameters used to create a Predictor.
Definition: Parameters.h:28
virtual Phase phase(const MJD &t) const =0
Return the phase, given the epoch.
static BinaryStatistic * factory(const std::string &name)
Create a new instance of BinaryStatistic based on name.
Definition: BinaryStatistic.C:179
static const std::vector< BinaryStatistic * > & children()
Returns a list of available BinaryStatistic children.
Definition: BinaryStatistic.C:166

Generated using doxygen 1.8.17