Just Intonation  Version 1.3.1 (19)
Explore key-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 QString f(Eigen::MatrixXd mat)
28 {
29  QString str;
30  QTextStream ss(&str);
31  const int N=static_cast<int>(mat.rows()), M=static_cast<int>(mat.cols());
32  for (int n=0; n<N; ++n)
33  {
34  for (int m=0; m<M; ++m)
35  {
36  ss << QString::number(mat(n,m));
37  if (m<N) ss<<" ";
38  }
39  ss << "|";
40  }
41  return str;
42 }
43 
44 QString f(Eigen::MatrixXi mat)
45 {
46  QString str;
47  QTextStream ss(&str);
48  const int N=static_cast<int>(mat.rows()), M=static_cast<int>(mat.cols());
49  for (int n=0; n<N; ++n)
50  {
51  for (int m=0; m<M; ++m)
52  {
53  ss << QString::number(mat(n,m));
54  if (m<N) ss<<" ";
55  }
56  ss << "|";
57  }
58  return str;
59 }
60 
61 QString f(Eigen::VectorXd vec)
62 {
63  QString str;
64  const int N=static_cast<int>(vec.rows());
65  QTextStream ss(&str);
66  for (int n1=0; n1<N; ++n1)
67  {
68  ss << QString::number(vec(n1));
69  if (n1<N) ss<<" ";
70  }
71  return str;
72 
73 }
74 
75 #endif // TUNERDEBUG_H
QString f(Eigen::MatrixXd mat)
Definition: tunerdebug.h:27