casa
$Rev:20696$
|
Interface class containing functions returning "Domain" type. More...
#include <ResidualEquation.h>
Public Member Functions | |
virtual | ~ResidualEquation () |
A virtual destructor may be necessary for use in derived classes. | |
virtual Bool | residual (Domain &answer, const LinearModel< Domain > &model)=0 |
The canonical member of this class defines a function which gives the residual when the model is propagated through the equation and compared with the data. | |
virtual Bool | residual (Domain &answer, Float &chisq, const LinearModel< Domain > &model)=0 |
Same as above, but also calculates Chi^2 (rms of residual image) | |
virtual Bool | residual (Domain &answer, Float &chisq, Domain &mask, const LinearModel< Domain > &model)=0 |
Same as above, but also calculates Chi^2 (rms of residual image) considering a mask image. |
Interface class containing functions returning "Domain" type.
Internal
<h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd</dl>
class should be read in conjunction with: LinearModel LinearEquation
ResidualEquation reflects the fact that the residual() function was the first, and perhaps most important member of the class.
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.
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.
SimpleModel< Vector<Float> > simplemodel;
Suppose we also have a big complicated equation that does the forward modelling from vectors to some arbitrary class;
FancyEquation<Vector<Float>, VisibilitySet> eqn;
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:
Vector<Float> error; if (eqn.residual(*this, error)){ use the error to determine a new model }
as part of the solve function.
The main reason for the existence of this class is to isolate the type of the model ("Domain" type) from knowing what the "Range" of the equation is.
template determines the type used to return the results for all the functions in this class. So even complicated template arguements should be OK.
is an interface class and does not contain any implementation (and hence does not throw exceptions)
Definition at line 119 of file ResidualEquation.h.
virtual casa::ResidualEquation< Domain >::~ResidualEquation | ( | ) | [virtual] |
A virtual destructor may be necessary for use in derived classes.
virtual Bool casa::ResidualEquation< Domain >::residual | ( | Domain & | answer, |
const LinearModel< Domain > & | model | ||
) | [pure virtual] |
The canonical member of this class defines a function which gives the residual when the model is propagated through the equation and compared with the data.
It returns False if the answer could not be computed.
Implemented in casa::ConvolutionEquation, casa::LatConvEquation, casa::IPLatConvEquation, casa::LinearEquation< Domain, Range >, casa::LinearEquation< Lattice< Float >, Lattice< Float > >, and casa::LinearEquation< Array< Float >, Array< Float > >.
virtual Bool casa::ResidualEquation< Domain >::residual | ( | Domain & | answer, |
Float & | chisq, | ||
const LinearModel< Domain > & | model | ||
) | [pure virtual] |
Same as above, but also calculates Chi^2 (rms of residual image)
Implemented in casa::ConvolutionEquation, casa::LatConvEquation, casa::IPLatConvEquation, casa::LinearEquation< Domain, Range >, casa::LinearEquation< Lattice< Float >, Lattice< Float > >, and casa::LinearEquation< Array< Float >, Array< Float > >.
virtual Bool casa::ResidualEquation< Domain >::residual | ( | Domain & | answer, |
Float & | chisq, | ||
Domain & | mask, | ||
const LinearModel< Domain > & | model | ||
) | [pure virtual] |
Same as above, but also calculates Chi^2 (rms of residual image) considering a mask image.
Implemented in casa::ConvolutionEquation, casa::LatConvEquation, casa::LinearEquation< Domain, Range >, casa::LinearEquation< Lattice< Float >, Lattice< Float > >, and casa::LinearEquation< Array< Float >, Array< Float > >.