The function FillArrayRix fills the matrix Mat so that each cell holds a unique integer value, starting with zero at the cell with the lowest index. The value is incremented by one for each succeeding cell. Thus the matrix is filled with kind of a running index.
The function returns the following error codes:
0 ... everything is OK
-1 ... the matrix Mat has zero size