code: public double[][] toDenseArray() {
          double[][] m = new double[values.length][values.length];
          for (int r = 0; r < values.length; ++r) {
              m[r][r] = values[r];
          }
          return m;
      }
docs: {@inheritDoc}