Array2D Class Reference
<classdoc Array 2 D> <descp> Defines a two-dimensional array with the elements organized into rows and columns. The array is defined with a limited number of operations similar those provided in other languages. The elements of the array, which store Python references, can be accessed using normal subscript notation, x[i, j]. The class is implemented as an array of arrays. <figure img="2darray.jpg" size="200px"> </descp> <method Array 2 D params="nrows, ncols">
<descp>
Creates a two-dimensional array with elements organized into rows and columns. The number of rows and columns in the array are provided as arguments. The elements are initialized to <method numRows> <descp> Returns the number of rows in the 2-D array. </descp> <returns>The number of rows in the array.</returns> </method> <method numCols> <descp> Returns the number of columns in the 2-D array. </descp> <returns>The number of columns in the array.</returns> </method> <method clear>
<descp>
Clears the array by setting every element to <method clear params="value"> <descp> Sets every element to a given value. All of the elements in the array will reference the same object, not separate copies. </descp> <param value>The value to be stored in each element of the array.</param> </method> <method __getitem__ op="value = x(:row , col:)"> <descp> Returns the value stored in an element of the array. </descp> <param row> The row index of the element whose value is to be returned. It must be >= 0 and less than the number of rows in the array. </param> <param col> The column index of the element whose value is to be returned. It must be >= 0 and less than the number of columns in the array. </param> <returns>The value stored in the given array element.</returns> <throws>IndexError</throws> </method> <method __setitem__ op="x(:row , col:) = value">
<descp>
Stores a new value into a specific element of the array. The contents of the array element in the given row and column is changed to </classdoc>
|