inline EDescent StringToEDescent(std::string s) { s = removeStringFormat(s); for ( EDescent des = DESCENT_STEEPEST; des < DESCENT_LAST; des++ ) { if ( !s.compare(removeStringFormat(EDescentToString(des))) ) { return des; } } return DESCENT_SECANT; }
/** \brief Print step name. This function produces a string containing the algorithmic step information. */ std::string printName( void ) const { std::stringstream hist; hist << "\n" << EDescentToString(edesc_) << " with " << ELineSearchToString(els_) << " Linesearch satisfying " << ECurvatureConditionToString(econd_) << "\n"; if ( edesc_ == DESCENT_NEWTONKRYLOV ) { hist << "Krylov Type: " << EKrylovToString(ekv_) << "\n"; } if ( edesc_ == DESCENT_SECANT || (edesc_ == DESCENT_NEWTONKRYLOV && (useSecantPrecond_ || useSecantHessVec_)) ) { hist << "Secant Type: " << ESecantToString(esec_) << "\n"; } if ( edesc_ == DESCENT_NONLINEARCG ) { hist << "Nonlinear CG Type: " << ENonlinearCGToString(enlcg_) << "\n"; } return hist.str(); }