code: @Override
    public void setDimensionality(int dimensionality) throws IllegalArgumentException {
      final int maxdim = getMaxDim();
      if(maxdim > dimensionality) {
        throw new IllegalArgumentException("Given dimensionality " + dimensionality + " is too small w.r.t. the given values (occurring maximum: " + maxdim + ").");
      }
      this.dimensionality = dimensionality;
    }
docs: Sets the dimensionality to the new value.
  
  
  @param dimensionality the new dimensionality
  @throws IllegalArgumentException if the given dimensionality is too small
  to cover the given values (i.e., the maximum index of any value not
  zero is bigger than the given dimensionality)