Commit 7a9268d4 authored by Dmitry Bagaev's avatar Dmitry Bagaev

Performance fix in solver_test003

parent c95e8155
...@@ -226,7 +226,7 @@ void Band(int n, int r, Sparse::Matrix & A) ...@@ -226,7 +226,7 @@ void Band(int n, int r, Sparse::Matrix & A)
A.SetInterval(idmin,idmax); A.SetInterval(idmin,idmax);
for (int i=idmin; i<idmax; i++) { for (int i=idmin; i<idmax; i++) {
for (int j=0; j<n; j++) { for (int j=std::max(0, i - r); j < std::max(i + r, n); j++) {
if (abs(i - j) < r) { if (abs(i - j) < r) {
if (i == j) { if (i == j) {
A[i][j] = (ndiag - 1.) + 1e-3; A[i][j] = (ndiag - 1.) + 1e-3;
......
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