public class PairsTableCalculator extends Object implements FeatureTableCalculator<FeatureInputPairObjects>
Successive pairs are evaluated in five different ways:
listSingle
)
listSingle
)
Due to the predictable pattern, feature-calculations can be cached predictably and appropriately to avoid redundancies.
Two types of caching are applied to avoid redundancy:
Constructor and Description |
---|
PairsTableCalculator(MergedPairsFeatures features) |
PairsTableCalculator(MergedPairsFeatures features,
MergedPairsInclude include,
boolean suppressErrors) |
Modifier and Type | Method and Description |
---|---|
ResultsVector |
calculate(FeatureInputPairObjects input)
Calculate the results of the features with a particular input.
|
ResultsVector |
calculate(FeatureInputPairObjects input,
FeatureList<FeatureInputPairObjects> featuresSubset)
Calculates the results of a subset of the features with a particular input.
|
ResultsVector |
calculateMaybeSuppressErrors(FeatureInputPairObjects input,
ErrorReporter errorReporter) |
ResultsVector |
calculateSuppressErrors(FeatureInputPairObjects input,
ErrorReporter errorReporter)
Calculates the results for an
input recording the error to an ErrorReporter
if anything goes wrong, but throwing no exception. |
FeatureNameList |
createFeatureNames()
Creates A list of names for each feature (columns of the table)
|
FeatureTableCalculator<FeatureInputPairObjects> |
duplicateForNewThread()
Makes a copy of the feature-store for a new thread.
|
int |
sizeFeatures()
The number of features that is calculated on each call to
FeatureCalculatorMulti.calculate(T) , and therefore
the size of the returned ResultsVector . |
void |
start(ImageInitialization initializtion,
Optional<EnergyStack> energyStack,
Logger logger)
Initializes a feature store that has the same structure as that previously created by
createFeatures() from the same object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculate
public PairsTableCalculator(MergedPairsFeatures features)
public PairsTableCalculator(MergedPairsFeatures features, MergedPairsInclude include, boolean suppressErrors)
public void start(ImageInitialization initializtion, Optional<EnergyStack> energyStack, Logger logger) throws InitializeException
FeatureTableCalculator
start
in interface FeatureTableCalculator<FeatureInputPairObjects>
InitializeException
public ResultsVector calculate(FeatureInputPairObjects input) throws NamedFeatureCalculateException
FeatureCalculatorMulti
calculate
in interface FeatureCalculatorMulti<FeatureInputPairObjects>
input
- the input to calculate.NamedFeatureCalculateException
- if any feature cannot be successfully calculated.public ResultsVector calculate(FeatureInputPairObjects input, FeatureList<FeatureInputPairObjects> featuresSubset)
FeatureCalculatorMulti
calculate
in interface FeatureCalculatorMulti<FeatureInputPairObjects>
input
- the input to calculate.featuresSubset
- the subset of features (from those bound to the current instance) to
calculate with.public ResultsVector calculateSuppressErrors(FeatureInputPairObjects input, ErrorReporter errorReporter)
FeatureCalculatorMulti
input
recording the error to an ErrorReporter
if anything goes wrong, but throwing no exception.calculateSuppressErrors
in interface FeatureCalculatorMulti<FeatureInputPairObjects>
input
- the input to calculate.errorReporter
- where errors are recorded.public ResultsVector calculateMaybeSuppressErrors(FeatureInputPairObjects input, ErrorReporter errorReporter) throws NamedFeatureCalculateException
NamedFeatureCalculateException
public FeatureNameList createFeatureNames()
FeatureTableCalculator
createFeatureNames
in interface FeatureTableCalculator<FeatureInputPairObjects>
public int sizeFeatures()
FeatureCalculatorMulti
FeatureCalculatorMulti.calculate(T)
, and therefore
the size of the returned ResultsVector
.sizeFeatures
in interface FeatureCalculatorMulti<FeatureInputPairObjects>
public FeatureTableCalculator<FeatureInputPairObjects> duplicateForNewThread()
FeatureTableCalculator
Deep-copies the features. Shallow-copies everything else.
duplicateForNewThread
in interface FeatureTableCalculator<FeatureInputPairObjects>
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.