Changeset 1635


Ignore:
Timestamp:
Jan 24, 2010 11:27:06 AM (10 years ago)
Author:
bradbell
Message:

/home/bradbell/cppad/trunk: In ode example, use smaller case for correctness, bigger for speed.

add_copyright.sh: script to add copyright message at top of a new file.
ode_check.hpp: prototype for the ode_check function.
ode_simple_check.cpp: split out of ode_check.cpp (use smaller size).
ode_fast_check.cpp: split out of ode_check.cpp (old size ok for this case).
*/makefile.in: changes automatically transferred from */makefile.am.
ode_speed.cpp: use new includ file names.
ode_run.hpp: only include problem definition.
ode_check.cpp: split out runing particular cases.
example/makefile.am: reference new source file names.
example.cpp: reference new test names.
check_svn_dist.sh: compile ipopt_cppad library before tests.

Location:
trunk
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/check_svn_dist.sh

    r1633 r1635  
    3636        example
    3737        test_more
     38        cppad_ipopt/src
    3839        cppad_ipopt/example
    3940        cppad_ipopt/speed
     
    5556        fi
    5657        program=`echo $name | sed -e 's|.*/||'`
    57         echo "./$program"
    58         if ! ./$program
    59         then
    60                 echo "$script: $dir/$name/$program failed"
    61                 exit 1
     58        # src directories create libraries
     59        if [ "$program" != "$src" ]
     60        then
     61                echo "./$program"
     62                if ! ./$program
     63                then
     64                        echo "$script: $dir/$name/$program failed"
     65                        exit 1
     66                fi
     67                echo "cd $dir"
     68                cd $dir
    6269        fi
    63         echo "cd $dir"
    64         cd $dir
    6570done
  • trunk/cppad_ipopt/example/example.cpp

    r1626 r1635  
    2222// external complied tests
    2323extern bool ipopt_get_started(void);
    24 extern bool ipopt_ode_check(void);
     24extern bool ode_simple_check(void);
     25extern bool ode_fast_check(void);
    2526
    2627namespace {
     
    4950        // external compiled tests
    5051        ok &= Run( ipopt_get_started,   "ipopt_get_started"  );
    51         ok &= Run( ipopt_ode_check,     "ipopt_ode_check"      );
     52        ok &= Run( ode_simple_check,    "ode_simple_check"   );
     53        ok &= Run( ode_fast_check,      "ode_fast_check"     );
    5254       
    5355        // check for errors
  • trunk/cppad_ipopt/example/makefile.am

    r1634 r1635  
    4444        example.cpp \
    4545        get_started.cpp \
     46        ode_check.cpp \
     47        ode_check.hpp \
     48        ode_fast_check.cpp \
    4649        ode_fast.hpp \
    4750        ode_problem.hpp \
    48         ode_simple.hpp \
    49         ode_check.cpp \
    50         ode_run.hpp
     51        ode_run.hpp \
     52        ode_simple_check.cpp \
     53        ode_simple.hpp
  • trunk/cppad_ipopt/example/makefile.in

    r1634 r1635  
    4646PROGRAMS = $(noinst_PROGRAMS)
    4747am_example_OBJECTS = example.$(OBJEXT) get_started.$(OBJEXT) \
    48         ode_check.$(OBJEXT)
     48        ode_check.$(OBJEXT) ode_fast_check.$(OBJEXT) \
     49        ode_simple_check.$(OBJEXT)
    4950example_OBJECTS = $(am_example_OBJECTS)
    5051example_LDADD = $(LDADD)
     
    8990CYGPATH_W = @CYGPATH_W@
    9091
    91 # $Id: makefile.am 1632 2010-01-23 12:19:08Z bradbell $
     92# $Id: makefile.am 1634 2010-01-24 08:44:17Z bradbell $
    9293# -----------------------------------------------------------------------------
    9394# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
     
    214215        example.cpp \
    215216        get_started.cpp \
     217        ode_check.cpp \
     218        ode_check.hpp \
     219        ode_fast_check.cpp \
    216220        ode_fast.hpp \
    217221        ode_problem.hpp \
    218         ode_simple.hpp \
    219         ode_check.cpp \
    220         ode_run.hpp
     222        ode_run.hpp \
     223        ode_simple_check.cpp \
     224        ode_simple.hpp
    221225
    222226all: all-am
     
    270274@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
    271275@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_check.Po@am__quote@
     276@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_fast_check.Po@am__quote@
     277@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_simple_check.Po@am__quote@
    272278
    273279.cpp.o:
  • trunk/cppad_ipopt/example/ode_check.cpp

    r1628 r1635  
    2424# include "ode_run.hpp"
    2525
    26 namespace { // Begin empty namespace
    27 bool check_solution(const SizeVector& N, const NumberVector& x)
     26bool ode_check(const SizeVector& N, const NumberVector& x)
    2827{       bool ok = true;
    2928        size_t i, j;
     
    104103        return ok;
    105104}
    106 } // End empty namespace
    107 
    108 bool ipopt_ode_check(void)
    109 {       bool ok = true;
    110         bool retape;
    111         size_t i;
    112 
    113         // solution vector
    114         NumberVector x;
    115 
    116         // number of time grid intervals between measurement values
    117         SizeVector N(Nz + 1);
    118         N[0] = 0;
    119         for(i = 1; i <= Nz; i++)
    120                 N[i] = 5;
    121 
    122         for(i = 0; i < 2; i++)
    123         {       retape = bool(i);
    124                 ipopt_ode_case<FG_simple>(retape, N, x);
    125                 ok &= check_solution(N, x);
    126                 ipopt_ode_case<FG_fast>(retape, N, x);
    127                 ok &= check_solution(N, x);
    128         }
    129  
    130         return ok;
    131 }
    132105// END PROGRAM
  • trunk/cppad_ipopt/example/ode_run.hpp

    r1628 r1635  
    2929
    3030// BEGIN PROGRAM
    31 # include "ode_simple.hpp"
    32 # include "ode_fast.hpp"
     31# include "ode_problem.hpp"
    3332
    3433namespace { // BEGIN empty namespace -----------------------------------------
  • trunk/cppad_ipopt/speed/makefile.in

    r1634 r1635  
    8787CYGPATH_W = @CYGPATH_W@
    8888
    89 # $Id: makefile.am 1632 2010-01-23 12:19:08Z bradbell $
     89# $Id: makefile.am 1634 2010-01-24 08:44:17Z bradbell $
    9090# -----------------------------------------------------------------------------
    9191# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
  • trunk/cppad_ipopt/speed/ode_speed.cpp

    r1628 r1635  
    2424// BEGIN PROGRAM
    2525# include "../example/ode_run.hpp"
     26# include "../example/ode_simple.hpp"
     27# include "../example/ode_fast.hpp"
    2628# include <cassert>
    2729
     
    6971        N[0] = 0;
    7072        for(i = 1; i <= Nz; i++)
    71         {       N[i] = 7;
     73        {       N[i] = 10;
    7274                // n   += N[i] * Ny;
    7375        }
  • trunk/cppad_ipopt/test/makefile.in

    r1634 r1635  
    8585CYGPATH_W = @CYGPATH_W@
    8686
    87 # $Id: makefile.am 1633 2010-01-23 14:48:12Z bradbell $
     87# $Id: makefile.am 1634 2010-01-24 08:44:17Z bradbell $
    8888# -----------------------------------------------------------------------------
    8989# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
  • trunk/makefile.in

    r1634 r1635  
    4141        $(top_srcdir)/omh/install_unix.omh.in \
    4242        $(top_srcdir)/omh/install_windows.omh.in AUTHORS COPYING \
    43         ChangeLog INSTALL NEWS config.guess config.sub depcomp \
    44         install-sh ltmain.sh missing
     43        ChangeLog INSTALL NEWS depcomp install-sh missing
    4544ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4645am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     
    238237@CppAD_POSTFIX_FALSE@postfix_dir = .
    239238
    240 # $Id: makefile.am 1633 2010-01-23 14:48:12Z bradbell $
     239# $Id: makefile.am 1634 2010-01-24 08:44:17Z bradbell $
    241240# -----------------------------------------------------------------------------
    242241# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
Note: See TracChangeset for help on using the changeset viewer.