Changeset 460


Ignore:
Timestamp:
Aug 17, 2005 2:32:35 PM (14 years ago)
Author:
claird
Message:

Removed the global object stuff from RegisteredOptions?.
They are now registered manually through calls in IpoptApplication?.

Location:
branches/dev
Files:
6 added
55 edited

Legend:

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

    r440 r460  
    2525
    2626  DBG_SET_VERBOSITY(0);
    27 
    28   DefineOptionsRegistrar(AdaptiveMuUpdate);
    2927
    3028  AdaptiveMuUpdate::AdaptiveMuUpdate
  • branches/dev/Algorithm/IpAdaptiveMuUpdate.hpp

    r430 r460  
    1818namespace Ipopt
    1919{
    20 
    21   DeclareOptionsRegistrar(AdaptiveMuUpdate);
    2220
    2321  /** Non-monotone mu update.
  • branches/dev/Algorithm/IpAlgBuilder.cpp

    r433 r460  
    4242{
    4343  DBG_SET_VERBOSITY(0);
    44 
    45   DefineOptionsRegistrar(AlgorithmBuilder);
    4644
    4745  void AlgorithmBuilder::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
  • branches/dev/Algorithm/IpAlgBuilder.hpp

    r430 r460  
    1414namespace Ipopt
    1515{
    16 
    17   DeclareOptionsRegistrar(AlgorithmBuilder);
    1816
    1917  /** Builder to create a complete IpoptAlg object.  This object
  • branches/dev/Algorithm/IpDefaultIterateInitializer.cpp

    r430 r460  
    1212{
    1313  DBG_SET_VERBOSITY(0);
    14 
    15   DefineOptionsRegistrar(DefaultIterateInitializer);
    1614
    1715  DefaultIterateInitializer::DefaultIterateInitializer
  • branches/dev/Algorithm/IpDefaultIterateInitializer.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(DefaultIterateInitializer);
    1917
    2018  /** Class implementing the default initialization procedure (based
  • branches/dev/Algorithm/IpFilterLineSearch.cpp

    r440 r460  
    3636
    3737  DBG_SET_VERBOSITY(0);
    38 
    39   DefineOptionsRegistrar(FilterLineSearch);
    4038
    4139  FilterLineSearch::FilterLineSearch(const SmartPtr<RestorationPhase>& resto_phase,
  • branches/dev/Algorithm/IpFilterLineSearch.hpp

    r430 r460  
    1818namespace Ipopt
    1919{
    20 
    21   DeclareOptionsRegistrar(FilterLineSearch);
    2220
    2321  /** Filter line search.  This class implements the filter line
  • branches/dev/Algorithm/IpGradientScaling.cpp

    r438 r460  
    2323{
    2424
    25   DefineOptionsRegistrar(GradientScaling);
    26 
    27   void GradientScaling::RegisterOptions(SmartPtr<RegisteredOptions>& roptions)
     25  void GradientScaling::RegisterOptions(const SmartPtr<RegisteredOptions>& roptions)
    2826  {
    2927    roptions->AddLowerBoundedNumberOption(
  • branches/dev/Algorithm/IpGradientScaling.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(GradientScaling);
    19 
    2017  /** This class does problem scaling by setting the
    2118   *  scaling parameters based on the maximum of the
     
    4138    //@{
    4239    /** Register the options for this class */
    43     static void RegisterOptions(SmartPtr<RegisteredOptions>& roptions);
     40    static void RegisterOptions(const SmartPtr<RegisteredOptions>& roptions);
    4441    //@}
    4542
  • branches/dev/Algorithm/IpIpoptAlg.cpp

    r440 r460  
    1414{
    1515  DBG_SET_VERBOSITY(0);
    16 
    17   DefineOptionsRegistrar(IpoptAlgorithm);
    1816
    1917  IpoptAlgorithm::IpoptAlgorithm(const SmartPtr<PDSystemSolver>& pd_solver,
  • branches/dev/Algorithm/IpIpoptAlg.hpp

    r430 r460  
    2323namespace Ipopt
    2424{
    25 
    26   DeclareOptionsRegistrar(IpoptAlgorithm);
    2725
    2826  /** The main ipopt algorithm class.
  • branches/dev/Algorithm/IpIpoptCalculatedQuantities.cpp

    r438 r460  
    2424{
    2525  DBG_SET_VERBOSITY(0);
    26 
    27   DefineOptionsRegistrar(IpoptCalculatedQuantities);
    2826
    2927  IpoptCalculatedQuantities::IpoptCalculatedQuantities
  • branches/dev/Algorithm/IpIpoptCalculatedQuantities.hpp

    r430 r460  
    2222    NORM_MAX
    2323  };
    24 
    25   DeclareOptionsRegistrar(IpoptCalculatedQuantities);
    2624
    2725  /** Class for all IPOPT specific calculated quantities.
  • branches/dev/Algorithm/IpIpoptData.cpp

    r430 r460  
    1414
    1515  DBG_SET_VERBOSITY(0);
    16 
    17   DefineOptionsRegistrar(IpoptData);
    1816
    1917  IpoptData::IpoptData()
  • branches/dev/Algorithm/IpIpoptData.hpp

    r430 r460  
    1717namespace Ipopt
    1818{
    19 
    20   DeclareOptionsRegistrar(IpoptData);
    2119
    2220  /* Forward declaration */
  • branches/dev/Algorithm/IpMonotoneMuUpdate.cpp

    r438 r460  
    2525  DBG_SET_VERBOSITY(0);
    2626
    27   DefineOptionsRegistrar(MonotoneMuUpdate);
    28 
    2927  MonotoneMuUpdate::MonotoneMuUpdate(const SmartPtr<LineSearch>& linesearch)
    3028      :
     
    4442  }
    4543
    46   void MonotoneMuUpdate::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
     44  void MonotoneMuUpdate::RegisterOptions(const SmartPtr<RegisteredOptions>& roptions)
    4745  {
    4846    roptions->AddLowerBoundedNumberOption(
  • branches/dev/Algorithm/IpMonotoneMuUpdate.hpp

    r430 r460  
    1212#include "IpMuUpdate.hpp"
    1313#include "IpLineSearch.hpp"
     14#include "IpRegOptions.hpp"
    1415
    1516namespace Ipopt
    1617{
    17 
    18   DeclareOptionsRegistrar(MonotoneMuUpdate);
    1918
    2019  /** Monotone Mu Update. This class implements the standard monotone mu update
     
    4645    /** Methods for IpoptType */
    4746    //@{
    48     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
     47    static void RegisterOptions(const SmartPtr<RegisteredOptions>& roptions);
    4948    //@}
    5049
  • branches/dev/Algorithm/IpNLPScaling.cpp

    r430 r460  
    177177    }
    178178  }
    179 
    180   DefineOptionsRegistrar(StandardScalingBase);
    181179
    182180  void
  • branches/dev/Algorithm/IpNLPScaling.hpp

    r430 r460  
    215215    SmartPtr<const Journalist> jnlst_;
    216216  };
    217 
    218   DeclareOptionsRegistrar(StandardScalingBase);
    219217
    220218  /** This is a base class for many standard scaling
  • branches/dev/Algorithm/IpOptErrorConvCheck.cpp

    r430 r460  
    1212{
    1313  DBG_SET_VERBOSITY(0);
    14 
    15   DefineOptionsRegistrar(OptimalityErrorConvergenceCheck);
    1614
    1715  OptimalityErrorConvergenceCheck::OptimalityErrorConvergenceCheck()
  • branches/dev/Algorithm/IpOptErrorConvCheck.hpp

    r430 r460  
    1414namespace Ipopt
    1515{
    16 
    17   DeclareOptionsRegistrar(OptimalityErrorConvergenceCheck);
    1816
    1917  /** Brief Class Description.
  • branches/dev/Algorithm/IpOrigIpoptNLP.cpp

    r438 r460  
    2222{
    2323  DBG_SET_VERBOSITY(0);
    24 
    25   DefineOptionsRegistrar(OrigIpoptNLP);
    2624
    2725  OrigIpoptNLP::OrigIpoptNLP(const SmartPtr<const Journalist>& jnlst,
  • branches/dev/Algorithm/IpOrigIpoptNLP.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(OrigIpoptNLP);
    1917
    2018  /** This class maps the traditional NLP into
  • branches/dev/Algorithm/IpPDFullSpaceSolver.cpp

    r433 r460  
    1414
    1515  DBG_SET_VERBOSITY(0);
    16 
    17   DefineOptionsRegistrar(PDFullSpaceSolver);
    1816
    1917  PDFullSpaceSolver::PDFullSpaceSolver(AugSystemSolver& augSysSolver,
  • branches/dev/Algorithm/IpPDFullSpaceSolver.hpp

    r430 r460  
    1616namespace Ipopt
    1717{
    18 
    19   DeclareOptionsRegistrar(PDFullSpaceSolver);
    2018
    2119  /** This is the implemetation of the Primal-Dual System, using the
  • branches/dev/Algorithm/IpPDPerturbationHandler.cpp

    r430 r460  
    1212{
    1313  DBG_SET_VERBOSITY(0);
    14 
    15   DefineOptionsRegistrar(PDPerturbationHandler);
    1614
    1715  PDPerturbationHandler::PDPerturbationHandler()
  • branches/dev/Algorithm/IpPDPerturbationHandler.hpp

    r430 r460  
    1414namespace Ipopt
    1515{
    16 
    17   DeclareOptionsRegistrar(PDPerturbationHandler);
    1816
    1917  /** Class for handling the perturbation factors delta_x, delta_s,
  • branches/dev/Algorithm/IpProbingMuOracle.cpp

    r438 r460  
    2424  DBG_SET_VERBOSITY(0);
    2525
    26   DefineOptionsRegistrar(ProbingMuOracle);
    27 
    2826  ProbingMuOracle::ProbingMuOracle(const SmartPtr<PDSystemSolver>& pd_solver)
    2927      :
  • branches/dev/Algorithm/IpProbingMuOracle.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(ProbingMuOracle);
    1917
    2018  /** Implementation of the probing strategy for computing the
  • branches/dev/Algorithm/IpQualityFunctionMuOracle.cpp

    r440 r460  
    2323
    2424  DBG_SET_VERBOSITY(0);
    25 
    26   DefineOptionsRegistrar(QualityFunctionMuOracle);
    2725
    2826  QualityFunctionMuOracle::QualityFunctionMuOracle(const SmartPtr<PDSystemSolver>& pd_solver)
  • branches/dev/Algorithm/IpQualityFunctionMuOracle.hpp

    r430 r460  
    1616namespace Ipopt
    1717{
    18 
    19   DeclareOptionsRegistrar(QualityFunctionMuOracle);
    2018
    2119  /** Implementation of the probing strategy for computing the
  • branches/dev/Algorithm/IpRestoFilterConvCheck.cpp

    r430 r460  
    1515
    1616  DBG_SET_VERBOSITY(0);
    17 
    18   DefineOptionsRegistrar(RestoFilterConvergenceCheck);
    1917
    2018  RestoFilterConvergenceCheck::RestoFilterConvergenceCheck()
  • branches/dev/Algorithm/IpRestoFilterConvCheck.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(RestoFilterConvergenceCheck);
    1917
    2018  /** Convergence check for the restoration phase as called by the
  • branches/dev/Algorithm/IpRestoIpoptNLP.cpp

    r438 r460  
    2626{
    2727  DBG_SET_VERBOSITY(0);
    28 
    29   DefineOptionsRegistrar(RestoIpoptNLP);
    3028
    3129  RestoIpoptNLP::RestoIpoptNLP(IpoptNLP& orig_ip_nlp,
  • branches/dev/Algorithm/IpRestoIpoptNLP.hpp

    r430 r460  
    2222namespace Ipopt
    2323{
    24 
    25   DeclareOptionsRegistrar(RestoIpoptNLP);
    2624
    2725  /** This class maps the traditional NLP into
  • branches/dev/Algorithm/IpRestoMinC_1Nrm.cpp

    r430 r460  
    1515{
    1616  DBG_SET_VERBOSITY(0);
    17 
    18   DefineOptionsRegistrar(MinC_1NrmRestorationPhase);
    1917
    2018  MinC_1NrmRestorationPhase::MinC_1NrmRestorationPhase
  • branches/dev/Algorithm/IpRestoMinC_1Nrm.hpp

    r430 r460  
    1616namespace Ipopt
    1717{
    18 
    19   DeclareOptionsRegistrar(MinC_1NrmRestorationPhase);
    2018
    2119  /** Restoration Phase that minimizes the 1-norm of the constraint
  • branches/dev/Algorithm/IpWarmStartIterateInitializer.cpp

    r438 r460  
    2626{
    2727  DBG_SET_VERBOSITY(0);
    28 
    29   DefineOptionsRegistrar(WarmStartIterateInitializer);
    3028
    3129  WarmStartIterateInitializer::WarmStartIterateInitializer()
  • branches/dev/Algorithm/IpWarmStartIterateInitializer.hpp

    r430 r460  
    1515namespace Ipopt
    1616{
    17 
    18   DeclareOptionsRegistrar(WarmStartIterateInitializer);
    1917
    2018  /** Class implementing an initialization procedure for warm starts.
  • branches/dev/Algorithm/LinearSolvers/IpMa27TSolverInterface.cpp

    r438 r460  
    4343  DBG_SET_VERBOSITY(0);
    4444
    45   DefineOptionsRegistrar(Ma27TSolverInterface);
    46 
    4745  Ma27TSolverInterface::Ma27TSolverInterface()
    4846      :
  • branches/dev/Algorithm/LinearSolvers/IpMa27TSolverInterface.hpp

    r430 r460  
    1414namespace Ipopt
    1515{
    16 
    17   DeclareOptionsRegistrar(Ma27TSolverInterface);
    18 
    1916  /** Interface to the symmetric linear solver MA27, derived from
    2017   *  SparseSymLinearSolverInterface.
  • branches/dev/Algorithm/LinearSolvers/Makefile.am

    r438 r460  
    1212
    1313liblinsolvers_a_SOURCES = \
     14        IpLinearSolversRegOp.cpp IpLinearSolversRegOp.hpp \
    1415        IpMa27TSolverInterface.cpp IpMa27TSolverInterface.hpp \
    1516        IpMc19TSymScalingMethod.cpp IpMc19TSymScalingMethod.hpp \
     
    4041
    4142ASTYLE_FILES = \
     43        IpLinearSolversRegOp.cppbak IpLinearSolversRegOp.hppbak \
    4244        IpMa27TSolverInterface.cppbak IpMa27TSolverInterface.hppbak \
    4345        IpMc19TSymScalingMethod.cppbak IpMc19TSymScalingMethod.hppbak \
  • branches/dev/Algorithm/LinearSolvers/Makefile.in

    r438 r460  
    6262liblinsolvers_a_AR = $(AR) $(ARFLAGS)
    6363liblinsolvers_a_LIBADD =
    64 am__liblinsolvers_a_SOURCES_DIST = IpMa27TSolverInterface.cpp \
     64am__liblinsolvers_a_SOURCES_DIST = IpLinearSolversRegOp.cpp \
     65        IpLinearSolversRegOp.hpp IpMa27TSolverInterface.cpp \
    6566        IpMa27TSolverInterface.hpp IpMc19TSymScalingMethod.cpp \
    6667        IpMc19TSymScalingMethod.hpp \
     
    7374@HAVE_PARDISO_TRUE@am__objects_1 = IpPardisoSolverInterface.$(OBJEXT)
    7475@HAVE_TAUCS_TRUE@am__objects_2 = IpTAUCSSolverInterface.$(OBJEXT)
    75 am_liblinsolvers_a_OBJECTS = IpMa27TSolverInterface.$(OBJEXT) \
     76am_liblinsolvers_a_OBJECTS = IpLinearSolversRegOp.$(OBJEXT) \
     77        IpMa27TSolverInterface.$(OBJEXT) \
    7678        IpMc19TSymScalingMethod.$(OBJEXT) \
    7779        IpTripletToCSRConverter.$(OBJEXT) IpTSymLinearSolver.$(OBJEXT) \
     
    224226AUTOMAKE_OPTIONS = foreign
    225227noinst_LIBRARIES = liblinsolvers.a
    226 liblinsolvers_a_SOURCES = IpMa27TSolverInterface.cpp \
     228liblinsolvers_a_SOURCES = IpLinearSolversRegOp.cpp \
     229        IpLinearSolversRegOp.hpp IpMa27TSolverInterface.cpp \
    227230        IpMa27TSolverInterface.hpp IpMc19TSymScalingMethod.cpp \
    228231        IpMc19TSymScalingMethod.hpp \
     
    234237# Astyle stuff
    235238ASTYLE_FILES = \
     239        IpLinearSolversRegOp.cppbak IpLinearSolversRegOp.hppbak \
    236240        IpMa27TSolverInterface.cppbak IpMa27TSolverInterface.hppbak \
    237241        IpMc19TSymScalingMethod.cppbak IpMc19TSymScalingMethod.hppbak \
     
    293297        -rm -f *.tab.c
    294298
     299@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpLinearSolversRegOp.Po@am__quote@
    295300@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpMa27TSolverInterface.Po@am__quote@
    296301@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpMc19TSymScalingMethod.Po@am__quote@
  • branches/dev/Algorithm/Makefile.am

    r441 r460  
    1616        IpAdaptiveMuUpdate.cpp IpAdaptiveMuUpdate.hpp \
    1717        IpAlgBuilder.cpp IpAlgBuilder.hpp \
     18        IpAlgorithmRegOp.cpp IpAlgorithmRegOp.hpp \
    1819        IpAlgStrategy.hpp \
    1920        IpAugRestoSystemSolver.cpp IpAugRestoSystemSolver.hpp \
     
    6970        IpAdaptiveMuUpdate.cppbak IpAdaptiveMuUpdate.hppbak \
    7071        IpAlgBuilder.cppbak IpAlgBuilder.hppbak \
     72        IpAlgorithmRegOp.cppbak IpAlgorithmRegOp.hppbak \
    7173        IpAlgStrategy.hppbak \
    7274        IpAugRestoSystemSolver.cppbak IpAugRestoSystemSolver.hppbak \
  • branches/dev/Algorithm/Makefile.in

    r441 r460  
    5757libipoptalg_a_LIBADD =
    5858am_libipoptalg_a_OBJECTS = IpAdaptiveMuUpdate.$(OBJEXT) \
    59         IpAlgBuilder.$(OBJEXT) IpAugRestoSystemSolver.$(OBJEXT) \
     59        IpAlgBuilder.$(OBJEXT) IpAlgorithmRegOp.$(OBJEXT) \
     60        IpAugRestoSystemSolver.$(OBJEXT) \
    6061        IpDefaultIterateInitializer.$(OBJEXT) IpFilter.$(OBJEXT) \
    6162        IpFilterLineSearch.$(OBJEXT) IpGradientScaling.$(OBJEXT) \
     
    232233        IpAdaptiveMuUpdate.cpp IpAdaptiveMuUpdate.hpp \
    233234        IpAlgBuilder.cpp IpAlgBuilder.hpp \
     235        IpAlgorithmRegOp.cpp IpAlgorithmRegOp.hpp \
    234236        IpAlgStrategy.hpp \
    235237        IpAugRestoSystemSolver.cpp IpAugRestoSystemSolver.hpp \
     
    279281        IpAdaptiveMuUpdate.cppbak IpAdaptiveMuUpdate.hppbak \
    280282        IpAlgBuilder.cppbak IpAlgBuilder.hppbak \
     283        IpAlgorithmRegOp.cppbak IpAlgorithmRegOp.hppbak \
    281284        IpAlgStrategy.hppbak \
    282285        IpAugRestoSystemSolver.cppbak IpAugRestoSystemSolver.hppbak \
     
    372375@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpAdaptiveMuUpdate.Po@am__quote@
    373376@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpAlgBuilder.Po@am__quote@
     377@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpAlgorithmRegOp.Po@am__quote@
    374378@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpAugRestoSystemSolver.Po@am__quote@
    375379@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpDefaultIterateInitializer.Po@am__quote@
  • branches/dev/Common/IpRegOptions.cpp

    r430 r460  
    671671    }
    672672  }
    673 
    674   std::list<OptionsRegistrar*>& OptionsRegistrarsList()
    675   {
    676     static std::list<OptionsRegistrar*> options_infos;
    677     return options_infos;
    678   }
    679 
    680673} // namespace Ipopt
  • branches/dev/Common/IpRegOptions.hpp

    r454 r460  
    562562    std::map<std::string, SmartPtr<RegisteredOption> > registered_options_;
    563563  };
    564 
    565   ///////////////////////////////////////////////////////////////////////
    566   ///////////////////////////////////////////////////////////////////////
    567 
    568   // Forward definition
    569   class OptionsRegistrar;
    570   std::list<OptionsRegistrar*>& OptionsRegistrarsList();
    571 
    572   /** This class is for implementing the registration of options on a
    573    *  class by class basis.  It is primarily used so we have runtime
    574    *  access to each class.
    575    */
    576   class OptionsRegistrar
    577   {
    578   public:
    579     /** @name Constructors / Destructors */
    580     //@{
    581     /** Standard Constructor - takes in the class_name of the derived class */
    582     OptionsRegistrar(const char* class_name)
    583         : class_name_(class_name)
    584     {
    585       OptionsRegistrarsList().push_back(this);
    586     }
    587 
    588     /** Standard destructor */
    589     virtual ~OptionsRegistrar()
    590     {}
    591     //@}
    592 
    593     /** Standard Access Methods */
    594     //@{
    595     std::string ClassName()
    596     {
    597       return class_name_;
    598     }
    599     //@}
    600 
    601     /** Static methods to interact with ALL class type infos */
    602     //@{
    603     /** Register all the options */
    604     static void RegisterAllOptions(SmartPtr<RegisteredOptions> reg_options);
    605     //@}
    606 
    607   protected:
    608     /** Methods to be overridded by derived classes */
    609     //@{
    610     /** Override this method in derived TypeInfo classs to register options */
    611     virtual void RegisterOptionsImpl(SmartPtr<RegisteredOptions> reg_options)=0;
    612     //@}
    613 
    614   private:
    615     /** store the type name */
    616     std::string class_name_;
    617 
    618     /** keep a static list of all OptionsRegistrar's */
    619     //  static std::list<OptionsRegistrar*> ipopt_type_infos_;
    620 
    621   };
    622 
    623   inline
    624   void OptionsRegistrar::RegisterAllOptions(SmartPtr<RegisteredOptions> reg_options)
    625   {
    626     std::list<OptionsRegistrar*>::iterator i;
    627     for (i=OptionsRegistrarsList().begin(); i != OptionsRegistrarsList().end(); i++) {
    628       (*i)->RegisterOptionsImpl(reg_options);
    629     }
    630   }
    631 
    632 
    633   //extern std::list<OptionsRegistrar*> OptionsRegistrar::ipopt_type_infos_;
    634 
    635 
    636   ////////////////////////////////////////////////////////////
    637   // Below is what needs to be added for each IpoptType
    638   // but I think this can be macro'ed
    639   ///////////////////////////////////////////////////////////
    640 
    641 #define DeclareOptionsRegistrar(__class_name__) \
    642 class __class_name__ ## OptionsRegistrar : public OptionsRegistrar \
    643  { \
    644   public: \
    645    __class_name__ ## OptionsRegistrar() \
    646      : OptionsRegistrar(# __class_name__) { } \
    647     \
    648    __class_name__ ## OptionsRegistrar* KeepCompilerFromOptimizing(); \
    649   protected: \
    650    virtual void RegisterOptionsImpl(SmartPtr<RegisteredOptions> reg_options); \
    651  }
    652 
    653 #define DefineOptionsRegistrar(__class_name__) \
    654   void __class_name__ ## OptionsRegistrar::RegisterOptionsImpl(SmartPtr<RegisteredOptions> reg_options) \
    655    { \
    656      reg_options->SetRegisteringClass(# __class_name__ ); \
    657      __class_name__::RegisterOptions(reg_options); \
    658      reg_options->SetRegisteringClass("Unknown Class"); \
    659    } \
    660  \
    661 __class_name__ ## OptionsRegistrar _ ## __class_name__ ## OptionsRegistrar_; \
    662  \
    663 __class_name__ ## OptionsRegistrar* \
    664 __class_name__ ## OptionsRegistrar::KeepCompilerFromOptimizing() \
    665    { return &_ ## __class_name__ ## OptionsRegistrar_; }
    666 
    667 
    668564} // namespace Ipopt
    669565
  • branches/dev/Extern/blas/Makefile.in

    r455 r460  
    1515@SET_MAKE@
    1616
    17 # Copyright (C) 2003, International Business Machines and others.
     17# Copyright (C) 2003, 2004, 2005 International Business Machines and others.
    1818# All Rights Reserved.
    1919# This file is distributed under the Common Public License.
  • branches/dev/Interfaces/IpIpoptApplication.cpp

    r441 r460  
    1717#include "IpGradientScaling.hpp"
    1818
     19#include "IpLinearSolversRegOp.hpp"
     20#include "IpInterfacesRegOp.hpp"
     21#include "IpAlgorithmRegOp.hpp"
     22
    1923namespace Ipopt
    2024{
    2125  DBG_SET_VERBOSITY(0);
    22 
    23   DefineOptionsRegistrar(IpoptApplication);
    2426
    2527  IpoptApplication::IpoptApplication(bool read_params_dat,
     
    3032      statistics_(NULL)
    3133  {
     34    try {
    3235# ifdef IP_DEBUG
    33     DebugJournalistWrapper::SetJournalist(GetRawPtr(jnlst_));
    34     SmartPtr<Journal> debug_jrnl = jnlst_->AddFileJournal("Debug", "debug.out", J_SUMMARY);
    35     debug_jrnl->SetPrintLevel(J_DBG, J_ALL);
     36      DebugJournalistWrapper::SetJournalist(GetRawPtr(jnlst_));
     37      SmartPtr<Journal> debug_jrnl = jnlst_->AddFileJournal("Debug", "debug.out", J_SUMMARY);
     38      debug_jrnl->SetPrintLevel(J_DBG, J_ALL);
    3639# endif
    3740
    38     DBG_START_METH("IpoptApplication::IpoptApplication()",
    39                    dbg_verbosity);
    40 
    41 
    42     SmartPtr<Journal> stdout_jrnl = NULL;
    43     if (create_console_out) {
    44       stdout_jrnl =
    45         jnlst_->AddFileJournal("console", "stdout", J_SUMMARY);
    46       stdout_jrnl->SetPrintLevel(J_DBG, J_NONE);
    47     }
    48 
    49     // Register the valid options
    50     SmartPtr<RegisteredOptions> reg_options = new RegisteredOptions();
    51     OptionsRegistrar::RegisterAllOptions(reg_options);
    52 
    53     options_->SetJournalist(jnlst_);
    54     options_->SetRegisteredOptions(reg_options);
    55 
    56     // Get the options
    57     if (read_params_dat) {
    58       FILE* fp_options = fopen("PARAMS.DAT", "r");
    59       if (fp_options) {
    60         // PARAMS.DAT exists, read the content
    61         options_->ReadFromFile(*jnlst_, fp_options);
    62         fclose(fp_options);
    63         fp_options=NULL;
    64       }
    65     }
    66 
    67     Index ivalue;
    68     options_->GetIntegerValue("print_level", ivalue, "");
    69     EJournalLevel print_level = (EJournalLevel)ivalue;
    70     if (create_console_out) {
    71       // Set printlevel for stdout
    72       stdout_jrnl->SetAllPrintLevels(print_level);
    73       stdout_jrnl->SetPrintLevel(J_DBG, J_NONE);
    74     }
    75 
    76     bool option_set;
     41      DBG_START_METH("IpoptApplication::IpoptApplication()",
     42                     dbg_verbosity);
     43
     44
     45      SmartPtr<Journal> stdout_jrnl = NULL;
     46      if (create_console_out) {
     47        stdout_jrnl =
     48          jnlst_->AddFileJournal("console", "stdout", J_SUMMARY);
     49        stdout_jrnl->SetPrintLevel(J_DBG, J_NONE);
     50      }
     51
     52      // Register the valid options
     53      SmartPtr<RegisteredOptions> reg_options = new RegisteredOptions();
     54      RegisterAllOptions(reg_options);
     55
     56      options_->SetJournalist(jnlst_);
     57      options_->SetRegisteredOptions(reg_options);
     58
     59      // Get the options
     60      if (read_params_dat) {
     61        FILE* fp_options = fopen("PARAMS.DAT", "r");
     62        if (fp_options) {
     63          // PARAMS.DAT exists, read the content
     64          options_->ReadFromFile(*jnlst_, fp_options);
     65          fclose(fp_options);
     66          fp_options=NULL;
     67        }
     68      }
     69
     70      Index ivalue;
     71      options_->GetIntegerValue("print_level", ivalue, "");
     72      EJournalLevel print_level = (EJournalLevel)ivalue;
     73      if (create_console_out) {
     74        // Set printlevel for stdout
     75        stdout_jrnl->SetAllPrintLevels(print_level);
     76        stdout_jrnl->SetPrintLevel(J_DBG, J_NONE);
     77      }
     78
     79      bool option_set;
    7780
    7881#ifdef IP_DEBUG
    79     // Set printlevel for debug
    80     option_set = options_->GetIntegerValue("debug_print_level",
    81                                            ivalue, "");
    82     EJournalLevel debug_print_level;
    83     if (option_set) {
    84       debug_print_level = (EJournalLevel)ivalue;
    85     }
    86     else {
    87       debug_print_level = print_level;
    88     }
    89     debug_jrnl->SetAllPrintLevels(debug_print_level);
    90     debug_jrnl->SetPrintLevel(J_DBG, J_ALL);
     82      // Set printlevel for debug
     83      option_set = options_->GetIntegerValue("debug_print_level",
     84                                             ivalue, "");
     85      EJournalLevel debug_print_level;
     86      if (option_set) {
     87        debug_print_level = (EJournalLevel)ivalue;
     88      }
     89      else {
     90        debug_print_level = print_level;
     91      }
     92      debug_jrnl->SetAllPrintLevels(debug_print_level);
     93      debug_jrnl->SetPrintLevel(J_DBG, J_ALL);
    9194#endif
    9295
    93     // Open an output file if required
    94     std::string output_filename;
    95     options_->GetValue("output_file", output_filename, "");
    96     if (output_filename != "") {
    97       EJournalLevel file_print_level;
    98       option_set = options_->GetIntegerValue("file_print_level", ivalue, "");
    99       if (option_set) {
    100         file_print_level = (EJournalLevel)ivalue;
    101       }
    102       else {
    103         file_print_level = print_level;
    104       }
    105       OpenOutputFile(output_filename, file_print_level);
    106     }
    107 
    108     // output a description of all the options
    109     bool print_options_documentation;
    110     options_->GetBoolValue("print_options_documentation",
    111                            print_options_documentation, "");
    112     if (print_options_documentation) {
    113       reg_options->OutputOptionDocumentation(*jnlst_);
     96      // Open an output file if required
     97      std::string output_filename;
     98      options_->GetValue("output_file", output_filename, "");
     99      if (output_filename != "") {
     100        EJournalLevel file_print_level;
     101        option_set = options_->GetIntegerValue("file_print_level", ivalue, "");
     102        if (option_set) {
     103          file_print_level = (EJournalLevel)ivalue;
     104        }
     105        else {
     106          file_print_level = print_level;
     107        }
     108        OpenOutputFile(output_filename, file_print_level);
     109      }
     110
     111      // output a description of all the options
     112      bool print_options_documentation;
     113      options_->GetBoolValue("print_options_documentation",
     114                             print_options_documentation, "");
     115      if (print_options_documentation) {
     116        reg_options->OutputOptionDocumentation(*jnlst_);
     117      }
     118
     119    }
     120    catch(OPTION_INVALID& exc) {
     121      exc.ReportException(*jnlst_);
     122      exit(-1);
     123    }
     124    catch(IpoptException& exc) {
     125      exc.ReportException(*jnlst_);
     126      exit(-1);
     127    }
     128    catch(std::bad_alloc& exc) {
     129      jnlst_->Printf(J_SUMMARY, J_MAIN, "\nEXIT: Not enough memory.\n");
     130      exit(-1);
     131    }
     132    catch(...) {
     133      IpoptException exc("Unknown Exception caught in ipopt", "Unknown File", -1);
     134      exc.ReportException(*jnlst_);
     135      exit(-1);
    114136    }
    115137  }
     
    362384  }
    363385
     386  void IpoptApplication::RegisterAllOptions(const SmartPtr<RegisteredOptions>& roptions)
     387  {
     388    RegisterOptions_Interfaces(roptions);
     389    RegisterOptions_Algorithm(roptions);
     390    RegisterOptions_LinearSolvers(roptions);
     391  }
     392
    364393} // namespace Ipopt
  • branches/dev/Interfaces/IpIpoptApplication.hpp

    r441 r460  
    2323  /* Return codes for the Optimize call for an application */
    2424#include "IpReturnCodes_inc.h"
    25 
    26   DeclareOptionsRegistrar(IpoptApplication);
    2725
    2826  /** This is the main application class for making calls to Ipopt. */
     
    9391    //@}
    9492
     93    /** Method to register all the options */
     94    void RegisterAllOptions(const SmartPtr<RegisteredOptions>& roptions);
     95
    9596    /**@name Variables that customize the application behavior */
    9697    //@{
  • branches/dev/Interfaces/IpTNLPAdapter.cpp

    r448 r460  
    1313
    1414  DBG_SET_VERBOSITY(0);
    15 
    16   DefineOptionsRegistrar(TNLPAdapter);
    1715
    1816  TNLPAdapter::TNLPAdapter(const SmartPtr<TNLP> tnlp)
  • branches/dev/Interfaces/IpTNLPAdapter.hpp

    r430 r460  
    1919namespace Ipopt
    2020{
    21 
    22   DeclareOptionsRegistrar(TNLPAdapter);
    2321
    2422  /** This class Adapts the TNLP interface so it looks like an NLP interface.
  • branches/dev/Interfaces/Makefile.am

    r441 r460  
    2525libinterfaces_a_SOURCES = \
    2626        IpAlgTypes.hpp \
     27        IpInterfacesRegOp.cpp IpInterfacesRegOp.hpp \
    2728        IpIpoptApplication.cpp IpIpoptApplication.hpp \
    2829        IpNLP.hpp \
     
    3738CXXFLAGS += -I$(srcdir)/../Common \
    3839        -I$(srcdir)/../LinAlg \
     40        -I$(srcdir)/../Algorithm/LinearSolvers \
    3941        -I$(srcdir)/../LinAlg/TMatrices \
    4042        -I$(srcdir)/../Algorithm
     
    4648ASTYLE_FILES = \
    4749        IpAlgTypes.hppbak \
     50        IpInterfacesRegOp.cppbak IpInterfacesRegOp.hppbak \
    4851        IpIpoptApplication.cppbak IpIpoptApplication.hppbak \
    4952        IpNLP.hppbak \
  • branches/dev/Interfaces/Makefile.in

    r441 r460  
    5858libinterfaces_a_AR = $(AR) $(ARFLAGS)
    5959libinterfaces_a_LIBADD =
    60 am_libinterfaces_a_OBJECTS = IpIpoptApplication.$(OBJEXT) \
    61         IpSolveStatistics.$(OBJEXT) IpStdCInterface.$(OBJEXT) \
    62         IpStdFInterface.$(OBJEXT) IpStdInterfaceTNLP.$(OBJEXT) \
    63         IpTNLPAdapter.$(OBJEXT)
     60am_libinterfaces_a_OBJECTS = IpInterfacesRegOp.$(OBJEXT) \
     61        IpIpoptApplication.$(OBJEXT) IpSolveStatistics.$(OBJEXT) \
     62        IpStdCInterface.$(OBJEXT) IpStdFInterface.$(OBJEXT) \
     63        IpStdInterfaceTNLP.$(OBJEXT) IpTNLPAdapter.$(OBJEXT)
    6464libinterfaces_a_OBJECTS = $(am_libinterfaces_a_OBJECTS)
    6565DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/inc
     
    130130CXXDEPMODE = @CXXDEPMODE@
    131131CXXFLAGS = @CXXFLAGS@ -I$(srcdir)/../Common -I$(srcdir)/../LinAlg \
     132        -I$(srcdir)/../Algorithm/LinearSolvers \
    132133        -I$(srcdir)/../LinAlg/TMatrices -I$(srcdir)/../Algorithm
    133134CXXLIBS = @CXXLIBS@
     
    231232libinterfaces_a_SOURCES = \
    232233        IpAlgTypes.hpp \
     234        IpInterfacesRegOp.cpp IpInterfacesRegOp.hpp \
    233235        IpIpoptApplication.cpp IpIpoptApplication.hpp \
    234236        IpNLP.hpp \
     
    245247ASTYLE_FILES = \
    246248        IpAlgTypes.hppbak \
     249        IpInterfacesRegOp.cppbak IpInterfacesRegOp.hppbak \
    247250        IpIpoptApplication.cppbak IpIpoptApplication.hppbak \
    248251        IpNLP.hppbak \
     
    302305        -rm -f *.tab.c
    303306
     307@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpInterfacesRegOp.Po@am__quote@
    304308@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpIpoptApplication.Po@am__quote@
    305309@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpSolveStatistics.Po@am__quote@
Note: See TracChangeset for help on using the changeset viewer.