55 ,
const char func_name[]
62 sqrt_macheps =
::sqrt(std::numeric_limits<value_type>::epsilon()),
63 min_sTy = sqrt_macheps * nrm_s * nrm_y;
66 sufficiently_p_d = sTy > min_sTy;
67 if( !sufficiently_p_d && out ) {
69 *out << func_name <<
" : ";
71 <<
"Error, s'*y = " << sTy <<
" < sqrt(mach_eps) * ||s||2 * ||y||2 = "
72 << sqrt_macheps <<
" * " << nrm_s <<
" * " << nrm_y <<
" = " << min_sTy
73 <<
"\nTherefore the BFGS update is illdefined!\n";
75 return sufficiently_p_d;
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
RTOp_value_type value_type
virtual value_type norm_2() const
Two norm. ||v||_2 = sqrt( sum( v(i)^2, i = 1,,,this->dim() ) )
bool BFGS_sTy_suff_p_d(const Vector &s, const Vector &y, const value_type *sTy=NULL, std::ostream *out=NULL, const char func_name[]=NULL)
Check that s'*y is sufficiently positive and print the result if it is not.
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2
void sqrt(DVectorSlice *vs_lhs, const DVectorSlice &vs_rhs)
vs_lhs = sqrt(vs_rhs)