| 1 | #cxx . . $ `<file>/dwsys/MAT_numerics.h`/pragma once |
| 2 | /* MAT_numerics.h |
| 3 | * |
| 4 | * Copyright (C) 2018-2019, 2026 David Weenink |
| 5 | * |
| 6 | * This code is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or (at |
| 9 | * your option) any later version. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 14 | * See the GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "melder.h"cxx . . $ `<file>/melder/melder.h`/ |
| 21 | #include "MATTypes_enums.h"cxx . . $ `<file>/dwsys/MATTypes_enums.h`/ |
| 22 | #include "Eigen.h"cxx . . $ `<file>/dwsys/Eigen.h`/ |
| 23 | |
| 24 | void MAT_into_Eigencxx . . $ MAT_into_Eigen(dc1eb59c37fac9d2). (constMATVUcxx . . $ constMATVU# const& mat, kMAT_TYPEcxx . . $ kMAT_TYPE# matType, Eigencxx . . $ Eigen# me, bool sortAscending); |
| 25 | |
| 26 | void MAT_getEigenSystemFromSymmetricMatrixcxx . . $ MAT_getEigenSystemFromSymmetricMatrix(5c0054344d6d0394). (constMATcxx . . $ constMAT# a, autoMATcxx . . $ autoMAT# *out_eigenvectors, autoVECcxx . . $ autoVEC# *out_eigenvalues, bool sortAscending); |
| 27 | /* |
| 28 | Calculates the eigenvectors and eigenvalues of a symmetric matrix; |
| 29 | Input: |
| 30 | a, a symmetric matrix of size nrow x nrow (a.ncol == a.nrow) |
| 31 | only the upper-half of the matrix is used in the calculation |
| 32 | sortAscending if true eigenvalues (and corresponding eigenvectors) are sorted ascending |
| 33 | Output: |
| 34 | if (out_eigenvalues) eigenvalues sorted |
| 35 | if (out_eigenvectors) eigenvectors corresponding to the eigenvalues, stored as row-wise vectors. |
| 36 | */ |
| 37 | |
| 38 | void MAT_getEigenSystemFromSymmetricMatrix_preallocatedcxx . . $ MAT_getEigenSystemFromSymmetricMatrix_preallocated(d29a18be8d2af5a4). (MATcxx . . $ MAT# eigenvectors, VECcxx . . $ VEC# eigenvalues, constMATVUcxx . . $ constMATVU# const& a, bool sortAscending); |
| 39 | /* |
| 40 | Input: |
| 41 | a, a symmetric a.ncol x a.ncol matrix |
| 42 | only the upper-half of the matrix is used in the calculation |
| 43 | eigenvalues, a vector of size ncol |
| 44 | eigenvectors, a matrix a.ncol x a.ncol |
| 45 | sortAscending if true eigenvalues (and corresponding eigenvectors) will be sorted ascending |
| 46 | Output: |
| 47 | eigenvectors, stored row-wise |
| 48 | eigenvalues, eigenvalues sorted according to sortAscending |
| 49 | */ |
| 50 | |
| 51 | void MAT_asPrincipalComponents_preallocatedcxx . . $ MAT_asPrincipalComponents_preallocated(128fc74062131bcf). (MATVUcxx . . $ MATVU# pc, constMATVUcxx . . $ constMATVU# const& m, integercxx . . $ integer# numberOfComponents); |
| 52 | autoMATcxx . . $ autoMAT# MAT_asPrincipalComponentscxx . . $ MAT_asPrincipalComponents(4987e7f027662247). (constMATVUcxx . . $ constMATVU# m, integercxx . . $ integer# numberOfComponents); |
| 53 | |
| 54 | void MATpseudoInversecxx . . $ MATpseudoInverse(ff53fc23fd1cc703). (MATVUcxx . . $ MATVU# const& target, constMATVUcxx . . $ constMATVU# const& mat, double tolerance); |
| 55 | autoMATcxx . . $ autoMAT# newMATpseudoInversecxx . . $ newMATpseudoInverse(d05068067bdbbf5a). (constMATVUcxx . . $ constMATVU# const& mat, double tolerance); |
| 56 | /* |
| 57 | Determines the pseudo-inverse Y^-1 of Y [1..nrow] [1..ncol] via s.v.d. |
| 58 | Alternative notation for pseudo-inverse: (Y'.Y)^-1.Y' |
| 59 | Returns a [1..ncol] [1..nrow] matrix |
| 60 | */ |
| 61 | |
| 62 | /* End of file MAT_numerics.h */ |