| compressedrow.c (df17f0d5a75f08e11c817a1972ff7c67227bc74f) | compressedrow.c (baa4e9fa94decc45528f349d244fecd9d9d631ec) |
|---|---|
| 1 2#include <private/matimpl.h> /*I "petscmat.h" I*/ 3 4#undef __FUNCT__ 5#define __FUNCT__ "MatCheckCompressedRow" 6/*@C 7 MatCheckCompressedRow - Determines whether the compressed row matrix format should be used. 8 If the format is to be used, this routine creates Mat_CompressedRow struct. --- 31 unchanged lines hidden (view full) --- 40 41 42 /* compute number of zero rows */ 43 nrows = 0; 44 for (i=0; i<mbs; i++){ /* for each row */ 45 nz = ai[i+1] - ai[i]; /* number of nonzeros */ 46 if (nz == 0) nrows++; 47 } | 1 2#include <private/matimpl.h> /*I "petscmat.h" I*/ 3 4#undef __FUNCT__ 5#define __FUNCT__ "MatCheckCompressedRow" 6/*@C 7 MatCheckCompressedRow - Determines whether the compressed row matrix format should be used. 8 If the format is to be used, this routine creates Mat_CompressedRow struct. --- 31 unchanged lines hidden (view full) --- 40 41 42 /* compute number of zero rows */ 43 nrows = 0; 44 for (i=0; i<mbs; i++){ /* for each row */ 45 nz = ai[i+1] - ai[i]; /* number of nonzeros */ 46 if (nz == 0) nrows++; 47 } |
| 48 |
|
| 48 /* if a large number of zero rows is found, use compressedrow data structure */ 49 if (nrows < ratio*mbs) { 50 compressedrow->use = PETSC_FALSE; 51 ierr = PetscInfo3(A,"Found the ratio (num_zerorows %d)/(num_localrows %d) < %G. Do not use CompressedRow routines.\n",nrows,mbs,ratio);CHKERRQ(ierr); 52 } else { 53 compressedrow->use = PETSC_TRUE; 54 ierr = PetscInfo3(A,"Found the ratio (num_zerorows %d)/(num_localrows %d) > %G. Use CompressedRow routines.\n",nrows,mbs,ratio);CHKERRQ(ierr); 55 --- 18 unchanged lines hidden --- | 49 /* if a large number of zero rows is found, use compressedrow data structure */ 50 if (nrows < ratio*mbs) { 51 compressedrow->use = PETSC_FALSE; 52 ierr = PetscInfo3(A,"Found the ratio (num_zerorows %d)/(num_localrows %d) < %G. Do not use CompressedRow routines.\n",nrows,mbs,ratio);CHKERRQ(ierr); 53 } else { 54 compressedrow->use = PETSC_TRUE; 55 ierr = PetscInfo3(A,"Found the ratio (num_zerorows %d)/(num_localrows %d) > %G. Use CompressedRow routines.\n",nrows,mbs,ratio);CHKERRQ(ierr); 56 --- 18 unchanged lines hidden --- |