Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stupid changes to resolve FPEs #7245

Merged
merged 2 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/belos/src/BelosStatusTestGenResNorm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,8 @@ StatusType StatusTestGenResNorm<ScalarType,MV,OP>::checkStatus( Iteration<Scalar
// Check if this index is valid
if (*p != -1) {
// Scale the std::vector accordingly
if ( scalevector_[ *p ] != zero ) {
// Don't intentionally divide by zero.
testvector_[ *p ] = resvector_[ *p ] / scalevector_[ *p ] / scalevalue_;
} else {
testvector_[ *p ] = resvector_[ *p ] / scalevalue_;
}
testvector_[ *p ] =
scalevector_[ *p ] != zero? resvector_[ *p ] / scalevalue_ : resvector_[ *p ] / scalevalue_;
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/ifpack2/src/Ifpack2_Relaxation_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,9 +1119,10 @@ void Relaxation<MatrixType>::compute ()
// Teuchos::ScalarTraits when its template parameter is not a
// floating-point type. (Ifpack2 sometimes gets instantiated for
// integer Scalar types.)
const IST oneOverMinDiagVal = (MinDiagonalValue_ == zero) ?
KAT::one () / static_cast<IST> (SmallTraits<scalar_type>::eps ()) :
KAT::one () / static_cast<IST> (MinDiagonalValue_);
IST oneOverMinDiagVal = KAT::one () / static_cast<IST> (SmallTraits<scalar_type>::eps ());
if ( MinDiagonalValue_ != zero)
oneOverMinDiagVal = KAT::one () / static_cast<IST> (MinDiagonalValue_);

// It's helpful not to have to recompute this magnitude each time.
const magnitude_type minDiagValMag = STS::magnitude (MinDiagonalValue_);

Expand Down