Changeset 485


Ignore:
Timestamp:
Aug 24, 2005 11:20:56 AM (14 years ago)
Author:
andreasw
Message:
  • added option print_info_string, and fit regular output into 80 columns
  • ran astyle
Location:
branches/dev/Algorithm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/Algorithm/IpAlgorithmRegOp.cpp

    r477 r485  
    2222#include "IpOptErrorConvCheck.hpp"
    2323#include "IpOrigIpoptNLP.hpp"
     24#include "IpOrigIterationOutput.hpp"
    2425#include "IpPDFullSpaceSolver.hpp"
    2526#include "IpPDPerturbationHandler.hpp"
     
    6162    roptions->SetRegisteringCategory("NLP");
    6263    OrigIpoptNLP::RegisterOptions(roptions);
     64    roptions->SetRegisteringCategory("Output");
     65    OrigIterationOutput::RegisterOptions(roptions);
    6366    roptions->SetRegisteringCategory("Step Calculation");
    6467    PDFullSpaceSolver::RegisterOptions(roptions);
  • branches/dev/Algorithm/IpFilterLineSearch.hpp

    r460 r485  
    9898    //@}
    9999
    100     /** Methods for IpoptType */
     100    /** Methods for OptionsList */
    101101    //@{
    102102    static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
  • branches/dev/Algorithm/IpOrigIterationOutput.cpp

    r465 r485  
    3131  {}
    3232
     33  void
     34  OrigIterationOutput::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
     35  {
     36    roptions->AddStringOption2(
     37      "print_info_string",
     38      "Enables printing of additional info string at end of iteration output.",
     39      "no",
     40      "no", "don't print string",
     41      "yes", "print string at end of each iteration output",
     42      "This string contains some insider information about the current iteration.");
     43  }
     44
    3345  bool OrigIterationOutput::InitializeImpl(const OptionsList& options,
    3446      const std::string& prefix)
    3547  {
     48    options.GetBoolValue("print_info_string", print_info_string_, prefix);
     49
    3650    return true;
    3751  }
     
    4559    Index iter = IpData().iter_count();
    4660    std::string header =
    47       " iter     objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls\n";
     61      "iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls\n";
    4862    Jnlst().Printf(J_DETAILED, J_MAIN,
    4963                   "\n\n**************************************************\n");
     
    94108    if (!IpData().info_skip_output()) {
    95109      Jnlst().Printf(J_SUMMARY, J_MAIN,
    96                      "%5d%c %14.7e %7.2e %7.2e %5.1f %7.2e %5s %7.2e %7.2e%c%3d %s\n",
     110                     "%4d%c %13.7e %7.2e %7.2e %5.1f %7.2e %5s %7.2e %7.2e%c%3d",
    97111                     iter, info_iter, unscaled_f, inf_pr, inf_du, log10(mu), dnrm, regu_x_ptr,
    98112                     alpha_dual, alpha_primal, alpha_primal_char,
    99                      ls_count, info_string.c_str());
     113                     ls_count);
     114      if (print_info_string_) {
     115        Jnlst().Printf(J_SUMMARY, J_MAIN, " %s", info_string.c_str());
     116      }
     117      else {
     118        Jnlst().Printf(J_DETAILED, J_MAIN, " %s", info_string.c_str());
     119      }
     120      Jnlst().Printf(J_SUMMARY, J_MAIN, "\n");
    100121    }
    101122
  • branches/dev/Algorithm/IpOrigIterationOutput.hpp

    r2 r485  
    1 // Copyright (C) 2004, International Business Machines and others.
     1// Copyright (C) 2004, 2005 International Business Machines and others.
    22// All Rights Reserved.
    33// This code is published under the Common Public License.
     
    3838    virtual void WriteOutput();
    3939
     40    /** Methods for OptionsList */
     41    //@{
     42    static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
     43    //@}
     44
    4045  private:
    4146    /**@name Default Compiler Generated Methods (Hidden to avoid
     
    5156    void operator=(const OrigIterationOutput&);
    5257    //@}
     58
     59    /** Flag indicating weather info string should be printed at end
     60     *  of iteration summary line. */
     61    bool print_info_string_;
    5362  };
    5463
  • branches/dev/Algorithm/IpRestoIterationOutput.cpp

    r465 r485  
    3737      const std::string& prefix)
    3838  {
     39    options.GetBoolValue("print_info_string", print_info_string_, prefix);
     40
    3941    bool retval = true;
    4042    if (IsValid(resto_orig_iteration_output_)) {
     
    7375
    7476    std::string header =
    75       " iter     objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls\n";
     77      "iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls\n";
    7678    Jnlst().Printf(J_DETAILED, J_MAIN,
    7779                   "\n\n**************************************************\n");
     
    136138
    137139    Jnlst().Printf(J_SUMMARY, J_MAIN,
    138                    "%5d%c %14.7e %7.2e %7.2e %5.1f %7.2e %5s %7.2e %7.2e%c%3d %s\n",
     140                   "%4d%c %13.7e %7.2e %7.2e %5.1f %7.2e %5s %7.2e %7.2e%c%3d",
    139141                   iter, info_iter, f, inf_pr, inf_du, log10(mu), dnrm, regu_x_ptr,
    140142                   alpha_dual, alpha_primal, alpha_primal_char,
    141                    ls_count, info_string.c_str());
    142 
     143                   ls_count);
     144    if (print_info_string_) {
     145      Jnlst().Printf(J_SUMMARY, J_MAIN, " %s", info_string.c_str());
     146    }
     147    else {
     148      Jnlst().Printf(J_DETAILED, J_MAIN, " %s", info_string.c_str());
     149    }
     150    Jnlst().Printf(J_SUMMARY, J_MAIN, "\n");
    143151
    144152    //////////////////////////////////////////////////////////////////////
  • branches/dev/Algorithm/IpRestoIterationOutput.hpp

    r2 r485  
    6161    //@}
    6262
     63    /** Pointer to output strategy object during regular iterations. */
    6364    SmartPtr<OrigIterationOutput> resto_orig_iteration_output_;
     65
     66    /** Flag indicating weather info string should be printed at end
     67     *  of iteration summary line. */
     68    bool print_info_string_;
    6469  };
    6570
Note: See TracChangeset for help on using the changeset viewer.