Changeset 338
- Timestamp:
- Mar 31, 2004, 4:40:28 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r337 r338 1 %%% $Id: psLibSDRS.tex,v 1.1 6 2004-04-01 02:34:37 eugene Exp $1 %%% $Id: psLibSDRS.tex,v 1.17 2004-04-01 02:40:28 price Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 %\documentclass[panstarrs]{panstarrs}4 3 5 4 % basic document variables … … 870 869 section~\ref{math}. 871 870 872 \subsection{Simple Array types} 873 874 \begin{verbatim} 875 psIntArray 876 psFloatArray 877 psDoubleArray 878 psComplexArray 879 psVoidPtrArray 880 \end{verbatim} 881 882 \subsubsection{Arrays of Simple Types} 871 \subsection{Arrays of Simple Types} 883 872 884 873 We require several types of basic one-dimensional arrays: arrays of … … 934 923 functions may be easily generated with C pre-processor macros. 935 924 936 \subs ubsection{Arrays of Pointer Types}925 \subsection{Arrays of Pointer Types} 937 926 938 927 Arrays of pointer types need some additional specification. We … … 1500 1489 psMatrixToVector(psMatrix *myMatrix ///< Matrix to convert 1501 1490 ); 1491 1492 /** Convert vector to matrix. */ 1493 psImage * 1494 psVectorToMatrix(psImage *out, //!< Matrix to return, or NULL 1495 psVector *myVector //!< Vector to convert 1496 ); 1502 1497 \end{verbatim} 1503 1498 … … 2198 2193 images, e.g.\ dividing one image by another, subtracting a vector 2199 2194 from an image, etc. Both binary operations and unary operations are 2200 required. 2195 required. To avoid the burden of memorizing a ton of APIs, we specify 2196 two generic APIs for the binary and unary operations. 2201 2197 2202 2198 \begin{verbatim} … … 2212 2208 2213 2209 \begin{verbatim} 2214 /** Perform a binary operation on two data items (psImage, psVector, psScalar).2210 /** Perform a unary operation on two data items (psImage, psVector, psScalar). 2215 2211 */ 2216 2212 psType * … … 2227 2223 perform the onerous task of creating the loops. 2228 2224 2225 Vectors are defined as arrays of floats: 2226 \begin{verbatim} 2227 /** Define a vector as an array of real numbers */ 2228 typedef psFloatArray psVector; 2229 #define psVectorAlloc(S,N) psFloatArrayAlloc(S,N) ///< Constructor 2230 #define psVectorRealloc(A,S) psFloatArrayRealloc(A,S) ///< Reallocator 2231 #define psVectorFree(A) psFloatArrayFree(A) ///< Destructor 2232 \end{verbatim} 2233 2229 2234 It is desirable to use the same functions for both vectors and 2230 2235 images, so inputs are \code{void*}; this necessitates that vectors 2231 2236 and images each have a type element at a pre-determined and constant 2232 location in the \code{struct}. It is further desirable to allow 2233 scalar values to be used within these functions, which requires the 2234 following additions: 2237 location in the \code{struct}. 2238 2239 \begin{verbatim} 2240 /** The type of a data type */ 2241 typedef struct { 2242 psElemType type; ///< The type 2243 psDimen dimen; ///< The dimensionality 2244 } psType; 2245 2246 /** Types of the elements of vectors, images, etc. */ 2247 typedef enum { 2248 PS_TYPE_CHAR, ///< Character 2249 PS_TYPE_SHORT, ///< Short integer 2250 PS_TYPE_INT, ///< Integer 2251 PS_TYPE_LONG, ///< Long integer 2252 PS_TYPE_UCHAR, ///< Unsigned character 2253 PS_TYPE_USHORT, ///< Unsigned short integer 2254 PS_TYPE_UINT, ///< Unsigned integer 2255 PS_TYPE_ULONG, ///< Unsigned long integer 2256 PS_TYPE_FLOAT, ///< Floating point 2257 PS_TYPE_DOUBLE, ///< Double-precision floating point 2258 PS_TYPE_COMPLEX, ///< Complex numbers consisting of floating point 2259 PS_TYPE_OTHER, ///< Something else that's not supported for arithmetic 2260 } psElemType; 2261 2262 /** Dimensions of a data type */ 2263 typedef enum { 2264 PS_DIMEN_SCALAR, ///< Scalar 2265 PS_DIMEN_VECTOR, ///< A vector 2266 PS_DIMEN_TRANSV, ///< A transposed vector 2267 PS_DIMEN_IMAGE, ///< An image 2268 PS_DIMEN_OTHER ///< Something else that's not supported for arithmetic 2269 } psDimen; 2270 \end{verbatim} 2271 2272 Binary operations between an image and a vector have a potential 2273 ambiguity --- do the vector elements correspond to the rows or the 2274 columns? For this reason, we define two vector types: a ``vector'' 2275 (\code{PS_DIMEN_VECTOR}), and a ``transposed vector'' 2276 (\code{PS_DIMEN_TRANSV}). We specify that a ``vector'', when involved 2277 in binary operations on an image, acts on the rows, while a 2278 ``transposed vector'' in the same context acts on the columns. 2279 Vectors, when created, will be created as ``vectors'', but may be 2280 converted to ``transposed vectors'' using the following function: 2281 2282 \begin{verbatim} 2283 /** Transpose a vector. Changes the type to a PS_DIMEN_TRANSV */ 2284 psVector *psVectorTranspose(psVector *out, //!< Output vector, or NULL 2285 psVector *myVector //!< Vector to be transposed 2286 ); 2287 \end{verbatim} 2288 2289 It is further desirable to allow scalar values to be used within these 2290 functions, which requires the following additions: 2235 2291 2236 2292 \begin{verbatim} … … 2859 2915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2860 2916 2861 \subsection{Astronom yImages}2917 \subsection{Astronomical Images} 2862 2918 2863 2919 \subsubsection{Overview}
Note:
See TracChangeset
for help on using the changeset viewer.
