25 #include "pointlayout.h" 40 return name.join(QString(NAME_SEPARATOR));
46 inline QStringList
splitName(
const QString& name,
bool includeRootNode =
false) {
47 if (includeRootNode)
return name.split(NAME_SEPARATOR);
48 return name.split(NAME_SEPARATOR, QString::SkipEmptyParts);
69 bool checkOriginalLayout =
true);
79 const QStringList& select = QStringList(
"*"),
80 const QStringList& exclude = QStringList(),
81 bool failOnUnmatched =
true);
84 typedef QList<QPair<Segment, Segment> > IndexMap;
91 const Region& region, IndexMap& realMap,
92 IndexMap& stringMap, IndexMap& enumMap);
99 const IndexMap& realMap,
const IndexMap& stringMap,
100 const IndexMap& enumMap);
108 const IndexMap& realMap,
const IndexMap& stringMap,
109 const IndexMap& enumMap);
151 const QMap<int, QString>& dnames);
157 QList<QPair<double, QString> >
dimensionBoost(
const Eigen::MatrixXf& featureVector,
189 enum BinaryFileFormat {
212 #endif // GAIA_UTILS_H void transferPointData(const Point *p, Point *result, const IndexMap &realMap, const IndexMap &stringMap, const IndexMap &enumMap)
Given a set of mappings, transfers the data from a Point to a new one.
Definition: utils.cpp:207
Definition: descriptor.h:39
A region is a physical location in the point layout which consists in a list of segments.
Definition: region.h:125
QString formatDimensionParticipation(const QList< QPair< double, QString > > &participation, bool ratio)
Formats the results of the dimensionParticipation function into a nicely printable string...
Definition: utils.cpp:594
PointLayout mergeLayouts(const PointLayout &layout1, const PointLayout &layout2)
Merges two PointLayouts together, provided that they don't overlap.
Definition: utils.cpp:351
Point * mapPoint(const Point *p, const PointLayout &newLayout, const IndexMap &realMap, const IndexMap &stringMap, const IndexMap &enumMap)
Creates a new Point that is a mapping of the given one, copying only those descriptors that are in ne...
Definition: utils.cpp:310
QString mergeName(const QStringList &name)
Utility function that merges a sequence of node names into a single fully-qualified name...
Definition: utils.h:39
Point * mergePoints(const Point *p1, const Point *p2)
Merges two points together, provided that their layout don't overlap, and return the resulting point...
Definition: utils.cpp:388
QList< QPair< double, QString > > dimensionParticipation(const Eigen::VectorXd &values, const QMap< int, QString > &dnames)
Given a list of values and a map from their indices to their respective names, returns a list of pair...
Definition: utils.cpp:533
This class represents a dataset and all related information.
Definition: dataset.h:91
QList< QPair< double, QString > > dimensionBoost(const Eigen::MatrixXf &featureVector, const Region ®ion, const DataSet *dataset)
Dimension boost after applying the rotation/scaling defined by the given base vectors.
Definition: utils.cpp:561
QPair< QString, int > parseDimension(const QString &dimension)
Parse a string representing a descriptor + optional dimension as a QPair<QString, int>...
Definition: utils.cpp:32
QStringList splitName(const QString &name, bool includeRootNode=false)
Splits a fully-qualified name into its consecutive node names.
Definition: utils.h:46
This class describes the layout of a point.
Definition: pointlayout.h:60
void setDataStreamVersion(QDataStream &out)
Sets the version of the QDataStream to the current version of Gaia.
Definition: utils.cpp:642
int gaiaVersion(const QDataStream &stream)
Returns the Gaia version of this stream.
Definition: utils.cpp:633
void checkIsomorphDataSets(const DataSet *dataset1, const DataSet *dataset2, bool checkOriginalLayout)
Returns normally if both dataset are isomorph, meaning that they can be linked together, merged together, etc...
Definition: utils.cpp:45
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
void createIndexMappings(const PointLayout &oldLayout, PointLayout &newLayout, const Region ®ion, IndexMap &realMap, IndexMap &stringMap, IndexMap &enumMap)
Creates mappings from indices in the NEW layout to indices in the OLD layout.
Definition: utils.cpp:131
DataSet * mergeDataSets(const DataSet *ds1, const DataSet *ds2)
Merges two datasets together, provided that their layout don't overlap, and return the resulting data...
Definition: utils.cpp:421
QStringList selectDescriptors(const PointLayout &layout, DescriptorType type, const QStringList &select, const QStringList &exclude, bool failOnUnmatched)
This function returns the region of descriptors from a layout that match the patterns given by the se...
Definition: utils.cpp:90
RealDescriptor mergeDescriptors(const Point *p, int nseg, const Region ®ion)
Merges the descriptors contained into the given region into a single one.
Definition: utils.cpp:322
DescriptorType
The possible types of descriptors accepted.
Definition: region.h:36
void checkValidDataStream(QDataStream &in)
Checks that the input QDataStream is a valid one (ie: supported by our version of Gaia) and sets its ...
Definition: utils.cpp:658
QMap< int, QString > mapRegionIndicesToNames(const Region ®ion, const DataSet *dataset)
Given a DataSet (for reference) and a Region, returns the mapping between the region indices and the ...
Definition: utils.cpp:484
QMap< QString, QList< int > > dimensionListToMapping(const QStringList &dims)
Converts a list of dimensions names in the format descriptorName[dim] to a map of descriptor name to ...
Definition: utils.cpp:615
int memoryUsage(QString mtype)
Returns the memory currently used by this process, in KBs.
Definition: utils.cpp:691