class DoubleMatrixUtils {

  public static DoubleMatrix2D getTwoDimensionalDiagonalMatrix(final DoubleMatrix1D vector) {
    Validate.notNull(vector);
    final int n = vector.getNumberOfElements();
    if (n == 0) {
      return DoubleMatrix2D.EMPTY_MATRIX;
    }
    final double[][] data = new double[n][n];
    for (int i = 0; i < n; i++) {
      data[i][i] = vector.getEntry(i);
    }
    return new DoubleMatrix2D(data);
  }

  private  DoubleMatrixUtils();

}