Functions and Operators to access entries of the Matrix

xxx& entry(int i)

Example: A.entry(i)
Return the i-th entry of the matrix if its data storage is considered to be a linear array. This is useful for quick operations on every entry of the matrix without regard for the specific (row, column) position of that entry. The total number of entries in the matrix is defined to be numRows() * numCols(), with indices ranging from 0 to numRows() * numCols() - 1. This function returns a reference to the actual entry in the matrix so that assignments can be made to that entry. In general, functions that wish to use linear references to each entry of a matrix A should use this function instead of the expression A.data[i] because classes which are derived from PtMatrix can then overload the entry() method and reuse the same functions.

xxx* operator [] (int row)

Example: A[row][column]
Return a pointer to the start of the row in the matrices data storage. (This operation is different to matrix classes defined as arrays of vectors, in which the [] operator returns the vector representing the desired row.) This operator is generally not used alone but with the [] operator defined on C arrays, so that A[i][j] will give you the entry of the matrix in the i-th row and j-th column of the data storage. The range of rows is from 0 to numRows()-1 and the range of columns is from 0 to numCols()-1.