Created
June 23, 2022 06:40
-
-
Save dvsseed/da6da2f5ddaa3011ac20d6add6a1e902 to your computer and use it in GitHub Desktop.
The header is for gsl_svd.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GSLSINGULARVALUEDECOMPOSITION_H | |
#define GSLSINGULARVALUEDECOMPOSITION_H | |
#include <gsl/gsl_matrix.h> | |
#include <gsl/gsl_vector.h> | |
#include <gsl/gsl_blas.h> | |
#include <gsl/gsl_linalg.h> | |
#include <gsl/gsl_errno.h> | |
void linearSolve_SVD(const gsl_matrix *A, const gsl_vector *b, gsl_vector *x); | |
class GslSVD { | |
public: | |
GslSVD(); | |
~GslSVD(); | |
int SV_decomp(const gsl_matrix *A); | |
int SV_decomp_mod(const gsl_matrix *A); | |
int SV_decomp_jacobi(gsl_matrix *A); | |
int SV_solve(const gsl_vector *b, gsl_vector *x); | |
gsl_vector *getVectorS(); | |
gsl_matrix *getMatrixU(); | |
gsl_matrix *getMatrixV(); | |
int trimVectorS(double abseps); | |
private: | |
gsl_vector *S; | |
gsl_matrix *U; | |
gsl_matrix *V; | |
void alloc_suv(int rows, int cols); | |
}; | |
#endif // GSLSINGULARVALUEDECOMPOSITION_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment