public class ApproxKNNQueryOperation extends KNNQueryOperation implements Approximate
QueryOperation.DataEqualOperation
AbstractOperation.OperationConstructor, AbstractOperation.OperationName
Approximate.LocalSearchType
Modifier and Type | Field and Description |
---|---|
protected int |
localSearchParam
Value of the local approximation parameter.
|
protected Approximate.LocalSearchType |
localSearchType
Type of the local approximation parameter used.
|
protected float |
radiusGuaranteed
Radius for which the answer is guaranteed as correct.
|
k
suppData, uuidOperationComparator
Constructor and Description |
---|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k)
Creates a new instance of ApproxkNNQueryOperation for a given query object and maximal number of objects to return.
|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k,
AnswerType answerType)
Creates a new instance of ApproxkNNQueryOperation for a given query object and maximal number of objects to return.
|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k,
AnswerType answerType,
int localSearchParam,
Approximate.LocalSearchType localSearchType,
float radiusGuaranteed)
Creates a new instance of ApproxKNNQueryOperation for a given query object,
maximal number of objects to return and parameters that control the approximation.
|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k,
boolean storeMetaDistances,
AnswerType answerType,
int localSearchParam,
Approximate.LocalSearchType localSearchType,
float radiusGuaranteed)
Creates a new instance of ApproxKNNQueryOperation for a given query object,
maximal number of objects to return and parameters that control the approximation.
|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k,
boolean storeMetaDistances,
AnswerType answerType,
int localSearchParam,
Approximate.LocalSearchType localSearchType,
float radiusGuaranteed,
RankedSortedCollection answerCollection)
Creates a new instance of ApproxKNNQueryOperation for a given query object,
maximal number of objects to return and parameters that control the approximation.
|
ApproxKNNQueryOperation(LocalAbstractObject queryObject,
int k,
int localSearchParam,
Approximate.LocalSearchType localSearchType,
float radiusGuaranteed)
Creates a new instance of ApproxKNNQueryOperation for a given query object,
maximal number of objects to return and parameters that control the approximation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getArgument(int index)
Returns argument that was passed while constructing instance.
|
int |
getArgumentCount()
Returns number of arguments of this operation: it is five (query, k, localSearchParam, localSearchType, radiusGuaranteed)
|
int |
getLocalSearchParam()
Returns the value of the local approximation parameter.
|
Approximate.LocalSearchType |
getLocalSearchType()
Returns the
type of the local approximation parameter used. |
float |
getRadiusGuaranteed()
Returns a currently set value of radius within which the results are guaranteed as correct.
|
void |
setLocalSearchParam(int localSearchParam)
Setter for the local search parameter value.
|
void |
setLocalSearchType(Approximate.LocalSearchType localSearchType)
Setter for the type of the local search parameter.
|
void |
setRadiusGuaranteed(float radiusGuaranteed)
Set a different value of radius within which the results are guaranteed as correct.
|
protected void |
updateFrom(ApproxKNNQueryOperation operation)
Updates the guaranteed radius from another approximate kNN query.
|
protected void |
updateFrom(RankingQueryOperation operation)
Update query answer data of this operation from another query operation.
|
dataEqualsImpl, dataHashCode, evaluate, getK
addToAnswer, addToAnswer, clearSurplusData, clone, createOperation, getQueryObject, isStoringMetaDistances
addToAnswer, endOperation, getAnswer, getAnswer, getAnswerClass, getAnswerCollectionClass, getAnswerCollectionClone, getAnswerComparator, getAnswerCount, getAnswerDistance, getAnswerDistanceRestricted, getAnswerDistanceRestricted, getAnswerMaximalCapacity, getAnswerObjects, getAnswerThreshold, getLastAnswer, getSubAnswer, getSubAnswer, getSubAnswerCount, isAnswerFull, resetAnswer, setAnswerCollection, setAnswerIgnoringDuplicates, setAnswerThresholdComputation, setAnswerThresholdComputation, updateFrom
appendErrorCode, clone, dataEquals, endOperation, getAllSubAnswers, getAnswerType, getQueryAnswer, iterator, setAnswerType, wasSuccessful
appendArguments, containsParameter, createOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getArgumentString, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, getParameter, getParameter, getParameter, getParameterCount, getParameterMap, getParameterNames, getRequiredParameter, getRequiredParameter, hashCode, isErrorCode, isFinished, removeParameter, setParameter, toString
protected Approximate.LocalSearchType localSearchType
protected int localSearchParam
localSearchType
.protected float radiusGuaranteed
public ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k)
AnswerType.NODATA_OBJECTS
will be returned in the result.queryObject
- query objectk
- number of objects to be returnedpublic ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k, AnswerType answerType)
queryObject
- the object to which the nearest neighbors are searchedk
- the number of nearest neighbors to retrieveanswerType
- the type of objects this operation stores in its answerpublic ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k, int localSearchParam, Approximate.LocalSearchType localSearchType, float radiusGuaranteed)
queryObject
- query objectk
- number of objects to be returnedlocalSearchParam
- local search parameter - typically approximation parameterlocalSearchType
- type of the local search parameterradiusGuaranteed
- radius within which the answer is required to be guaranteed as correctpublic ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k, AnswerType answerType, int localSearchParam, Approximate.LocalSearchType localSearchType, float radiusGuaranteed)
queryObject
- query objectk
- number of objects to be returnedanswerType
- the type of objects this operation stores in its answerlocalSearchParam
- local search parameter - typically approximation parameterlocalSearchType
- type of the local search parameterradiusGuaranteed
- radius within which the answer is required to be guaranteed as correctpublic ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k, boolean storeMetaDistances, AnswerType answerType, int localSearchParam, Approximate.LocalSearchType localSearchType, float radiusGuaranteed)
queryObject
- query objectk
- number of objects to be returnedstoreMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answeranswerType
- the type of objects this operation stores in its answerlocalSearchParam
- local search parameter - typically approximation parameterlocalSearchType
- type of the local search parameterradiusGuaranteed
- radius within which the answer is required to be guaranteed as correctpublic ApproxKNNQueryOperation(LocalAbstractObject queryObject, int k, boolean storeMetaDistances, AnswerType answerType, int localSearchParam, Approximate.LocalSearchType localSearchType, float radiusGuaranteed, RankedSortedCollection answerCollection)
queryObject
- query objectk
- number of objects to be returnedstoreMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answeranswerType
- the type of objects this operation stores in its answerlocalSearchParam
- local search parameter - typically approximation parameterlocalSearchType
- type of the local search parameterradiusGuaranteed
- radius within which the answer is required to be guaranteed as correctanswerCollection
- collection to be used as answer (it must be empty, otherwise it will be cleared)public int getArgumentCount()
getArgumentCount
in class KNNQueryOperation
public java.lang.Object getArgument(int index) throws java.lang.IndexOutOfBoundsException
getArgument
in class KNNQueryOperation
index
- index of an argument passed to constructorjava.lang.IndexOutOfBoundsException
- if index parameter is out of rangepublic Approximate.LocalSearchType getLocalSearchType()
Approximate
type of the local approximation
parameter used.getLocalSearchType
in interface Approximate
type of the local approximation
parameter usedpublic void setLocalSearchParam(int localSearchParam)
Approximate
local search type
.setLocalSearchParam
in interface Approximate
localSearchParam
- new value for the local search parameterpublic void setLocalSearchType(Approximate.LocalSearchType localSearchType)
Approximate
setLocalSearchType
in interface Approximate
localSearchType
- new type of the local search parameterpublic int getLocalSearchParam()
Approximate
local search type
.getLocalSearchParam
in interface Approximate
public void setRadiusGuaranteed(float radiusGuaranteed)
Approximate
setRadiusGuaranteed
in interface Approximate
radiusGuaranteed
- new guaranteed radius valuepublic float getRadiusGuaranteed()
Approximate
getRadiusGuaranteed
in interface Approximate
protected void updateFrom(RankingQueryOperation operation)
operation
is approximate kNN query, the
radius guaranteed is also updated.updateFrom
in class RankingQueryOperation
operation
- the operation to update answer fromprotected void updateFrom(ApproxKNNQueryOperation operation)
operation
- the operation to update answer from