Skip to content
Snippets Groups Projects
Commit 905c3fcb authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Optimization in GMRES: avoiding a priori known scalar product

parent 44d1be85
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
......@@ -459,8 +459,10 @@ hauseholder_apply_trunc( HostView out,
// no-op if the problem is not distributed
CommunicatorType::Bcast( YL_i.getData(), YL_i.getSize(), 0, Traits::getCommunicationGroup( *this->matrix ) );
// TODO: is aux always 1?
const RealType aux = T[ i + i * (restarting_max + 1) ] * y_i.scalarProduct( z );
// NOTE: aux = t_i * (y_i, z) = 1 since t_i = 2 / ||y_i||^2 and
// (y_i, z) = ||z_trunc||^2 + |z_i| ||z_trunc|| = ||y_i||^2 / 2
// const RealType aux = T[ i + i * (restarting_max + 1) ] * y_i.scalarProduct( z );
constexpr RealType aux = 1.0;
if( localOffset == 0 ) {
if( std::is_same< DeviceType, Devices::Host >::value ) {
for( int k = 0; k <= i; k++ )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment