Gaia
Cyclops Class Reference
Inheritance diagram for Cyclops:

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 &params=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::PointgetPoint (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
 

Member Function Documentation

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.

Parameters
distanceNamethe identifier to be used for this distance
datasetNamethe dataset on which this distance will operate
distancethe name of the distance to create (its ID in the factory)
paramsthe parameters used to create the distance

References gaia2::DataSet::layout().

void Cyclops::deleteDistance ( const QString &  distanceName)

Delete the distance identified by the given name.

Parameters
distanceNamethe distance identifier
QString Cyclops::layout ( const QString &  datasetName) const

Return the layout of the specified dataset.

Parameters
datasetNamethe 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.

Parameters
datasetNamethe identifier to be used for the loaded dataset
filenamethe 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.

Parameters
queryIDthe ID of the point to query
datasetNamethe identifier of the dataset in which to perform the query
distanceNamethe identifier of the distance to be used for the query
numberResultsthe number of results to be returned
offsetthe 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.

Parameters
queryIDthe ID of the point to query
datasetNamethe identifier of the dataset in which to perform the query
distanceNamethe identifier of the distance to be used for the query
filtera string representing the filter to be used
numberResultsthe number of results to be returned
offsetthe 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.

Parameters
datasetthe dataset for which you want to set a reference
referenceDatasetthe 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.

Parameters
datasetNamethe dataset identifier

Referenced by CyclopsMaster::sendReplyToClient().

void Cyclops::unload ( const QString &  datasetName)

Unload a dataset from memory, and frees the associated memory.

Parameters
datasetNamethe dataset identifier

The documentation for this class was generated from the following files: