A matrix is a 2D array. A matrix list is a 2D ArrayList. Sometime with matrix, the ArrayList version is marked.
A matrix is squared in case number of rows and columns are equal and there is value in every cell.
Because a matrix is made via array or ArrayList, in all rows there is a 1D array or ArrayList. For processing, it is advised to check whether all cells are existing by checking length (size) all rows.
Matrix diagonal means cells where row and column indexes are equal (geometrically a line from top left to bottom right). Only a square matrix has diagonal.
Transposing a matrix means geometrically mirroring (or rotating) cell values on or around its diagonal. Only square matrix can be transposed.
Reversing rows in a matrix means for each row the order of elements are to reversed (e.g. 1, 3, 2 becomes 2, 3, 1, no sorting).
Rotating a matrix means several processes in a chain. For rotating, the matrix has to be squared due to using a process which works on a square matrix:
rotate clockwise (+90 degrees): transpose, then reverse rows
rotate counter-clockwise (-90 degrees): reverse rows then transpose
rotate by 180 degrees: rotate twice in clockwise (or counter-clockwise) direction
EXAMPLE FOR CHECKING SQUARED:
EXAMPLE FOR CONVERTING MATRIX TO MATRIX LIST:
EXAMPLE FOR CONVERTING MATRIX LIST TO MATRIX:
EXAMPLE FOR TRANSPOSING A MATRIX (LIST):
EXAMPLE FOR REVERSING ROWS IN A MATRIX (LIST):