marf.Classification.Distance
Class MinkowskiDistance

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Classification.Classification
          extended by marf.Classification.Distance.Distance
              extended by marf.Classification.Distance.MinkowskiDistance
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IClassification, IStorageManager

public class MinkowskiDistance
extends Distance

Class MinkowskiDistance.

$Id: MinkowskiDistance.java,v 1.12 2007/12/31 00:17:04 mokhov Exp $

Since:
0.2.0
Version:
$Revision: 1.12 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
private  double r
          Minkowski Factor.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class marf.Classification.Classification
adFeatureVector, oFeatureExtraction, oResultSet, oTrainingSet
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Classification.IClassification
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
MinkowskiDistance(IFeatureExtraction poFeatureExtraction)
          MinkowskiDistance Constructor.
 
Method Summary
 double distance(double[] paVector1, double[] paVector2)
          Minkowski Distance implementation.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 
Methods inherited from class marf.Classification.Distance.Distance
classify, getResult
 
Methods inherited from class marf.Classification.Classification
classify, clone, dump, getFeatureExtraction, getResultSet, getTrainingSetFilename, loadTrainingSet, restore, setFeatureExtraction, train, train
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values

r

private double r
Minkowski Factor. Default is 3; r = 1 is Chebyshev distance, r = 2 is Euclidean distance.

Constructor Detail

MinkowskiDistance

public MinkowskiDistance(IFeatureExtraction poFeatureExtraction)
MinkowskiDistance Constructor.

Parameters:
poFeatureExtraction - FeatureExtraction module reference
Method Detail

distance

public final double distance(double[] paVector1,
                             double[] paVector2)
Minkowski Distance implementation.

Specified by:
distance in class Distance
Parameters:
paVector1 - first vector to compare
paVector2 - second vector to compare
Returns:
Minkowski distance between two feature vectors

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string
Since:
0.3.0.2


SourceForge Logo