Changeset 2722


Ignore:
Timestamp:
Jan 6, 2013 11:52:46 AM (7 years ago)
Author:
bradbell
Message:
  1. Change echo_exec to echo_eval.

limits.hpp: Improve documentation.
limits.cpp: Simplify example.
epsilon.cpp: Replace by more general limits.cpp.
limits.cpp: Modified version of old example/limits.cpp.

Location:
trunk
Files:
1 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/check_all.sh

    r2717 r2722  
    1616        exit 1
    1717fi
    18 echo_exec() {
     18echo_eval() {
    1919     echo $*
    2020     eval $*
    2121}
    22 echo_exec_log() {
     22echo_eval_log() {
    2323        echo "$* >> check_all.log"
    2424        echo $* >> $top_srcdir/check_all.log
     
    3232if [ -e 'check_all.log' ]
    3333then
    34         echo_exec rm check_all.log
     34        echo_eval rm check_all.log
    3535fi
    3636top_srcdir=`pwd`
     
    4848# -----------------------------------------------------------------------------
    4949# Create package to run test in
    50 echo_exec bin/package.sh
     50echo_eval bin/package.sh
    5151# -----------------------------------------------------------------------------
    5252# change into gpl version of package directory
    5353version=`bin/version.sh get`
    54 echo_exec cd work/cppad-$version
     54echo_eval cd work/cppad-$version
    5555# -----------------------------------------------------------------------------
    5656list="
     
    6363        if [ -e "$name" ]
    6464        then
    65                 echo_exec rm -r $name
    66         fi
    67 done
    68 echo_exec mkdir work
    69 echo_exec cd work
     65                echo_eval rm -r $name
     66        fi
     67done
     68echo_eval mkdir work
     69echo_eval cd work
    7070# -----------------------------------------------------------------------------
    7171cmake_args="$cmake_args  -D cmake_install_prefix=$HOME/prefix/cppad"
     
    105105#
    106106#
    107 echo_exec_log cmake $cmake_args ..
    108 # -----------------------------------------------------------------------------
    109 echo_exec_log make check
     107echo_eval_log cmake $cmake_args ..
     108# -----------------------------------------------------------------------------
     109echo_eval_log make check
    110110# -----------------------------------------------------------------------------
    111111skip=''
     
    129129                skip="$skip $program"
    130130        else
    131                 echo_exec_log $program
     131                echo_eval_log $program
    132132        fi
    133133done
     
    141141                skip="$skip $program"
    142142        else
    143                 echo_exec_log $program correct 54321
    144                 echo_exec_log $program correct 54321 retape
     143                echo_eval_log $program correct 54321
     144                echo_eval_log $program correct 54321 retape
    145145        fi
    146146done
     
    159159                #
    160160                # fast cases, test for all programs
    161                 echo_exec_log ./$program a11c
    162                 echo_exec_log ./$program simple_ad
    163                 echo_exec_log ./$program team_example
     161                echo_eval_log ./$program a11c
     162                echo_eval_log ./$program simple_ad
     163                echo_eval_log ./$program team_example
    164164        fi
    165165done
     
    168168        # test_time=1,max_thread=4,mega_sum=1
    169169        next_program
    170         echo_exec_log ./$program harmonic 1 4 1
     170        echo_eval_log ./$program harmonic 1 4 1
    171171        #
    172172        # test_time=2,max_thread=4,num_zero=20,num_sub=30,num_sum=500,use_ad=true
    173173        next_program
    174         echo_exec_log ./$program multi_newton 2 4 20 30 500 true
     174        echo_eval_log ./$program multi_newton 2 4 20 30 500 true
    175175        #
    176176        # case that failed in the past
    177177        next_program
    178         echo_exec_log ./$program multi_newton 1 1 100 700 1 true
     178        echo_eval_log ./$program multi_newton 1 1 100 700 1 true
    179179        #
    180180        # case that failed in the past
    181181        next_program
    182         echo_exec_log ./$program multi_newton 1 2 3 12 1 true
     182        echo_eval_log ./$program multi_newton 1 2 3 12 1 true
    183183fi
    184184#
     
    188188        skip="$skip print_for/print_for"
    189189else
    190         echo_exec_log print_for/print_for
     190        echo_eval_log print_for/print_for
    191191        print_for/print_for | sed -e '/^Test passes/,$d' > junk.1.$$
    192192        print_for/print_for | sed -e '1,/^Test passes/d' > junk.2.$$
     
    201201fi
    202202#
    203 echo_exec_log make install
     203echo_eval_log make install
    204204#
    205205if [ "$skip" != '' ]
  • trunk/bin/gpl_license.sh

    r2587 r2722  
    22# $Id$
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    2121        exit 1
    2222fi
    23 echo_exec() {
     23echo_eval() {
    2424     echo $*
    2525     eval $*
     
    5252if [ -e $archive_dir/$archive_name.gpl.tgz ]
    5353then
    54         echo_exec rm $archive_dir/$archive_name.gpl.tgz
     54        echo_eval rm $archive_dir/$archive_name.gpl.tgz
    5555fi
    5656#
    5757# change into work directory
    58 echo_exec cd $work_dir
     58echo_eval cd $work_dir
    5959#
    6060# delete old version of directory (if it exists)
    6161if [ -e $archive_name ]
    6262then
    63         echo_exec rm -r $archive_name
     63        echo_eval rm -r $archive_name
    6464fi
    6565if [ -e $archive_name ]
     
    7070#
    7171# extract from the EPL version
    72 echo_exec tar -xzf $archive_dir/$archive_name.epl.tgz
     72echo_eval tar -xzf $archive_dir/$archive_name.epl.tgz
    7373#
    7474# remove documentation directory (if it exists)
    7575if [ -e $archive_name/doc ]
    7676then
    77         echo_exec rm -r $archive_name/doc
     77        echo_eval rm -r $archive_name/doc
    7878fi
    7979#
    8080# change into the directory
    81 echo_exec cd $archive_name
     81echo_eval cd $archive_name
    8282#
    8383# files that need removing
    84 echo_exec rm epl-v10.html epl-v10.txt
     84echo_eval rm epl-v10.html epl-v10.txt
    8585#
    8686# files that need changing
     
    9999#
    100100# change back up to work directory (to be safe)
    101 echo_exec cd ..
     101echo_eval cd ..
    102102#
    103103echo "Changing license from EPL to GPL"
     
    171171#
    172172# change into the version directory
    173 echo_exec cd $archive_name
     173echo_eval cd $archive_name
    174174#
    175175# Only include the *.xml verison of the documentation in distribution
     
    190190then
    191191        mv omhelp.xml.log ../..
    192         echo_exec mv doc.omh.save doc.omh
     192        echo_eval mv doc.omh.save doc.omh
    193193        exit 1
    194194fi
    195195# Move the log to the directory where the start directory
    196 echo_exec mv omhelp.xml.log $start_dir
    197 #
    198 echo_exec mv doc.omh.save doc.omh
    199 echo_exec cd ..
     196echo_eval mv omhelp.xml.log $start_dir
     197#
     198echo_eval mv doc.omh.save doc.omh
     199echo_eval cd ..
    200200# ----------------------------------------------------------------------------
    201201#
    202202# create GPL tarball file as copy or the version directory
    203 echo_exec tar -czf $archive_dir/$archive_name.gpl.tgz $archive_name
     203echo_eval tar -czf $archive_dir/$archive_name.gpl.tgz $archive_name
    204204
    205205# if we reach here, no error occurred
  • trunk/bin/package.sh

    r2720 r2722  
    1616        exit 1
    1717fi
    18 echo_exec() {
     18echo_eval() {
    1919     echo $*
    2020     eval $*
     
    2323if [ -e package.log ]
    2424then
    25         echo_exec rm package.log
     25        echo_eval rm package.log
    2626fi
    2727# ----------------------------------------------------------------------------
     
    3030# Use CMakeLists.txt to update version number in other files
    3131version=`bin/version.sh get`
    32 echo_exec bin/version.sh copy
     32echo_eval bin/version.sh copy
    3333#
    3434# Update cppad/configure.hpp, example/test_one.sh, test_more/test_one.sh
    3535if [ ! -d work ]
    3636then
    37         echo_exec mkdir work
     37        echo_eval mkdir work
    3838fi
    39 echo_exec cd work
    40 echo_exec cmake ..
    41 echo_exec cd ..
     39echo_eval cd work
     40echo_eval cmake ..
     41echo_eval cd ..
    4242# ----------------------------------------------------------------------------
    4343# Run automated checking of file names in original source directory
     
    5656for check in $list
    5757do
    58         echo_exec bin/$check
     58        echo_eval bin/$check
    5959done
    6060# ----------------------------------------------------------------------------
    6161# Check for doxygen errors
    62 echo_exec bin/run_doxygen.sh
     62echo_eval bin/run_doxygen.sh
    6363# ----------------------------------------------------------------------------
    6464# Create the package directory
     
    6666if [ -e "$package_dir" ]
    6767then
    68         echo_exec rm -r $package_dir
     68        echo_eval rm -r $package_dir
    6969fi
    7070if [ -e "$package_dir.epl.tgz" ]
    7171then
    72         echo_exec rm $package_dir.epl.tgz
     72        echo_eval rm $package_dir.epl.tgz
    7373fi
    74 echo_exec mkdir -p $package_dir
     74echo_eval mkdir -p $package_dir
    7575# -----------------------------------------------------------------------------
    7676# Source file that are coppied to the package directory
     
    126126# ----------------------------------------------------------------------------
    127127# build the xml version of documentation for this distribution
    128 echo_exec cd $package_dir
     128echo_eval cd $package_dir
    129129#
    130130# Only include the *.xml verison of the documentation in distribution
     
    145145then
    146146        mv omhelp.xml.log ../..
    147         echo_exec mv doc.omh.save doc.omh
     147        echo_eval mv doc.omh.save doc.omh
    148148        exit 1
    149149fi
     
    151151mv omhelp.xml.log ../..
    152152#
    153 echo_exec mv doc.omh.save doc.omh
     153echo_eval mv doc.omh.save doc.omh
    154154# ----------------------------------------------------------------------------
    155155# change back to the package parent directory and create the tarball
    156 echo_exec cd ..
    157 echo_exec tar -czf cppad-$version.epl.tgz cppad-$version
     156echo_eval cd ..
     157echo_eval tar -czf cppad-$version.epl.tgz cppad-$version
    158158# ----------------------------------------------------------------------------
    159159# create gpl version of package
    160 echo_exec cd ..
    161 echo_exec bin/gpl_license.sh cppad-$version work work
     160echo_eval cd ..
     161echo_eval bin/gpl_license.sh cppad-$version work work
  • trunk/bin/run_doxygen.sh

    r2616 r2722  
    22# $Id$
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    1616        exit 1
    1717fi
    18 echo_exec() {
     18echo_eval() {
    1919     echo $*
    2020     eval $*
     
    2828        if [ -e $name ]
    2929        then
    30                 echo_exec rm -r $name
     30                echo_eval rm -r $name
    3131        fi
    3232done
    33 echo_exec mkdir doxydoc
    34 echo_exec bin/doxyfile.sh $version $error_file $output_directory
     33echo_eval mkdir doxydoc
     34echo_eval bin/doxyfile.sh $version $error_file $output_directory
    3535#
    3636echo 'doxygen doxyfile > doxygen.log'
    3737doxygen doxyfile       > doxygen.log
    3838#
    39 echo_exec cat doxygen.err
    40 echo_exec bin/check_doxygen.sh
     39echo_eval cat doxygen.err
     40echo_eval bin/check_doxygen.sh
    4141#
    4242echo 'OK: bin/run_doxygen.sh'
  • trunk/bin/run_omhelp.sh

    r2717 r2722  
    1818# -----------------------------------------------------------------------------
    1919# bash function that echos and executes a command
    20 echo_exec() {
     20echo_eval() {
    2121        echo $*
    2222        eval $*
     
    3636if [ "$1" == "clean" ]
    3737then
    38         echo_exec rm -rf doc
     38        echo_eval rm -rf doc
    3939        exit 0
    4040fi
     
    5050if [ ! -e doc ]
    5151then
    52         echo_exec mkdir doc
     52        echo_eval mkdir doc
    5353fi
    54 echo_exec cd doc
     54echo_eval cd doc
    5555cmd="omhelp ../doc.omh -noframe -debug -l http://www.coin-or.org/CppAD/"
    5656if [ "$ext" == "xml" ]
     
    8888if [ -e 'index.htm' ]
    8989then
    90         echo_exec rm index.htm
     90        echo_eval rm index.htm
    9191fi
    9292cat << EOF > index.html
  • trunk/bin/version.sh

    r2710 r2722  
    2525        exit 1
    2626fi
    27 echo_exec() {
     27echo_eval() {
    2828     echo $*
    2929     eval $*
     
    115115        fi
    116116        #
    117         echo_exec rm $name.old
     117        echo_eval rm $name.old
    118118done
    119119echo 'bin/version.sh copy: OK'
  • trunk/cppad/local/limits.hpp

    r2625 r2722  
    33# define CPPAD_LIMITS_INCLUDED
    44/* --------------------------------------------------------------------------
    5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    66
    77CppAD is distributed under multiple licenses. This distribution is under
     
    3030$index limit, epsilon$$
    3131
    32 $section Numeric Limits For an AD Type$$
     32$section Numeric Limits For an AD and Base Types$$
    3333
    3434$head Syntax$$
    35 $icode%eps% = numeric_limits::epsilon<%Float%>()
     35$icode%eps% = numeric_limits<%Float%>::epsilon()
    3636%$$
    37 $icode%min% = numeric_limits::min<%Float%>()
     37$icode%min% = numeric_limits<%Float%>::min()
    3838%$$
    39 $icode%max% = numeric_limits::min<%Float%>()
     39$icode%max% = numeric_limits<%Float%>::max()
    4040%$$
    4141
    4242$head Purpose$$
    4343Obtain the value of some of the C++ standard numeric limits
    44 using the CppAD namespace version.
     44using the CppAD namespace version of $code numeric_limits$$.
    4545These are all functions and have the prototype
    4646$codei%
    47         %Type% numeric_limits<%Type%>::%fun%(%void%)
     47        %Float% numeric_limits<%Float%>::%fun%(%void%)
    4848%$$
    4949where $icode fun$$ is $code epsilon$$, $code min$$, or $code max$$.
    50 Note that this is different than the standard namespace prototype
    51 for some types; e.g., $code std::complex<double>$$.
     50$pre
    5251
    53 $head Type$$
     52$$
     53Note that C++ standard specifies that Non-fundamental standard
     54types, such as $codei%std::complex<%T%>%$$ shall not have specializations
     55of $code std::numeric_limits$$; see Section 18.2 of
     56ISO/IEC 14882:1998(E).
     57
     58$head Float$$
    5459These functions are defined for all $codei%AD<%Base%>%$$,
    55 and for all corresponding $icode Base$$ types.
     60and for all corresponding $icode Base$$ types;
     61see $icode Base$$ type $cref/limits/base_std_math/limits/$$.
    5662
    5763$head eps$$
    5864The result $icode eps$$ is equal to machine epsilon and has prototype
    5965$codei%
    60         %Type% eps
     66        %Float% %eps%
    6167%$$
     68CppAD tests the value $icode eps$$ by checking that the following are true
     69$codei%
     70        1 != 1 + %eps%
     71        1 == 1 + %eps% / 2
     72%$$
     73where all the values, and calculations, are done with the precision
     74corresponding to $icode Float$$.
     75       
    6276
    6377$head min$$
     
    6579the minimum positive normalized value and has prototype
    6680$codei%
    67         %Type% min
     81        %Float% %min%
    6882%$$
     83CppAD tests the value $icode min$$ by checking that the following are true
     84$codei%
     85        abs( ((%min% / 100) * 100) / %min% - 1 ) > 3 * %eps%
     86        abs( ((%min% * 100) / (100 * (1 - %eps%)) / %min% - 1 ) < 3 * %eps%
     87%$$
     88where all the values, and calculations, are done with the precision
     89corresponding to $icode Float$$.
    6990
    7091$head max$$
     
    7293the maximum finite value and has prototype
    7394$codei%
    74         %Type% max
     95        %Float% %max%
    7596%$$
     97CppAD tests the value $icode max$$ by checking that the following are true
     98$codei%
     99        abs( ((%max% * 100) / 100) / %max% - 1 ) > 3 * %eps%
     100        abs( ((%max% / 100) * (100 * (1 - %eps%)) / %max% - 1 ) < 3 * %eps%
     101%$$
     102where all the values, and calculations, are done with the precision
     103corresponding to $icode Float$$.
    76104
    77105$head Example$$
     
    102130
    103131/// Default value for all undefined numeric_limits types
    104 template <class Type>
     132template <class Float>
    105133class numeric_limits {
    106134public:
    107135        /// machine epsilon
    108         static Type epsilon(void)
     136        static Float epsilon(void)
    109137        {       CPPAD_ASSERT_KNOWN(
    110138                false,
    111                 "numeric_limits<Type>::epsilon() is not specialized for this Type"
     139                "numeric_limits<Float>::epsilon() is not specialized for this Float"
    112140                );
    113                 return Type(0);
     141                return Float(0);
    114142        }
    115143        /// minimum positive normalized value
    116         static Type min(void)
     144        static Float min(void)
    117145        {       CPPAD_ASSERT_KNOWN(
    118146                false,
    119                 "numeric_limits<Type>::min() is not specialized for this Type"
     147                "numeric_limits<Float>::min() is not specialized for this Float"
    120148                );
    121                 return Type(0);
     149                return Float(0);
    122150        }
    123151        /// maximum finite value
    124         static Type max(void)
     152        static Float max(void)
    125153        {       CPPAD_ASSERT_KNOWN(
    126154                false,
    127                 "numeric_limits<Type>::max() is not specialized for this Type"
     155                "numeric_limits<Float>::max() is not specialized for this Float"
    128156                );
    129                 return Type(0);
     157                return Float(0);
    130158        }
    131159};
  • trunk/example/limits.cpp

    r2720 r2722  
    3232// Supress Microsoft compiler warning about possible loss of precision,
    3333// in the constructors (when converting to std::complex<float>)
    34 //      Type one = 1
    35 //      Type two = 2
     34//      Float one = 1
     35//      Float two = 2
    3636// 1 and 2 are small enough so no loss of precision when converting to float.
    3737# pragma warning(disable:4244)
     
    4242
    4343namespace {
    44         template <class Type>
    45         Type add_one(const Type& value)
    46         {       return( Type(1) + value ); }
     44        typedef CppAD::AD<double> Float;
     45        //
    4746        // -----------------------------------------------------------------
    48         template <class Type>
    4947        bool check_epsilon(void)
    5048        {       bool ok    = true;
    51                 CppAD::vector<Type> eps(1), one(1), two(1), eps2(1), check(1);
    52                 eps[0]     = CppAD::numeric_limits<Type>::epsilon();
    53                 one[0]     = 1;
    54                 two[0]     = 2;
    55                 eps2[0]    = eps[0] / two[0];
    56                 check[0]   = add_one(eps[0]);
    57                 ok        &= one[0] != check[0];
    58                 check[0]   = add_one(eps2[0]);
    59                 ok        &= one[0] == check[0];
     49                Float eps   = CppAD::numeric_limits<Float>::epsilon();
     50                Float eps2  = eps / 2.0;
     51                Float check = 1.0 + eps;
     52                ok         &= 1.0 !=  check;
     53                check       = 1.0 + eps2;
     54                ok         &= 1.0 == check;
    6055                return ok;
    6156        }
    6257        // -----------------------------------------------------------------
    63         template <class Type>
    6458        bool check_min(void)
    65         {       bool ok    = true;
    66                 CppAD::vector<Type> min(1), eps(1), one(1), three(1), tmp(1), match(1);
    67                 min[0]     = CppAD::numeric_limits<Type>::min();
    68                 eps[0]     = CppAD::numeric_limits<Type>::epsilon();
    69                 one[0]     = 1;
    70                 three[0]   = 3;
    71                 tmp[0]     = (min[0] * eps[0]) / three[0];
    72                 match[0]   = (tmp[0] * three[0]) / eps[0];
    73                 //        &= abs(match[0] / min[0] - one[0]) > three[0] * eps[0]
    74                 ok        &= CppAD::abs_geq(match[0] / min[0] - one[0], three[0] * eps[0]);
     59        {       bool ok     = true;
     60                Float min   = CppAD::numeric_limits<Float>::min();
     61                Float eps   = CppAD::numeric_limits<Float>::epsilon();
    7562                //
    76                 tmp[0]     = (min[0] / eps[0]) * three[0];
    77                 match[0]   = (tmp[0] / three[0]) * eps[0];
    78                 //        &= abs(match[0] / min[0] - one[0]) < three[0] * eps[0]
    79                 ok        &= CppAD::abs_geq(three[0] * eps[0], match[0] / min[0] - one[0]);
     63                Float match = (min / 100. ) * 100.;
     64                ok         &= abs(match/min - 1.0) > 3.0 * eps;
     65                //
     66                match       = (min * 100.) / (100. * (1.0 - eps));
     67                ok         &= abs(match / min - 1.0) < 3.0 * eps;
    8068                return ok;
    8169        }
    8270        // -----------------------------------------------------------------
    83         template <class Type>
    8471        bool check_max(void)
    85         {       bool ok    = true;
    86                 CppAD::vector<Type> max(1), eps(1), one(1), three(1), tmp(1), match(1);
    87                 max[0]     = CppAD::numeric_limits<Type>::max();
    88                 eps[0]     = CppAD::numeric_limits<Type>::epsilon();
    89                 one[0]     = 1;
    90                 three[0]   = 3;
    91                 tmp[0]     = max[0] *  ( one[0] / eps[0]);
    92                 match[0]   = tmp[0] * eps[0];
    93                 ok        &= CppAD::abs(match[0] / max[0] - one[0]) > three[0] * eps[0];
    94                 return ok;
    95         }
    96         //
    97         template <class Type>
    98         bool check_max_complex(void)
    99         {       typedef std::complex<Type> Complex;
    100                 bool ok    = true;
    101                 CppAD::vector<Complex> c_max(1), c_eps(1);
    102                 CppAD::vector<Type> max(1), eps(1), one(1), three(1), tmp(1), match(1);
    103                 c_max[0]     = CppAD::numeric_limits<Complex>::max();
    104                 c_eps[0]     = CppAD::numeric_limits<Type>::epsilon();
    105                 ok &= c_eps[0].imag() == Type(0);
    106                 ok &= c_max[0].imag() == Type(0);
    107                 max[0]     = c_max[0].real();
    108                 eps[0]     = c_eps[0].real();
    109                 one[0]     = 1;
    110                 three[0]   = 3;
    111                 tmp[0]     = max[0] *  ( one[0] / eps[0]);
    112                 match[0]   = tmp[0] * eps[0];
    113                 ok        &= CppAD::abs(match[0] / max[0] - one[0]) > three[0] * eps[0];
    114                 return ok;
    115         }
    116         //
    117         template <class Base>
    118         bool check_max_ad_complex()
    119         {       using CppAD::AD;
    120                 bool ok    = true;
    121                 AD<Base> c_max   = CppAD::numeric_limits< AD<Base> >::max();
    122                 ok &= Value(c_max).imag() == Base(0);
    123                 ok &= Value(c_max).real() == CppAD::numeric_limits<Base>::max();
    124 
     72        {       bool ok     = true;
     73                Float max   = CppAD::numeric_limits<Float>::max();
     74                Float eps   = CppAD::numeric_limits<Float>::epsilon();
     75                //
     76                Float match = (max * 100.) / 100.;
     77                ok         &= abs(match / max - 1.0) > 3.0 * eps;
     78                //
     79                match       = (max / 100. ) * (100. * (1.0 - eps));
     80                ok         &= abs(match/max - 1.0) < 3.0 * eps;
    12581                return ok;
    12682        }
     
    12985bool limits(void)
    13086{       bool ok = true;
    131         using CppAD::AD;
    13287
    133         // -------------------------------------------------------------------
    134         // epsilon for Base types defined by CppAD
    135         ok &= check_epsilon<float>();
    136         ok &= check_epsilon<double>();
    137         ok &= check_epsilon< std::complex<float> >();
    138         ok &= check_epsilon< std::complex<double> >();
    139 
    140         // epsilon for some AD types.
    141         ok &= check_epsilon< AD<float> >();
    142         ok &= check_epsilon< AD<double> >();
    143         ok &= check_epsilon<  AD<std::complex<float> > >();
    144         ok &= check_epsilon<  AD<std::complex<double> > >();
    145 
    146         // -------------------------------------------------------------------
    147         // min for Base types defined by CppAD
    148         ok &= check_min<float>();
    149         ok &= check_min<double>();
    150         ok &= check_min< std::complex<float> >();
    151         ok &= check_min< std::complex<double> >();
    152 
    153         // min for some AD types.
    154         ok &= check_min< AD<float> >();
    155         ok &= check_min< AD<double> >();
    156         ok &= check_min<  AD<std::complex<float> > >();
    157         ok &= check_min<  AD<std::complex<double> > >();
    158 
    159         // -------------------------------------------------------------------
    160         // max for Base types defined by CppAD
    161         ok &= check_max<float>();
    162         ok &= check_max<double>();
    163         ok &= check_max_complex<float>();
    164         ok &= check_max_complex<double>();
    165 
    166         // max for some AD types.
    167         ok &= check_max< AD<float> >();
    168         ok &= check_max< AD<double> >();
    169         ok &= check_max_ad_complex< std::complex<float> >();
    170         ok &= check_max_ad_complex< std::complex<double> >();
     88        ok &= check_epsilon();
     89        ok &= check_max();
     90        ok &= check_min();
    17191
    17292        return ok;
  • trunk/omh/whats_new/whats_new_13.omh

    r2720 r2722  
    2929The purpose of this section is to
    3030assist you in learning about changes between various versions of CppAD.
     31
     32$head 01-06$$
     33$list number$$
     34The $cref limits$$ documentation was corrected an improved.
     35$lnext
     36The $cref limits.cpp$$ example was simplified and restricted to just testing
     37for $code AD<double>$$.
     38$lnext
     39Testing for types other than $code AD<double>$$
     40was moved to $code test_more/limits.cpp$$.
     41In addition, $code test_more/limits.cpp$$ was modified to avoid the
     42use of guard digits (and hence test failure) on more machines.
     43$lend
    3144
    3245$head 01-05$$
  • trunk/test_more/CMakeLists.txt

    r2683 r2722  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
     
    100100        div_zero_one.cpp
    101101        erf.cpp
    102         epsilon.cpp
    103102        exp.cpp
    104103        for_hess.cpp
     
    109108        ipopt_solve.cpp
    110109        jacobian.cpp
     110        limits.cpp
    111111        log.cpp
    112112        log10.cpp
  • trunk/test_more/makefile.am

    r2683 r2722  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
     
    113113        div_zero_one.cpp \
    114114        erf.cpp \
    115         epsilon.cpp \
    116115        exp.cpp \
    117116        for_hess.cpp \
     
    121120        fun_check.cpp \
    122121        jacobian.cpp \
     122        limits.cpp \
    123123        log.cpp \
    124124        log10.cpp \
  • trunk/test_more/makefile.in

    r2683 r2722  
    7676        compare_change.cpp cond_exp.cpp cond_exp_ad.cpp copy.cpp \
    7777        cos.cpp cosh.cpp dbl_epsilon.cpp div.cpp div_eq.cpp \
    78         div_zero_one.cpp erf.cpp epsilon.cpp exp.cpp for_hess.cpp \
     78        div_zero_one.cpp erf.cpp exp.cpp for_hess.cpp \
    7979        for_sparse_jac.cpp forward.cpp from_base.cpp fun_check.cpp \
    80         jacobian.cpp log.cpp log10.cpp mul.cpp mul_eq.cpp \
     80        jacobian.cpp limits.cpp log.cpp log10.cpp mul.cpp mul_eq.cpp \
    8181        mul_level.cpp mul_zero_one.cpp ndebug.cpp near_equal_ext.cpp \
    8282        neg.cpp ode_err_control.cpp optimize.cpp parameter.cpp \
     
    101101        cosh.$(OBJEXT) dbl_epsilon.$(OBJEXT) div.$(OBJEXT) \
    102102        div_eq.$(OBJEXT) div_zero_one.$(OBJEXT) erf.$(OBJEXT) \
    103         epsilon.$(OBJEXT) exp.$(OBJEXT) for_hess.$(OBJEXT) \
    104         for_sparse_jac.$(OBJEXT) forward.$(OBJEXT) from_base.$(OBJEXT) \
    105         fun_check.$(OBJEXT) jacobian.$(OBJEXT) log.$(OBJEXT) \
     103        exp.$(OBJEXT) for_hess.$(OBJEXT) for_sparse_jac.$(OBJEXT) \
     104        forward.$(OBJEXT) from_base.$(OBJEXT) fun_check.$(OBJEXT) \
     105        jacobian.$(OBJEXT) limits.$(OBJEXT) log.$(OBJEXT) \
    106106        log10.$(OBJEXT) mul.$(OBJEXT) mul_eq.$(OBJEXT) \
    107107        mul_level.$(OBJEXT) mul_zero_one.$(OBJEXT) ndebug.$(OBJEXT) \
     
    186186# $Id$
    187187# -----------------------------------------------------------------------------
    188 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     188# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    189189#
    190190# CppAD is distributed under multiple licenses. This distribution is under
     
    392392        div_zero_one.cpp \
    393393        erf.cpp \
    394         epsilon.cpp \
    395394        exp.cpp \
    396395        for_hess.cpp \
     
    400399        fun_check.cpp \
    401400        jacobian.cpp \
     401        limits.cpp \
    402402        log.cpp \
    403403        log10.cpp \
     
    523523@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_eq.Po@am__quote@
    524524@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_zero_one.Po@am__quote@
    525 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epsilon.Po@am__quote@
    526525@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erf.Po@am__quote@
    527526@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exp.Po@am__quote@
     
    534533@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jacobian.Po@am__quote@
    535534@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeigen_a-cppad_eigen.Po@am__quote@
     535@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limits.Po@am__quote@
    536536@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
    537537@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log10.Po@am__quote@
  • trunk/test_more/test_more.cpp

    r2683 r2722  
    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
     
    4444extern bool DivZeroOne(void);
    4545extern bool Erf(void);
    46 extern bool epsilon(void);
    4746extern bool Exp(void);
    4847extern bool ForHess(void);
     
    5352extern bool ipopt_solve(void);
    5453extern bool jacobian(void);
     54extern bool limits(void);
    5555extern bool Log(void);
    5656extern bool Log10(void);
     
    151151        ok &= Run( DivZeroOne,      "DivZeroOne"     );
    152152        ok &= Run( Erf,             "Erf"            );
    153         ok &= Run( epsilon,         "epsilon"        );
    154153        ok &= Run( Exp,             "Exp"            );
    155154        ok &= Run( ForHess,         "ForHess"        );
     
    159158        ok &= Run( FunCheck,        "FunCheck"       );
    160159        ok &= Run( jacobian,        "jacobian"       );
     160        ok &= Run( limits,          "limits"         );
    161161        ok &= Run( Log,             "Log"            );
    162162        ok &= Run( Log10,           "Log10"          );
Note: See TracChangeset for help on using the changeset viewer.