Examples of OnDiskUpperTriangleMatrix


Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      if(id.getIntegerID() < 0) {
        throw new AbortException("OnDiskMatrixCache does not allow negative DBIDs.");
      }
    }

    OnDiskUpperTriangleMatrix matrix;
    try {
      matrix = new OnDiskUpperTriangleMatrix(out, DiskCacheBasedFloatDistanceFunction.FLOAT_CACHE_MAGIC, 0, FLOAT_SIZE, matrixsize);
    }
    catch(IOException e) {
      throw new AbortException("Error creating output matrix.", e);
    }

    for(DBID id1 : distanceQuery.getRelation().iterDBIDs()) {
      for(DBID id2 : distanceQuery.getRelation().iterDBIDs()) {
        if(id2.getIntegerID() >= id1.getIntegerID()) {
          float d = distanceQuery.distance(id1, id2).floatValue();
          if(debugExtraCheckSymmetry) {
            float d2 = distanceQuery.distance(id2, id1).floatValue();
            if(Math.abs(d - d2) > 0.0000001) {
              logger.warning("Distance function doesn't appear to be symmetric!");
            }
          }
          try {
            matrix.getRecordBuffer(id1.getIntegerID(), id2.getIntegerID()).putFloat(d);
          }
          catch(IOException e) {
            throw new AbortException("Error writing distance record " + id1 + "," + id2 + " to matrix.", e);
          }
        }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      if(id.getIntegerID() < 0) {
        throw new AbortException("OnDiskMatrixCache does not allow negative DBIDs.");
      }
    }

    OnDiskUpperTriangleMatrix matrix;
    try {
      matrix = new OnDiskUpperTriangleMatrix(out, DiskCacheBasedDoubleDistanceFunction.DOUBLE_CACHE_MAGIC, 0, 8, matrixsize);
    }
    catch(IOException e) {
      throw new AbortException("Error creating output matrix.", e);
    }

    for(DBID id1 : distanceQuery.getRelation().iterDBIDs()) {
      for(DBID id2 : distanceQuery.getRelation().iterDBIDs()) {
        if(id2.getIntegerID() >= id1.getIntegerID()) {
          double d = distanceQuery.distance(id1, id2).doubleValue();
          if(debugExtraCheckSymmetry) {
            double d2 = distanceQuery.distance(id2, id1).doubleValue();
            if(Math.abs(d - d2) > 0.0000001) {
              logger.warning("Distance function doesn't appear to be symmetric!");
            }
          }
          try {
            matrix.getRecordBuffer(id1.getIntegerID(), id2.getIntegerID()).putDouble(d);
          }
          catch(IOException e) {
            throw new AbortException("Error writing distance record " + id1 + "," + id2 + " to matrix.", e);
          }
        }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      super.makeOptions(config);
      final FileParameter param = new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if(config.grab(param)) {
        File matrixfile = param.getValue();
        try {
          cache = new OnDiskUpperTriangleMatrix(matrixfile, DOUBLE_CACHE_MAGIC, 0, DOUBLE_SIZE, false);
        }
        catch(IOException e) {
          config.reportError(new WrongParameterValueException(param, matrixfile.toString(), e));
        }
      }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      super.makeOptions(config);
      final FileParameter param = new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if(config.grab(param)) {
        File matrixfile = param.getValue();
        try {
          cache = new OnDiskUpperTriangleMatrix(matrixfile, FLOAT_CACHE_MAGIC, 0, FLOAT_SIZE, false);
        }
        catch(IOException e) {
          config.reportError(new WrongParameterValueException(param, matrixfile.toString(), e));
        }
      }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      super.makeOptions(config);
      final FileParameter param = new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if(config.grab(param)) {
        File matrixfile = param.getValue();
        try {
          cache = new OnDiskUpperTriangleMatrix(matrixfile, DOUBLE_CACHE_MAGIC, 0, DOUBLE_SIZE, false);
        }
        catch(IOException e) {
          config.reportError(new WrongParameterValueException(param, matrixfile.toString(), e));
        }
      }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      super.makeOptions(config);
      final FileParameter param = new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if(config.grab(param)) {
        File matrixfile = param.getValue();
        try {
          cache = new OnDiskUpperTriangleMatrix(matrixfile, FLOAT_CACHE_MAGIC, 0, FLOAT_SIZE, false);
        }
        catch(IOException e) {
          config.reportError(new WrongParameterValueException(param, matrixfile.toString(), e));
        }
      }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      if(id.getIntegerID() < 0) {
        throw new AbortException("OnDiskMatrixCache does not allow negative DBIDs.");
      }
    }

    OnDiskUpperTriangleMatrix matrix;
    try {
      matrix = new OnDiskUpperTriangleMatrix(out, DiskCacheBasedFloatDistanceFunction.FLOAT_CACHE_MAGIC, 0, FLOAT_SIZE, matrixsize);
    }
    catch(IOException e) {
      throw new AbortException("Error creating output matrix.", e);
    }

    for(DBID id1 : relation.iterDBIDs()) {
      for(DBID id2 : relation.iterDBIDs()) {
        if(id2.getIntegerID() >= id1.getIntegerID()) {
          float d = distanceQuery.distance(id1, id2).floatValue();
          if(debugExtraCheckSymmetry) {
            float d2 = distanceQuery.distance(id2, id1).floatValue();
            if(Math.abs(d - d2) > 0.0000001) {
              logger.warning("Distance function doesn't appear to be symmetric!");
            }
          }
          try {
            matrix.getRecordBuffer(id1.getIntegerID(), id2.getIntegerID()).putFloat(d);
          }
          catch(IOException e) {
            throw new AbortException("Error writing distance record " + id1 + "," + id2 + " to matrix.", e);
          }
        }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.persistent.OnDiskUpperTriangleMatrix

      if(id.getIntegerID() < 0) {
        throw new AbortException("OnDiskMatrixCache does not allow negative DBIDs.");
      }
    }

    OnDiskUpperTriangleMatrix matrix;
    try {
      matrix = new OnDiskUpperTriangleMatrix(out, DiskCacheBasedDoubleDistanceFunction.DOUBLE_CACHE_MAGIC, 0, 8, matrixsize);
    }
    catch(IOException e) {
      throw new AbortException("Error creating output matrix.", e);
    }

    for(DBID id1 : relation.iterDBIDs()) {
      for(DBID id2 : relation.iterDBIDs()) {
        if(id2.getIntegerID() >= id1.getIntegerID()) {
          double d = distanceQuery.distance(id1, id2).doubleValue();
          if(debugExtraCheckSymmetry) {
            double d2 = distanceQuery.distance(id2, id1).doubleValue();
            if(Math.abs(d - d2) > 0.0000001) {
              logger.warning("Distance function doesn't appear to be symmetric!");
            }
          }
          try {
            matrix.getRecordBuffer(id1.getIntegerID(), id2.getIntegerID()).putDouble(d);
          }
          catch(IOException e) {
            throw new AbortException("Error writing distance record " + id1 + "," + id2 + " to matrix.", e);
          }
        }
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.