Commits

Tobin Isaac committed b2ec919

MatSOR_SeqBAIJ: protect against zero vector length

Comments (0)

Files changed (1)

src/mat/impls/baij/seq/baij.c

 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   ierr  = VecGetArray(xx,&x);CHKERRQ(ierr);
 
   if (!a->idiagvalid) {ierr = MatInvertBlockDiagonal(A,NULL);CHKERRQ(ierr);}
 
+  if (!m) PetscFunctionReturn(0);
   diag  = a->diag;
   idiag = a->idiag;
   if (!a->mult_work) {