Changeset 2720 for trunk/test_more


Ignore:
Timestamp:
Jan 5, 2013 8:27:22 PM (7 years ago)
Author:
bradbell
Message:
  1. Fix check of numerical limits by making it harder for compiler to include

gaurd digits during calculations.

  1. Fix missing object expected by library that was not being used.

check_svn_id.sh: ignore temp.*.
package.sh: ignore temp.sh.
CMakeLists.txt: remove unecessary includes and library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/epsilon.cpp

    r2506 r2720  
    11/* $Id$ */
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    4545        bool check_epsilon(void)
    4646        {       bool ok  = true;
     47                CppAD::vector<Type> eps(1), one(1), two(1), eps2(1), check(1);
    4748                using CppAD::epsilon;
    4849                using CppAD::abs;
    49                 Type eps   = CppAD::epsilon<Type>();
    50                 Type one   = 1;
    51                 Type two   = 2;
    52                 Type eps2  = eps / two;
    53                 Type check = add_one(eps);
    54                 ok        &= one !=  check;
    55                 check      = add_one(eps2);
    56                 ok        &= one == check;
     50                eps[0]     = CppAD::epsilon<Type>();
     51                one[0]     = 1;
     52                two[0]     = 2;
     53                eps2[0]    = eps[0] / two[0];
     54                check[0]   = add_one(eps[0]);
     55                ok        &= one[0] != check[0];
     56                check[0]   = add_one(eps2[0]);
     57                ok        &= one[0] == check[0];
    5758                return ok;
    5859        }
Note: See TracChangeset for help on using the changeset viewer.