Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
tunerdebug.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2016-2017 Karolin Stange, Christoph Wick, and Haye Hinrichsen
3  *
4  * This file is part of JustIntonation.
5  *
6  * JustIntonation is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * JustIntonation is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with JustIntonation. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 //=============================================================================
21 // Tuning algorithm debugging tools (normally not included)
22 //=============================================================================
23 
24 #ifndef TUNERDEBUG_H
25 #define TUNERDEBUG_H
26 
27 #include <QString> // delete this later
28 
29 QString f(Eigen::MatrixXd mat)
30 {
31  QString str;
32  QTextStream ss(&str);
33  const int N=mat.rows(), M=mat.cols();
34  for (int n=0; n<N; ++n)
35  {
36  for (int m=0; m<M; ++m)
37  {
38  ss << QString::number(mat(n,m));
39  if (m<N) ss<<" ";
40  }
41  ss << "|";
42  }
43  return str;
44 }
45 
46 QString f(Eigen::MatrixXi mat)
47 {
48  QString str;
49  QTextStream ss(&str);
50  const int N=mat.rows(), M=mat.cols();
51  for (int n=0; n<N; ++n)
52  {
53  for (int m=0; m<M; ++m)
54  {
55  ss << QString::number(mat(n,m));
56  if (m<N) ss<<" ";
57  }
58  ss << "|";
59  }
60  return str;
61 }
62 
63 QString f(Eigen::VectorXd vec)
64 {
65  QString str;
66  const int N=vec.rows();
67  QTextStream ss(&str);
68  for (int n1=0; n1<N; ++n1)
69  {
70  ss << QString::number(vec(n1));
71  if (n1<N) ss<<" ";
72  }
73  return str;
74 
75 }
76 
77 
78 #endif // TUNERDEBUG_H
QString f(Eigen::MatrixXd mat)
Definition: tunerdebug.h:29