18% performance boost by using pointer to address destination matrix A
parent
631248f902
commit
be10fc2a90
|
@ -345,8 +345,12 @@ weighted_eliminate(Matrix& A, Vector& b, const Vector& sigmas) {
|
|||
for (int i=0;i<m;++i) { // update all rows
|
||||
double ai = a(i);
|
||||
b(i) -= ai*d;
|
||||
for (int j2=j+1;j2<n;++j2) // limit to only columns in separator
|
||||
A(i,j2) -= ai*r(j2);
|
||||
double *Aptr = A.data().begin()+i*n+j+1;
|
||||
for (int j2=j+1;j2<n;++j2){ // limit to only columns in separator
|
||||
//A(i,j2) -= ai*r(j2);
|
||||
*Aptr -= ai*r(j2);
|
||||
Aptr++;
|
||||
}
|
||||
}
|
||||
if (verbose) print(sub(A,0,m,j+1,n), "updated A");
|
||||
if (verbose) print(b, "updated b ");
|
||||
|
|
Loading…
Reference in New Issue