
OPDIAGONAL(3LO)      Linop Reference Manual       OPDIAGONAL(3LO)

NAME
     <type>opDiagonal - Optimized diagonal array of operators.

SYNOPSIS
     #include <<type>oparray.h>

DESCRIPTION
     Class <type>opDiagonal acts  like  a  diagonal  fopArray  of
     operators.  It  is derived from <type>operator, NOT fopArray
     because it only stores and applies the operators  along  the
     diagonal.    The  functions  supplied  result  in  the  same
     behavior as those for fopArrays, except that  indexing  only
     requires  one  int  value  instead of two (since the row and
     column number  are  always  equal  for  diagonal  elements).
     Non-diagonal  positions  can neither be accessed nor set and
     are treated as "zero" operators.

     The  <type>opDiagonal  does  not  contain  copies   of   the
     <type>operators,  but  rather  pointers  to  them. Thus, the
     <type>operators  cannot  be  changed  or  deleted,  or   the
     <type>opArray will behave strangely.

PUBLIC OPERATIONS
     <type>opDiagonal(int i)
          Construct a <type>opDiagonal, with the number  of  rows
          and columns specified by i.

     <type>opDiagonal(int i, foperator &)
     <type>opDiagonal(int i, foperator *)
          Construct from the row/column number and an operator to
          insert at every diagonal position.

     <type>opDiagonal(const <type>opDiagonal &)
          Create a new <type>opDiagonal with copied  pointers  to
          the <type>opDiagonal.

     <type>opDiagonal & operator=(const <type>opDiagonal &)
          Set the pointers to <type>operators equal to  those  of
          the <type>opDiagonal.

     ~<type>opDiagonal()

     const <type>operator & operator()(int i)
          Return a reference to the  <type>operator  at  position
          (i,i)  in  the  array.   This  <type>operator cannot be
          changed, but can be applied to a spacearray.

     void set(int i, <type>operator &)
     void set(int i, <type>operator *)
          Set the position (i,i) to the reference or pointer to a
          <type>operator.  A  pointer  to  a  <type>operator with
          allocated space should be used when the array will  not

OPDIAGONAL(3LO)      Linop Reference Manual       OPDIAGONAL(3LO)

          be applied within the same scope as it is created.

     <type>spacearray Forward(const <type>spacearray &) const
     <type>spacearray Adjoint(const <type>spacearray &) const
          These are the functions for applying a <type>opDiagonal
          to  a  <type>spacearray. In the case of Forward, if the
          <type>opDiagonal has the same number of columns as  the
          <type>spacearray  has  rows,  the  function  behaves as
          though the rows of the <type>opDiagonal are  multiplied
          by  the  columns  of  the <type>spacearray, and summed.
          This is just like matrix multiplication.  Adjoint  does
          the   same,   except   with   the   transpose   of  the
          <type>opDiagonal.

PRIVATE VARIABLE
     int size
          <type>operator ** ops

PRIVATE OPERATION
     void unref()

SEE ALSO
     <type>opArray, <type>space, <type>spacearray, <type>operator

