Skip to content

Commit 70a2e8a

Browse files
committed
add more
1 parent b48ca04 commit 70a2e8a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

FORTRAN/pevsl_f90.c

+27
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,33 @@ void PEVSL_FORT(pevsl_copy_result)(uintptr_t *pevslf90, double *val, double *vec
500500
}
501501

502502

503+
/** @brief copy the computed eigenvalues and vectors
504+
* @warning after this call the internal saved results will be freed
505+
* @param[in, out] pevslf90 Data to be cast to pevsl_Data
506+
* @param[in] ld leading dimension of vec [ld >= pevsl.n]
507+
* @param[out] vec Lanczos vectors output
508+
*/
509+
void PEVSL_FORT(pevsl_copy_vectors)(uintptr_t *pevslf90, double *vec, int *ld) {
510+
int i;
511+
/* cast pointer */
512+
pevsl_Data *pevsl = (pevsl_Data *) (*pevslf90);
513+
514+
515+
/* copy eigenvectors */
516+
for (i=0; i<pevsl->nev_computed; i++) {
517+
double *dest = vec + i * (*ld);
518+
double *src = pevsl->evec_computed->data + i * pevsl->evec_computed->ld;
519+
memcpy(dest, src, pevsl->n*sizeof(double));
520+
}
521+
522+
/* reset pointers */
523+
pevsl->nev_computed = 0;
524+
pEVSL_ParvecsFree(pevsl->evec_computed);
525+
PEVSL_FREE(pevsl->evec_computed);
526+
}
527+
528+
529+
503530
/* added JS 020619 for complex Hermitian
504531
* @brief copy the computed eigenvalues and vectors
505532
* @warning after this call the internal saved results will be freed

0 commit comments

Comments
 (0)