
OPONE(3LO)           Linop Reference Manual            OPONE(3LO)

NAME
     <type>opone - base class for most linear operators.

SYNOPSIS
     #include <<type>opone.h>

DESCRIPTION
     The <type>opone class is a class derived from  <type>op,  to
     be  used as a base class that makes writing linear operators
     easier. It handles creating the output space, arranging  the
     input space (through transposes) so that the axes are in the
     right order for calculating, and cycling over any extraneous
     axes.  Thus,  to  write  an  operator  which is derived from
     <type>opone, you need only write the constructors, the  des-
     tructor  (if  one  is needed), and the apply function, to do
     the calculation.

PUBLIC OPERATIONS
     <type>opone()

     <type>opone(const Axislist &,const Axislist &)
          Create  an  <type>opone  given  an  input  and   output
          Axislist for the operator.

     <type>space Forward(const <type>space &) const
     <type>space Adjoint(const <type>space &) const
          These functions call the functions which rearrange  the
          input  space,  create  the  output  space,  cycle  over
          extraneous axes, and finally call  the  apply  routine.
          Thus,  in writing an operator derived from <type>opone,
          everything is handled  except  for  the  apply  routine
          itself.

     <type>spacearray Forward(const <type>spacearray &) const
     <type>spacearray Adjoint(const <type>spacearray &) const
          These are simply  passed  through  to  <type>op,  which
          calls  Forward  or  Adjoint for each <type>space in the
          <type>spacearray.

     virtual Axislist forwardinfo(const Axislist &) const
     virtual Axislist adjointinfo(const Axislist &) const
          These functions  are  called  by  Forward  or  Adjoint,
          respectively, given the input <type>space Axislist, and
          return the Axislist of the output <type>space.

PROTECTED VARIABLES
     Axislist inaxis
          An Axislist which describes the  input  axes  that  are
          required  of  a <type>space for Forward to be called on
          it. Any axes that the <type>space has that are  not  in
          inaxis will be cycled over.

OPONE(3LO)           Linop Reference Manual            OPONE(3LO)

     Axislist outaxis
          An Axislist  describing  the  axes  that  Forward  will
          create.  Also,  any  axes  that are cycled over will be
          stuck on the back of the output Axislist.

     The two previous definitions can be reversed  for  when  the
     Adjoint function is called.

PROTECTED OPERATIONS
     virtual void forwarddata(<type>Array& in,<type>Array& out,
                              const Axislist & outlist,
                              const Axislist & inlist) const
          Called by Forward to process the input <type>Array.  It
          can   be   overwritten  by  an  operator  derived  from
          <type>opone, but if not, it calls the apply function.

     virtual void forwardtransform(Axislist & out,
                                   const Axislist & in) const
          Copy the incoming Axislist into  the  outgoing  one  or
          calls forwardwildtrans if wildcards are present.

     virtual forwardwildtrans(Axislist & out,
                              const Axislist & in) const
          Called  by  forwardtransform  to  create  the  outgoing
          Axislist  when  wildcards  are  present.   It  MUST  be
          defined by any derived class that uses wildcards.  When
          the  function  exits,  all  no  wildcarded  values  may
          remain.

     virtual void adjointdata(<type>Array in&,<type>Array& out,
                              const Axislist & out
                              const Axislist & in) const
     virtual void adjointtransform(Axislist & out,
                                   const Axislist & in) const
     virtual void adjointwildtrans(Axislist & out,
                                   const Axislist & in) const
          Same as above, except for Adjoint.

     virtual void apply(<type>Array& a,<type>Array& b,
                         int adj, Axislist & alist,
                         const Axislist& blist) const
          The apply function is meant  to  be  overwritten  by  a
          derived  class. When called by Forward, adj=, a is the
          input <type>Array, and b is the output. When called  by
          Adjoint, adj=, a is the output, and b is the input.

PRIVATE OPERATIONS
     <type>space forwardorder(const <type>space &) const
     void forwardhelp(int,int,int,const Axislist &,<type>Array &,
                      <type>Array &,const Axislist &) const
     type>space adjointorder(const <type>space &) const
     void adjointhelp(int,int,int,const Axislist &,<type>Array &,

OPONE(3LO)           Linop Reference Manual            OPONE(3LO)

                      <type>Array &,const Axislist &) const

     int wildcard(const Axislist &) const

DERIVED CLASSES
     To write an operator derived from <type>opone, you must:

     . Write a constructor that  defines  inaxis,  outaxis,  and
     initializes any internal variables.

     2. If the constructor used new or malloc  on  any  variable,
     write a destructor to delete or free these variables.

     3. Write the apply routine to do the work of  the  operator.
     For  adj=,  the Forward case, apply will take a <type>Array
     matching inaxis, and return a <type>Array matching  outaxis.
     For  adj=,  the Adjoint case, a <type>Array matching inaxis
     must be created from a <type>Array matching outaxis.

     4. Write forwardwildtrans and adjointwildtrans if  wildcards
     will be used.

SEE ALSO
     <type>space, <type>op, <type>Array, Axislist

