File: dataStructure.tex

package info (click to toggle)
spooles 2.2-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,824 kB
  • ctags: 3,665
  • sloc: ansic: 146,828; csh: 3,615; makefile: 2,045; perl: 70
file content (30 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\par
\section{Data Structure}
\par
The {\tt Coords} object has four fields.
\begin{itemize}
\item {\tt int type} : coordinate type.
When {\tt type = 1}, coordinates are stored by tuples,
$(x_0,y_0,\ldots)$ first,
$(x_1,y_1,\ldots)$ next, etc.
% \begin{verbatim}
% x(icoor, idim) = coors[idim + icoor*ndim]
% \end{verbatim}
When {\tt type = 2}, coordinates are stored by $x$-coordinates
first, $y$-coordinates next, etc.
% \begin{verbatim}
% x(icoor, idim) = coors[icoor + idim*ncoor]
% \end{verbatim}
\item {\tt int ndim} : 
number of dimensions for the coordinates, 
e.g., for $(x,y)$ coordinates {\tt ndim = 2},
for $(x,y,z)$ coordinates {\tt ndim = 3}.
\item {\tt int ncoor} : 
number of coordinates (i.e., number of grid points).
\item {\tt float *coors} : 
pointer to a {\tt float} vector that holds the coordinates
\end{itemize}
A correctly initialized and nontrivial {\tt Coords} object 
will have {\tt type} be {\tt 1} or {\tt 2},
positive {\tt ndim} and {\tt ncoor} values,
and a non-{\tt NULL} {\tt coors} field.