inline ECurvatureCondition StringToECurvatureCondition(std::string s) { s = removeStringFormat(s); for ( ECurvatureCondition cc = CURVATURECONDITION_WOLFE; cc < CURVATURECONDITION_LAST; cc++ ) { if ( !s.compare(removeStringFormat(ECurvatureConditionToString(cc))) ) { return cc; } } return CURVATURECONDITION_WOLFE; }
inline ETestObjectives StringToETestObjectives(std::string s) { s = removeStringFormat(s); for ( ETestObjectives to = TESTOBJECTIVES_ROSENBROCK; to < TESTOBJECTIVES_LAST; to++ ) { if ( !s.compare(removeStringFormat(ETestObjectivesToString(to))) ) { return to; } } return TESTOBJECTIVES_ROSENBROCK; }
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; }
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; }
inline ESecant StringToESecant(std::string s) { s = removeStringFormat(s); for ( ESecant sec = SECANT_LBFGS; sec < SECANT_LAST; sec++ ) { if ( !s.compare(removeStringFormat(ESecantToString(sec))) ) { return sec; } } return SECANT_LBFGS; }
inline EKrylov StringToEKrylov(std::string s) { s = removeStringFormat(s); for ( EKrylov des = KRYLOV_CG; des < KRYLOV_LAST; des++ ) { if ( !s.compare(removeStringFormat(EKrylovToString(des))) ) { return des; } } return KRYLOV_CG; }
inline EBoundAlgorithm StringToEBoundAlgorithm(std::string s) { s = removeStringFormat(s); for ( EBoundAlgorithm des = BOUNDALGORITHM_PROJECTED; des < BOUNDALGORITHM_LAST; des++ ) { if ( !s.compare(removeStringFormat(EBoundAlgorithmToString(des))) ) { return des; } } return BOUNDALGORITHM_PROJECTED; }
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; }
inline EConstraint StringToEConstraint(std::string s) { s = removeStringFormat(s); for ( EConstraint ctype = CONSTRAINT_EQUALITY; ctype < CONSTRAINT_LAST; ctype++ ) { if ( !s.compare(removeStringFormat(EConstraintToString(ctype))) ) { return ctype; } } return CONSTRAINT_EQUALITY; }
inline EStep StringToEStep(std::string s) { s = removeStringFormat(s); for ( EStep tr = STEP_AUGMENTEDLAGRANGIAN; tr < STEP_LAST; tr++ ) { if ( !s.compare(removeStringFormat(EStepToString(tr))) ) { return tr; } } return STEP_TRUSTREGION; }
inline ETestOptProblem StringToETestOptProblem(std::string s) { s = removeStringFormat(s); for ( ETestOptProblem to = TESTOPTPROBLEM_HS1; to < TESTOPTPROBLEM_LAST; to++ ) { if ( !s.compare(removeStringFormat(ETestOptProblemToString(to))) ) { return to; } } return TESTOPTPROBLEM_HS1; }
inline EDistribution StringToEDistribution(std::string s) { s = removeStringFormat(s); for ( EDistribution tr = DISTRIBUTION_ARCSINE; tr < DISTRIBUTION_LAST; tr++ ) { if ( !s.compare(removeStringFormat(EDistributionToString(tr))) ) { return tr; } } return DISTRIBUTION_UNIFORM; }
inline ERiskMeasure StringToERiskMeasure(std::string s) { s = removeStringFormat(s); for ( ERiskMeasure tr = RISKMEASURE_CVAR; tr < RISKMEASURE_LAST; tr++ ) { if ( !s.compare(removeStringFormat(ERiskMeasureToString(tr))) ) { return tr; } } return RISKMEASURE_LAST; }
inline EBarrierType StringToEBarrierType( std::string s ) { s = removeStringFormat(s); for( EBarrierType to = BARRIER_LOGARITHM; to < BARRIER_LAST; ++to ) { if( !s.compare(removeStringFormat(EBarrierToString(to))) ) { return to; } } return BARRIER_LOGARITHM; }
inline EBarrierType StringToEBarrierType( std::string s ) { s = removeStringFormat(s); EBarrierType type = BARRIER_LOGARITHM; for( int to = BARRIER_LOGARITHM; to != BARRIER_LAST; ++to ) { type = static_cast<EBarrierType>(to); if( !s.compare(removeStringFormat(EBarrierToString(type))) ) { return type; } } return type; }