Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 363)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 365)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.25 2004-04-01 09:16:12 eugene Exp $
+%%% $Id: psLibSDRS.tex,v 1.26 2004-04-01 09:29:01 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -1947,9 +1947,8 @@
 is derived from the statistics of the pixels at that direction
 coordinate.  The statistic used to derive the output vector value is
-specified by \code{psStats *stats}.
-\begin{verbatim}
-psFloatArray *psImageSlice(psFloatArray *out, psImage *input, 
-                           int x, int y, int nx, int ny, 
-   int direction, const psStats *stats);
+specified by \code{stats}.
+\begin{verbatim}
+psFloatArray *psImageSlice(psFloatArray *out, psImage *input, int x, int y, int nx, int ny, 
+                           int direction, const psStats *stats);
 \end{verbatim}
 
@@ -1962,22 +1961,19 @@
 statistics of the pixels interpolated along the perpendicular
 direction.  The statistic used to derive the output vector value is
-specified by \code{psStats stats}.
-\begin{verbatim}
-psFloatArray *psImageCut(psFloatArray *out, psImage *input, 
-                         float xs, float ys, float xe, float ye, float dw, 
- const psStats *stats);
-\end{verbatim}
-
-Extract radial annuli data to a vector.  A vector is constructed
-where each vector elements is derived from the statistics of the
-pixels which land in one of a sequence of annuli.  The annuli are
-centered on the image pixel coordinate \code{x,y}, and have width
-\code{dr}.  The number of annuli is $radius / dr$.  The statistic
-used to derive the output vector value is specified by \code{psStats
-stats}
-\begin{verbatim}
-psFloatArray *psImageRadialCut(psFloatArray *out, psImage *input, 
-                               float x, float y, float radius, float dr, 
-       psStats *stats);
+specified by \code{stats}.
+\begin{verbatim}
+psFloatArray *psImageCut(psFloatArray *out, psImage *input, float xs, float ys, float xe, float ye, 
+                         float dw, psStats *stats);
+\end{verbatim}
+
+Extract radial annuli data to a vector.  A vector is constructed where
+each vector elements is derived from the statistics of the pixels
+which land in one of a sequence of annuli.  The annuli are centered on
+the image pixel coordinate \code{x,y}, and have width \code{dr}.  The
+number of annuli is $radius / dr$.  The statistic used to derive the
+output vector value is specified by \code{stats}
+\begin{verbatim}
+psFloatArray *psImageRadialCut(psFloatArray *out, psImage *input, float x, float y, float radius, float dr, 
+                               psStats *stats);
 \end{verbatim}
 
@@ -1989,5 +1985,5 @@
 input image pixels.  Each pixel in the output image is derived from
 the statistics of the corresponding set of input image pixels based on
-the statistics specified by \code{psStats stats}.
+the statistics specified by \code{stats}.
 \begin{verbatim}
 psImage *psImageRebin(psImage *out, psImage *input, float scale, psStats *stats);
@@ -2024,5 +2020,5 @@
 
 Determine statistics for image (or subimage).  The statistics to be
-determined are specified by \code{psStats stats}.
+determined are specified by \code{stats}.
 \begin{verbatim}
 psStats *psImageGetStats(psImage *input, psStats *stats);
@@ -2067,6 +2063,5 @@
 one-dimensional.
 \begin{verbatim}
