Changeset 3637


Ignore:
Timestamp:
Feb 9, 2015 7:48:56 PM (5 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: fd0eb43ee368470823d047016d455bcc074c73e2
end hash code: 3249a4c6f8216de001805d3e22bcdec63fed2d25

commit 3249a4c6f8216de001805d3e22bcdec63fed2d25
Author: Brad Bell <bradbell@…>
Date: Mon Feb 9 17:44:30 2015 -0700

whats_new_15.omh: add entry for change on 2015-02-07.

commit f10d3f5a1ad37816f59de0485acbd92e46abf7c1
Author: Brad Bell <bradbell@…>
Date: Mon Feb 9 07:17:24 2015 -0700

whats_new_15.omh: bug fix necessary for el6 package.

commit e8e418a0bedcaaf83d9902307ccab7266a3d0975
Author: Brad Bell <bradbell@…>
Date: Mon Feb 9 06:28:42 2015 -0700

Fix optimization check to use near eqaul instead of exact equal in some cases.
atomic.sh: more simplification.
optimize.cpp: Changes near equals to use machine epsilon.

commit da9efa0e41c776914976f9ea8305884eaa5500b6
Author: Brad Bell <bradbell@…>
Date: Sat Feb 7 21:47:04 2015 -0700

atomic.sh: simplify and move toward removing use if Eigen.

commit 04d0106b494d63f7861ab3a4e5b932ae0f00ea50
Author: Brad Bell <bradbell@…>
Date: Sat Feb 7 16:34:46 2015 -0700

atomic.sh: bug report / question from Micheal Braun.
CMakeLists.txt: make test simplier by using static library.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/omh/whats_new/whats_new_15.omh

    r3633 r3637  
    1414$dollar @$$
    1515$spell
     16        src
    1617        op
    1718        onetape
     
    4142assist you in learning about changes between various versions of CppAD.
    4243
     44$head 02-09$$
     45The test $code test_more/optimize.cpp$$ was failing on some systems
     46because an exactly equality check should have been a near equal check.
     47This has been fixed.
     48
     49$head 02-07$$
     50On some systems, the library
     51corresponding to $code speed/src$$ could not be found.
     52This library is only used for testing and so has been changed to always be
     53static (hence does not need to be found at run time).
     54
    4355$head 02-06$$
    4456There was a bug in the coloring method change on
  • trunk/speed/src/CMakeLists.txt

    r3122 r3637  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
     
    1717#       source1 source2 ... sourceN)
    1818# )
    19 ADD_LIBRARY(speed_src EXCLUDE_FROM_ALL
     19# Make libspeed_src a static library because this is just for testing
     20# and is not installed (do not have to worry about library search path).
     21ADD_LIBRARY(speed_src STATIC EXCLUDE_FROM_ALL
    2022        link_det_lu.cpp
    2123        link_det_minor.cpp
  • trunk/test_more/optimize.cpp

    r3607 r3637  
    1717
    1818namespace {
     19        // accuracy for almost equal checks
     20        double eps = 10. * std::numeric_limits<double>::epsilon();
     21        using CppAD::NearEqual;
     22
    1923        // note this enum type is not part of the API (but its values are)
    2024        CppAD::atomic_base<double>::option_enum atomic_sparsity_option;
     
    396400                depend_fun(x, check, original, opt);
    397401                for(i = 0; i < m; i++)
    398                         ok &= (y[i] == check[i]);
     402                        ok &= NearEqual(y[i], check[i], eps, eps);
    399403       
    400404                // Check size before optimization
     
    411415                y = F.Forward(0, x);
    412416                for(i = 0; i < m; i++)
    413                         ok &= (y[i] == check[i]);
     417                        ok &= NearEqual(y[i], check[i], eps, eps);
    414418       
    415419                return ok;
     
    528532                dw = F.Reverse(1, w);
    529533
    530                 double eps = 20. * std::numeric_limits<double>::epsilon();
    531534                double check = x[1] * pow( x[0], x[1] - 1. );
    532                 ok &= CppAD::NearEqual( dw[0], check, eps, eps );
     535                ok &= NearEqual( dw[0], check, eps, eps );
    533536
    534537                check = log( x[0] ) * pow( x[0], x[1] );
    535                 ok &= CppAD::NearEqual( dw[1], check, eps, eps );
     538                ok &= NearEqual( dw[1], check, eps, eps );
    536539
    537540                check = 0.;
    538                 ok &= CppAD::NearEqual( dw[2], check, eps, eps );
     541                ok &= NearEqual( dw[2], check, eps, eps );
    539542       
    540543                return ok;
     
    645648                duplicate_fun(x, check, original, opt);
    646649                for(i = 0; i < m; i++)
    647                         ok &= (y[i] == check[i]);
     650                        ok &= NearEqual(y[i], check[i], eps, eps);
    648651       
    649652                // Check size before optimization
     
    660663                y = F.Forward(0, x);
    661664                for(i = 0; i < m; i++)
    662                         ok &= (y[i] == check[i]);
     665                        ok &= NearEqual(y[i], check[i], eps, eps);
    663666       
    664667                return ok;
     
    936939                x0[1]    = 4.;
    937940                y0       = F.Forward(0, x0);
    938                 ok      &= NearEqual(y0[0] , x0[0]+x0[0]+x0[1], 1e-10, 1e-10);
     941                ok      &= NearEqual(y0[0] , x0[0]+x0[0]+x0[1], eps, eps);
    939942       
    940943                // evaluate derivative of F in X[0] direction
     
    944947                x1[1]    = 0.;
    945948                y1       = F.Forward(1, x1);
    946                 ok      &= NearEqual(y1[0] , x1[0]+x1[0]+x1[1], 1e-10, 1e-10);
     949                ok      &= NearEqual(y1[0] , x1[0]+x1[0]+x1[1], eps, eps);
    947950       
    948951                // evaluate second derivative of F in X[0] direction
     
    953956                y2          = F.Forward(2, x2);
    954957                double F_00 = 2. * y2[0];
    955                 ok         &= NearEqual(F_00, 0., 1e-10, 1e-10);
     958                ok         &= NearEqual(F_00, 0., eps, eps);
    956959       
    957960                return ok;
     
    985988                x0[1]    = 4.;
    986989                y0       = F.Forward(0, x0);
    987                 ok      &= NearEqual(y0[0] , x0[0]-x0[0]+x0[1], 1e-10, 1e-10);
     990                ok      &= NearEqual(y0[0] , x0[0]-x0[0]+x0[1], eps, eps);
    988991       
    989992                // evaluate derivative of F
     
    992995                w[0]    = 1.;
    993996                dF      = F.Reverse(1, w);
    994                 ok     &= NearEqual(dF[0] , 0., 1e-10, 1e-10);
    995                 ok     &= NearEqual(dF[1] , 1., 1e-10, 1e-10);
     997                ok     &= NearEqual(dF[0] , 0., eps, eps);
     998                ok     &= NearEqual(dF[1] , 1., eps, eps);
    996999       
    9971000                return ok;
Note: See TracChangeset for help on using the changeset viewer.