Exemplo n.º 1
0
 inline ELineSearch StringToELineSearch(std::string s) {
   s = removeStringFormat(s);
   for ( ELineSearch ls = LINESEARCH_ITERATIONSCALING; ls < LINESEARCH_LAST; ls++ ) {
     if ( !s.compare(removeStringFormat(ELineSearchToString(ls))) ) {
       return ls;
     }
   }
   return LINESEARCH_ITERATIONSCALING;
 }
Exemplo n.º 2
0
  /** \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();
  }