From bc1223dba9e743885b3fdaf9ef87039f4bf4deb5 Mon Sep 17 00:00:00 2001 From: barrylee Date: Fri, 1 Feb 2008 23:07:59 +0000 Subject: [PATCH] Remove bug for object type HYPRE_STRUCT. --- sstruct_mv/sstruct_innerprod.c | 2 +- sstruct_mv/sstruct_matvec.c | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/sstruct_mv/sstruct_innerprod.c b/sstruct_mv/sstruct_innerprod.c index 39f0c7632..7cf61bb08 100644 --- a/sstruct_mv/sstruct_innerprod.c +++ b/sstruct_mv/sstruct_innerprod.c @@ -89,7 +89,7 @@ hypre_SStructInnerProd( hypre_SStructVector *x, result = 0.0; - if (x_object_type == HYPRE_SSTRUCT) + if ( (x_object_type == HYPRE_SSTRUCT) || (x_object_type == HYPRE_STRUCT) ) { for (part = 0; part < nparts; part++) { diff --git a/sstruct_mv/sstruct_matvec.c b/sstruct_mv/sstruct_matvec.c index a8e5e2b58..03573c6df 100644 --- a/sstruct_mv/sstruct_matvec.c +++ b/sstruct_mv/sstruct_matvec.c @@ -321,7 +321,7 @@ hypre_SStructMatvecCompute( void *matvec_vdata, printf("possible error: A and x are different object types\n"); } - if (x_object_type == HYPRE_SSTRUCT) + if ( (x_object_type == HYPRE_SSTRUCT) || (x_object_type == HYPRE_STRUCT) ) { /* do S-matrix computations */ for (part = 0; part < nparts; part++) @@ -333,25 +333,29 @@ hypre_SStructMatvecCompute( void *matvec_vdata, hypre_SStructPMatvecCompute(pdata, alpha, pA, px, beta, py); } - /* do U-matrix computations */ + if ( (x_object_type == HYPRE_SSTRUCT) ) + { - /* GEC1002 the data chunk pointed by the local-parvectors - * inside the semistruct vectors x and y is now identical to the - * data chunk of the structure vectors x and y. The role of the function - * convert is to pass the addresses of the data chunk - * to the parx and pary. */ + /* do U-matrix computations */ - hypre_SStructVectorConvert(x, &parx); - hypre_SStructVectorConvert(y, &pary); + /* GEC1002 the data chunk pointed by the local-parvectors + * inside the semistruct vectors x and y is now identical to the + * data chunk of the structure vectors x and y. The role of the function + * convert is to pass the addresses of the data chunk + * to the parx and pary. */ - hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, 1.0, pary); + hypre_SStructVectorConvert(x, &parx); + hypre_SStructVectorConvert(y, &pary); - /* dummy functions since there is nothing to restore */ + hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, 1.0, pary); - hypre_SStructVectorRestore(x, NULL); - hypre_SStructVectorRestore(y, pary); + /* dummy functions since there is nothing to restore */ - parx = NULL; + hypre_SStructVectorRestore(x, NULL); + hypre_SStructVectorRestore(y, pary); + + parx = NULL; + } }