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

Bugfix:

In operator= for assigning a BCRSMatrix that was constructed without
specifying the number of nonzero one has to calculate the number of
nonzeros before allocating memory.

[[Imported from SVN: r699]]
parent 48ae7a79
No related branches found
No related tags found
No related merge requests found
......@@ -427,8 +427,15 @@ namespace Dune {
// free rows
A::template free<row_type>(r);
if (Mat.nnz<=0)
{
nnz = 0;
for (size_type i=0; i<Mat.n; i++)
nnz += Mat.r[i].getsize();
}
// allocate a,j
allocate(Mat.n, Mat.m, Mat.nnz, n!=Mat.n);
allocate(Mat.n, Mat.m, nnz, n!=Mat.n);
// build window structure
copyWindowStructure(Mat);
......
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