Skip to content
Snippets Groups Projects
Commit 0ad9d513 authored by Markus Blatt's avatar Markus Blatt
Browse files

Merge branch 'fix-amg-empty-matrix-on-one-proc' into 'master'

Fix segmentation fault in AMG if matrix of one rank is empty.

See merge request !159
parents 55b6f9ea 8434134d
No related branches found
No related tags found
1 merge request!159Fix segmentation fault in AMG if matrix of one rank is empty.
Pipeline #
......@@ -927,6 +927,9 @@ namespace Dune {
DUNE_THROW(BCRSMatrixError,"creation only allowed for uninitialized matrix");
if(Mat.build_mode!=row_wise)
DUNE_THROW(BCRSMatrixError,"creation only allowed if row wise allocation was requested in the constructor");
if(i==0 && _Mat.N()==0)
// empty Matrix is always built.
Mat.ready = built;
}
//! prefix increment
......
......@@ -1986,6 +1986,11 @@ namespace Dune
VertexDescriptor* edge=edges_;
// Cater for the case that there are no vertices.
// Otherwise endVertex_ will get 1 below.
if ( graph.noVertices() == 0)
return;
typedef typename Graph::ConstVertexIterator Iterator;
Iterator endVertex=graph.end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment