Skip to content

Commit

Permalink
BUG: initialize X to zero in lsmr Solve
Browse files Browse the repository at this point in the history
Since x wasn't initialized, behavior was not well defined.
  • Loading branch information
tvercaut committed Jul 7, 2016
1 parent 5d83c91 commit 83bd9f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/lsmrBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ Solve( unsigned int m, unsigned int n, const double * b, double * x )
std::copy( b, b+m, u );
std::fill( v, v+n, zero);
std::fill( w, v+n, zero);
std::fill( x, x+n, zero);

this->Scale( m, (-1.0), u );
this->Aprod1( m, n, x, u );
this->Scale( m, (-1.0), u );
Expand Down

0 comments on commit 83bd9f7

Please sign in to comment.