
OPERATOR(3LO)        Linop Reference Manual         OPERATOR(3LO)

NAME
     <type>operator - A virtual base class for all linear  opera-
     tors operating from <type>spacearray to <type>spacearray.

SYNOPSIS
     #include <<type>operator.h>

DESCRIPTION
     The class <type>operator is a virtual  base  class  defining
     the operations that must be defined for all linear operators
     operating from <type>spacearray to  <type>spacearray.  These
     include  a  constructor, a destructor (which does not always
     need to be written), a Forward function, and a Adjoint func-
     tion  operating  from  <type>spacearray to <type>spacearray.
     All derived classes must define Forward  and  Adjoint.   Any
     derived   class  is  provided  with  functions  to  get  the
     <type>Array or Axislist from a <type>space, and the rows and
     cols from a <type>spacearray.

     The <type>operator class also  handles  reference  counting.
     When  an  object of a subclass is constructed, its reference
     count is automatically initialized.  When  a  <type>operator
     is to be deleted, it should have only  reference to it.  In
     the current implementation, no warning is given if  this  is
     not   the  case.   <type>operators  such  as  <type>oparray,
     <type>opchain  and  <type>optrans,  which  contain  multiple
     references  to  the  same  <type>operator, internally handle
     reference counting.  When pointers are  explicitly  assigned
     to  already existing <type>operators by the user, ref() must
     be called to increment the  count,  and  deref()  should  be
     called in the place of delete.

     Something to notice is there is no copy  constructor  for  a
     <type>operator.  This  is  because  all classes derived from
     <type>operator can be referred to as a  <type>operator.  The
     result  of  this is that <type>operators cannot be copied or
     assigned, or passed by functions. A function can be passed a
     pointer  or  reference  to  a  <type>operator,  but  not the
     <type>operator itself. In addition, a <type>operator  cannot
     be  a  return value, nor can a reference to a <type>operator
     be a return value.

PUBLIC OPERATIONS
     <type>operator()
          Set references to one for a new <type>operator.

     void ref()
          Increment references.

     void deref()
          Decrement references and deletes <type>operator  if  no
          references remain.

OPERATOR(3LO)        Linop Reference Manual         OPERATOR(3LO)

     virtual ~<type>operator()
          Decrements references.

     virtual <type>spacearray Forward(const <type>spacearray &)
                                                      const = 
     virtual <type>spacearray Adjoint(const <type>spacearray &)
                                                      const = 
          These must be written  for  an  operator  derived  from
          <type>operator.

PROTECTED OPERATIONS
     int rows(const <type>spacearray &) const
     int cols(const <type>spacearray &) const
          A class derived from <type>op gets  special  access  to
          the  private  members of <type>spacearray through these
          functions- it can get (but not change)  the  number  of
          rows and columns.

     <type>Array & getdata(const <type>space &) const
          A class derived from <type>op also gets special  access
          to  the  private members of <type>space. getdata allows
          access to the <type>Array in a <type>space,  which  can
          be changed with this function.

     Axislist & getinfo(const <type>space &) const
          Allow access to the Axislist in  a  <type>space,  which
          can be changed with this function.

     Note that getdata and getinfo return  references.   Attempts
     to   use   the  return  values  outside  the  scope  of  the
     <type>space will result in loss of  data  and  unpredictable
     behavior.

PRIVATE VARIABLES
     int references

SEE ALSO
     <type>op,  <type>spacearray,  <type>opChain,  <type>opTrans,
     <type>opArray, <type>opPatch

