static diag(data, rows, columns) {
                var l = data.length;
                if (rows === undefined) rows = l;
                if (columns === undefined) columns = rows;
                var min = Math.min(l, rows, columns);
                var matrix = this.zeros(rows, columns);
                for (var i = 0; i < min; i++) {
                    matrix.set(i, i, data[i]);
                }
                return matrix;
            }
Creates a diagonal matrix based on the given array.
@param {Array} data - Array containing the data for the diagonal
@param {number} [rows] - Number of rows (Default: data.length)
@param {number} [columns] - Number of columns (Default: rows)
@return {Matrix} - The new diagonal matrix