45 #include "AbstractLinAlgPack_assert_print_nan_inf.hpp"
46 #include "AbstractLinAlgPack_Vector.hpp"
48 #include "RTOpPack_RTOpC.hpp"
50 #include "Teuchos_Assert.hpp"
58 class init_rtop_server_t {
60 init_rtop_server_t() {
66 init_rtop_server_t init_rtop_server;
70 bool AbstractLinAlgPack::assert_print_nan_inf(
const value_type& val,
const char name[]
71 ,
bool throw_excpt, std::ostream* out )
73 if( RTOp_is_nan_inf(val) ) {
74 std::ostringstream omsg;
76 <<
"The scalar \"" << name
77 <<
"\" = " << val <<
" is not a valid bounded number";
79 *out << omsg.str() << std::endl;
81 throw_excpt,NaNInfException
82 ,
"assert_print_nan_inf(...) : Error, " << omsg.str() );
88 bool AbstractLinAlgPack::assert_print_nan_inf(
89 const Vector& v,
const char name[]
90 ,
bool throw_excpt, std::ostream* out
94 const Vector* vecs[1] = { &v };
95 apply_op(find_nan_inf_op,1,vecs,0,NULL,&*find_nan_inf_targ);
96 RTOp_ROp_find_nan_inf_reduct_obj_t
100 <<
"The vector \"" << name <<
"\" has the first following NaN or Inf element\n"
101 << name <<
"(" << ele.i <<
") = " << ele.v0_i << std::endl;
104 ele.i && throw_excpt, NaNInfException
105 ,
"assert_print_nan_inf(...) : Error, the vector named "
106 << name <<
" has at least one element which is NaN or Inf" );
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void reduct_obj_reinit(const Ptr< ReductTarget > &reduct_obj) const
Teuchos::RCP< ReductTarget > reduct_obj_create() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
struct RTOp_ROp_find_nan_inf_reduct_obj_t RTOp_ROp_find_nan_inf_val(RTOp_ReductTarget targ_obj)