Skip to content

Commit

Permalink
Stupid changes to resolve FPEs
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Bettencourt committed Apr 23, 2020
1 parent f86a556 commit 2134660
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
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

0 comments on commit 2134660

Please sign in to comment.