Examples of TreeSetModifiableDBIDs


Examples of de.lmu.ifi.dbs.elki.database.ids.TreeSetModifiableDBIDs

   * @param ids the ids of deleted objects causing a change of materialized kNNs
   * @return the RkNNs of the specified ids, i.e. the kNNs which have been
   *         updated
   */
  private ArrayDBIDs updateKNNsAfterDeletion(DBIDs ids) {
    TreeSetModifiableDBIDs idsSet = DBIDUtil.newTreeSet(ids);
    ArrayDBIDs rkNN_ids = DBIDUtil.newArray();
    for(DBID id1 : relation.iterDBIDs()) {
      List<DistanceResultPair<D>> kNNs = storage.get(id1);
      for(DistanceResultPair<D> kNN : kNNs) {
        if(idsSet.contains(kNN.getDBID())) {
          rkNN_ids.add(id1);
          break;
        }
      }
    }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.database.ids.TreeSetModifiableDBIDs

   * @param extraxt a list of lists of DistanceResultPair to extract
   * @param remove the ids to remove
   * @return the DBIDs in the given collection
   */
  protected ArrayDBIDs extractAndRemoveIDs(List<List<DistanceResultPair<D>>> extraxt, ArrayDBIDs remove) {
    TreeSetModifiableDBIDs ids = DBIDUtil.newTreeSet();
    for(List<DistanceResultPair<D>> drps : extraxt) {
      for(DistanceResultPair<D> drp : drps) {
        ids.add(drp.getDBID());
      }
    }
    ids.removeAll(remove);
    return DBIDUtil.ensureArray(ids);

  }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.database.ids.TreeSetModifiableDBIDs

    storage = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, SetDBIDs.class);
    KNNQuery<O, D> knnquery = QueryUtil.getKNNQuery(relation, distanceFunction, numberOfNeighbors);

    FiniteProgress progress = getLogger().isVerbose() ? new FiniteProgress("assigning nearest neighbor lists", relation.size(), getLogger()) : null;
    for(DBID id : relation.iterDBIDs()) {
      TreeSetModifiableDBIDs neighbors = DBIDUtil.newTreeSet(numberOfNeighbors);
      List<DistanceResultPair<D>> kNN = knnquery.getKNNForDBID(id, numberOfNeighbors);
      for(int i = 0; i < kNN.size(); i++) {
        final DBID nid = kNN.get(i).getDBID();
        // if(!id.equals(nid)) {
        neighbors.add(nid);
        // }
        // Size limitation to exaclty numberOfNeighbors
        if(neighbors.size() >= numberOfNeighbors) {
          break;
        }
      }
      storage.put(id, neighbors);
      if(progress != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.