casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrayModel.h
Go to the documentation of this file.
1 //# ArrayModel.h: this defines ArrayModel
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_ARRAYMODEL_H
30 #define SYNTHESIS_ARRAYMODEL_H
31 
32 
33 #include <casa/aips.h>
35 #include <casa/Arrays/Array.h>
36 
37 namespace casa { //# NAMESPACE CASA - BEGIN
38 
39 // <summary> models with an internal & external representation
40 // as an array </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="Arrays">Arrays</linkto>
49 // <li> <linkto class="LinearModel">LinearModel</linkto>
50 // <li> LinearModel/LinearEquation paradigm
51 // </prerequisite>
52 //
53 // <synopsis>
54 // An ArrayModel is a base class for Models that can be
55 // represented by arrays. It is expected that this class will be mainly used
56 // as base classes for other classes which will then provide the solve()
57 // functions necessary to update the model given an equation.
58 //
59 // However this class does not contain any pure virtual functions and hence
60 // can be used "as is". An example of this is given below. For an example of
61 // how this class can be used by derived classes see the
62 // <linkto class=HogbomCleanModel>HogbomCleanModel</linkto>
63 // class.
64 //
65 // This class makes an internal copy of the casacore::Array supplied to it (either
66 // when constructed or when using the setModel function). If this is found
67 // to significantly affect performance (execution speed or memory
68 // requirements) this may be changed to a reference, perhaps using a smart
69 // pointer like the <linkto class=casacore::COWPtr>COWPtr</linkto>
70 // </synopsis>
71 //
72 // <example>
73 // <srcblock>
74 // ArrayModel<casacore::Float> currentModel(); // Cannot use the model yet!
75 // {
76 // casacore::Matrix<casacore::Float> bestGuess(32,32);
77 // ... put your best guess into the casacore::Matrix ...
78 // currentModel.setModel(bestGuess); // This does a real copy
79 // }
80 // ConvolutionEquation eqn(psf, dirty); // psf, and dirty are arrays defined
81 // // elsewhere.
82 // eqn.evaluate(result, currentModel); // Here result is the convolution of
83 // // of the model with the psf.
84 // </srcblock>
85 // </example>
86 //
87 // <motivation>
88 // All the different image plane based clean algorithms have a common
89 // implementation in that they can use an array to store the current
90 // model. This class provides a way to abstract this functionality.
91 // </motivation>
92 //
93 // <templating arg=T>
94 // While the template arguement for this class can be just about anything,
95 // the use of this class with an equation class will significantly restrict
96 // the possible templates. I have used this class (or derivations of it)
97 // with the following data types.
98 // <li> Float
99 // <li> StokesVector
100 // </templating>
101 //
102 // <thrown>
103 // This class does not explicitly throw exceptions however the objects used
104 // by this class may
105 // </thrown>
106 //
107 // <todo asof="1996/05/14">
108 // <li> Decide whether to copy the input array by reference or stay with
109 // the current scheme.
110 // </todo>
111 
112 template<class T> class ArrayModel:
113  public LinearModel<casacore::Array<T> > {
114 public:
115 
116  ArrayModel();
117  ArrayModel(const casacore::Array<T> & model);
119 
120  virtual const casacore::Array<T> & getModel() const;
121  virtual void getModel(casacore::Array<T>& model) const;
122  virtual void setModel(const casacore::Array<T>& model);
123  virtual void setModel(casacore::Array<T> & model);
124 
125 protected:
127 };
128 
129 
130 } //# NAMESPACE CASA - END
131 
132 #ifndef AIPS_NO_TEMPLATE_SRC
133 #include <synthesis/MeasurementEquations/ArrayModel.tcc>
134 #endif //# AIPS_NO_TEMPLATE_SRC
135 #endif
virtual const casacore::Array< T > & getModel() const
Return the current model.
casacore::Array< T > theModel
Definition: ArrayModel.h:126
models with an internal &amp; external representation as an array
Definition: ArrayModel.h:112
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
virtual void setModel(const casacore::Array< T > &model)
Set the current model.
Provides a model for use in model fitting applications.