mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Count lower/upper entries simpler and faster.
This commit is contained in:
parent
8a038401ce
commit
48db4062b5
@ -446,14 +446,14 @@ namespace Opm
|
||||
size_type numLower = 0;
|
||||
size_type numUpper = 0;
|
||||
const auto endi = A.end();
|
||||
for (auto i=A.begin(); i!=endi; ++i) {
|
||||
for (auto i = A.begin(); i != endi; ++i) {
|
||||
const size_type iIndex = i.index();
|
||||
size_type numLowerRow = 0;
|
||||
for (auto j = (*i).begin(); j.index() < iIndex; ++j) {
|
||||
++numLower;
|
||||
}
|
||||
for (auto j = (*i).beforeEnd(); j.index() > iIndex; --j) {
|
||||
++numUpper;
|
||||
++numLowerRow;
|
||||
}
|
||||
numLower += numLowerRow;
|
||||
numUpper += (*i).size() - numLowerRow - 1;
|
||||
}
|
||||
assert(numLower + numUpper + A.N() == A.nonzeroes());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user