
SPACE(3LO)           Linop Reference Manual            SPACE(3LO)

NAME
     <type>space - Class for a space with elements of <type>

SYNOPSIS
     #include <<type>space.h>

DESCRIPTION
     A <type>space is a multi-dimensional array of data (of  type
     <type>),  with  a  description, along each dimension, of the
     origin, length, and delta that the data  is  located  along.
     The  data  is stored in a <type>Array, and the axis descrip-
     tion in an Axislist. The <type>space can be constructed from
     either  a  SepData *, or from a <type>Array and an Axislist.
     It can be manipulated with arithmetic operators, either with
     a  matching  <type>space  or  a  <type>,  and  inserted from
     another <type>space, or extracted from a <type>space.

     Linear operators, <type>op, are meant to do most of the cal-
     culations  on  a  <type>space. They are defined as a friend,
     and have direct access to the matrix class, and thus can use
     all the operators for the matrix class to do calculations.

PUBLIC OPERATIONS
     Axislist getaxislist() const
          Get a copy of the Axislist of the <type>space. This  is
          just a copy, and changing it will not change the inter-
          nal axislist.

     const <type>Array & getarray() const
          Return a constant reference to the array of the  space.
          The data cannot be changed, only viewed.  Use getdata()
          for <type>operators to change the data.

     <type>space()
     <type>space(const <type>space &)

     <type>space(SepInput *)
          Construct  <type>space   from   a   SepInput   *.   The
          <type>space and SepInput then share the data memory, so
          the SepInput should not be used or deleted after this.

     <type>space(SepData *)
          Construct <type>space from a SepData *. The <type>space
          and  SepData then share the data memory, so the SepData
          should not be used or deleted after this.

     SepData * sepdata()
          Return a pointer  to  a  new  SepData.  As  above,  the
          <type>space   and   SepData  share  the  data,  so  the
          <type>space should not be used after this.

     <type>space(SepPlane *)

SPACE(3LO)           Linop Reference Manual            SPACE(3LO)

     SepPlane * sepplane()
          Same as above, except for SepPlanes instead  of  SepDa-
          tas.

     <type>space(const <type>Array &,SepInfo *)
          Construct a <type>space from the  <type>Array  and  the
          SepInfo.  This checks to see if the <type>Array matches
          the SepInfo, exiting with an error if it doesn't.

     <type>space(const <type>Array &,const Axislist &)
          Same thing, but with an Axislist instead of a SepInfo.

     <type>space(const Axislist &)
          Construct a <type>space as defined  by  Axislist,  ini-
          tialized to zero.

     <type>space empty() const
          Return a <type>space the of the same size, but equal to
          zero.

     ~<type>space()

     friend ostream & operator<<(ostream&,const <type>space &)
          Print a <type>space. Actually just prints  the  matrix,
          not the axis information.

     float norm() const
     float norm2() const
          norm returns the square root of the sum of the elements
          squared. norm2 returns norm squared.

     <type> cross(const <type>space & s) const
          If s is conformable (matching Axislist), cross multiply
          the  two  <type>space  objects, element by element, and
          sums.

     <type>space trans() const
          Return a <type>space that is the transpose, meaning the
          first two axes are switched.

     <type>space trans(int i,int j=,int k=2,int l=3) const
          Transpose by giving axis  the axis number  i,  axis  
          the axis number j, etc.

     <type> & operator()(int i,int j=,int k=,int l=) const
          Get an element out of the matrix. This element  can  be
          changed.

     <type>space extract(const Axislist & a) const
          Get a <type>space which is the  subspace  of  this  one
          defined  by  a.  This  <type>space  is  a  copy  of the
          extracted parts, and altering it will  not  change  the

SPACE(3LO)           Linop Reference Manual            SPACE(3LO)

          original <type>space.

     <type>space extractslice(int dim,int num) const
          Extract a subspace, with one less  dimension  than  the
          original,  that is slice number num along dimension dim
          of the <type>space.

     void insert(const <type>space & s)
          Insert s into the <type>space if s is a subspace.

     void insertslice(<type>space s,int dim,int num)
          Insert s into the <type>space, making it slice  num  of
          dimension dim.

     friend <type>space operator*(<type>,const <type>space &)
     friend <type>space operator*(const <type>space &,<type>)
     friend <type>space operator*(const <type>space &,
                                  const <type>space &)
     friend <type>space operator/(<type>,const <type>space &)
     friend <type>space operator/(const <type>space &,<type>)
     friend <type>space operator/(const <type>space &,
                                  const <type>space &)
     friend <type>space operator+(<type>,const <type>space &)
     friend <type>space operator+(const <type>space &,<type>)
     friend <type>space operator+(const <type>space &,
                                  const <type>space &)
     friend <type>space operator-(<type>,const <type>space &)
     friend <type>space operator-(const <type>space &,<type>)
     friend <type>space operator-(const <type>space &,
                                  const <type>space &)
     <type>space operator-()
     <type>space operator+()
          All  the  arithmetic  operators  that  are  given   two
          <type>spaces require that the <type>spaces are conform-
          able; that is, their axislists are  equal  or  that  at
          least  one of the <type>spaces is a zero space (meaning
          its Axislist is made up of all wild Axis objects).

     <type>space & operator=(const <type>space &)
     <type>space & operator=(<type>)
     <type>space & operator+=(const <type>space &)
     <type>space & operator+=(<type>)
     <type>space & operator-=(const <type>space &)
     <type>space & operator-=(<type>)
     <type>space & operator*=(const <type>space &)
     <type>space & operator*=(<type>)
     <type>space & operator/=(const <type>space &)
     <type>space & operator/=(<type>)

PRIVATE VARIABLES
     <type>Array array
     Axislist axislist

SPACE(3LO)           Linop Reference Manual            SPACE(3LO)

PRIVATE OPERATIONS
     int compatible(const <type>space &) const
     void checkspace() const
     Index getindex(const Axis&, const Axis&) const

SEE ALSO
     Axis, Axislist, <type>spacearray, <type>op, <type>Array

