casacore
FittingProxy.h
Go to the documentation of this file.
1 //# DittingProxy.h: This class gives object access to Fitting
2 //# Copyright (C) 2006
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This program is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU General Public License as published by the Free
7 //# Software Foundation; either version 2 of the License, or (at your option)
8 //# any later version.
9 //#
10 //# This program is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 //# more details.
14 //#
15 //# You should have received a copy of the GNU General Public License along
16 //# with this program; if not, write to the Free Software Foundation, Inc.,
17 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef SCIMATH_FITTINGPROXY_H
29 #define SCIMATH_FITTINGPROXY_H
30 
31 //# Includes
32 
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/casa/Containers/Record.h>
36 
37 //# Forward declarations
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39  class String;
40  template<class T> class GenericL2Fit;
41 
42 // <summary> This class gives Proxy to Fitting connection</summary>
43 
44 // <use visibility=export>
45 
46 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
47 // </reviewed>
48 
49 // <prerequisite>
50 // <li> <linkto module=Fitting>Fitting</linkto>
51 // </prerequisite>
52 
53 // <etymology>
54 // Distributed Object and fitting
55 // </etymology>
56 
57 // <synopsis>
58 // The class makes the connection between the
59 // <linkto module=Fitting>Fitting</linkto> module and
60 // other object system. It provides a series of proxy callable
61 // methods. See Note 197 for details. <br>
62 // Operations supported
63 // are all the fitting methods supported in the Fitting module
64 // </synopsis>
65 
66 // <example>
67 // </example>
68 
69 // <motivation>
70 // To provide a direct user interface between the user and
71 // <linkto module=Fitting>Fitting</linkto> related calculations.
72 // </motivation>
73 
74 // <todo asof="2004/08/30">
75 // <li> Nothing I know of
76 // </todo>
77 
78 class FittingProxy {
79 
80 public:
81  //# Standard constructors/destructors
83  virtual ~FittingProxy();
84 
87  Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac);
88  Bool done(Int id);
89  Bool reset(Int id);
90  Bool set(Int id, Int nin, Int tpin, Double colfac, Double lmfac);
91  Record functional(Int id, const Record& fnc,
92  const Vector<Double>& xval,
93  const Vector<Double>& yval,
94  const Vector<Double>& wt,
95  Int mxit, const Record& constraint);
96  Record linear(Int id, const Record& fnc,
97  const Vector<Double>& xval,
98  const Vector<Double>& yval,
99  const Vector<Double>& wt,
100  const Record& constraint);
101  Record cxfunctional(Int id, const Record& fnc,
102  const Vector<DComplex>& xval,
103  const Vector<DComplex>& yval,
104  const Vector<DComplex>& wt,
105  Int mxit, const Record& constraint);
106  Record cxlinear(Int id, const Record& fnc,
107  const Vector<DComplex>& xval,
108  const Vector<DComplex>& yval,
109  const Vector<DComplex>& wt,
110  const Record& constraint);
111 
112 private:
113  // Class to aid in distributing different fitters
114  class FitType {
115  public:
116  //# Constructors
117  // Default constructor: no method known
119  // Destructor
121  //# Method
122  // Set a fitter pointer (real or complex)
123  // <group>
126  // </group>
127  // Get a fitter pointer (real or complex)
128  // <group>
131  // </group>
132  // Set the status
133  void setStatus(Int n, Int typ, Double colfac, Double lmfac);
134  // Get the number of terms in condition equation
135  Int getNceq() const { return nceq_p;} ;
136  // Get the number of unknowns
137  Int getN() const { return n_p;} ;
138  // Get the number of real unknowns
139  Int getNreal() const { return nreal_p;} ;
140  // Get the type
141  Int getType() const { return typ_p;} ;
142  // Get the collinearity factor
143  Double getColfac() const { return colfac_p;} ;
144  // Get the Levenberg-Marquardt factor
145  Double getLMfac() const { return lmfac_p;} ;
146  // Set solution done or not
147  void setSolved(Bool solved);
148  // Solution done?
149  Bool getSolved() const { return soldone_p;} ;
150  private:
151  // Copy constructor: not implemented
152  FitType(const FitType &other);
153  // Assignment: not implemented
154  FitType &operator=(const FitType &other);
155  //# Data
156  // Pointer to a Fitting Machine: real or complex
157  // <group>
160  // </group>
161  // Number of unknowns
163  // Number of terms in condition equation
165  // Number of real unknowns
167  // Type
169  // Collinearity factor
171  // Levenberg-Marquardt factor
173  // Solution done?
175  // System's rank deficiency
177  };
178  //# Member functions
179  //# Data
180  // Number of FitType obkects present
182  // List of FitTypes
184 };
185 
186 } //# NAMESPACE CASACORE - END
187 
188 #endif
Class to aid in distributing different fitters.
Definition: FittingProxy.h:114
void setSolved(Bool solved)
Set solution done or not.
Double lmfac_p
Levenberg-Marquardt factor.
Definition: FittingProxy.h:172
Double colfac_p
Collinearity factor.
Definition: FittingProxy.h:170
casacore::GenericL2Fit< Double > * fitter_p
Pointer to a Fitting Machine: real or complex.
Definition: FittingProxy.h:158
Int nreal_p
Number of real unknowns.
Definition: FittingProxy.h:166
Int nceq_p
Number of terms in condition equation.
Definition: FittingProxy.h:164
uInt nr_p
System's rank deficiency.
Definition: FittingProxy.h:176
GenericL2Fit< DComplex > *const & getFitterCX() const
GenericL2Fit< Double > *const & getFitter() const
Get a fitter pointer (real or complex)
Int getN() const
Get the number of unknowns.
Definition: FittingProxy.h:137
Bool soldone_p
Solution done?
Definition: FittingProxy.h:174
Int getType() const
Get the type.
Definition: FittingProxy.h:141
Int n_p
Number of unknowns.
Definition: FittingProxy.h:162
casacore::GenericL2Fit< DComplex > * fitterCX_p
Definition: FittingProxy.h:159
FitType()
Default constructor: no method known.
void setStatus(Int n, Int typ, Double colfac, Double lmfac)
Set the status.
FitType(const FitType &other)
Copy constructor: not implemented.
Double getLMfac() const
Get the Levenberg-Marquardt factor.
Definition: FittingProxy.h:145
Bool getSolved() const
Solution done?
Definition: FittingProxy.h:149
Int getNreal() const
Get the number of real unknowns.
Definition: FittingProxy.h:139
Double getColfac() const
Get the collinearity factor.
Definition: FittingProxy.h:143
void setFitter(GenericL2Fit< Double > *ptr)
Set a fitter pointer (real or complex)
FitType & operator=(const FitType &other)
Assignment: not implemented.
Int getNceq() const
Get the number of terms in condition equation.
Definition: FittingProxy.h:135
void setFitterCX(GenericL2Fit< DComplex > *ptr)
Bool set(Int id, Int nin, Int tpin, Double colfac, Double lmfac)
Record functional(Int id, const Record &fnc, const Vector< Double > &xval, const Vector< Double > &yval, const Vector< Double > &wt, Int mxit, const Record &constraint)
Record getstate(Int id)
Record linear(Int id, const Record &fnc, const Vector< Double > &xval, const Vector< Double > &yval, const Vector< Double > &wt, const Record &constraint)
FitType ** list_p
List of FitTypes.
Definition: FittingProxy.h:183
uInt nFitter_p
Number of FitType obkects present.
Definition: FittingProxy.h:181
Record cxlinear(Int id, const Record &fnc, const Vector< DComplex > &xval, const Vector< DComplex > &yval, const Vector< DComplex > &wt, const Record &constraint)
Record cxfunctional(Int id, const Record &fnc, const Vector< DComplex > &xval, const Vector< DComplex > &yval, const Vector< DComplex > &wt, Int mxit, const Record &constraint)
Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac)
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
double Double
Definition: aipstype.h:55