Changeset 1039
- Timestamp:
- Jun 14, 2004, 2:51:08 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r961 r1039 1 %%% $Id: psLibSDRS.tex,v 1.5 6 2004-06-09 22:16:39 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.57 2004-06-15 00:51:08 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1164 1164 In these functions, \code{nalloc} is the number of elements to 1165 1165 allocate. For \code{psVectorAlloc}, the value of \code{psVector.n} is 1166 set to 0. For \code{psVectorRealloc}, if the value of \code{nalloc} 1167 is smaller than the current value of \code{psVector.n}, then 1168 \code{psVector.n} is set to \code{nalloc}, the array is adjusted down 1169 to match \code{nalloc}, and the extra elements are lost. If 1170 \code{nalloc} is larger than the current value of \code{psVector.n}, 1171 \code{psVector.n} is left intact. If the value of \code{myArray} is 1172 \code{NULL}, then \code{psVectorRealloc} must return an error. In 1173 \code{psVectorFree}, the function \code{elemFree} is required for 1174 arrays of pointer types; it is the destructor appropriate to the data 1175 pointed to by the pointers. This function, which may be \code{NULL}, 1176 is called for each existing element of the array before the array 1177 itself is freed. If the function is \code{NULL}, the elements are are 1178 not freed. This function must not be defined for any data type except 1179 the \code{void} pointer array. 1166 set to \code{nalloc}. Users may choose to restrict the data range 1167 after the \code{psVectorAlloc} function is called. For 1168 \code{psVectorRealloc}, if the value of \code{nalloc} is smaller than 1169 the current value of \code{psVector.n}, then \code{psVector.n} is set 1170 to \code{nalloc}, the array is adjusted down to match \code{nalloc}, 1171 and the extra elements are lost. If \code{nalloc} is larger than the 1172 current value of \code{psVector.n}, \code{psVector.n} is left intact. 1173 If the value of \code{myArray} is \code{NULL}, then 1174 \code{psVectorRealloc} must return an error. In \code{psVectorFree}, 1175 the function \code{elemFree} is required for arrays of pointer types; 1176 it is the destructor appropriate to the data pointed to by the 1177 pointers. This function, which may be \code{NULL}, is called for each 1178 existing element of the array before the array itself is freed. If 1179 the function is \code{NULL}, the elements are are not freed. This 1180 function must not be defined for any data type except the \code{void} 1181 pointer array. 1180 1182 1181 1183 \subsection{Simple Images} … … 1483 1485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1484 1486 1485 \subsection{Bit sets}1486 1487 Bit sets are required in order to turn options on and off. We require1487 \subsection{BitSets} 1488 1489 BitSets are required in order to turn options on and off. We require 1488 1490 the capability to have a bitset of arbitrary length (i.e., not limited 1489 by the length of a \code{long}, say). The \code{psBit set} structure1491 by the length of a \code{long}, say). The \code{psBitSet} structure 1490 1492 is defined below. Note that the entry \code{bits} is an array of type 1491 1493 \code{char} storing the bits as bits of each byte in the array, with 8 … … 1498 1500 int n; ///< Number of chars that form the bitset 1499 1501 char *bits; ///< The bits 1500 } psBit set;1502 } psBitSet; 1501 1503 \end{verbatim} 1502 1504 1503 1505 We also require the corresponding constructor and destructor: 1504 1506 \begin{verbatim} 1505 psBit set *psBitsetAlloc(int n);1506 void psBit setFree(psBitset *restrict myBits);1507 psBitSet *psBitSetAlloc(int n); 1508 void psBitSetFree(psBitSet *restrict myBits); 1507 1509 \end{verbatim} 1508 1510 where \code{n} is the requested number of bits. … … 1518 1520 1519 1521 \begin{verbatim} 1520 psBit set *psBitsetSet(psBitset *restrict myBits, int bit);1521 psBit set *psBitsetOp(psBitset *outBits,1522 const psBit set *restrict inBits1,1522 psBitSet *psBitSetSet(psBitSet *restrict myBits, int bit); 1523 psBitSet *psBitSetOp(psBitSet *outBits, 1524 const psBitSet *restrict inBits1, 1523 1525 char *operator, 1524 const psBit set *restrict inBits2);1525 psBit set *psBitsetNot(psBitset *out, psBitset *in);1526 int psBitsetTest(const psBitset *restrict checkBits, int bit);1527 \end{verbatim} 1528 1529 \code{psBit setSet} sets the specified \code{bit} in the1530 \code{psBit set}, and returns the updated bitset. The input bitset1526 const psBitSet *restrict inBits2); 1527 psBitSet *psBitSetNot(psBitSet *out, psBitSet *in); 1528 bool psBitSetTest(const psBitSet *restrict checkBits, int bit); 1529 \end{verbatim} 1530 1531 \code{psBitSetSet} sets the specified \code{bit} in the 1532 \code{psBitSet}, and returns the updated bitset. The input bitset 1531 1533 will be modified. 1532 1534 1533 \code{psBit setOp} returns the \code{psBitset} that is the result of1535 \code{psBitSetOp} returns the \code{psBitSet} that is the result of 1534 1536 performing the specified \code{operator} (one of \code{"AND"}, 1535 1537 \code{"OR"}, or \code{"XOR"}) on \code{inBits1} and \code{inBits2}. … … 1537 1539 the function. 1538 1540 1539 \code{psBit setNot} applies a unary \code{NOT} to a bitset, placing the1541 \code{psBitSetNot} applies a unary \code{NOT} to a bitset, placing the 1540 1542 answer in the bitset \code{out}, or creating a new bitset if 1541 1543 \code{out} is \code{NULL}. 1542 1544 1543 Finally, \code{psBit setTest} returns a true value if the specified1545 Finally, \code{psBitSetTest} returns a true value if the specified 1544 1546 \code{bit} is set; otherwise, it returns a false value. 1545 1547 … … 1564 1566 in \code{x}. In order to facilitate this, we will have a sort 1565 1567 function return a vector containing the indices for the unsorted list 1566 in the order appropriate for the sorted vector. The output vector must 1567 be of type \code{psU32}. This function is specified for input types 1568 \code{psU8, psU16, psF32, psF64}. 1568 in the order appropriate for the sorted vector, sorted from the 1569 smallest (i.e.\ most negative) value in the first element, and the 1570 largest (i.e.\ most positive) value in the last element. The output 1571 vector must be of type \code{psU32}. This function is specified for 1572 input types \code{psU8, psU16, psF32, psF64}. 1569 1573 1570 1574 \begin{verbatim}
Note:
See TracChangeset
for help on using the changeset viewer.
