CMatrix:Rows
The Rows method returns the maximum row index in the CMatrix. This is the number of rows needed to hold every possible index in a completely filled rectangular matrix.
nRows = CMatrix:Rows() where |
nRows is the maximum row index of the matrix. On failure or if the matrix is empty, 0 is returned.
This method returns the maximum row index in the matrix. Since all indices do not have to be filled in a sparse matrix, the returned value is not the same as the number of rows. For example, if the CMatrix has 1 row with 2 members, one at index [1][1] and the other at index[1][10000], then Rows = 1.
Suppose a CMatrix assigned to M contains 3 members as shown below:
|
-- create a CMatrix |
|
-- set member 2, 44 |
|
-- set member 50, 20 |
|
-- set member 120, 2 |
|
-- result: Rows = 120 |