Beyn: keep singular values from rank test

Former-commit-id: eb82025e460575335f9d6e3d9acb3cfdfe8867f0
This commit is contained in:
Marek Nečada 2019-09-16 08:02:31 +03:00
parent 11aa48d2da
commit 2762ada49c
3 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,7 @@ void beyn_result_gsl_free(beyn_result_gsl_t *r) {
gsl_vector_complex_free(r->eigval_err); gsl_vector_complex_free(r->eigval_err);
gsl_vector_free(r->residuals); gsl_vector_free(r->residuals);
gsl_matrix_complex_free(r->eigvec); gsl_matrix_complex_free(r->eigvec);
gsl_vector_free(r->ranktest_SV);
free(r); free(r);
} }
} }
@ -134,7 +135,6 @@ void BeynSolver_free_partial(BeynSolver *solver)
gsl_matrix_complex_free(solver->A0_coarse); gsl_matrix_complex_free(solver->A0_coarse);
gsl_matrix_complex_free(solver->A1_coarse); gsl_matrix_complex_free(solver->A1_coarse);
gsl_matrix_complex_free(solver->MInvVHat); gsl_matrix_complex_free(solver->MInvVHat);
gsl_vector_free(solver->Sigma);
gsl_matrix_complex_free(solver->VHat); gsl_matrix_complex_free(solver->VHat);
free(solver); free(solver);
@ -406,6 +406,7 @@ beyn_result_gsl_t *beyn_solve_gsl(const size_t m, const size_t l,
result->eigval_err = solver->eigenvalue_errors; result->eigval_err = solver->eigenvalue_errors;
result->residuals = solver->residuals; result->residuals = solver->residuals;
result->eigvec = solver->eigenvectors; result->eigvec = solver->eigenvectors;
result->ranktest_SV = solver->Sigma;
result->neig = K; result->neig = K;
BeynSolver_free_partial(solver); BeynSolver_free_partial(solver);
@ -463,6 +464,7 @@ beyn_result_t *beyn_result_from_beyn_result_gsl(beyn_result_gsl_t *g) {
result->eigval_err = (complex double *) result->gsl->eigval_err->data; result->eigval_err = (complex double *) result->gsl->eigval_err->data;
result->residuals = result->gsl->residuals->data; result->residuals = result->gsl->residuals->data;
result->eigvec = (complex double *) result->gsl->eigvec->data; result->eigvec = (complex double *) result->gsl->eigvec->data;
result->ranktest_SV = result->gsl->ranktest_SV->data;
return result; return result;
} }

View File

@ -44,6 +44,7 @@ typedef struct beyn_result_gsl_t {
gsl_vector_complex *eigval_err; gsl_vector_complex *eigval_err;
gsl_vector *residuals; gsl_vector *residuals;
gsl_matrix_complex *eigvec; gsl_matrix_complex *eigvec;
gsl_vector *ranktest_SV;
} beyn_result_gsl_t; } beyn_result_gsl_t;
void beyn_result_gsl_free(beyn_result_gsl_t *result); void beyn_result_gsl_free(beyn_result_gsl_t *result);
@ -56,6 +57,7 @@ typedef struct beyn_result_t {
complex double *eigval_err; complex double *eigval_err;
double *residuals; double *residuals;
complex double *eigvec; complex double *eigvec;
double *ranktest_SV;
/// Private, we wrap it around beyn_result_gsl_t for now. /// Private, we wrap it around beyn_result_gsl_t for now.
beyn_result_gsl_t *gsl; beyn_result_gsl_t *gsl;

View File

@ -559,6 +559,7 @@ cdef extern from "beyn.h":
cdouble *eigval_err cdouble *eigval_err
double *residuals double *residuals
cdouble *eigvec cdouble *eigvec
double *ranktest_SV
beyn_result_gsl_t *gsl beyn_result_gsl_t *gsl
ctypedef int (*beyn_function_M_gsl_t)(gsl_matrix_complex *target_M, cdouble z, void *params) ctypedef int (*beyn_function_M_gsl_t)(gsl_matrix_complex *target_M, cdouble z, void *params)