Generate a bitmap with the specified values set to true. The provided longs values don't have
to be in sorted order, but it may be preferable to sort them from a performance point of view.

@param dat set values
@return a new bitmap
191887
public static Roaring64NavigableMap bitmapOf(final long... dat) {
    final Roaring64NavigableMap ans = new Roaring64NavigableMap();
    ans.add(dat);
    return ans;
  }
196896
public BitSet projectG2(BitSet set) {
        BitSet projection = new BitSet(getSecondGraphSize());
        CDKRNode xNode = null;

        for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
            xNode = getGraph().get(x);
            projection.set(xNode.getRMap().getId2());
        }
        return projection;
    }
198785
public static Bitmap getBitmap(Drawable drawable) {
        if (drawable == null)
            return null;

        if (drawable instanceof BitmapDrawable) {
            return ((BitmapDrawable) drawable).getBitmap();
        } else {
            Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),
                    drawable.getOpacity() != PixelFormat.OPAQUE ? Config.ARGB_8888 : Config.RGB_565);
            Canvas canvas = new Canvas(bitmap);
            drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
            drawable.draw(canvas);
            return bitmap;
        }
    }
537054
public static SortedMap<Short, List<MappeableContainer>> groupByKey(
          ImmutableRoaringBitmap... bitmaps) {
    Map<Short, List<MappeableContainer>> grouped = new HashMap<>();
    for (ImmutableRoaringBitmap bitmap : bitmaps) {
      MappeableContainerPointer it = bitmap.highLowContainer.getContainerPointer();
      while (null != it.getContainer()) {
        MappeableContainer container = it.getContainer();
        Short key = it.key();
        List<MappeableContainer> slice = grouped.get(key);
        if (null == slice) {
          slice = new ArrayList<>();
          grouped.put(key, slice);
        }
        slice.add(container);
        it.advance();
      }
    }
    SortedMap<Short, List<MappeableContainer>> sorted = new TreeMap<>(BufferUtil::compareUnsigned);
    sorted.putAll(grouped);
    return sorted;
  }
476768
public ImageSource toFastBitmap() {
        OneBandSource l = new OneBandSource(width, height);
        PowerSpectrum();

        double max = Math.log(PowerMax + 1.0);
        double scale = 1.0;
        if (scaleValue > 0) scale = scaleValue / max;

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                double p = Power[i][j];
                double plog = Math.log(p + 1.0);
                l.setRGB(i, j, (int) (plog * scale * 255));
            }
        }

        return l;
    }
497699
public Bitmap asBitmap(INDArray array, int dataType) {
        return converter2.convert(asFrame(array, dataType));
    }
701820
public BitSet projectG1(BitSet set) {
        BitSet projection = new BitSet(firstGraphSize);
        RNode xNode = null;

        for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
            xNode = (RNode) graph.get(x);
            projection.set(xNode.rMap.id1);
        }
        return projection;
    }
909433
@Deprecated
  public static int setBitmapRangeAndCardinalityChange(LongBuffer bitmap, int start, int end) {
    if (BufferUtil.isBackedBySimpleArray(bitmap)) {
      return Util.setBitmapRangeAndCardinalityChange(bitmap.array(), start, end);
    }
    int cardbefore = cardinalityInBitmapWordRange(bitmap, start, end);
    setBitmapRange(bitmap, start, end);
    int cardafter = cardinalityInBitmapWordRange(bitmap, start, end);
    return cardafter - cardbefore;
  }
1187607
public static void setBitmapRange(long[] bitmap, int start, int end) {
    if (start == end) {
      return;
    }
    int firstword = start / 64;
    int endword = (end - 1) / 64;
    if (firstword == endword) {
      bitmap[firstword] |= (~0L << start) & (~0L >>> -end);
      return;
    }
    bitmap[firstword] |= ~0L << start;
    for (int i = firstword + 1; i < endword; i++) {
      bitmap[i] = ~0L;
    }
    bitmap[endword] |= ~0L >>> -end;
  }
477263
@Deprecated
  public static int setBitmapRangeAndCardinalityChange(long[] bitmap, int start, int end) {
    int cardbefore = cardinalityInBitmapWordRange(bitmap, start, end);
    setBitmapRange(bitmap, start,end);
    int cardafter = cardinalityInBitmapWordRange(bitmap, start, end);
    return cardafter - cardbefore;
  }
482981
public static void fillArrayANDNOT(final short[] container, final long[] bitmap1,
      final long[] bitmap2) {
    int pos = 0;
    if (bitmap1.length != bitmap2.length) {
      throw new IllegalArgumentException("not supported");
    }
    for (int k = 0; k < bitmap1.length; ++k) {
      long bitset = bitmap1[k] & (~bitmap2[k]);
      while (bitset != 0) {
        container[pos++] = (short) (k * 64 + numberOfTrailingZeros(bitset));
        bitset &= (bitset - 1);
      }
    }
  }
1197315
public static <E> Set<E> newSetFromMap(Map<E, Boolean> m) {
        return new SetFromMap<>(m);
    }
1081349
public static final BitSet toBitSet(final int size, final long value) {
    BitSet bits = new BitSet(size);
    int idx = 0;
    long tmp = value;
    while (tmp != 0L) {
      if (tmp % 2L != 0L) {
        bits.set(idx);
      }
      ++idx;
      tmp = tmp >>> 1;
    }
    return bits;
  }
1358388
public BitSet getInputSet(ValueNumber output) {
        BitSet outputSet = outputToInputMap.get(output);
        if (outputSet == null) {
            if (DEBUG) {
                System.out.println("Create new input set for " + output.getNumber());
            }
            outputSet = new BitSet();
            outputToInputMap.put(output, outputSet);
        }
        return outputSet;
    }
402079
public static Bitmap flip(Bitmap src) {
        Matrix m = new Matrix();
        m.preScale(-1, 1);
        return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, false);
    }
1339628
private static Bitmap.Config getSuitableBitmapConfig(Bitmap source) {
    Bitmap.Config finalConfig = Bitmap.Config.ARGB_8888;
    final Bitmap.Config sourceConfig = source.getConfig();

    // GIF files generate null configs, assume ARGB_8888
    if (sourceConfig != null) {
      switch (sourceConfig) {
        case RGB_565:
          finalConfig = Bitmap.Config.RGB_565;
          break;
        case ALPHA_8:
          finalConfig = Bitmap.Config.ALPHA_8;
          break;
        case ARGB_4444:
        case ARGB_8888:
        default:
          finalConfig = Bitmap.Config.ARGB_8888;
          break;
      }
    }
    return finalConfig;
  }
613706
public static RoaringBitmap naive_and(Iterator<? extends RoaringBitmap> bitmaps) {
    if (!bitmaps.hasNext()) {
      return new RoaringBitmap();
    }
    RoaringBitmap answer = bitmaps.next().clone();
    while (bitmaps.hasNext()) {
      answer.and(bitmaps.next());
    }
    return answer;
  }