code: public static BasicVector constant(int length, double value) {
          double[] array = new double[length];
          Arrays.fill(array, value);
  
          return new BasicVector(array);
      }
docs: Creates a constant {@link BasicVector} of the given {@code length} with
  the given {@code value}.