casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fitter.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef FITTER_H_
27 #define FITTER_H_
28 
29 #include <casa/Arrays/Vector.h>
30 #include <QString>
31 #include <QTextStream>
32 
33 namespace casa {
34 
38 class Fitter {
39 public:
40  Fitter();
42  virtual void restrictDomain( double xMin, double xMax );
43  virtual void clearDomainLimits();
44  void setUnits( QString units );
47  virtual bool doFit() = 0;
48  virtual void clearFit();
49 
50  virtual void toAscii( QTextStream& out ) const;
51  bool isFit() const;
52  virtual QString getSolutionStatistics() const = 0;
53  QString getErrorMessage() const;
54  QString getStatusMessage() const;
55  virtual ~Fitter();
56 
57 protected:
58  QString formatResultLine( QString label, float value, bool endLine = true ) const;
61 
65  double domainMin;
66  double domainMax;
67  QString errorMsg;
68  QString statusMsg;
69  QString units;
70  bool dataFitted;
71  float getMean() const;
72  void resetDataWithLimits();
73 private:
74 
77 
78 
79 };
80 
81 } /* namespace casa */
82 #endif /* FITTER_H_ */
double domainMax
Definition: Fitter.h:66
bool isFit() const
QString formatResultLine(QString label, float value, bool endLine=true) const
casacore::Vector< casacore::Float > yValues
Definition: Fitter.h:76
void setUnits(QString units)
void setData(casacore::Vector< casacore::Float > xValues, casacore::Vector< casacore::Float > yValues)
virtual ~Fitter()
virtual void clearFit()
casacore::Vector< casacore::Float > getFitValuesX() const
casacore::Vector< casacore::Float > xValues
Definition: Fitter.h:75
QString errorMsg
Definition: Fitter.h:67
QString statusMsg
Definition: Fitter.h:68
QString getStatusMessage() const
QString units
Definition: Fitter.h:69
double domainMin
Definition: Fitter.h:65
virtual void restrictDomain(double xMin, double xMax)
casacore::Vector< casacore::Float > actualXValues
Definition: Fitter.h:62
casacore::Vector< casacore::Float > actualYValues
Definition: Fitter.h:63
virtual QString getSolutionStatistics() const =0
void resetDataWithLimits()
float solutionChiSquared
Definition: Fitter.h:59
virtual void clearDomainLimits()
casacore::Vector< casacore::Float > getFitValues() const
float getMean() const
Base class for classes performing histogram fits.
Definition: Fitter.h:38
casacore::Vector< casacore::Float > fitValues
Definition: Fitter.h:64
bool dataFitted
Definition: Fitter.h:70
QString getErrorMessage() const
virtual bool doFit()=0
bool solutionConverged
Definition: Fitter.h:60
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual void toAscii(QTextStream &out) const