63 ,
bool print_all_warnings
77 sep_line[] =
"\n-----------------------------------------------------------------\n";
84 <<
"\n|(sum(B*s)-sum(y))/||y||inf| = ";
92 err = ::fabs( (sum_Bs - sum_y) / nrm_y );
95 <<
"|("<<sum_Bs<<
"-"<<sum_y<<
")/"<<nrm_y<<
"| = " << err << std::endl;
96 if( err >= error_tol ) {
99 <<
"Error, above error = " << err <<
" >= error_tol = " << error_tol
100 <<
"\nThe test has failed!\n";
101 if(out && print_all_warnings) {
110 else if( err >= warning_tol ) {
113 <<
"Warning!, above error = " << err <<
" >= warning_tol = " << warning_tol << std::endl;
123 <<
"\n|(sum(inv(B)*y)-sum(s))/||s||inf| = ";
128 sum_InvBy =
sum(*InvBy),
131 err = ::fabs( (sum_InvBy - sum_s) / nrm_s );
134 <<
"|("<<sum_InvBy<<
"-"<<sum_s<<
")/"<<nrm_s<<
"| = " << err << std::endl;
135 if( err >= error_tol ) {
138 <<
"Error, above error = " << err <<
" >= error_tol = " << error_tol
139 <<
"\nThe test has failed!\n";
140 if(out && print_all_warnings) {
144 <<
"\ninv(B)*y =\n" << *InvBy
149 else if( err >= warning_tol ) {
152 <<
"Warning!, above error = " << err <<
" >= warning_tol = " << warning_tol << std::endl;
virtual const VectorSpace & space() const =0
Return the vector space that this vector belongs to.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
virtual value_type norm_inf() const
Infinity norm. ||v||_inf = max( |v(i)|, i = 1,,,this->dim() )
RTOp_value_type value_type
const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_dbl_prec const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_int LAPACK_C_Decl::f_dbl_prec B[]
void V_InvMtV(VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
v_lhs = inv(op(M_rhs1)) * v_rhs2
bool assert_print_nan_inf(const value_type &val, const char name[], bool throw_excpt, std::ostream *out)
This function asserts if a value_type scalare is a NaN or Inf and optionally prints out these entires...
Base class for all matrices that support basic matrix operations.
void V_MtV(VectorMutable *v_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs = op(M_rhs1) * V_rhs2.
bool TestMatrixSymSecant(const MatrixOp &B, const Vector &s, const Vector &y, value_type warning_tol, value_type error_tol, bool print_all_warnings, std::ostream *out, bool trase=true)
Checks the secant condition B*s = y.
value_type sum(const Vector &v_rhs)
result = sum( v_rhs(i), i = 1,,,dim )
virtual vec_mut_ptr_t create_member() const =0
Create a vector member from the vector space.
Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with bu...