From 07985b26f294b6e0a0aa9579210c3468f79b916b Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Tue, 25 Oct 2016 12:19:42 +0200 Subject: [PATCH] Silent warning when printing complex --- z_spm_print.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/z_spm_print.c b/z_spm_print.c index 6e4f9929..40c9dc70 100644 --- a/z_spm_print.c +++ b/z_spm_print.c @@ -61,11 +61,11 @@ z_spmPrint( const pastix_spm_t *spm ) { for(jj=0; jj<dofj; jj++, valptr++) { - fprintf( stderr, "%ld %ld %e\n", - row + jj, col + ii, *valptr ); + fprintf( stderr, "%ld %ld (%e, %e)\n", + row + jj, col + ii, creal(*valptr), cimag(*valptr) ); if (i != j) { - fprintf( stderr, "%ld %ld %e\n", - col + ii, row + jj, conj(*valptr) ); + fprintf( stderr, "%ld %ld (%e, %e)\n", + col + ii, row + jj, creal(conj(*valptr)), cimag(conj(*valptr)) ); } } } @@ -89,12 +89,21 @@ z_spmPrint( const pastix_spm_t *spm ) { for(jj=0; jj<dofj; jj++, valptr++) { +#if defined(PRECISION_z) || defined(PRECISION_c) + fprintf( stderr, "%ld %ld (%e, %e)\n", + row + jj, col + ii, creal(*valptr), cimag(*valptr) ); + if (i != j) { + fprintf( stderr, "%ld %ld (%e, %e)\n", + col + ii, row + jj, creal(*valptr), cimag(*valptr) ); + } +#else fprintf( stderr, "%ld %ld %e\n", row + jj, col + ii, *valptr ); if (i != j) { fprintf( stderr, "%ld %ld %e\n", col + ii, row + jj, *valptr ); } +#endif } } } @@ -117,8 +126,13 @@ z_spmPrint( const pastix_spm_t *spm ) { for(jj=0; jj<dofj; jj++, valptr++) { +#if defined(PRECISION_z) || defined(PRECISION_c) + fprintf( stderr, "%ld %ld (%e, %e)\n", + row + jj, col + ii, creal(*valptr), cimag(*valptr) ); +#else fprintf( stderr, "%ld %ld %e\n", row + jj, col + ii, *valptr ); +#endif } } } -- GitLab