Package elki.application.cache
Class PrecomputeDistancesAsciiApplication<O>
- java.lang.Object
-
- elki.application.AbstractApplication
-
- elki.application.cache.PrecomputeDistancesAsciiApplication<O>
-
- Type Parameters:
O- Object type
public class PrecomputeDistancesAsciiApplication<O> extends AbstractApplication
Application to precompute pairwise distances into an ascii file.IDs in the output file will always begin at 0.
The result can then be used with the DoubleDistanceParse.
Symmetry is assumed.
- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrecomputeDistancesAsciiApplication.Par<O>Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description private DatabasedatabaseData source to process.private booleandebugExtraCheckSymmetryDebug flag, to double-check all write operations.private Distance<? super O>distanceDistance function that is to be cached.static java.lang.StringGZIP_POSTFIXGzip file name postfix.private static LoggingLOGThe logger for this class.private java.nio.file.PathoutOutput file.-
Fields inherited from class elki.application.AbstractApplication
REFERENCE, VERSION
-
-
Constructor Summary
Constructors Constructor Description PrecomputeDistancesAsciiApplication(Database database, Distance<? super O> distance, java.nio.file.Path out)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Main method, delegate to super class.private static java.io.PrintStreamopenStream(java.nio.file.Path out)Open the output stream, using gzip if necessary.voidrun()Runs the application.-
Methods inherited from class elki.application.AbstractApplication
printErrorMessage, runCLIApplication, usage
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The logger for this class.
-
GZIP_POSTFIX
public static final java.lang.String GZIP_POSTFIX
Gzip file name postfix.- See Also:
- Constant Field Values
-
debugExtraCheckSymmetry
private boolean debugExtraCheckSymmetry
Debug flag, to double-check all write operations.
-
database
private Database database
Data source to process.
-
out
private java.nio.file.Path out
Output file.
-
-
Method Detail
-
run
public void run()
Description copied from class:AbstractApplicationRuns the application.- Specified by:
runin classAbstractApplication
-
openStream
private static java.io.PrintStream openStream(java.nio.file.Path out) throws java.io.IOExceptionOpen the output stream, using gzip if necessary.- Parameters:
out- Output file name.- Returns:
- Output stream
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args)
Main method, delegate to super class.- Parameters:
args- Command line arguments
-
-