Gaia
rca.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_RCA_H
21 #define GAIA_RCA_H
22 
23 #include "analyzer.h"
24 #include "Eigen/Core"
25 
26 namespace gaia2 {
27 
51 class RCA : public Analyzer {
52 
53  protected:
54  QString _resultName;
55  int _targetDimension;
56  QString _classFile, _className;
57  QMap<QString, QString> _classMap;
58 
67  Eigen::MatrixXd computeCovarianceMatrix(const QList<const PointArray*>& chunklets,
68  const Region& region) const;
69 
70  Eigen::MatrixXd whitenMatrix(const Eigen::MatrixXd& cov) const;
71 
72 
73  public:
74  RCA(const ParameterMap& params);
75  virtual ~RCA() {};
76 
77  Transformation analyze(const DataSet* dataset, const Region& region) const;
78 
79 
80  // static helper functions
81  static QList<const PointArray*> cleanChunklets(QList<PointArray*>& chunklets);
82 
83  static QList<const PointArray*> getChunkletsFromMap(const QMap<QString, QString>& filename,
84  const DataSet* inputDataSet);
85 
86  static QList<const PointArray*> getChunkletsFromFile(const QString& filename,
87  const DataSet* inputDataSet);
88 
89  static QList<const PointArray*> getChunkletsFromLabel(const QString& label,
90  const DataSet* inputDataSet);
91 
92 
93 
94 };
95 
96 }
97 
98 #endif // GAIA_RCA_H
The RCA Analyzer computes the Relevant Components Analysis of the given DataSet using the specified d...
Definition: rca.h:51
A region is a physical location in the point layout which consists in a list of segments.
Definition: region.h:125
Class containing all info pertaining to a specific transformation, ie: the name of the analyzer class...
Definition: transformation.h:41
This class represents a dataset and all related information.
Definition: dataset.h:91
Eigen::MatrixXd computeCovarianceMatrix(const QList< const PointArray * > &chunklets, const Region &region) const
Computes the within chunklet covariance matrix.
Definition: rca.cpp:168
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
the Analyzer abstract base class.
Definition: analyzer.h:43
Definition: parameter.h:34
Transformation analyze(const DataSet *dataset, const Region &region) const
Definition: rca.cpp:64