Package de.lmu.ifi.dbs.elki.utilities.exceptions

Examples of de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException


    super();
    try {
      loadCache(parser, matrixfile);
    }
    catch(IOException e) {
      throw new AbortException("Could not load external distance file: " + matrixfile.toString(), e);
    }
  }
View Full Code Here


    }
    if(id2 == null) {
      return getDistanceFactory().undefinedDistance();
    }
    if(id1.getIntegerID() < 0 || id2.getIntegerID() < 0) {
      throw new AbortException("Negative DBIDs not supported in OnDiskCache");
    }
    // the smaller id is the first key
    if(id1.getIntegerID() > id2.getIntegerID()) {
      return distance(id2, id1);
    }
View Full Code Here

  protected void preprocess() {
    DistanceQuery<O, D> distanceQuery = relation.getDatabase().getDistanceQuery(relation, distanceFunction);

    Collection<SpatialIndexTree<N, E>> indexes = ResultUtil.filterResults(relation, SpatialIndexTree.class);
    if(indexes.size() != 1) {
      throw new AbortException(SpatialApproximationMaterializeKNNPreprocessor.class.getSimpleName() + " found " + indexes.size() + " spatial indexes, expected exactly one.");
    }
    SpatialIndexTree<N, E> index = indexes.iterator().next();

    storage = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_STATIC, List.class);
    MeanVariance pagesize = new MeanVariance();
View Full Code Here

   * Process a single object during initialization.
   *
   * @param obj Object to process
   */
  protected void prepareProcessInstance(I obj) {
    throw new AbortException("ProcessInstance not implemented, but prepareStart true?");
  }
View Full Code Here

    BufferedImage maski = null;
    if(mask != null) {
      maski = ImageUtil.loadImage(mask);
      if(maski.getHeight() != height || maski.getWidth() != width) {
        throw new AbortException("Input image and mask do not agree on the image size!");
      }
    }

    double[] bins = new double[getNumBins()];
    long valid = 0;

    for(int x = 0; x < width; x++) {
      for(int y = 0; y < height; y++) {
        if(maski != null) {
          int col = maski.getRGB(x, y);
          // More transparent than covering
          if((col >>> 24) < 127) {
            continue;
          }
          // More black than white: (R+G+B) > 1.5 * 255
          if(((col >>> 16) & 0xFF) + ((col >>> 8) & 0xFF) + (col & 0xFF) < 382) {
            continue;
          }
        }
        int bin = getBinForColor(image.getRGB(x, y));
        assert (bin < bins.length);
        bins[bin] += 1;
        valid += 1;
      }
    }
    if (valid == 0) {
      throw new AbortException("Mask apparently was all-black.");
    }
    for(int i = 0; i < bins.length; i++) {
      bins[i] /= valid;
    }
    return bins;
View Full Code Here

          try {
            ClassLabel lbl = classLabelFactory.makeFromString(ll.remove(classLabelIndex));
            clscol.add(lbl);
          }
          catch(Exception e) {
            throw new AbortException("Cannot initialize class labels: "+e.getMessage(), e);
          }
          lblcol.add(ll);
          if(ll.size() > 0) {
            keeplabelcol = true;
          }
View Full Code Here

          }
          else if(pair.length == 2) {
            LoggingConfiguration.setLevelFor(pair[0], pair[1]);
          }
          else {
            throw new AbortException("Invalid logging settings");
          }
        }
        catch(IllegalArgumentException e) {
          logger.warning("Invalid logging statement for package " + pair[0] + ": " + e.getMessage());
        }
View Full Code Here

   * Process a single object during initialization.
   *
   * @param obj Object to process
   */
  protected void prepareProcessInstance(I obj) {
    throw new AbortException("ProcessInstance not implemented, but prepareStart true?");
  }
View Full Code Here

    super();
    try {
      loadCache(parser, matrixfile);
    }
    catch(IOException e) {
      throw new AbortException("Could not load external distance file: " + matrixfile.toString(), e);
    }
  }
View Full Code Here

    }
    if(id2 == null) {
      return getDistanceFactory().undefinedDistance();
    }
    if(id1.getIntegerID() < 0 || id2.getIntegerID() < 0) {
      throw new AbortException("Negative DBIDs not supported in OnDiskCache");
    }
    // the smaller id is the first key
    if(id1.getIntegerID() > id2.getIntegerID()) {
      return distance(id2, id1);
    }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException

Copyright © 2018 www.massapicom. 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.