diff --git a/include/spm/const.h b/include/spm/const.h index adff0081d26e53c1c5c6f536f15c9dee15a0eba5..01f9de534e2cc089ad918008cc6f264b52115e4b 100644 --- a/include/spm/const.h +++ b/include/spm/const.h @@ -189,7 +189,7 @@ typedef enum spm_normtype_e { SpmOneNorm = 171, /**< One norm: max_j( sum_i( |a_{ij}| ) ) */ SpmFrobeniusNorm = 174, /**< Frobenius norm: sqrt( sum_{i,j} (a_{ij}^2) ) */ SpmInfNorm = 175, /**< Inifinite norm: max_i( sum_j( |a_{ij}| ) ) */ - SpmMaxNorm = 177 /**< Inifinite norm: max_{i,j}( | a_{ij} | ) */ + SpmMaxNorm = 177 /**< Max norm: max_{i,j}( | a_{ij} | ) */ } spm_normtype_t; /** diff --git a/src/spm.c b/src/spm.c index 2fc61e1cd6346a6d44a3ccebe66470f6a97251ec..03328a0f3a8028d15fadb566005a85f1bf321aa8 100644 --- a/src/spm.c +++ b/src/spm.c @@ -321,7 +321,7 @@ spmBase( spmatrix_t *spm, } } if (spm->dofs != NULL) { - for (i = 0; i <= n; i++) { + for (i = 0; i <= spm->gN; i++) { spm->dofs[i] += baseadj; } } diff --git a/src/spm_dof_extend.c b/src/spm_dof_extend.c index 18eed840759c2e2d8d8998c7f8c88d6687184725..64ddfdaa9e239bee62962f71dd9b236d1f76b9be 100644 --- a/src/spm_dof_extend.c +++ b/src/spm_dof_extend.c @@ -86,8 +86,8 @@ spmDofExtend( const spmatrix_t *spm, * Initialize the dofs array where the degree of freedom of vertex i is * dof[i+1] - dof[i] */ - *dofptr = baseval; if( spm->clustnum == 0 ) { + *dofptr = baseval; for(i=0; i<spm->gN; i++, dofptr++) { dofi = 1 + ( rand() % dof ); dofptr[1] = dofptr[0] + dofi; diff --git a/src/spm_gather.c b/src/spm_gather.c index 91f231842c5d930029d0fb454272ed57a7a9115d..a918ca69c5ec05239aa123252ac7277e75dbd683 100644 --- a/src/spm_gather.c +++ b/src/spm_gather.c @@ -116,7 +116,7 @@ spm_gather_csx_update( const spmatrix_t *spm, for ( c=1; c<spm->clustnbr; c++ ) { /* Let's start shifting the value after the first array */ spm_int_t shift = recvdispls[c]; - spm_int_t end = ( c == spm->clustnbr-1 ) ? spm->gN+1 : recvdispls[c+1]; + spm_int_t end = ( c < (spm->clustnbr-1) ) ? recvdispls[c+1] : spm->gN+1; spm_int_t i; to_add += recvcounts[c-1]; diff --git a/src/z_spm.h b/src/z_spm.h index eff04607e23c6c0c1140d8d451945598dcd97c47..f7eb42fe30ec1267c144b4c596fd5f00ce00f58f 100644 --- a/src/z_spm.h +++ b/src/z_spm.h @@ -64,7 +64,7 @@ int spm_zspmm( spm_side_t side, /** * Norm computation routines */ -double z_spmNorm( int ntype, const spmatrix_t *spm ); +double z_spmNorm( spm_normtype_t ntype, const spmatrix_t *spm ); /** * Extra routines diff --git a/src/z_spm_norm.c b/src/z_spm_norm.c index 861a4f536b1042f44c139ad9699f2c577387db01..29e9ccfd5e7531539a0fd014779d079fd18c3151 100644 --- a/src/z_spm_norm.c +++ b/src/z_spm_norm.c @@ -386,7 +386,7 @@ z_spmOneNorm( const spmatrix_t *spm ) * *******************************************************************************/ double -z_spmNorm( int ntype, +z_spmNorm( spm_normtype_t ntype, const spmatrix_t *spm ) { double norm = 0.;