Changeset 3684 for trunk/test_more


Ignore:
Timestamp:
May 10, 2015 10:01:21 AM (5 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 494270b7d9413bba508ae4944e44e33b6f7be05b
end hash code: 4f37fd28086cb8ea9d063a034b715db0621a820f

commit 4f37fd28086cb8ea9d063a034b715db0621a820f
Author: Brad Bell <bradbell@…>
Date: Sun May 10 06:56:06 2015 -0700

Automatic changes for and generated by deprecated auto-tools install process.

commit f90fc447255412bda926eac132e9472a6e611bd4
Author: Brad Bell <bradbell@…>
Date: Sun May 10 06:29:53 2015 -0700

Add log1p function.

commit 7f792b718f437458af399e1feb67006779a98706
Author: Brad Bell <bradbell@…>
Date: Sun May 10 05:25:03 2015 -0700

op_code.hpp: fix comment about Expm1 operator.

commit b4be5e4692149773b061391f8ba2957e51ab7c33
Author: Brad Bell <bradbell@…>
Date: Sun May 10 05:03:25 2015 -0700

expm1.hpp: Fix title, description, and latex \exp command.

commit 148f381814fec10c5ad4480e43f59822c2c7ef30
Author: Brad Bell <bradbell@…>
Date: Sun May 10 04:32:58 2015 -0700

Change Log -> log and remove trailing white space.

Location:
trunk/test_more
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/CMakeLists.txt

    r3683 r3684  
    107107        limits.cpp
    108108        log.cpp
     109        log1p.cpp
    109110        log10.cpp
    110111        mul.cpp
  • trunk/test_more/log.cpp

    r2506 r3684  
    11/* $Id$ */
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    6666        w    = f.Forward(2, v);
    6767        ok &= NearEqual(
    68                 2. * w[y] , 
     68                2. * w[y] ,
    6969                - 1. / (Z[x]*Z[x]*U[s]*U[s]) - 1. / (Z[x]*U[s]*U[s]),
    7070                1e-10 ,
    71                 1e-10 
    72         ); 
     71                1e-10
     72        );
    7373
    7474        // reverse computation of second partials of y
     
    7878        r    = f.Reverse(2, w);
    7979        ok &= NearEqual(
    80                 r[2 * s + 1] , 
     80                r[2 * s + 1] ,
    8181                - 1. / (Z[x]*Z[x]*U[s]*U[s]) - 1. / (Z[x]*U[s]*U[s]),
    8282                1e-10 ,
    83                 1e-10 
    84         ); 
     83                1e-10
     84        );
    8585
    8686        return ok;
     
    100100        AD<double> x = exp(U[0]);
    101101
    102         // dependent variable vector 
     102        // dependent variable vector
    103103        CPPAD_TESTVECTOR(AD<double>) Z(1);
    104104        Z[0] = log(x);       // log( exp(u) )
    105105
    106106        // create f: U -> Z and vectors used for derivative calculations
    107         ADFun<double> f(U, Z); 
     107        ADFun<double> f(U, Z);
    108108        CPPAD_TESTVECTOR(double) v(1);
    109109        CPPAD_TESTVECTOR(double) w(1);
    110110
    111         // check value 
     111        // check value
    112112        ok &= NearEqual(U[0] , Z[0],  1e-10 , 1e-10);
    113113
     
    120120        for(j = 1; j < p; j++)
    121121        {       jfac *= j;
    122                 w     = f.Forward(j, v);       
     122                w     = f.Forward(j, v);
    123123                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    124124                v[0]  = 0.;
     
    127127
    128128        // reverse computation of partials of Taylor coefficients
    129         CPPAD_TESTVECTOR(double) r(p); 
     129        CPPAD_TESTVECTOR(double) r(p);
    130130        w[0]  = 1.;
    131131        r     = f.Reverse(p, w);
     
    143143} // END empty namespace
    144144
    145 bool Log(void)
     145bool log(void)
    146146{       bool ok = true;
    147147        ok &= LogTestOne();
    148         ok &= LogTestTwo(); 
     148        ok &= LogTestTwo();
    149149        return ok;
    150150}
  • trunk/test_more/log10.cpp

    r2506 r3684  
    11/* $Id$ */
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1616# include <cppad/cppad.hpp>
    1717
    18 bool Log10(void)
     18bool log10(void)
    1919{       bool ok = true;
    2020
  • trunk/test_more/makefile.am

    r3683 r3684  
    133133        limits.cpp \
    134134        log.cpp \
     135        log1p.cpp \
    135136        log10.cpp \
    136137        mul.cpp \
  • trunk/test_more/makefile.in

    r3683 r3684  
    113113        for_sparse_jac.cpp forward.cpp forward_dir.cpp \
    114114        forward_order.cpp from_base.cpp fun_check.cpp jacobian.cpp \
    115         limits.cpp log.cpp log10.cpp mul.cpp mul_eq.cpp mul_level.cpp \
    116         mul_zero_one.cpp near_equal_ext.cpp neg.cpp \
     115        limits.cpp log.cpp log1p.cpp log10.cpp mul.cpp mul_eq.cpp \
     116        mul_level.cpp mul_zero_one.cpp near_equal_ext.cpp neg.cpp \
    117117        ode_err_control.cpp optimize.cpp parameter.cpp poly.cpp \
    118118        pow.cpp pow_int.cpp print_for.cpp romberg_one.cpp rosen_34.cpp \
     
    142142        forward_dir.$(OBJEXT) forward_order.$(OBJEXT) \
    143143        from_base.$(OBJEXT) fun_check.$(OBJEXT) jacobian.$(OBJEXT) \
    144         limits.$(OBJEXT) log.$(OBJEXT) log10.$(OBJEXT) mul.$(OBJEXT) \
    145         mul_eq.$(OBJEXT) mul_level.$(OBJEXT) mul_zero_one.$(OBJEXT) \
    146         near_equal_ext.$(OBJEXT) neg.$(OBJEXT) \
     144        limits.$(OBJEXT) log.$(OBJEXT) log1p.$(OBJEXT) log10.$(OBJEXT) \
     145        mul.$(OBJEXT) mul_eq.$(OBJEXT) mul_level.$(OBJEXT) \
     146        mul_zero_one.$(OBJEXT) near_equal_ext.$(OBJEXT) neg.$(OBJEXT) \
    147147        ode_err_control.$(OBJEXT) optimize.$(OBJEXT) \
    148148        parameter.$(OBJEXT) poly.$(OBJEXT) pow.$(OBJEXT) \
     
    358358cppad_compiler_has_erf = @cppad_compiler_has_erf@
    359359cppad_compiler_has_expm1 = @cppad_compiler_has_expm1@
     360cppad_compiler_has_log1p = @cppad_compiler_has_log1p@
    360361cppad_cppadvector = @cppad_cppadvector@
    361362cppad_cxx_flags = @cppad_cxx_flags@
     
    525526        limits.cpp \
    526527        log.cpp \
     528        log1p.cpp \
    527529        log10.cpp \
    528530        mul.cpp \
     
    671673@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
    672674@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log10.Po@am__quote@
     675@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log1p.Po@am__quote@
    673676@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul.Po@am__quote@
    674677@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_eq.Po@am__quote@
  • trunk/test_more/test_more.cpp

    r3683 r3684  
    6262extern bool jacobian(void);
    6363extern bool limits(void);
    64 extern bool Log(void);
    65 extern bool Log10(void);
     64extern bool log(void);
     65extern bool log10(void);
     66extern bool log1p(void);
    6667extern bool Mul(void);
    6768extern bool mul_level(void);
     
    176177        ok &= Run( jacobian,        "jacobian"       );
    177178        ok &= Run( limits,          "limits"         );
    178         ok &= Run( Log,             "Log"            );
    179         ok &= Run( Log10,           "Log10"          );
     179        ok &= Run( log,             "log"            );
     180        ok &= Run( log10,           "log10"          );
     181        ok &= Run( log1p,           "log1p"          );
    180182        ok &= Run( Mul,             "Mul"            );
    181183        ok &= Run( mul_level,       "mul_level"      );
Note: See TracChangeset for help on using the changeset viewer.