Commit b703d4d9 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

BlockOffDiagMatrix:: toSparse

BlockOffDiagMatrix: toSparse()
does not support patches with overlapping rows
That is it supports blocked matrices like so
A 0 0
0 B 0
0 C 0
where A, B, C are matrices.

But does not support
0 0 0
0 A B
0 0 0

Because blocks A and B overlap rows.
parent ca1c29da
......@@ -208,6 +208,20 @@ public:
assert(offsetRows_.size() > 0);
SizeType n = offsetRows_.size() - 1;
for (SizeType ipatch = 0; ipatch < n; ++ipatch) {
SizeType inThisIpatch = 0;
for (SizeType jpatch = 0; jpatch < n; ++jpatch) {
const MatrixBlockType* mptr = data_(ipatch, jpatch);
if (mptr == 0) continue;
++inThisIpatch;
}
if (inThisIpatch > 1)
err(PsimagLite::String("BlockOffDiagMatrix: toSparse() ") +
"does not support patches with overlapping rows\n");
}
VectorSizeType nonzeroInThisRow(rows_, 0);
SizeType count = 0;
for (SizeType ipatch = 0; ipatch < n; ++ipatch) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment