casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearModel.h
Go to the documentation of this file.
1 //# LinearModel.h: this defines LinearModel
2 //# Copyright (C) 1996,1997,1998,1999
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library 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 Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 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 //#
27 //# $Id$
28 
29 #ifndef SYNTHESIS_LINEARMODEL_H
30 #define SYNTHESIS_LINEARMODEL_H
31 
32 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36 //# Forward Declarations
37 
38 // <summary>Provides a model for use in model fitting applications</summary>
39 
40 // <use visibility=export>
41 
42 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43 // </reviewed>
44 
45 // <prerequisite>
46 // This class should be read in conjunction with:
47 // <li> <linkto class="LinearEquation">LinearEquation</linkto>
48 // <li> <linkto class="ResidualEquation">ResidualEquation</linkto>
49 // </prerequisite>
50 //
51 // <etymology>
52 // LinearModel was originally conceived for providing the model, and optionally
53 // for derived classes the iterative solution methods for linear equations
54 // (like Ax=b) but may be more general in scope.
55 // </etymology>
56 //
57 // <synopsis>
58 // This abstract class defines the interface between a model of the sky (or
59 // any other quantity) and the equation used to predict the measured
60 // quantities. It provides the current best guess model, and given
61 // measures of the discrepency between the current model and the data (as
62 // provided by the ResidualEquation class) derived classes may be able to
63 // solve for a better model that corresponds more closely to the measured
64 // data.
65 // </synopsis>
66 //
67 // <example>
68 // I'll pass this class into a function as an actual instance of an
69 // abstract class cannot be constructed.
70 // <srcblock>
71 // void foo(LinearModel< Image<casacore::Float> > mod,
72 // ResidualEquation< Image<casacore::Float> > eqn)
73 // {
74 // Image<casacore::Float> currentModel, newModel;
75 // currentModel = mod.getModel(); // get the current model;
76 // }
77 // </srcblock>
78 // </example>
79 //
80 // <motivation>
81 // This class was originally conceived to be used in implementing
82 // deconvolution algorithms. I would not be surprised if it found wider
83 // applicability.
84 // </motivation>
85 //
86 // <templating arg=Domain>
87 // The template determines the external representation of the model used.
88 // So complicated templates can be expected and should be OK.
89 // </templating>
90 //
91 // <thrown>
92 // This is an abstract class and does not contain any implementation (and
93 // hence does not throw exceptions)
94 // </thrown>
95 //
96 // <todo asof="1996/03/29">
97 // I cannot see what else I need to do with this class (famous last words)
98 // </todo>
99 
100 template<class Domain> class LinearModel
101 {
102 public:
103  // A virtual destructor is necessary
104  virtual ~LinearModel();
105 
106  // Return the current model.
107  virtual const Domain & getModel() const = 0;
108 
109  // Set the current model
110  virtual void setModel(const Domain & model) = 0;
111 };
112 
113 
114 } //# NAMESPACE CASA - END
115 
116 #ifndef AIPS_NO_TEMPLATE_SRC
117 #include <synthesis/MeasurementEquations/LinearModel.tcc>
118 #endif //# AIPS_NO_TEMPLATE_SRC
119 #endif
virtual void setModel(const Domain &model)=0
Set the current model.
virtual const Domain & getModel() const =0
Return the current model.
virtual ~LinearModel()
A virtual destructor is necessary.