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.
number = CMatrix:Rows() |
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 |
|
-- if finished with M, clean up memory |