Package adams.data.statistics
Class ArrayMinkowskiDistance
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.statistics.AbstractArrayStatistic<T>
-
- adams.data.statistics.AbstractArrayDistance
-
- adams.data.statistics.ArrayMinkowskiDistance
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter
,SizeOfHandler
,EqualLengthArrayStatistic
,Serializable
public class ArrayMinkowskiDistance extends AbstractArrayDistance
Calculates the Minkowski distance between the first array and the remaining arrays. The arrays must be numeric, of course.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-exponent <double> (property: exponent) The exponent 'p' to use for 'sum(|x-y|^p)^(1/p)'. default: 2.0
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.statistics.AbstractArrayStatistic
AbstractArrayStatistic.StatisticContainer<T extends Serializable>
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Exponent
the exponent p.-
Fields inherited from class adams.data.statistics.AbstractArrayStatistic
m_Data
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ArrayMinkowskiDistance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
calcDistance(double[] first, double[] second)
Calculates the distance between the two arrays.protected String
createCellHeader()
Creates the cell header prefix to use.void
defineOptions()
Adds options to the internal list of options.String
exponentTipText()
Returns the tip text for this property.protected String
getDistanceName()
Returns the name of the distance.double
getExponent()
Returns the exponent p.void
setExponent(double value)
Sets the exponent p.-
Methods inherited from class adams.data.statistics.AbstractArrayDistance
doCalculate, getLength, getMax, getMin, globalInfo
-
Methods inherited from class adams.data.statistics.AbstractArrayStatistic
add, calculate, check, checkEqualLength, clear, forCommandLine, forName, get, getAdditionalInformation, getStatistics, initialize, remove, set, shallowCopy, shallowCopy, size, toString
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
getDistanceName
protected String getDistanceName()
Returns the name of the distance.- Specified by:
getDistanceName
in classAbstractArrayDistance
- Returns:
- the name
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setExponent
public void setExponent(double value)
Sets the exponent p.- Parameters:
value
- the exponent
-
getExponent
public double getExponent()
Returns the exponent p.- Returns:
- the exponent
-
exponentTipText
public String exponentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
createCellHeader
protected String createCellHeader()
Creates the cell header prefix to use.- Overrides:
createCellHeader
in classAbstractArrayDistance
- Returns:
- the prefix
-
calcDistance
protected double calcDistance(double[] first, double[] second)
Calculates the distance between the two arrays.- Specified by:
calcDistance
in classAbstractArrayDistance
- Parameters:
first
- the first arraysecond
- the second array- Returns:
- the distance
-
-