casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef SCIMATH_FITTINGPROXY_H
27#define SCIMATH_FITTINGPROXY_H
28
29// # Includes
30
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/ArrayFwd.h>
33#include <casacore/casa/Containers/Record.h>
34
35// # Forward declarations
36namespace casacore { // # NAMESPACE CASACORE - BEGIN
37class String;
38template <class T>
39class GenericL2Fit;
40
41// <summary> This class gives Proxy to Fitting connection</summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46// </reviewed>
47
48// <prerequisite>
49// <li> <linkto module=Fitting>Fitting</linkto>
50// </prerequisite>
51
52// <etymology>
53// Distributed Object and fitting
54// </etymology>
55
56// <synopsis>
57// The class makes the connection between the
58// <linkto module=Fitting>Fitting</linkto> module and
59// other object system. It provides a series of proxy callable
60// methods. See Note 197 for details. <br>
61// Operations supported
62// are all the fitting methods supported in the Fitting module
63// </synopsis>
64
65// <example>
66// </example>
67
68// <motivation>
69// To provide a direct user interface between the user and
70// <linkto module=Fitting>Fitting</linkto> related calculations.
71// </motivation>
72
73// <todo asof="2004/08/30">
74// <li> Nothing I know of
75// </todo>
76
78 public:
79 // # Standard constructors/destructors
81 virtual ~FittingProxy();
82
85 Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac);
88 Bool set(Int id, Int nin, Int tpin, Double colfac, Double lmfac);
89 Record functional(Int id, const Record& fnc, const Vector<Double>& xval,
90 const Vector<Double>& yval, const Vector<Double>& wt, Int mxit,
91 const Record& constraint);
92 Record linear(Int id, const Record& fnc, const Vector<Double>& xval, const Vector<Double>& yval,
93 const Vector<Double>& wt, const Record& constraint);
94 Record cxfunctional(Int id, const Record& fnc, const Vector<DComplex>& xval,
95 const Vector<DComplex>& yval, const Vector<DComplex>& wt, Int mxit,
96 const Record& constraint);
97 Record cxlinear(Int id, const Record& fnc, const Vector<DComplex>& xval,
98 const Vector<DComplex>& yval, const Vector<DComplex>& wt,
99 const Record& constraint);
100
101 private:
102 // Class to aid in distributing different fitters
103 class FitType {
104 public:
105 // # Constructors
106 // Default constructor: no method known
108 // Destructor
110 // # Method
111 // Set a fitter pointer (real or complex)
112 // <group>
115 // </group>
116 // Get a fitter pointer (real or complex)
117 // <group>
120 // </group>
121 // Set the status
122 void setStatus(Int n, Int typ, Double colfac, Double lmfac);
123 // Get the number of terms in condition equation
124 Int getNceq() const { return nceq_p; };
125 // Get the number of unknowns
126 Int getN() const { return n_p; };
127 // Get the number of real unknowns
128 Int getNreal() const { return nreal_p; };
129 // Get the type
130 Int getType() const { return typ_p; };
131 // Get the collinearity factor
132 Double getColfac() const { return colfac_p; };
133 // Get the Levenberg-Marquardt factor
134 Double getLMfac() const { return lmfac_p; };
135 // Set solution done or not
136 void setSolved(Bool solved);
137 // Solution done?
138 Bool getSolved() const { return soldone_p; };
139
140 private:
141 // Copy constructor: not implemented
142 FitType(const FitType& other);
143 // Assignment: not implemented
144 FitType& operator=(const FitType& other);
145 // # Data
146 // Pointer to a Fitting Machine: real or complex
147 // <group>
150 // </group>
151 // Number of unknowns
153 // Number of terms in condition equation
155 // Number of real unknowns
157 // Type
159 // Collinearity factor
161 // Levenberg-Marquardt factor
163 // Solution done?
165 // System's rank deficiency
167 };
168 // # Member functions
169 // # Data
170 // Number of FitType obkects present
172 // List of FitTypes
174};
175
176} // namespace casacore
177
178#endif
Class to aid in distributing different fitters.
FitType & operator=(const FitType &other)
Assignment: not implemented.
void setSolved(Bool solved)
Set solution done or not.
Double lmfac_p
Levenberg-Marquardt factor.
Double colfac_p
Collinearity factor.
casacore::GenericL2Fit< Double > * fitter_p
Pointer to a Fitting Machine: real or complex.
Int nreal_p
Number of real unknowns.
Int nceq_p
Number of terms in condition equation.
GenericL2Fit< DComplex > *const & getFitterCX() const
uInt nr_p
System's rank deficiency.
GenericL2Fit< Double > *const & getFitter() const
Get a fitter pointer (real or complex).
Int getN() const
Get the number of unknowns.
Int getType() const
Get the type.
Int n_p
Number of unknowns.
casacore::GenericL2Fit< DComplex > * fitterCX_p
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.
Bool getSolved() const
Solution done?
Int getNreal() const
Get the number of real unknowns.
Double getColfac() const
Get the collinearity factor.
void setFitter(GenericL2Fit< Double > *ptr)
Set a fitter pointer (real or complex).
Int getNceq() const
Get the number of terms in condition equation.
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.
uInt nFitter_p
Number of FitType obkects present.
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)
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53