ReceptionModelSolver.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2004 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/ReceptionModelSolver.h
10
11#ifndef __ReceptionModelSolver_H
12#define __ReceptionModelSolver_H
13
14#include "Pulsar/ReceptionModel.h"
15#include "MEAL/LeastSquares.h"
16#include <fstream>
17
18namespace Calibration
19{
22 {
23
24 public:
25
26 Solver () { verbose = 0; }
27
29 static bool report_chisq;
30
32 virtual Solver* clone () const = 0;
33
36
39
42
44 virtual void solve ();
45
47 void set_verbosity (unsigned level) { verbose = level; }
48 unsigned get_verbosity () const { return verbose; }
49
50 protected:
51
53 virtual void fit () = 0;
54
57
60
63
65 void count_infit ();
66
68 void count_constraint ();
69
71 void check_constraints ();
72
75
77 void erase_transformation (unsigned index);
78
80 void check_inputs ();
81
83 void erase_input (unsigned index);
84
85 void set_variances ();
86 void check_solution ();
87
90
92 std::vector<CoherencyMeasurementSet>& get_data ();
93
95 unsigned verbose;
96
97 private:
98
100 std::vector<bool> state_observed;
101
103 std::vector<bool> path_observed;
104 };
105
106}
107
108#endif
109
Solve the measurement equation by non-linear least squares minimization.
Definition ReceptionModelSolver.h:22
void count_infit()
Count the number of parameters to be fit.
Definition ReceptionModelSolver.C:21
virtual Solver * clone() const =0
Return a new, copy-constructed clone.
void count_constraint()
Count the total number of constraints (one-dimensional data)
Definition ReceptionModelSolver.C:38
Reference::To< ReceptionModel, false > equation
The measurement equation to be solved.
Definition ReceptionModelSolver.h:89
virtual void solve()
Solve the measurement equations by least squares minimization.
Definition ReceptionModelSolver.C:212
void erase_input(unsigned index)
remove the input from the model and adjust all measurements accordingly
Definition ReceptionModelSolver.C:202
void set_verbosity(unsigned level)
Set the verbosity level (0 = quiet, 3 = most verbose)
Definition ReceptionModelSolver.h:47
void add_convergence_condition(Functor< bool(ReceptionModel *) >)
Add a convergence condition.
Definition ReceptionModelSolver.C:332
std::string prefit_report_filename
Filename to which a pre-fit report will be written.
Definition ReceptionModelSolver.h:62
void check_constraints()
verify that all free parameters have constraining data
Definition ReceptionModelSolver.C:93
static bool report_chisq
report the reduced chisq on completion
Definition ReceptionModelSolver.h:29
void check_inputs()
verify that all inputs with free parameters have constraining data
Definition ReceptionModelSolver.C:158
virtual void fit()=0
The fit is performed by derived classes.
void erase_transformation(unsigned index)
remove the transformation from the model and adjust all measurements accordingly
Definition ReceptionModelSolver.C:150
unsigned verbose
Verbosity level.
Definition ReceptionModelSolver.h:95
std::vector< CoherencyMeasurementSet > & get_data()
The observations used to constrain the measurement equations.
Definition ReceptionModelSolver.C:325
void check_transformations()
verify that all transformations with free parameters have constraining data
Definition ReceptionModelSolver.C:106
std::vector< Functor< bool(ReceptionModel *) > > convergence_condition
Additional convergence conditions.
Definition ReceptionModelSolver.h:56
std::vector< Functor< bool(ReceptionModel *) > > acceptance_condition
Additional acceptance conditions.
Definition ReceptionModelSolver.h:59
void set_equation(ReceptionModel *)
Set the measurement equation to be solved.
Definition ReceptionModelSolver.C:344
void add_acceptance_condition(Functor< bool(ReceptionModel *) >)
Add an acceptance condition.
Definition ReceptionModelSolver.C:339
friend class Solver
Provide Solver class with acces to data.
Definition ReceptionModel.h:135
ReceptionModel()
null constructor
Definition ReceptionModel.C:20
static bool verbose

Generated using doxygen 1.14.0