docs: public static double[][] diagonal(final double[] v1) {
      final int dim = v1.length;
      final double[][] result = new double[dim][dim];
      for(int i = 0; i < dim; i++) {
        result[i][i] = v1[i];
      }
      return result;
    }