Vespucci  1.0.0
analysisresults.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2015 Wright State University - All Rights Reserved
3  Daniel P. Foose - Author
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #ifndef ANALYSISRESULTS_H
21 #define ANALYSISRESULTS_H
22 #include "Global/libvespucci.h"
23 #include "Math/VespucciMath.h"
24 #include <QStringList>
25 #include <QMap>
26 #include <QSharedPointer>
27 using namespace std;
28 using namespace arma;
35 {
36 public:
37  AnalysisResults(QString name, QString type);
38  virtual ~AnalysisResults();
39  const mat & GetMatrix(const QString &key);
40  void AddMatrix(const QString &key, const mat &value, QStringList column_headings = QStringList());
41  void AddColumns(const QStringList &keys, const mat &value);
42  void AddMetadata(QString key, QString value);
43  void AddField(const QString &key, const field<mat> &value);
44  const field<mat> & GetField(const QString &key);
45  const mat & GetFieldElement(const QString &key, const uword &index);
46  bool HasField(const QString &key) const;
47  bool HasMatrix(const QString &key) const;
48  const QStringList KeyList() const;
49  const QString name() const;
50  const QString type() const;
51  const mat & EmptyMatrix();
52  const QMap<QString, QString> GetMetadata() const;
53  const QString GetColumnHeading(const QString &key, int column);
54  const QString GetRowHeading(const QString &key, int row);
55  void SetName(const QString &new_name);
56  void SetType(const QString &new_type);
57  QSharedPointer<AnalysisResults> Subset(QStringList matrices, uword start_row, uword end_row);
58  void AddParent(QString key, uword start_row, uword end_row);
59  QMap<QString, uvec> parent_rows();
60  bool Concatenate(QSharedPointer<AnalysisResults> other);
61  QSharedPointer<AnalysisResults> Replicate();
62  void RemoveMatrix(const QString &key);
63 
64 private:
68  QString name_;
69 
73  QString type_;
74 
78  QMap<QString, QSharedPointer<mat> > matrices_;
79 
80  QMap<QString, QString> metadata_;
81  QMap<QString, QStringList> column_headings_;
82  QMap<QString, QStringList> row_headings_;
83  QMap<QString, QSharedPointer<field<mat> > > fields_;
84  QMap<QString, uvec> parent_rows_;
85  mat empty_matrix_;
86 };
87 
88 #endif // ANALYSISRESULTS_H
The AnalysisResults class A container for a mat object that allows a mat to be copied to a heap-alloc...