Search in sources :

Example 1 with HashSetDBIDs

use of de.lmu.ifi.dbs.elki.database.ids.HashSetDBIDs in project elki by elki-project.

the class Eclat method mergeJoin.

private DBIDs mergeJoin(DBIDs first, DBIDs second) {
    assert (!(first instanceof HashSetDBIDs));
    assert (!(second instanceof HashSetDBIDs));
    ArrayModifiableDBIDs ids = DBIDUtil.newArray();
    DBIDIter i1 = first.iter(), i2 = second.iter();
    while (i1.valid() && i2.valid()) {
        int c = DBIDUtil.compare(i1, i2);
        if (c < 0) {
            i1.advance();
        } else if (c > 0) {
            i2.advance();
        } else {
            ids.add(i1);
            i1.advance();
            i2.advance();
        }
    }
    return ids;
}
Also used : ArrayModifiableDBIDs(de.lmu.ifi.dbs.elki.database.ids.ArrayModifiableDBIDs) HashSetDBIDs(de.lmu.ifi.dbs.elki.database.ids.HashSetDBIDs) DBIDIter(de.lmu.ifi.dbs.elki.database.ids.DBIDIter)

Aggregations

ArrayModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ArrayModifiableDBIDs)1 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)1 HashSetDBIDs (de.lmu.ifi.dbs.elki.database.ids.HashSetDBIDs)1