Gaia
algoutils.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_ALGOUTILS_H
21 #define GAIA_ALGOUTILS_H
22 
23 #include "dataset.h"
24 
25 namespace gaia2 {
26 
27 
35 QPair<Point, Point> getRegionMeanVar(const DataSet& dataset,
36  const Region& region);
37 
38 
46 QPair<Point, Point> getRegionMinMax(const DataSet& dataset,
47  const Region& region);
48 
49 
55 class DescCompare {
56  const PointLayout& _layout;
57  public:
58  DescCompare(const PointLayout& layout) : _layout(layout) {}
59  bool operator()(const QString& a, const QString& b) const {
62 
63  if (la == FixedLength && lb == VariableLength) return true;
64  if (la == VariableLength && lb == FixedLength) return false;
65  return a < b;
66  }
67 };
68 
69 
82 QStringList findVariableLengthDescriptors(const DataSet* dataset);
83 
84 } // namespace gaia2
85 
86 #endif // GAIA_ALGOUTILS_H
This class represents a dataset and all related information.
Definition: dataset.h:91
Compare the descriptor names using the following criteria:
Definition: algoutils.h:55
QStringList findVariableLengthDescriptors(const DataSet *dataset)
For all variable-length descriptors in this DataSet, find all the ones which actually are of differen...
Definition: algoutils.cpp:124
This class describes the layout of a point.
Definition: pointlayout.h:60
DescriptorLengthType
Either fixed-length or variable-length.
Definition: region.h:46
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
QPair< Point, Point > getRegionMeanVar(const DataSet &dataset, const Region &region)
Gets the mean and variance of the descriptors in the given region.
Definition: algoutils.cpp:25
DescriptorLengthType lengthType() const
Returns the descriptor length type if all segments within this region are of the same type...
Definition: region.cpp:90
QPair< Point, Point > getRegionMinMax(const DataSet &dataset, const Region &region)
Gets the mean and variance of the descriptors in the given region.
Definition: algoutils.cpp:81
Region descriptorLocation(const QString &name) const
Returns the region corresponding to the location of the specified descriptor or group of descriptors...
Definition: pointlayout.cpp:60