@Override
    public void set(int index, float value) {
        if (value > 0) {
            int bucket = bucket(index);
            if (bucket >= data.length) {
                long[] temp = new long[bucket+1];
                System.arraycopy(data, 0, temp, 0, data.length);
                data = temp;
            }
            data[bucket] |= (1L << (index % 64));
        }
        if (index >= length) {
            length = index+1;
        }
    }