Loading...
Searching...
No Matches
FittingProxy.h
Go to the documentation of this file.
//# DittingProxy.h: This class gives object access to Fitting
//# Copyright (C) 2006
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This program is free software; you can redistribute it and/or modify it
//# under the terms of the GNU General Public License as published by the Free
//# Software Foundation; either version 2 of the License, or (at your option)
//# any later version.
//#
//# This program is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
//# more details.
//#
//# You should have received a copy of the GNU General Public License along
//# with this program; if not, write to the Free Software Foundation, Inc.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef SCIMATH_FITTINGPROXY_H
#define SCIMATH_FITTINGPROXY_H
//# Includes
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/ArrayFwd.h>
#include <casacore/casa/Containers/Record.h>
//# Forward declarations
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class String;
template<class T> class GenericL2Fit;
// <summary> This class gives Proxy to Fitting connection</summary>
// <use visibility=export>
// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> <linkto module=Fitting>Fitting</linkto>
// </prerequisite>
// <etymology>
// Distributed Object and fitting
// </etymology>
// <synopsis>
// The class makes the connection between the
// <linkto module=Fitting>Fitting</linkto> module and
// other object system. It provides a series of proxy callable
// methods. See Note 197 for details. <br>
// Operations supported
// are all the fitting methods supported in the Fitting module
// </synopsis>
// <example>
// </example>
// <motivation>
// To provide a direct user interface between the user and
// <linkto module=Fitting>Fitting</linkto> related calculations.
// </motivation>
// <todo asof="2004/08/30">
// <li> Nothing I know of
// </todo>
class FittingProxy {
public:
//# Standard constructors/destructors
FittingProxy();
virtual ~FittingProxy();
Int getid();
Record getstate(Int id);
Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac);
Bool done(Int id);
Bool reset(Int id);
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 linear(Int id, const Record& fnc,
const Vector<Double>& xval,
const Vector<Double>& yval,
const Vector<Double>& 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);
Record cxlinear(Int id, const Record& fnc,
const Vector<DComplex>& xval,
const Vector<DComplex>& yval,
const Vector<DComplex>& wt,
const Record& constraint);
private:
// Class to aid in distributing different fitters
class FitType {
public:
//# Constructors
// Default constructor: no method known
FitType();
// Destructor
~FitType();
//# Method
// Set a fitter pointer (real or complex)
// <group>
void setFitter (GenericL2Fit<Double> *ptr);
void setFitterCX (GenericL2Fit<DComplex> *ptr);
// </group>
// Get a fitter pointer (real or complex)
// <group>
GenericL2Fit<Double> *const &getFitter() const;
GenericL2Fit<DComplex> *const &getFitterCX() const;
// </group>
// Set the status
void setStatus(Int n, Int typ, Double colfac, Double lmfac);
// Get the number of terms in condition equation
Int getNceq() const { return nceq_p;} ;
// Get the number of unknowns
Int getN() const { return n_p;} ;
// Get the number of real unknowns
Int getNreal() const { return nreal_p;} ;
// Get the type
Int getType() const { return typ_p;} ;
// Get the collinearity factor
Double getColfac() const { return colfac_p;} ;
// Get the Levenberg-Marquardt factor
Double getLMfac() const { return lmfac_p;} ;
// Set solution done or not
void setSolved(Bool solved);
// Solution done?
Bool getSolved() const { return soldone_p;} ;
private:
// Copy constructor: not implemented
FitType(const FitType &other);
// Assignment: not implemented
FitType &operator=(const FitType &other);
//# Data
// Pointer to a Fitting Machine: real or complex
// <group>
casacore::GenericL2Fit<Double> *fitter_p;
casacore::GenericL2Fit<DComplex> *fitterCX_p;
// </group>
// Number of unknowns
Int n_p;
// Number of terms in condition equation
Int nceq_p;
// Number of real unknowns
Int nreal_p;
// Type
Int typ_p;
// Collinearity factor
Double colfac_p;
// Levenberg-Marquardt factor
Double lmfac_p;
// Solution done?
Bool soldone_p;
// System's rank deficiency
uInt nr_p;
};
//# Member functions
//# Data
// Number of FitType obkects present
uInt nFitter_p;
// List of FitTypes
FitType **list_p;
};
} //# NAMESPACE CASACORE - END
#endif
casacore::FittingProxy::FitType
Class to aid in distributing different fitters.
Definition FittingProxy.h:112
casacore::FittingProxy::FitType::operator=
FitType & operator=(const FitType &other)
Assignment: not implemented.
casacore::FittingProxy::FitType::setSolved
void setSolved(Bool solved)
Set solution done or not.
casacore::FittingProxy::FitType::lmfac_p
Double lmfac_p
Levenberg-Marquardt factor.
Definition FittingProxy.h:170
casacore::FittingProxy::FitType::colfac_p
Double colfac_p
Collinearity factor.
Definition FittingProxy.h:168
casacore::FittingProxy::FitType::fitter_p
casacore::GenericL2Fit< Double > * fitter_p
Pointer to a Fitting Machine: real or complex.
Definition FittingProxy.h:156
casacore::FittingProxy::FitType::~FitType
~FitType()
Destructor.
casacore::FittingProxy::FitType::nreal_p
Int nreal_p
Number of real unknowns.
Definition FittingProxy.h:164
casacore::FittingProxy::FitType::nceq_p
Int nceq_p
Number of terms in condition equation.
Definition FittingProxy.h:162
casacore::FittingProxy::FitType::getFitterCX
GenericL2Fit< DComplex > *const & getFitterCX() const
casacore::FittingProxy::FitType::nr_p
uInt nr_p
System's rank deficiency.
Definition FittingProxy.h:174
casacore::FittingProxy::FitType::typ_p
Int typ_p
Type.
Definition FittingProxy.h:166
casacore::FittingProxy::FitType::getFitter
GenericL2Fit< Double > *const & getFitter() const
Get a fitter pointer (real or complex).
casacore::FittingProxy::FitType::getN
Int getN() const
Get the number of unknowns.
Definition FittingProxy.h:135
casacore::FittingProxy::FitType::soldone_p
Bool soldone_p
Solution done?
Definition FittingProxy.h:172
casacore::FittingProxy::FitType::getType
Int getType() const
Get the type.
Definition FittingProxy.h:139
casacore::FittingProxy::FitType::n_p
Int n_p
Number of unknowns.
Definition FittingProxy.h:160
casacore::FittingProxy::FitType::fitterCX_p
casacore::GenericL2Fit< DComplex > * fitterCX_p
Definition FittingProxy.h:157
casacore::FittingProxy::FitType::FitType
FitType()
Default constructor: no method known.
casacore::FittingProxy::FitType::setStatus
void setStatus(Int n, Int typ, Double colfac, Double lmfac)
Set the status.
casacore::FittingProxy::FitType::FitType
FitType(const FitType &other)
Copy constructor: not implemented.
casacore::FittingProxy::FitType::getLMfac
Double getLMfac() const
Get the Levenberg-Marquardt factor.
Definition FittingProxy.h:143
casacore::FittingProxy::FitType::getSolved
Bool getSolved() const
Solution done?
Definition FittingProxy.h:147
casacore::FittingProxy::FitType::getNreal
Int getNreal() const
Get the number of real unknowns.
Definition FittingProxy.h:137
casacore::FittingProxy::FitType::getColfac
Double getColfac() const
Get the collinearity factor.
Definition FittingProxy.h:141
casacore::FittingProxy::FitType::setFitter
void setFitter(GenericL2Fit< Double > *ptr)
Set a fitter pointer (real or complex).
casacore::FittingProxy::FitType::getNceq
Int getNceq() const
Get the number of terms in condition equation.
Definition FittingProxy.h:133
casacore::FittingProxy::FitType::setFitterCX
void setFitterCX(GenericL2Fit< DComplex > *ptr)
casacore::FittingProxy::set
Bool set(Int id, Int nin, Int tpin, Double colfac, Double lmfac)
casacore::FittingProxy::functional
Record functional(Int id, const Record &fnc, const Vector< Double > &xval, const Vector< Double > &yval, const Vector< Double > &wt, Int mxit, const Record &constraint)
casacore::FittingProxy::getstate
Record getstate(Int id)
casacore::FittingProxy::linear
Record linear(Int id, const Record &fnc, const Vector< Double > &xval, const Vector< Double > &yval, const Vector< Double > &wt, const Record &constraint)
casacore::FittingProxy::done
Bool done(Int id)
casacore::FittingProxy::list_p
FitType ** list_p
List of FitTypes.
Definition FittingProxy.h:181
casacore::FittingProxy::nFitter_p
uInt nFitter_p
Number of FitType obkects present.
Definition FittingProxy.h:179
casacore::FittingProxy::reset
Bool reset(Int id)
casacore::FittingProxy::cxlinear
Record cxlinear(Int id, const Record &fnc, const Vector< DComplex > &xval, const Vector< DComplex > &yval, const Vector< DComplex > &wt, const Record &constraint)
casacore::FittingProxy::getid
Int getid()
casacore::FittingProxy::cxfunctional
Record cxfunctional(Int id, const Record &fnc, const Vector< DComplex > &xval, const Vector< DComplex > &yval, const Vector< DComplex > &wt, Int mxit, const Record &constraint)
casacore::FittingProxy::FittingProxy
FittingProxy()
casacore::FittingProxy::~FittingProxy
virtual ~FittingProxy()
casacore::FittingProxy::init
Bool init(Int id, Int n, Int tp, Double colfac, Double lmfac)
casacore::GenericL2Fit
Definition GenericL2Fit.h:211
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::Vector
Definition Vector.h:82
casacore::Record
Record()
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::uInt
unsigned int uInt
Definition aipstype.h:49
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::Double
double Double
Definition aipstype.h:53