static identity(size) {
        if (!Number.isInteger(size) || size <= 0) {
            throw new DetailedError("Bad size", {size});
        }
        let buf = new Float64Array(size*size*2);
        for (let k = 0; k < size; k++) {
            buf[k*(size + 1)*2] = 1;
        }
        return new Matrix(size, size, buf);
    }
Returns the identity matrix, with 1s on the main diagonal and all other entries zero.
@param size The dimension of the returned identity matrix.
@returns {!Matrix}