Source
xxxxxxxxxx
//# ResidualEquation.h: this defines ResidualEquation
//# Copyright (C) 1996,1997,1999,2000
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library 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 Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; 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: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//#
//#
//# $Id$
namespace casa { //# NAMESPACE CASA - BEGIN
template<class Domain> class LinearModel;
// <summary>Interface class containing functions returning "Domain" type</summary>
// <use visibility=local>
// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
// </reviewed>
// <prerequisite>
// This class should be read in conjunction with:
// <li> <linkto class="LinearModel">LinearModel</linkto>
// <li> <linkto class="LinearEquation">LinearEquation</linkto>
// </prerequisite>
//
// <etymology>
// ResidualEquation reflects the fact that the residual() function was the
// first, and perhaps most important member of the class.
// </etymology>
//
// <synopsis>
// ResidualEquation is an abstract interface class into the more extensive
// LinearEquation class. It is composed of the subset of functions from
// LinearEquation which return objects of the "Domain", type. These objects
// can be used by the solve() function in the LinearModel to determine a new
// model. The separation of the ResidualEquation functions isolates the
// model, of type "Domain" from knowing what the data "Range", used by the
// LinearEquation class is.
// </synopsis>
//
// <example>
// Suppose we have a simple class that has a vector model and knows (using
// the solve() function) how to update this vector if it is told the error
// betweeen the measured data and a model of the data produced using the
// current vector.
// <srcblock>
// SimpleModel< casacore::Vector<casacore::Float> > simplemodel;
// </srcblock>
//
// Suppose we also have a big complicated equation that does
// the forward modelling from vectors to some arbitrary class;
//
// <srcblock>
// FancyEquation<casacore::Vector<casacore::Float>, VisibilitySet> eqn;
// </srcblock>
//
// Then Simplemodel class does not need to know anything about the
// VisibilitySet class as it knows that the FancyEquation class will have
// (via inheritence) a ResidualEquation interface which returns vectors,
// so that it can use code like:
// <srcblock>
// casacore::Vector<casacore::Float> error;
// if (eqn.residual(*this, error)){
// use the error to determine a new model