OEFPDatabaseOptions¶
class OEFPDatabaseOptions
The OEFPDatabaseOptions class allows setting options on a per-search basis. This class is used to control the behavior of:
the following methods of the OEFPDatabase class
the following methods of the OEFastFPDatabase class
See also
Example code in Similarity calculation with an option class section
Example code in Sorted similarity calculation with an option class section
Example code in Searching fast fingerprint database section
The OEFPDatabaseOptions class stores the following properties:
Property |
Get method |
Set method |
Corresponding namespace / type |
---|---|---|---|
cutoff value |
floating point number |
||
order of sorting |
boolean |
||
max number of scores |
integer |
||
similarity method |
|||
\(\alpha\) and \(\beta\) for |
floating point number |
||
numper of processors |
integer |
Constructors¶
OEFPDatabaseOptions()
Default constructor.
Property |
Default value |
---|---|
cutoff value |
no cutoff set |
order of sorting |
true (means descending order) |
max number of scores |
0 (means no limit) |
similarity method |
|
\(\alpha\) and \(\beta\) for |
\(\alpha = 0.95, \beta = 0.05\) |
number of processors |
1 |
OEFPDatabaseOptions(const unsigned limit,
const unsigned simfunc=OESimMeasure::Tanimoto)
Constructs an OEFPDatabaseOptions object with
a limit on the number of similarity scores returned and a similarity
method from the OESimMeasure
namespace.
The returned scores will be in descending order and applying no
cutoff value.
OEFPDatabaseOptions(const OEFPDatabaseOptions &rhs)
Copy constructors.
ClearCutoff¶
void ClearCutoff()
Removes the cutoff value previously set by the
OEFPDatabaseOptions::SetCutoff
method.
After clearing the cutoff value, OEFPDatabaseOptions::HasCutoff
method will return false
.
See also
GetCutoff¶
float GetCutoff() const
Returns the cutoff value previously set by the
OEFPDatabase::SetCutoff
method.
See also
GetDescendingOrder¶
bool GetDescendingOrder() const
Returns whether the similarity scores will be returned in descending or in ascending order.
See also
GetLimit¶
unsigned GetLimit() const
Returns the maximum number of similarity scores returned.
See also
GetSimFunc¶
unsigned GetSimFunc() const
Returns the similarity measure used to evaluate fingerprint
similarities.
The return value is taken from the OESimMeasure
namespace.
See also
GetNumProcessors¶
unsigned GetNumProcessors()
Returns the number of threads that are used to search
fingerprints when calling the
OEFastFPDatabase::SortedSearch
method.
See also
GetTverskyAlpha¶
float GetTverskyAlpha() const
Returns the \(\alpha\) parameter of the
Tversky
similarity.
See also
OETverskySim class
GetTverskyBeta¶
float GetTverskyBeta() const
Returns the \(\beta\) parameter of the
Tversky
similarity.
See also
OETverskySim class
HasCutoff¶
bool HasCutoff() const
Returns whether the cutoff value of the OEFPDatabaseOptions
object has been set by the OEFPDatabaseOptions::SetCutoff
method.
See also
SetCutoff¶
void SetCutoff(const float cutoff)
Sets the cutoff value of the OEFPDatabaseOptions object.
See also
SetDescendingOrder¶
void SetDescendingOrder(const bool descending=true)
Sets whether the similarity scores will be returned in descending or in ascending order.
Note
This method has no effect on the
OEFPDatabase::GetScores
method.
See also
SetLimit¶
void SetLimit(const unsigned limit)
Sets the maximum number of similarity scores returned.
- limit
If it is set to zero, then all similarity scores are returned.
Note
This method has no effect on the
OEFPDatabase::GetScores
method.
See also
SetSimFunc¶
void SetSimFunc(const unsigned simtype)
Sets the similarity measure used to evaluate fingerprint similarities.
- simtype
This value has to be from the
OESimMeasure
namespace.
See also
SetNumProcessors¶
void SetNumProcessors(const unsigned nrps)
Sets the number of threads that are used to search
fingerprints when calling the
OEFastFPDatabase::SortedSearch
method.
When set to 0
, the number of processors used will be the number
returned by the OEGetNumProcessors
function.
Multi-threaded fingerprint search is currently only available in
OEFastFPDatabaseMemoryType::MemoryMapped
and
OEFastFPDatabaseMemoryType::InMemory
modes.
SetTverskyCoeffs¶
void SetTverskyCoeffs(const float alpha=0.95f, const float beta=0.05f)
Sets \(\alpha\) and \(\beta\) parameters for the
Tversky
similarity.
See also
OETverskySim class