Changeset 1628 for trunk/test_more


Ignore:
Timestamp:
Jan 20, 2010 10:04:49 AM (10 years ago)
Author:
bradbell
Message:

trunk: move ipopt_cppad to cppad_ipopot to facillitate future refactoring, see whats_new_10.omh entry for 01-20.

Location:
trunk/test_more
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/test_more/cppad_ipopt.cpp

    r1627 r1628  
    1111-------------------------------------------------------------------------- */
    1212
    13 # include "../ipopt_cppad/src/ipopt_cppad_nlp.hpp"
     13# include "../cppad_ipopt/src/cppad_ipopt_nlp.hpp"
    1414
    1515namespace { // Begin empty namespace
    1616// ---------------------------------------------------------------------------
    17 class FG_retape : public ipopt_cppad_fg_info
     17class FG_retape : public cppad_ipopt_fg_info
    1818{
    1919public:
     
    3939};
    4040
    41 bool ipopt_cppad_retape(void)
     41bool cppad_ipopt_retape(void)
    4242{       bool ok = true;
    4343        size_t j;
     
    6565        // object in derived class
    6666        FG_retape fg_retape;
    67         ipopt_cppad_fg_info *fg_info = &fg_retape; 
     67        cppad_ipopt_fg_info *fg_info = &fg_retape; 
    6868
    6969        // create the Ipopt interface
    70         ipopt_cppad_solution solution;
    71         Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new ipopt_cppad_nlp(
     70        cppad_ipopt_solution solution;
     71        Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new cppad_ipopt_nlp(
    7272                n, m, x_i, x_l, x_u, g_l, g_u, fg_info, &solution
    7373        );
     
    103103        Check some of the solution values
    104104        */
    105         ok &= solution.status == ipopt_cppad_solution::success;
     105        ok &= solution.status == cppad_ipopt_solution::success;
    106106        //
    107107        double check_x[]   = { -1., 0. };
     
    119119/*
    120120This solve the same problem as
    121 ../ipopt_cppad/ipopt_cppad_simple.cpp (repository revision
     121../cppad_ipopt/cppad_ipopt_simple.cpp (repository revision
    1221221276) in a convoluted way in order to test the representation code.
    123123*/
    124 class FG_K_gt_1 : public ipopt_cppad_fg_info
     124class FG_K_gt_1 : public cppad_ipopt_fg_info
    125125{
    126126private:
     
    181181};
    182182       
    183 bool ipopt_cppad_K_gt_1(void)
     183bool cppad_ipopt_K_gt_1(void)
    184184{       bool ok = true;
    185185        size_t j;
     
    214214        size_t icase;
    215215        for(icase = 0; icase <= 1; icase++)
    216         {       // Should ipopt_cppad_nlp retape the operation sequence for
     216        {       // Should cppad_ipopt_nlp retape the operation sequence for
    217217                // every new x. Can test both true and false cases because
    218218                // the operation sequence does not depend on x (for this case).
     
    227227                // object in derived class
    228228                FG_K_gt_1 my_fg_info(retape);
    229                 ipopt_cppad_fg_info *fg_info = &my_fg_info; 
     229                cppad_ipopt_fg_info *fg_info = &my_fg_info; 
    230230
    231231                // create the Ipopt interface
    232                 ipopt_cppad_solution solution;
    233                 Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new ipopt_cppad_nlp(
     232                cppad_ipopt_solution solution;
     233                Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new cppad_ipopt_nlp(
    234234                n, m, x_i, x_l, x_u, g_l, g_u, fg_info, &solution
    235235                );
     
    265265                Check some of the solution values
    266266                */
    267                 ok &= solution.status == ipopt_cppad_solution::success;
     267                ok &= solution.status == cppad_ipopt_solution::success;
    268268                //
    269269                double check_z_l[] = { 1.087871, 0.,       0.,      0.       };
     
    301301namespace
    302302{
    303 class FG_J_changes : public ipopt_cppad_fg_info
     303class FG_J_changes : public cppad_ipopt_fg_info
    304304{
    305305private:
     
    360360}
    361361
    362 bool ipopt_cppad_J_changes(void)
     362bool cppad_ipopt_J_changes(void)
    363363{
    364364        bool ok = true;
     
    388388        bool retape = false;
    389389        FG_J_changes my_fg_info(retape);
    390         ipopt_cppad_fg_info *fg_info = &my_fg_info;
    391 
    392         ipopt_cppad_solution solution;
    393         Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new ipopt_cppad_nlp(
     390        cppad_ipopt_fg_info *fg_info = &my_fg_info;
     391
     392        cppad_ipopt_solution solution;
     393        Ipopt::SmartPtr<Ipopt::TNLP> cppad_nlp = new cppad_ipopt_nlp(
    394394                n, m, x_i, x_l, x_u, g_l, g_u, fg_info, &solution
    395395        );
     
    419419         Check solution status
    420420         */
    421         ok &= solution.status == ipopt_cppad_solution::success;
     421        ok &= solution.status == cppad_ipopt_solution::success;
    422422        ok &= CppAD::NearEqual(solution.x[1], 0., 1e-6, 1e-6);
    423423
     
    428428} // End empty namespace
    429429
    430 bool ipopt_cppad(void)
     430bool cppad_ipopt(void)
    431431{       bool ok = true;
    432         ok &= ipopt_cppad_retape();
    433         ok &= ipopt_cppad_K_gt_1();
    434         ok &= ipopt_cppad_J_changes();
     432        ok &= cppad_ipopt_retape();
     433        ok &= cppad_ipopt_K_gt_1();
     434        ok &= cppad_ipopt_J_changes();
    435435        return ok;
    436436}
  • trunk/test_more/makefile.am

    r1626 r1628  
    2929endif
    3030if CppAD_IPOPT_CPPAD
    31 IPOPT_SRC_FILES   = ../ipopt_cppad/src/ipopt_cppad_nlp.cpp ipopt_cppad.cpp
     31IPOPT_SRC_FILES   = ../cppad_ipopt/src/cppad_ipopt_nlp.cpp cppad_ipopt.cpp
    3232IPOPT_EXTRA_FILES =
    3333IPOPT_INCLUDE     = -I$(IPOPT_DIR)/include
     
    3737else
    3838IPOPT_SRC_FILES   =
    39 IPOPT_EXTRA_FILES = ipopt_cppad.cpp
     39IPOPT_EXTRA_FILES = cppad_ipopt.cpp
    4040IPOPT_INCLUDE     =
    4141IPOPT_LIB         =
  • trunk/test_more/makefile.in

    r1627 r1628  
    4747PROGRAMS = $(noinst_PROGRAMS)
    4848am__test_more_SOURCES_DIST = base_adolc.cpp \
    49         ../ipopt_cppad/src/ipopt_cppad_nlp.cpp ipopt_cppad.cpp \
     49        ../cppad_ipopt/src/cppad_ipopt_nlp.cpp cppad_ipopt.cpp \
    5050        test_more.cpp abs.cpp acos.cpp asin.cpp add.cpp add_eq.cpp \
    5151        add_zero.cpp atan.cpp atan_2.cpp check_simple_vector.cpp \
     
    6464        value.cpp vec_ad.cpp vec_ad_par.cpp vec_unary.cpp
    6565@CppAD_ADOLC_TRUE@am__objects_1 = base_adolc.$(OBJEXT)
    66 @CppAD_IPOPT_CPPAD_TRUE@am__objects_2 = ipopt_cppad_nlp.$(OBJEXT) \
    67 @CppAD_IPOPT_CPPAD_TRUE@        ipopt_cppad.$(OBJEXT)
     66@CppAD_IPOPT_CPPAD_TRUE@am__objects_2 = cppad_ipopt_nlp.$(OBJEXT) \
     67@CppAD_IPOPT_CPPAD_TRUE@        cppad_ipopt.$(OBJEXT)
    6868am_test_more_OBJECTS = $(am__objects_1) $(am__objects_2) \
    6969        test_more.$(OBJEXT) abs.$(OBJEXT) acos.$(OBJEXT) \
     
    240240@CppAD_ADOLC_TRUE@ADOLC_FLAGS = -DCPPAD_ADOLC_TEST
    241241@CppAD_IPOPT_CPPAD_FALSE@IPOPT_SRC_FILES =
    242 @CppAD_IPOPT_CPPAD_TRUE@IPOPT_SRC_FILES = ../ipopt_cppad/src/ipopt_cppad_nlp.cpp ipopt_cppad.cpp
    243 @CppAD_IPOPT_CPPAD_FALSE@IPOPT_EXTRA_FILES = ipopt_cppad.cpp
     242@CppAD_IPOPT_CPPAD_TRUE@IPOPT_SRC_FILES = ../cppad_ipopt/src/cppad_ipopt_nlp.cpp cppad_ipopt.cpp
     243@CppAD_IPOPT_CPPAD_FALSE@IPOPT_EXTRA_FILES = cppad_ipopt.cpp
    244244@CppAD_IPOPT_CPPAD_TRUE@IPOPT_EXTRA_FILES =
    245245@CppAD_IPOPT_CPPAD_FALSE@IPOPT_INCLUDE =
     
    404404@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cos.Po@am__quote@
    405405@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cosh.Po@am__quote@
     406@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_ipopt.Po@am__quote@
     407@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_ipopt_nlp.Po@am__quote@
    406408@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbl_epsilon.Po@am__quote@
    407409@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div.Po@am__quote@
     
    415417@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/from_base.Po@am__quote@
    416418@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fun_check.Po@am__quote@
    417 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipopt_cppad.Po@am__quote@
    418 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipopt_cppad_nlp.Po@am__quote@
    419419@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jacobian.Po@am__quote@
    420420@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
     
    470470@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
    471471
    472 ipopt_cppad_nlp.o: ../ipopt_cppad/src/ipopt_cppad_nlp.cpp
    473 @am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ipopt_cppad_nlp.o -MD -MP -MF $(DEPDIR)/ipopt_cppad_nlp.Tpo -c -o ipopt_cppad_nlp.o `test -f '../ipopt_cppad/src/ipopt_cppad_nlp.cpp' || echo '$(srcdir)/'`../ipopt_cppad/src/ipopt_cppad_nlp.cpp
    474 @am__fastdepCXX_TRUE@   $(am__mv) $(DEPDIR)/ipopt_cppad_nlp.Tpo $(DEPDIR)/ipopt_cppad_nlp.Po
    475 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../ipopt_cppad/src/ipopt_cppad_nlp.cpp' object='ipopt_cppad_nlp.o' libtool=no @AMDEPBACKSLASH@
     472cppad_ipopt_nlp.o: ../cppad_ipopt/src/cppad_ipopt_nlp.cpp
     473@am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cppad_ipopt_nlp.o -MD -MP -MF $(DEPDIR)/cppad_ipopt_nlp.Tpo -c -o cppad_ipopt_nlp.o `test -f '../cppad_ipopt/src/cppad_ipopt_nlp.cpp' || echo '$(srcdir)/'`../cppad_ipopt/src/cppad_ipopt_nlp.cpp
     474@am__fastdepCXX_TRUE@   $(am__mv) $(DEPDIR)/cppad_ipopt_nlp.Tpo $(DEPDIR)/cppad_ipopt_nlp.Po
     475@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../cppad_ipopt/src/cppad_ipopt_nlp.cpp' object='cppad_ipopt_nlp.o' libtool=no @AMDEPBACKSLASH@
    476476@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    477 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ipopt_cppad_nlp.o `test -f '../ipopt_cppad/src/ipopt_cppad_nlp.cpp' || echo '$(srcdir)/'`../ipopt_cppad/src/ipopt_cppad_nlp.cpp
    478 
    479 ipopt_cppad_nlp.obj: ../ipopt_cppad/src/ipopt_cppad_nlp.cpp
    480 @am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ipopt_cppad_nlp.obj -MD -MP -MF $(DEPDIR)/ipopt_cppad_nlp.Tpo -c -o ipopt_cppad_nlp.obj `if test -f '../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; then $(CYGPATH_W) '../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; else $(CYGPATH_W) '$(srcdir)/../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; fi`
    481 @am__fastdepCXX_TRUE@   $(am__mv) $(DEPDIR)/ipopt_cppad_nlp.Tpo $(DEPDIR)/ipopt_cppad_nlp.Po
    482 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../ipopt_cppad/src/ipopt_cppad_nlp.cpp' object='ipopt_cppad_nlp.obj' libtool=no @AMDEPBACKSLASH@
     477@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cppad_ipopt_nlp.o `test -f '../cppad_ipopt/src/cppad_ipopt_nlp.cpp' || echo '$(srcdir)/'`../cppad_ipopt/src/cppad_ipopt_nlp.cpp
     478
     479cppad_ipopt_nlp.obj: ../cppad_ipopt/src/cppad_ipopt_nlp.cpp
     480@am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cppad_ipopt_nlp.obj -MD -MP -MF $(DEPDIR)/cppad_ipopt_nlp.Tpo -c -o cppad_ipopt_nlp.obj `if test -f '../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; then $(CYGPATH_W) '../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; else $(CYGPATH_W) '$(srcdir)/../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; fi`
     481@am__fastdepCXX_TRUE@   $(am__mv) $(DEPDIR)/cppad_ipopt_nlp.Tpo $(DEPDIR)/cppad_ipopt_nlp.Po
     482@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../cppad_ipopt/src/cppad_ipopt_nlp.cpp' object='cppad_ipopt_nlp.obj' libtool=no @AMDEPBACKSLASH@
    483483@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    484 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ipopt_cppad_nlp.obj `if test -f '../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; then $(CYGPATH_W) '../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; else $(CYGPATH_W) '$(srcdir)/../ipopt_cppad/src/ipopt_cppad_nlp.cpp'; fi`
     484@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cppad_ipopt_nlp.obj `if test -f '../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; then $(CYGPATH_W) '../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; else $(CYGPATH_W) '$(srcdir)/../cppad_ipopt/src/cppad_ipopt_nlp.cpp'; fi`
    485485
    486486ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  • trunk/test_more/test_more.cpp

    r1558 r1628  
    2323extern bool AddEq(void);
    2424extern bool AddZero(void);
    25 extern bool ipopt_cppad(void);
     25extern bool cppad_ipopt(void);
    2626extern bool Asin(void);
    2727extern bool Atan(void);
     
    186186# endif
    187187# ifdef CPPAD_IPOPT_CPPAD_TEST
    188         ok &= Run( ipopt_cppad,     "ipopt_cppad"    );
     188        ok &= Run( cppad_ipopt,     "cppad_ipopt"    );
    189189# endif
    190190
Note: See TracChangeset for help on using the changeset viewer.