In reorthogonalization methods Modified 2-Sync Gramm-Schmidt and Postmodern Gramm_Schmidt, member variable h_rv_ (a pointer to real_type) is first allocated
h_rv_ = new real_type[num_vecs_ + 1];
and then, a few lines later, a new value is assigned to the pointer h_rv_ as
h_rv_ = vec_rv_->getVectorData(1, memory::HOST);
thus leaking previous allocation.
There is no need for h_rv_ to be a member variable to begin with, since it is used only locally in Modified 2-sync and Postmodern Gram-Schmidt methods. It should be defined locally in the orthogonalize function and initialized to nullptr.
In reorthogonalization methods Modified 2-Sync Gramm-Schmidt and Postmodern Gramm_Schmidt, member variable
h_rv_
(a pointer toreal_type
) is first allocatedand then, a few lines later, a new value is assigned to the pointer
h_rv_
asthus leaking previous allocation.
There is no need for
h_rv_
to be a member variable to begin with, since it is used only locally in Modified 2-sync and Postmodern Gram-Schmidt methods. It should be defined locally in theorthogonalize
function and initialized tonullptr
.CC @stonecoldhughes @maksud