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
37 class String;
38 template<class T> class GenericL2Fit;
39
40// <summary> This class gives Proxy to Fitting connection</summary>
41
42// <use visibility=export>
43
44// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45// </reviewed>
46
47// <prerequisite>
48// <li> <linkto module=Fitting>Fitting</linkto>
49// </prerequisite>
50
51// <etymology>
52// Distributed Object and fitting
53// </etymology>
54
55// <synopsis>
56// The class makes the connection between the
57// <linkto module=Fitting>Fitting</linkto> module and
58// other object system. It provides a series of proxy callable
59// methods. See Note 197 for details. <br>
60// Operations supported
61// are all the fitting methods supported in the Fitting module
62// </synopsis>
63
64// <example>
65// </example>
66
67// <motivation>
68// To provide a direct user interface between the user and
69// <linkto module=Fitting>Fitting</linkto> related calculations.
70// </motivation>
71
72// <todo asof="2004/08/30">
73// <li> Nothing I know of
74// </todo>
75
77
78public:
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,
90 const Vector<Double>& xval,
91 const Vector<Double>& yval,
92 const Vector<Double>& wt,
93 Int mxit, const Record& constraint);
94 Record linear(Int id, const Record& fnc,
95 const Vector<Double>& xval,
96 const Vector<Double>& yval,
97 const Vector<Double>& wt,
98 const Record& constraint);
99 Record cxfunctional(Int id, const Record& fnc,
100 const Vector<DComplex>& xval,
101 const Vector<DComplex>& yval,
102 const Vector<DComplex>& wt,
103 Int mxit, const Record& constraint);
104 Record cxlinear(Int id, const Record& fnc,
105 const Vector<DComplex>& xval,
106 const Vector<DComplex>& yval,
107 const Vector<DComplex>& wt,
108 const Record& constraint);
109
110private:
111 // Class to aid in distributing different fitters
112 class FitType {
113 public:
114 //# Constructors
115 // Default constructor: no method known
117 // Destructor
119 //# Method
120 // Set a fitter pointer (real or complex)
121 // <group>
124 // </group>
125 // Get a fitter pointer (real or complex)
126 // <group>
129 // </group>
130 // Set the status
131 void setStatus(Int n, Int typ, Double colfac, Double lmfac);
132 // Get the number of terms in condition equation
133 Int getNceq() const { return nceq_p;} ;
134 // Get the number of unknowns
135 Int getN() const { return n_p;} ;
136 // Get the number of real unknowns
137 Int getNreal() const { return nreal_p;} ;
138 // Get the type
139 Int getType() const { return typ_p;} ;
140 // Get the collinearity factor
141 Double getColfac() const { return colfac_p;} ;
142 // Get the Levenberg-Marquardt factor
143 Double getLMfac() const { return lmfac_p;} ;
144 // Set solution done or not
145 void setSolved(Bool solved);
146 // Solution done?
147 Bool getSolved() const { return soldone_p;} ;
148 private:
149 // Copy constructor: not implemented
150 FitType(const FitType &other);
151 // Assignment: not implemented
152 FitType &operator=(const FitType &other);
153 //# Data
154 // Pointer to a Fitting Machine: real or complex
155 // <group>
158 // </group>
159 // Number of unknowns
161 // Number of terms in condition equation
163 // Number of real unknowns
165 // Type
167 // Collinearity factor
169 // Levenberg-Marquardt factor
171 // Solution done?
173 // System's rank deficiency
175 };
176 //# Member functions
177 //# Data
178 // Number of FitType obkects present
180 // List of FitTypes
182};
183
184} //# NAMESPACE CASACORE - END
185
186#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)
this file contains all the compiler specific defines
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