diff --git a/qpms/beyn.c b/qpms/beyn.c index d2495af..9cdf408 100644 --- a/qpms/beyn.c +++ b/qpms/beyn.c @@ -77,6 +77,7 @@ void beyn_result_gsl_free(beyn_result_gsl_t *r) { gsl_vector_complex_free(r->eigval_err); gsl_vector_free(r->residuals); gsl_matrix_complex_free(r->eigvec); + gsl_vector_free(r->ranktest_SV); free(r); } } @@ -134,7 +135,6 @@ void BeynSolver_free_partial(BeynSolver *solver) gsl_matrix_complex_free(solver->A0_coarse); gsl_matrix_complex_free(solver->A1_coarse); gsl_matrix_complex_free(solver->MInvVHat); - gsl_vector_free(solver->Sigma); gsl_matrix_complex_free(solver->VHat); 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->residuals = solver->residuals; result->eigvec = solver->eigenvectors; + result->ranktest_SV = solver->Sigma; result->neig = K; 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->residuals = result->gsl->residuals->data; result->eigvec = (complex double *) result->gsl->eigvec->data; + result->ranktest_SV = result->gsl->ranktest_SV->data; return result; } diff --git a/qpms/beyn.h b/qpms/beyn.h index cbcb64d..bd17928 100644 --- a/qpms/beyn.h +++ b/qpms/beyn.h @@ -44,6 +44,7 @@ typedef struct beyn_result_gsl_t { gsl_vector_complex *eigval_err; gsl_vector *residuals; gsl_matrix_complex *eigvec; + gsl_vector *ranktest_SV; } beyn_result_gsl_t; void beyn_result_gsl_free(beyn_result_gsl_t *result); @@ -56,6 +57,7 @@ typedef struct beyn_result_t { complex double *eigval_err; double *residuals; complex double *eigvec; + double *ranktest_SV; /// Private, we wrap it around beyn_result_gsl_t for now. beyn_result_gsl_t *gsl; diff --git a/qpms/qpms_cdefs.pxd b/qpms/qpms_cdefs.pxd index 046c343..7ea32e9 100644 --- a/qpms/qpms_cdefs.pxd +++ b/qpms/qpms_cdefs.pxd @@ -559,6 +559,7 @@ cdef extern from "beyn.h": cdouble *eigval_err double *residuals cdouble *eigvec + double *ranktest_SV beyn_result_gsl_t *gsl ctypedef int (*beyn_function_M_gsl_t)(gsl_matrix_complex *target_M, cdouble z, void *params)