| dense.c (2ffef20af2c47fa8de84ff175d9b4dd7f3672115) | dense.c (ef66eb6987ddfdf4e414d6b820cbc8d8d7d17bc2) |
|---|---|
| 1/*$Id: dense.c,v 1.206 2001/08/07 03:02:45 balay Exp bsmith $*/ | 1/*$Id: dense.c,v 1.207 2001/08/24 16:12:05 bsmith Exp bsmith $*/ |
| 2/* 3 Defines the basic matrix operations for sequential dense. 4*/ 5 6#include "src/mat/impls/dense/seq/dense.h" 7#include "petscblaslapack.h" 8 9#undef __FUNCT__ --- 352 unchanged lines hidden (view full) --- 362 ierr = VecGetArray(xx,&x);CHKERRQ(ierr); 363 ierr = VecGetArray(bb,&b);CHKERRQ(ierr); 364 while (its--) { 365 if (flag & SOR_FORWARD_SWEEP){ 366 for (i=0; i<m; i++) { 367#if defined(PETSC_USE_COMPLEX) 368 /* cannot use BLAS dot for complex because compiler/linker is 369 not happy about returning a double complex */ | 2/* 3 Defines the basic matrix operations for sequential dense. 4*/ 5 6#include "src/mat/impls/dense/seq/dense.h" 7#include "petscblaslapack.h" 8 9#undef __FUNCT__ --- 352 unchanged lines hidden (view full) --- 362 ierr = VecGetArray(xx,&x);CHKERRQ(ierr); 363 ierr = VecGetArray(bb,&b);CHKERRQ(ierr); 364 while (its--) { 365 if (flag & SOR_FORWARD_SWEEP){ 366 for (i=0; i<m; i++) { 367#if defined(PETSC_USE_COMPLEX) 368 /* cannot use BLAS dot for complex because compiler/linker is 369 not happy about returning a double complex */ |
| 370 int _i; | 370 int _i; |
| 371 PetscScalar sum = b[i]; 372 for (_i=0; _i<m; _i++) { 373 sum -= PetscConj(v[i+_i*m])*x[_i]; 374 } 375 xt = sum; 376#else 377 xt = b[i]-BLdot_(&m,v+i,&m,x,&o); 378#endif 379 x[i] = (1. - omega)*x[i] + omega*(xt+v[i + i*m]*x[i])/(v[i + i*m]+shift); 380 } 381 } 382 if (flag & SOR_BACKWARD_SWEEP) { 383 for (i=m-1; i>=0; i--) { 384#if defined(PETSC_USE_COMPLEX) 385 /* cannot use BLAS dot for complex because compiler/linker is 386 not happy about returning a double complex */ | 371 PetscScalar sum = b[i]; 372 for (_i=0; _i<m; _i++) { 373 sum -= PetscConj(v[i+_i*m])*x[_i]; 374 } 375 xt = sum; 376#else 377 xt = b[i]-BLdot_(&m,v+i,&m,x,&o); 378#endif 379 x[i] = (1. - omega)*x[i] + omega*(xt+v[i + i*m]*x[i])/(v[i + i*m]+shift); 380 } 381 } 382 if (flag & SOR_BACKWARD_SWEEP) { 383 for (i=m-1; i>=0; i--) { 384#if defined(PETSC_USE_COMPLEX) 385 /* cannot use BLAS dot for complex because compiler/linker is 386 not happy about returning a double complex */ |
| 387 int _i; | 387 int _i; |
| 388 PetscScalar sum = b[i]; 389 for (_i=0; _i<m; _i++) { 390 sum -= PetscConj(v[i+_i*m])*x[_i]; 391 } 392 xt = sum; 393#else 394 xt = b[i]-BLdot_(&m,v+i,&m,x,&o); 395#endif --- 1151 unchanged lines hidden --- | 388 PetscScalar sum = b[i]; 389 for (_i=0; _i<m; _i++) { 390 sum -= PetscConj(v[i+_i*m])*x[_i]; 391 } 392 xt = sum; 393#else 394 xt = b[i]-BLdot_(&m,v+i,&m,x,&o); 395#endif --- 1151 unchanged lines hidden --- |