\manpage {array2} {E} {Two Dimensional Arrays} 
 
\definition
An instance $A$ of the parameterized data type \name\ is a mapping from a 
set of pairs $I = [a..b] \times [c..d]$, called the index set of $A$, to the 
set of variables of data type $E$, called the element type of $A$, for two 
fixed intervals of integers $[a..b]$ and $[c..d]$.  $A(i,j)$ is called the 
element at position $(i,j)$.

 
\creation  A 
 
\create {(int\ a,int\ b,int\ c,int\ d)}
   { creates an instance \var\ of type \name\ with index set
                 $[a..b]\times [c..d]$.   }
 
 
\create {(int\ n,int\ m)}
   { creates an instance \var\ of type \name\ with index set
                 $[0..n-1]\times [0..m-1]$.   }
 
 
\operations 1.5 5 
 
\funop E\&  {int\ i, \ int\ j}
         {  returns $A(i,j)$.\\
        	\precond $a\le i\le b$ and $c\le j\le d$. }
 
 
\op  int low1 {()}
           {  returns $a$.  }
 
 
\op  int high1 {()}
           {  returns $b$.  }
 
 
\op  int low2 {()}
           {  returns $c$.  }
 
 
\op  int high2 {()}
           {  returns $d$.  }
 
 
\implementation
Two dimensional arrays are implemented by \CC vectors. All operations
take time $O(1)$, the space requirement is $O(|I|* sizeof(E))$.

 
