1*2c733ed4SBarry Smith #include <../src/mat/impls/baij/seq/baij.h> 2*2c733ed4SBarry Smith #include <petsc/private/kernels/blockinvert.h> 3*2c733ed4SBarry Smith 4*2c733ed4SBarry Smith /* Block operations are done by accessing one column at at time */ 5*2c733ed4SBarry Smith /* Default MatSolve for block size 14 */ 6*2c733ed4SBarry Smith 7*2c733ed4SBarry Smith PetscErrorCode MatSolve_SeqBAIJ_14_NaturalOrdering(Mat A,Vec bb,Vec xx) 8*2c733ed4SBarry Smith { 9*2c733ed4SBarry Smith Mat_SeqBAIJ *a=(Mat_SeqBAIJ*)A->data; 10*2c733ed4SBarry Smith PetscErrorCode ierr; 11*2c733ed4SBarry Smith const PetscInt n=a->mbs,*ai=a->i,*aj=a->j,*adiag=a->diag,*vi,bs=A->rmap->bs,bs2=a->bs2; 12*2c733ed4SBarry Smith PetscInt i,k,nz,idx,idt,m; 13*2c733ed4SBarry Smith const MatScalar *aa=a->a,*v; 14*2c733ed4SBarry Smith PetscScalar s[14]; 15*2c733ed4SBarry Smith PetscScalar *x,xv; 16*2c733ed4SBarry Smith const PetscScalar *b; 17*2c733ed4SBarry Smith 18*2c733ed4SBarry Smith PetscFunctionBegin; 19*2c733ed4SBarry Smith ierr = VecGetArrayRead(bb,&b);CHKERRQ(ierr); 20*2c733ed4SBarry Smith ierr = VecGetArray(xx,&x);CHKERRQ(ierr); 21*2c733ed4SBarry Smith 22*2c733ed4SBarry Smith /* forward solve the lower triangular */ 23*2c733ed4SBarry Smith for (i=0; i<n; i++) { 24*2c733ed4SBarry Smith v = aa + bs2*ai[i]; 25*2c733ed4SBarry Smith vi = aj + ai[i]; 26*2c733ed4SBarry Smith nz = ai[i+1] - ai[i]; 27*2c733ed4SBarry Smith idt = bs*i; 28*2c733ed4SBarry Smith x[idt] = b[idt]; x[1+idt] = b[1+idt]; x[2+idt] = b[2+idt]; x[3+idt] = b[3+idt]; x[4+idt] = b[4+idt]; 29*2c733ed4SBarry Smith x[5+idt] = b[5+idt]; x[6+idt] = b[6+idt]; x[7+idt] = b[7+idt]; x[8+idt] = b[8+idt]; x[9+idt] = b[9+idt]; 30*2c733ed4SBarry Smith x[10+idt] = b[10+idt]; x[11+idt] = b[11+idt]; x[12+idt] = b[12+idt]; x[13+idt] = b[13+idt]; 31*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 32*2c733ed4SBarry Smith idx = bs*vi[m]; 33*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 34*2c733ed4SBarry Smith xv = x[k + idx]; 35*2c733ed4SBarry Smith x[idt] -= v[0]*xv; 36*2c733ed4SBarry Smith x[1+idt] -= v[1]*xv; 37*2c733ed4SBarry Smith x[2+idt] -= v[2]*xv; 38*2c733ed4SBarry Smith x[3+idt] -= v[3]*xv; 39*2c733ed4SBarry Smith x[4+idt] -= v[4]*xv; 40*2c733ed4SBarry Smith x[5+idt] -= v[5]*xv; 41*2c733ed4SBarry Smith x[6+idt] -= v[6]*xv; 42*2c733ed4SBarry Smith x[7+idt] -= v[7]*xv; 43*2c733ed4SBarry Smith x[8+idt] -= v[8]*xv; 44*2c733ed4SBarry Smith x[9+idt] -= v[9]*xv; 45*2c733ed4SBarry Smith x[10+idt] -= v[10]*xv; 46*2c733ed4SBarry Smith x[11+idt] -= v[11]*xv; 47*2c733ed4SBarry Smith x[12+idt] -= v[12]*xv; 48*2c733ed4SBarry Smith x[13+idt] -= v[13]*xv; 49*2c733ed4SBarry Smith v += 14; 50*2c733ed4SBarry Smith } 51*2c733ed4SBarry Smith } 52*2c733ed4SBarry Smith } 53*2c733ed4SBarry Smith /* backward solve the upper triangular */ 54*2c733ed4SBarry Smith for (i=n-1; i>=0; i--) { 55*2c733ed4SBarry Smith v = aa + bs2*(adiag[i+1]+1); 56*2c733ed4SBarry Smith vi = aj + adiag[i+1]+1; 57*2c733ed4SBarry Smith nz = adiag[i] - adiag[i+1] - 1; 58*2c733ed4SBarry Smith idt = bs*i; 59*2c733ed4SBarry Smith s[0] = x[idt]; s[1] = x[1+idt]; s[2] = x[2+idt]; s[3] = x[3+idt]; s[4] = x[4+idt]; 60*2c733ed4SBarry Smith s[5] = x[5+idt]; s[6] = x[6+idt]; s[7] = x[7+idt]; s[8] = x[8+idt]; s[9] = x[9+idt]; 61*2c733ed4SBarry Smith s[10] = x[10+idt]; s[11] = x[11+idt]; s[12] = x[12+idt]; s[13] = x[13+idt]; 62*2c733ed4SBarry Smith 63*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 64*2c733ed4SBarry Smith idx = bs*vi[m]; 65*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 66*2c733ed4SBarry Smith xv = x[k + idx]; 67*2c733ed4SBarry Smith s[0] -= v[0]*xv; 68*2c733ed4SBarry Smith s[1] -= v[1]*xv; 69*2c733ed4SBarry Smith s[2] -= v[2]*xv; 70*2c733ed4SBarry Smith s[3] -= v[3]*xv; 71*2c733ed4SBarry Smith s[4] -= v[4]*xv; 72*2c733ed4SBarry Smith s[5] -= v[5]*xv; 73*2c733ed4SBarry Smith s[6] -= v[6]*xv; 74*2c733ed4SBarry Smith s[7] -= v[7]*xv; 75*2c733ed4SBarry Smith s[8] -= v[8]*xv; 76*2c733ed4SBarry Smith s[9] -= v[9]*xv; 77*2c733ed4SBarry Smith s[10] -= v[10]*xv; 78*2c733ed4SBarry Smith s[11] -= v[11]*xv; 79*2c733ed4SBarry Smith s[12] -= v[12]*xv; 80*2c733ed4SBarry Smith s[13] -= v[13]*xv; 81*2c733ed4SBarry Smith v += 14; 82*2c733ed4SBarry Smith } 83*2c733ed4SBarry Smith } 84*2c733ed4SBarry Smith ierr = PetscMemzero(x+idt,bs*sizeof(MatScalar));CHKERRQ(ierr); 85*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 86*2c733ed4SBarry Smith x[idt] += v[0]*s[k]; 87*2c733ed4SBarry Smith x[1+idt] += v[1]*s[k]; 88*2c733ed4SBarry Smith x[2+idt] += v[2]*s[k]; 89*2c733ed4SBarry Smith x[3+idt] += v[3]*s[k]; 90*2c733ed4SBarry Smith x[4+idt] += v[4]*s[k]; 91*2c733ed4SBarry Smith x[5+idt] += v[5]*s[k]; 92*2c733ed4SBarry Smith x[6+idt] += v[6]*s[k]; 93*2c733ed4SBarry Smith x[7+idt] += v[7]*s[k]; 94*2c733ed4SBarry Smith x[8+idt] += v[8]*s[k]; 95*2c733ed4SBarry Smith x[9+idt] += v[9]*s[k]; 96*2c733ed4SBarry Smith x[10+idt] += v[10]*s[k]; 97*2c733ed4SBarry Smith x[11+idt] += v[11]*s[k]; 98*2c733ed4SBarry Smith x[12+idt] += v[12]*s[k]; 99*2c733ed4SBarry Smith x[13+idt] += v[13]*s[k]; 100*2c733ed4SBarry Smith v += 14; 101*2c733ed4SBarry Smith } 102*2c733ed4SBarry Smith } 103*2c733ed4SBarry Smith ierr = VecRestoreArrayRead(bb,&b);CHKERRQ(ierr); 104*2c733ed4SBarry Smith ierr = VecRestoreArray(xx,&x);CHKERRQ(ierr); 105*2c733ed4SBarry Smith ierr = PetscLogFlops(2.0*bs2*(a->nz) - bs*A->cmap->n);CHKERRQ(ierr); 106*2c733ed4SBarry Smith PetscFunctionReturn(0); 107*2c733ed4SBarry Smith } 108*2c733ed4SBarry Smith 109*2c733ed4SBarry Smith /* Block operations are done by accessing one column at at time */ 110*2c733ed4SBarry Smith /* Default MatSolve for block size 13 */ 111*2c733ed4SBarry Smith 112*2c733ed4SBarry Smith PetscErrorCode MatSolve_SeqBAIJ_13_NaturalOrdering(Mat A,Vec bb,Vec xx) 113*2c733ed4SBarry Smith { 114*2c733ed4SBarry Smith Mat_SeqBAIJ *a=(Mat_SeqBAIJ*)A->data; 115*2c733ed4SBarry Smith PetscErrorCode ierr; 116*2c733ed4SBarry Smith const PetscInt n=a->mbs,*ai=a->i,*aj=a->j,*adiag=a->diag,*vi,bs=A->rmap->bs,bs2=a->bs2; 117*2c733ed4SBarry Smith PetscInt i,k,nz,idx,idt,m; 118*2c733ed4SBarry Smith const MatScalar *aa=a->a,*v; 119*2c733ed4SBarry Smith PetscScalar s[13]; 120*2c733ed4SBarry Smith PetscScalar *x,xv; 121*2c733ed4SBarry Smith const PetscScalar *b; 122*2c733ed4SBarry Smith 123*2c733ed4SBarry Smith PetscFunctionBegin; 124*2c733ed4SBarry Smith ierr = VecGetArrayRead(bb,&b);CHKERRQ(ierr); 125*2c733ed4SBarry Smith ierr = VecGetArray(xx,&x);CHKERRQ(ierr); 126*2c733ed4SBarry Smith 127*2c733ed4SBarry Smith /* forward solve the lower triangular */ 128*2c733ed4SBarry Smith for (i=0; i<n; i++) { 129*2c733ed4SBarry Smith v = aa + bs2*ai[i]; 130*2c733ed4SBarry Smith vi = aj + ai[i]; 131*2c733ed4SBarry Smith nz = ai[i+1] - ai[i]; 132*2c733ed4SBarry Smith idt = bs*i; 133*2c733ed4SBarry Smith x[idt] = b[idt]; x[1+idt] = b[1+idt]; x[2+idt] = b[2+idt]; x[3+idt] = b[3+idt]; x[4+idt] = b[4+idt]; 134*2c733ed4SBarry Smith x[5+idt] = b[5+idt]; x[6+idt] = b[6+idt]; x[7+idt] = b[7+idt]; x[8+idt] = b[8+idt]; x[9+idt] = b[9+idt]; 135*2c733ed4SBarry Smith x[10+idt] = b[10+idt]; x[11+idt] = b[11+idt]; x[12+idt] = b[12+idt]; 136*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 137*2c733ed4SBarry Smith idx = bs*vi[m]; 138*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 139*2c733ed4SBarry Smith xv = x[k + idx]; 140*2c733ed4SBarry Smith x[idt] -= v[0]*xv; 141*2c733ed4SBarry Smith x[1+idt] -= v[1]*xv; 142*2c733ed4SBarry Smith x[2+idt] -= v[2]*xv; 143*2c733ed4SBarry Smith x[3+idt] -= v[3]*xv; 144*2c733ed4SBarry Smith x[4+idt] -= v[4]*xv; 145*2c733ed4SBarry Smith x[5+idt] -= v[5]*xv; 146*2c733ed4SBarry Smith x[6+idt] -= v[6]*xv; 147*2c733ed4SBarry Smith x[7+idt] -= v[7]*xv; 148*2c733ed4SBarry Smith x[8+idt] -= v[8]*xv; 149*2c733ed4SBarry Smith x[9+idt] -= v[9]*xv; 150*2c733ed4SBarry Smith x[10+idt] -= v[10]*xv; 151*2c733ed4SBarry Smith x[11+idt] -= v[11]*xv; 152*2c733ed4SBarry Smith x[12+idt] -= v[12]*xv; 153*2c733ed4SBarry Smith v += 13; 154*2c733ed4SBarry Smith } 155*2c733ed4SBarry Smith } 156*2c733ed4SBarry Smith } 157*2c733ed4SBarry Smith /* backward solve the upper triangular */ 158*2c733ed4SBarry Smith for (i=n-1; i>=0; i--) { 159*2c733ed4SBarry Smith v = aa + bs2*(adiag[i+1]+1); 160*2c733ed4SBarry Smith vi = aj + adiag[i+1]+1; 161*2c733ed4SBarry Smith nz = adiag[i] - adiag[i+1] - 1; 162*2c733ed4SBarry Smith idt = bs*i; 163*2c733ed4SBarry Smith s[0] = x[idt]; s[1] = x[1+idt]; s[2] = x[2+idt]; s[3] = x[3+idt]; s[4] = x[4+idt]; 164*2c733ed4SBarry Smith s[5] = x[5+idt]; s[6] = x[6+idt]; s[7] = x[7+idt]; s[8] = x[8+idt]; s[9] = x[9+idt]; 165*2c733ed4SBarry Smith s[10] = x[10+idt]; s[11] = x[11+idt]; s[12] = x[12+idt]; 166*2c733ed4SBarry Smith 167*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 168*2c733ed4SBarry Smith idx = bs*vi[m]; 169*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 170*2c733ed4SBarry Smith xv = x[k + idx]; 171*2c733ed4SBarry Smith s[0] -= v[0]*xv; 172*2c733ed4SBarry Smith s[1] -= v[1]*xv; 173*2c733ed4SBarry Smith s[2] -= v[2]*xv; 174*2c733ed4SBarry Smith s[3] -= v[3]*xv; 175*2c733ed4SBarry Smith s[4] -= v[4]*xv; 176*2c733ed4SBarry Smith s[5] -= v[5]*xv; 177*2c733ed4SBarry Smith s[6] -= v[6]*xv; 178*2c733ed4SBarry Smith s[7] -= v[7]*xv; 179*2c733ed4SBarry Smith s[8] -= v[8]*xv; 180*2c733ed4SBarry Smith s[9] -= v[9]*xv; 181*2c733ed4SBarry Smith s[10] -= v[10]*xv; 182*2c733ed4SBarry Smith s[11] -= v[11]*xv; 183*2c733ed4SBarry Smith s[12] -= v[12]*xv; 184*2c733ed4SBarry Smith v += 13; 185*2c733ed4SBarry Smith } 186*2c733ed4SBarry Smith } 187*2c733ed4SBarry Smith ierr = PetscMemzero(x+idt,bs*sizeof(MatScalar));CHKERRQ(ierr); 188*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 189*2c733ed4SBarry Smith x[idt] += v[0]*s[k]; 190*2c733ed4SBarry Smith x[1+idt] += v[1]*s[k]; 191*2c733ed4SBarry Smith x[2+idt] += v[2]*s[k]; 192*2c733ed4SBarry Smith x[3+idt] += v[3]*s[k]; 193*2c733ed4SBarry Smith x[4+idt] += v[4]*s[k]; 194*2c733ed4SBarry Smith x[5+idt] += v[5]*s[k]; 195*2c733ed4SBarry Smith x[6+idt] += v[6]*s[k]; 196*2c733ed4SBarry Smith x[7+idt] += v[7]*s[k]; 197*2c733ed4SBarry Smith x[8+idt] += v[8]*s[k]; 198*2c733ed4SBarry Smith x[9+idt] += v[9]*s[k]; 199*2c733ed4SBarry Smith x[10+idt] += v[10]*s[k]; 200*2c733ed4SBarry Smith x[11+idt] += v[11]*s[k]; 201*2c733ed4SBarry Smith x[12+idt] += v[12]*s[k]; 202*2c733ed4SBarry Smith v += 13; 203*2c733ed4SBarry Smith } 204*2c733ed4SBarry Smith } 205*2c733ed4SBarry Smith ierr = VecRestoreArrayRead(bb,&b);CHKERRQ(ierr); 206*2c733ed4SBarry Smith ierr = VecRestoreArray(xx,&x);CHKERRQ(ierr); 207*2c733ed4SBarry Smith ierr = PetscLogFlops(2.0*bs2*(a->nz) - bs*A->cmap->n);CHKERRQ(ierr); 208*2c733ed4SBarry Smith PetscFunctionReturn(0); 209*2c733ed4SBarry Smith } 210*2c733ed4SBarry Smith 211*2c733ed4SBarry Smith /* Block operations are done by accessing one column at at time */ 212*2c733ed4SBarry Smith /* Default MatSolve for block size 12 */ 213*2c733ed4SBarry Smith 214*2c733ed4SBarry Smith PetscErrorCode MatSolve_SeqBAIJ_12_NaturalOrdering(Mat A,Vec bb,Vec xx) 215*2c733ed4SBarry Smith { 216*2c733ed4SBarry Smith Mat_SeqBAIJ *a=(Mat_SeqBAIJ*)A->data; 217*2c733ed4SBarry Smith PetscErrorCode ierr; 218*2c733ed4SBarry Smith const PetscInt n=a->mbs,*ai=a->i,*aj=a->j,*adiag=a->diag,*vi,bs=A->rmap->bs,bs2=a->bs2; 219*2c733ed4SBarry Smith PetscInt i,k,nz,idx,idt,m; 220*2c733ed4SBarry Smith const MatScalar *aa=a->a,*v; 221*2c733ed4SBarry Smith PetscScalar s[12]; 222*2c733ed4SBarry Smith PetscScalar *x,xv; 223*2c733ed4SBarry Smith const PetscScalar *b; 224*2c733ed4SBarry Smith 225*2c733ed4SBarry Smith PetscFunctionBegin; 226*2c733ed4SBarry Smith ierr = VecGetArrayRead(bb,&b);CHKERRQ(ierr); 227*2c733ed4SBarry Smith ierr = VecGetArray(xx,&x);CHKERRQ(ierr); 228*2c733ed4SBarry Smith 229*2c733ed4SBarry Smith /* forward solve the lower triangular */ 230*2c733ed4SBarry Smith for (i=0; i<n; i++) { 231*2c733ed4SBarry Smith v = aa + bs2*ai[i]; 232*2c733ed4SBarry Smith vi = aj + ai[i]; 233*2c733ed4SBarry Smith nz = ai[i+1] - ai[i]; 234*2c733ed4SBarry Smith idt = bs*i; 235*2c733ed4SBarry Smith x[idt] = b[idt]; x[1+idt] = b[1+idt]; x[2+idt] = b[2+idt]; x[3+idt] = b[3+idt]; x[4+idt] = b[4+idt]; 236*2c733ed4SBarry Smith x[5+idt] = b[5+idt]; x[6+idt] = b[6+idt]; x[7+idt] = b[7+idt]; x[8+idt] = b[8+idt]; x[9+idt] = b[9+idt]; 237*2c733ed4SBarry Smith x[10+idt] = b[10+idt]; x[11+idt] = b[11+idt]; 238*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 239*2c733ed4SBarry Smith idx = bs*vi[m]; 240*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 241*2c733ed4SBarry Smith xv = x[k + idx]; 242*2c733ed4SBarry Smith x[idt] -= v[0]*xv; 243*2c733ed4SBarry Smith x[1+idt] -= v[1]*xv; 244*2c733ed4SBarry Smith x[2+idt] -= v[2]*xv; 245*2c733ed4SBarry Smith x[3+idt] -= v[3]*xv; 246*2c733ed4SBarry Smith x[4+idt] -= v[4]*xv; 247*2c733ed4SBarry Smith x[5+idt] -= v[5]*xv; 248*2c733ed4SBarry Smith x[6+idt] -= v[6]*xv; 249*2c733ed4SBarry Smith x[7+idt] -= v[7]*xv; 250*2c733ed4SBarry Smith x[8+idt] -= v[8]*xv; 251*2c733ed4SBarry Smith x[9+idt] -= v[9]*xv; 252*2c733ed4SBarry Smith x[10+idt] -= v[10]*xv; 253*2c733ed4SBarry Smith x[11+idt] -= v[11]*xv; 254*2c733ed4SBarry Smith v += 12; 255*2c733ed4SBarry Smith } 256*2c733ed4SBarry Smith } 257*2c733ed4SBarry Smith } 258*2c733ed4SBarry Smith /* backward solve the upper triangular */ 259*2c733ed4SBarry Smith for (i=n-1; i>=0; i--) { 260*2c733ed4SBarry Smith v = aa + bs2*(adiag[i+1]+1); 261*2c733ed4SBarry Smith vi = aj + adiag[i+1]+1; 262*2c733ed4SBarry Smith nz = adiag[i] - adiag[i+1] - 1; 263*2c733ed4SBarry Smith idt = bs*i; 264*2c733ed4SBarry Smith s[0] = x[idt]; s[1] = x[1+idt]; s[2] = x[2+idt]; s[3] = x[3+idt]; s[4] = x[4+idt]; 265*2c733ed4SBarry Smith s[5] = x[5+idt]; s[6] = x[6+idt]; s[7] = x[7+idt]; s[8] = x[8+idt]; s[9] = x[9+idt]; 266*2c733ed4SBarry Smith s[10] = x[10+idt]; s[11] = x[11+idt]; 267*2c733ed4SBarry Smith 268*2c733ed4SBarry Smith for (m=0; m<nz; m++) { 269*2c733ed4SBarry Smith idx = bs*vi[m]; 270*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 271*2c733ed4SBarry Smith xv = x[k + idx]; 272*2c733ed4SBarry Smith s[0] -= v[0]*xv; 273*2c733ed4SBarry Smith s[1] -= v[1]*xv; 274*2c733ed4SBarry Smith s[2] -= v[2]*xv; 275*2c733ed4SBarry Smith s[3] -= v[3]*xv; 276*2c733ed4SBarry Smith s[4] -= v[4]*xv; 277*2c733ed4SBarry Smith s[5] -= v[5]*xv; 278*2c733ed4SBarry Smith s[6] -= v[6]*xv; 279*2c733ed4SBarry Smith s[7] -= v[7]*xv; 280*2c733ed4SBarry Smith s[8] -= v[8]*xv; 281*2c733ed4SBarry Smith s[9] -= v[9]*xv; 282*2c733ed4SBarry Smith s[10] -= v[10]*xv; 283*2c733ed4SBarry Smith s[11] -= v[11]*xv; 284*2c733ed4SBarry Smith v += 12; 285*2c733ed4SBarry Smith } 286*2c733ed4SBarry Smith } 287*2c733ed4SBarry Smith ierr = PetscMemzero(x+idt,bs*sizeof(MatScalar));CHKERRQ(ierr); 288*2c733ed4SBarry Smith for (k=0; k<bs; k++) { 289*2c733ed4SBarry Smith x[idt] += v[0]*s[k]; 290*2c733ed4SBarry Smith x[1+idt] += v[1]*s[k]; 291*2c733ed4SBarry Smith x[2+idt] += v[2]*s[k]; 292*2c733ed4SBarry Smith x[3+idt] += v[3]*s[k]; 293*2c733ed4SBarry Smith x[4+idt] += v[4]*s[k]; 294*2c733ed4SBarry Smith x[5+idt] += v[5]*s[k]; 295*2c733ed4SBarry Smith x[6+idt] += v[6]*s[k]; 296*2c733ed4SBarry Smith x[7+idt] += v[7]*s[k]; 297*2c733ed4SBarry Smith x[8+idt] += v[8]*s[k]; 298*2c733ed4SBarry Smith x[9+idt] += v[9]*s[k]; 299*2c733ed4SBarry Smith x[10+idt] += v[10]*s[k]; 300*2c733ed4SBarry Smith x[11+idt] += v[11]*s[k]; 301*2c733ed4SBarry Smith v += 12; 302*2c733ed4SBarry Smith } 303*2c733ed4SBarry Smith } 304*2c733ed4SBarry Smith ierr = VecRestoreArrayRead(bb,&b);CHKERRQ(ierr); 305*2c733ed4SBarry Smith ierr = VecRestoreArray(xx,&x);CHKERRQ(ierr); 306*2c733ed4SBarry Smith ierr = PetscLogFlops(2.0*bs2*(a->nz) - bs*A->cmap->n);CHKERRQ(ierr); 307*2c733ed4SBarry Smith PetscFunctionReturn(0); 308*2c733ed4SBarry Smith } 309