示例#1
0
 inline ENonlinearCG StringToENonlinearCG(std::string s) {
   s = removeStringFormat(s);
   for ( ENonlinearCG nlcg = NONLINEARCG_HESTENES_STIEFEL; nlcg < NONLINEARCG_LAST; nlcg++ ) {
     if ( !s.compare(removeStringFormat(ENonlinearCGToString(nlcg))) ) {
       return nlcg;
     }
   }
   return NONLINEARCG_HESTENES_STIEFEL;
 }
  /** \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();
  }