Possible bug in Teuchos::SerialDenseSolve::factor()
Created by: bartgol
In case refineSolution_==true, the matrix and the factor are stored separately. However, the way the factor is created, that is,
Factor_ = rcp( new SerialDenseMatrix<OrdinalType,ScalarType>(*Matrix_) );
is buggy (I think). In fact, if the original matrix was created as a view (of either another matrix or some raw pointer), then the copy constructor will not do a deep copy of the array values_ stored in *Matrix_, but will only copy the pointer. I believe the above line should be replaced with
Factor_ = rcp( new SerialDenseMatrix<OrdinalType,ScalarType>(Teuchos::Copy, *Matrix_) );
to ensure that *Factor_ is indeed a deep copy of *Matrix_, regardless of how *Matrix_ was created.