Gaia
|
Public Member Functions | |
void | load (const QString &datasetName, const QString &filename, int start=0, int offset=-1) |
Load a dataset into memory and use the given name as identifier. More... | |
void | loadNthPart (const QString &datasetName, const QString &filename, int idx, int total) |
Load the n-th part of a dataset. | |
void | unload (const QString &datasetName) |
Unload a dataset from memory, and frees the associated memory. More... | |
QStringList | datasetNames () const |
Return the list of datasets currently loaded in memory. | |
QString | layout (const QString &datasetName) const |
Return the layout of the specified dataset. More... | |
int | size (const QString &datasetName) const |
Return the size (number of points) of the specified dataset. More... | |
void | setReferenceDataSet (const QString &dataset, const QString &referenceDataset) |
Set the second dataset as a reference for the first one. More... | |
void | createDistance (const QString &distanceName, const QString &datasetName, const QString &distance, const gaia2::ParameterMap ¶ms=gaia2::ParameterMap()) |
Create a distance to be used for nn-queries. More... | |
void | deleteDistance (const QString &distanceName) |
Delete the distance identified by the given name. More... | |
QStringList | distanceNames () const |
Return a list of distances currently created in memory. | |
void | indexOn (const QString &datasetName, const QString &descriptorName) |
Indexes a dataset/view on the given descriptor name. | |
CyclopsResults | chainedSearch (const gaia2::yaml::Sequence &queries, const gaia2::yaml::Sequence &header, int numberResults, int offset=0) |
Perform a chain of searches, where each result of a query is used as inputSpace for the next one. More... | |
gaia2::SearchResults | nnSearchById (const QString &queryID, const QString &datasetName, const QString &distanceName, int numberResults, int offset=0) |
Perform a query-by-id on the given ID. More... | |
gaia2::SearchResults | nnSearchByIdWithFilter (const QString &queryID, const QString &datasetName, const QString &distanceName, const QString &filter, int numberResults, int offset=0) |
Perform a query-by-id on the given ID and using a filter. More... | |
gaia2::SearchResults | nnSearchByExample (const gaia2::Point &query, const QString &datasetName, const QString &distanceName, int numberResults, int offset=0) |
gaia2::SearchResults | nnSearchByExampleWithFilter (const gaia2::Point &query, const QString &datasetName, const QString &distanceName, const QString &filter, int numberResults, int offset=0) |
const gaia2::Point * | getPoint (const QString &datasetName, const QString &pointName) const |
Get the point with the given ID from the specified dataset. | |
std::string | getPoints (const QString &datasetName, const QStringList &pointNames, bool failOnError=true) const |
Get the list of points with the given IDs from the specified dataset as the base64 representation of a new DataSet containing them. | |
void | setup (const QString &filename) |
Read the yaml config file and sets up the specified datasets and distances. | |
void | setupFromYaml (const gaia2::yaml::Mapping &config) |
Protected Member Functions | |
gaia2::ResultSet | nnSearch (const QString &methodName, const gaia2::yaml::Sequence &args, const gaia2::ResultSet *inputSpace=0) |
Protected Attributes | |
QMap< QString, gaia2::DataSet * > | _datasets |
QMap< QString, gaia2::View * > | _views |
QMap< QString, gaia2::DistanceFunction * > | _dfuncs |
CyclopsResults Cyclops::chainedSearch | ( | const gaia2::yaml::Sequence & | queries, |
const gaia2::yaml::Sequence & | header, | ||
int | numberResults, | ||
int | offset = 0 |
||
) |
Perform a chain of searches, where each result of a query is used as inputSpace for the next one.
WARNING: you should not be calling this method directly, rather use the facilities provided by the python client which will make all this machinery transparent and have everything work the same as if using directly the standard python bindings.
References gaia2::Point::fromBase64(), gaia2::BaseResultSet< SearchPointType, DataSetType >::get(), gaia2::DataSet::point(), gaia2::DataSet::referenceDataSet(), and gaia2::BaseResultSet< SearchPointType, DataSetType >::thresholdLimit().
void Cyclops::createDistance | ( | const QString & | distanceName, |
const QString & | datasetName, | ||
const QString & | distance, | ||
const gaia2::ParameterMap & | params = gaia2::ParameterMap() |
||
) |
Create a distance to be used for nn-queries.
If there was already a distance with the same name, it will be overwritten.
distanceName | the identifier to be used for this distance |
datasetName | the dataset on which this distance will operate |
distance | the name of the distance to create (its ID in the factory) |
params | the parameters used to create the distance |
References gaia2::DataSet::layout().
void Cyclops::deleteDistance | ( | const QString & | distanceName | ) |
Delete the distance identified by the given name.
distanceName | the distance identifier |
QString Cyclops::layout | ( | const QString & | datasetName | ) | const |
Return the layout of the specified dataset.
datasetName | the dataset identifier |
void Cyclops::load | ( | const QString & | datasetName, |
const QString & | filename, | ||
int | start = 0 , |
||
int | offset = -1 |
||
) |
Load a dataset into memory and use the given name as identifier.
If there was already a dataset with the same name, it will be overwritten.
datasetName | the identifier to be used for the loaded dataset |
filename | the filename where the dataset is stored |
References gaia2::DataSet::load().
SearchResults Cyclops::nnSearchById | ( | const QString & | queryID, |
const QString & | datasetName, | ||
const QString & | distanceName, | ||
int | numberResults, | ||
int | offset = 0 |
||
) |
Perform a query-by-id on the given ID.
queryID | the ID of the point to query |
datasetName | the identifier of the dataset in which to perform the query |
distanceName | the identifier of the distance to be used for the query |
numberResults | the number of results to be returned |
offset | the offset in the list of results |
References gaia2::BaseResultSet< SearchPointType, DataSetType >::get().
SearchResults Cyclops::nnSearchByIdWithFilter | ( | const QString & | queryID, |
const QString & | datasetName, | ||
const QString & | distanceName, | ||
const QString & | filter, | ||
int | numberResults, | ||
int | offset = 0 |
||
) |
Perform a query-by-id on the given ID and using a filter.
queryID | the ID of the point to query |
datasetName | the identifier of the dataset in which to perform the query |
distanceName | the identifier of the distance to be used for the query |
filter | a string representing the filter to be used |
numberResults | the number of results to be returned |
offset | the offset in the list of results |
References gaia2::BaseResultSet< SearchPointType, DataSetType >::get().
void Cyclops::setReferenceDataSet | ( | const QString & | dataset, |
const QString & | referenceDataset | ||
) |
Set the second dataset as a reference for the first one.
dataset | the dataset for which you want to set a reference |
referenceDataset | the dataset which will serve as reference for the other one |
int Cyclops::size | ( | const QString & | datasetName | ) | const |
Return the size (number of points) of the specified dataset.
datasetName | the dataset identifier |
Referenced by CyclopsMaster::sendReplyToClient().
void Cyclops::unload | ( | const QString & | datasetName | ) |
Unload a dataset from memory, and frees the associated memory.
datasetName | the dataset identifier |