code: function getData(matrix, array) {
    toArray(matrix, array);
  
    array.rows = matrix.rows;
    array.cols = matrix.cols;
  
    return array;
  }
docs: Get the matrix data as an array with properties for rows and cols.
  
  @param {Matrix} matrix The matrix instance.
  @param {Array} array The array to use.
  
  @return {Array} The array.
  
  @private