-psImage *psImageReadSection(psImage *output, 
-                            int x, int y, int nx, int ny, int z, 
+psImage *psImageReadSection(psImage *output, int x, int y, int nx, int ny, int z, 
                             char *extname, int extnum, char *filename);
 \end{verbatim}
@@ -2076,8 +2071,6 @@
 \code{psImageReadSection}.
 \begin{verbatim}
-psImage *
-psImageFReadSection(psImage *output, 
-                    int x, int y, int nx, int ny, int z, 
-    char *extname, int extnum, FILE *f);
+psImage *psImageFReadSection(psImage *output, int x, int y, int nx, int ny, int z, 
+                             char *extname, int extnum, FILE *f);
 \end{verbatim}
 \tbd{The use of \code{FILE*} to carry around the file descriptor is to be reviewed.}
@@ -2090,6 +2083,5 @@
 created.
 \begin{verbatim}
-psImage *psImageWriteSection(psImage *input, 
-                             int x, int y, int z, 
+psImage *psImageWriteSection(psImage *input, int x, int y, int z, 
                              char *extname, int extnum, char *filename);
 \end{verbatim}
@@ -2097,6 +2089,5 @@
 Write an image section to file descriptor as above:
 \begin{verbatim}
-psImage *psImageFWriteSection(psImage *input, 
-                              int x, int y, int z, 
+psImage *psImageFWriteSection(psImage *input, int x, int y, int z, 
                               char *extname, int extnum, FILE *f);
 \end{verbatim}
@@ -2157,76 +2148,16 @@
 
 \begin{verbatim}
-/** Perform a binary operation on two data items (psImage, psVector, psScalar).
-*/
-psType *
-psBinaryOp (void *out,                  ///< destination (may be NULL)
-            void *in1,                  ///< first input
-            char *operator,             ///< operator
-            void *in2                   ///< second input
-    );
-\end{verbatim}
-
-\begin{verbatim}
-/** Perform a unary operation on two data items (psImage, psVector, psScalar).
-*/
-psType *
-psUnaryOp (void *out,                   ///< destination (may be NULL)
-           void *in,                    ///< input
-           char *operator,              ///< operator
-    );
-\end{verbatim}
-
-Note that these functions should return the appropriate type (i.e.,
-the \code{psType} return type refers to \code{psVector} and
-\code{psImage} and \code{psScalar}).  It is expected that the
-implementation of these functions will employ pre-processor macros to
-perform the onerous task of creating the loops.
-
-Vectors are defined as arrays of floats:
-\begin{verbatim}
-/** Define a vector as an array of real numbers */
-typedef psFloatArray psVector;
-#define psVectorAlloc(S,N) psFloatArrayAlloc(S,N) ///< Constructor
-#define psVectorRealloc(A,S) psFloatArrayRealloc(A,S) ///< Reallocator
-#define psVectorFree(A) psFloatArrayFree(A) ///< Destructor
-\end{verbatim}
-
-It is desirable to use the same functions for both vectors and
-images, so inputs are \code{void*}; this necessitates that vectors
-and images each have a type element at a pre-determined and constant
-location in the \code{struct}.
-
-\begin{verbatim}
-/** The type of a data type */
-typedef struct {
-    psElemType type;                    ///< The type
-    psDimen dimen;                      ///< The dimensionality
-} psType;
-
-/** Types of the elements of vectors, images, etc. */
-typedef enum {
-    PS_TYPE_CHAR,                       ///< Character
-    PS_TYPE_SHORT,                      ///< Short integer
-    PS_TYPE_INT,                        ///< Integer
-    PS_TYPE_LONG,                       ///< Long integer
-    PS_TYPE_UCHAR,                      ///< Unsigned character
-    PS_TYPE_USHORT,                     ///< Unsigned short integer
-    PS_TYPE_UINT,                       ///< Unsigned integer
-    PS_TYPE_ULONG,                      ///< Unsigned long integer
-    PS_TYPE_FLOAT,                      ///< Floating point
-    PS_TYPE_DOUBLE,                     ///< Double-precision floating point
-    PS_TYPE_COMPLEX,                    ///< Complex numbers consisting of floating point
-    PS_TYPE_OTHER,                      ///< Something else that's not supported for arithmetic
-} psElemType;
-
-/** Dimensions of a data type */
-typedef enum {
-    PS_DIMEN_SCALAR,                    ///< Scalar
-    PS_DIMEN_VECTOR,                    ///< A vector
-    PS_DIMEN_TRANSV,                    ///< A transposed vector
-    PS_DIMEN_IMAGE,                     ///< An image
-    PS_DIMEN_OTHER                      ///< Something else that's not supported for arithmetic
-} psDimen;
-\end{verbatim}
+psType *psBinaryOp (void *out, void *in1, char *op, void *in2);
+psType *psUnaryOp (void *out, void *in, char *op);
+\end{verbatim}
+These functions determine the type of the operands on the basis of
+their \code{psType} elements, which always are the first elements.
+Note that these functions return a pointer to the appropriate type for
+the operation.  Since the result may is cast to \code{psType}, the
+resulting type may be determined by examining the return value.  It is
+expected that the implementation of these functions will employ
+pre-processor macros to perform the onerous task of creating the
+loops.  Also note that \code{psVectors} is equivalent to
+\code{psFloatArray}.
 
 Binary operations between an image and a vector have a potential
