LinearEquation.h

Classes

LinearEquation -- defines a relationship between Domain and Range objects (full description)

template<class Domain, class Range> class LinearEquation: public ResidualEquation<Domain>

Interface

Public Members
virtual ~LinearEquation()
virtual Bool evaluate(Range & result, const LinearModel<Domain>& model) = 0
virtual Bool residual(Domain & answer, const LinearModel<Domain> & model) = 0
virtual Bool residual(Domain & answer, Float & chisq, const LinearModel<Domain> & model) = 0
virtual Bool residual(Domain & answer, Float & chisq, Domain & mask, const LinearModel<Domain> & model) = 0

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

LinearEquation was originally conceived for implementing linear equations (like Ax=b) but was in hindsight found to be more general.

Synopsis

This abstract class defines the basic functions used for forward modelling of measured data of "Range" data type. It defines the functions used to transform a model, of "Domain" data type to predicted data. It can also compare the predicted data with the measured data and return residuals to classes derived from LinearModel which can then be used to update the model.

Example

I'll pass this class into a subroutine as an actual instance of an abstract class cannot be constructed.
    void foo(LinearModel< Image<Float> > mod, 
             LinearEquation<Image<Float>, VisibilitySet>)
    VisibilitySet predictedVisibility;
    eqn.evaluate(predictedVisibility, mod); 
    

Motivation

This class was originally conceived to be used in implementing deconvolution algorithms. I would not be surprised if it found wider applicability.

Template Type Argument Requirements (Domain)

Template Type Argument Requirements (Range)

Thrown Exceptions

To Do

Member Description

virtual ~LinearEquation()

A virtual destructor may be necessary for use in derived classes.

virtual Bool evaluate(Range & result, const LinearModel<Domain>& model) = 0

This function evaluates the Equation for the specified model. It returns False if the result could not be computed.

virtual Bool residual(Domain & answer, const LinearModel<Domain> & model) = 0

evaluate residual

virtual Bool residual(Domain & answer, Float & chisq, const LinearModel<Domain> & model) = 0

Same as above, but also calculates Chi^2

virtual Bool residual(Domain & answer, Float & chisq, Domain & mask, const LinearModel<Domain> & model) = 0

Same as above, but also calculates Chi^2 considering a mask