| 1 | /* Eigen_and_TableOfReal.cpp |
| 2 | * |
| 3 | * Copyright (C) 1993-2019 David Weenink |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | /* |
| 20 | djmw 20020327 Initial version. |
| 21 | djmw 20020429 _project: copy rowLabels too. |
| 22 | djmw 20020502 Added from index to projections. |
| 23 | djmw 20020813 GPL header |
| 24 | djmw 20110304 Thing_new |
| 25 | */ |
| 26 | |
| 27 | #include "Eigen_and_TableOfReal.h" |
| 28 | #include "NUM2.h" |
| 29 | |
| 30 | autoEigen TablesOfReal_to_Eigen_gsvd (TableOfReal me, TableOfReal thee) { |
| 31 | try { |
| 32 | Melder_require (my numberOfColumns == thy numberOfColumns, |
| 33 | U"Both tables should have the same number of columns."); |
| 34 | autoEigen him = Thing_new (Eigen); |
| 35 | Eigen_initFromSquareRootPair (him.get(), my data.get(), thy data.get()); |
| 36 | return him; |
| 37 | } catch (MelderError) { |
| 38 | Melder_throw (me, U": Eigen not created."); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /* End of file Eigen_and_TableOfReal.cpp */ |