TimeDomainCovariance.h
1/***************************************************************************
2 * *
3 * * Copyright (C) 2011 by Stefan Oslowski
4 * * Licensed under the Academic Free License version 2.1
5 * *
6 ****************************************************************************/
7
8#ifndef __Pulsar__TimeDomainCovariance_h
9#define __Pulsar__TimeDomainCovariance_h
10
11#include "Pulsar/ProfileCovariance.h"
12
13namespace Pulsar
14{
15 class TimeDomainCovariance : public ProfileCovariance
16 {
17 public:
18
20 TimeDomainCovariance ();
21
23 void choose_bins ( unsigned, unsigned );
24
26 std::string get_name () const;
27
29 void add_Profile (const Profile* );
30 void add_Profile (const Profile*, float wt );
31
33 void set_covariance_matrix ( const double * );
34
36 void get_covariance_matrix_copy ( double* dest );
37
39 double get_covariance_matrix_value ( unsigned row, unsigned col );
40
42 void finalize ();
43
45 void eigen ();
46
48 void set_eigenvectors ( const std::vector<double>& );
49 void set_eigenvectors ( const double* );
50
52 void get_eigenvectors_copy ( std::vector<double>& );
53 void get_eigenvectors_copy ( double* );
54
55 double get_eigenvectors_value ( unsigned row, unsigned col );
56 const double* get_eigenvectors_pointer ();
57
59 void set_eigenvalues ( const std::vector<double>& );
60 void set_eigenvalues ( const double* );
61
63 void get_eigenvalues_copy ( std::vector<double>& );
64 void get_eigenvalues_copy ( double* );
65
66 double get_eigenvalue ( unsigned row );
67 const double* get_eigenvalues_pointer ();
68
70 unsigned get_count ();
71
73 void set_count ( unsigned );
74
76 unsigned get_rank ();
77
79 void set_rank ( unsigned );
80
82 void reset ();
83
84 protected:
85
87 unsigned first_bin;
88
90 unsigned last_bin;
91
92 bool subtract_mean;
93
95 std::vector<double> covariance_matrix;
96
98 std::vector<double> mean;
99
101 std::vector<double> eigenvectors;
102
104 std::vector<double> eigenvalues;
105
106 bool eigen_decomposed;
107
108 };
109}
110
111#endif
Definition ProfileCovariance.h:21
virtual void reset()=0
Reset the covariance matrix calculations.
virtual std::string get_name() const =0
Return a copy constructed from instance of self.
virtual unsigned get_count()=0
Get the count of profiles used to estimate the covariance matrix.
virtual unsigned get_rank()=0
Get the rank of covariance matrix.
virtual void eigen()=0
Perform eigen decomposition of covariance matrix.
virtual void finalize()=0
Compute the covariance matrix after all the profiles were added.
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0