Changeset 3871


Ignore:
Timestamp:
Jan 22, 2017 11:31:03 PM (3 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: b103d4dd72a281b542373a3a7e256c8020b7b981
end hash code: 009923c51f128bfb79e69fc4911448c92133b535

commit 009923c51f128bfb79e69fc4911448c92133b535
Author: Brad Bell <bradbell@…>
Date: Sun Jan 22 21:28:33 2017 -0700

Automatic chagnes to auto-tools build files.

commit 53ed3ca52d097a6cd1bcfcdb28be39d2f446a84a
Author: Brad Bell <bradbell@…>
Date: Sun Jan 22 21:26:57 2017 -0700

Convert uses of abs to fabs where makes sense
(next step would be to deprecate abs).

commit 1987621469c32497425bb94b07de1f4050252d7c
Author: Brad Bell <bradbell@…>
Date: Sun Jan 22 18:49:06 2017 -0700

Convert example/*.cpp to test fabs, instead of abs.

commit 5a1d19e113a7205860e2434a6dc1919f4ad3f2d5
Author: Brad Bell <bradbell@…>
Date: Sun Jan 22 16:22:40 2017 -0700

Convert test_more/*.cpp to test fabs, instead of abs.

commit 9ce5faad42ead227abd2b0c23732971b793ca19c
Author: Brad Bell <bradbell@…>
Date: Sun Jan 22 15:00:22 2017 -0700

  1. Change use abs to define fabs in the base type definitions.
  2. Advanced to cppad-201701122.
Location:
trunk
Files:
2 added
2 deleted
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r3870 r3871  
    22             ===========================================
    33
    4 To date, 2017-01-20, Bradley M. Bell is the sole author of CppAD.
     4To date, 2017-01-22, Bradley M. Bell is the sole author of CppAD.
    55While Bradley M. Bell worked for the University of Washington during
    66the development of CppAD, the following are also true:
  • trunk/CMakeLists.txt

    r3870 r3871  
    1717
    1818# cppad_version is used by set_version.sh to get the version number.
    19 SET(cppad_version      "20170120" )
     19SET(cppad_version      "20170122" )
    2020SET(cppad_url          "http://www.coin-or.org/CppAD" )
    2121SET(cppad_description  "Differentiation of C++ Algorithms" )
  • trunk/configure

    r3870 r3871  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.69 for cppad 20170120.
     3# Generated by GNU Autoconf 2.69 for cppad 20170122.
    44#
    55# Report bugs to <cppad@list.coin-or.org>.
     
    581581PACKAGE_NAME='cppad'
    582582PACKAGE_TARNAME='cppad'
    583 PACKAGE_VERSION='20170120'
    584 PACKAGE_STRING='cppad 20170120'
     583PACKAGE_VERSION='20170122'
     584PACKAGE_STRING='cppad 20170122'
    585585PACKAGE_BUGREPORT='cppad@list.coin-or.org'
    586586PACKAGE_URL=''
     
    14101410  # This message is too long to be a string in the A/UX 3.1 sh.
    14111411  cat <<_ACEOF
    1412 \`configure' configures cppad 20170120 to adapt to many kinds of systems.
     1412\`configure' configures cppad 20170122 to adapt to many kinds of systems.
    14131413
    14141414Usage: $0 [OPTION]... [VAR=VALUE]...
     
    14801480if test -n "$ac_init_help"; then
    14811481  case $ac_init_help in
    1482      short | recursive ) echo "Configuration of cppad 20170120:";;
     1482     short | recursive ) echo "Configuration of cppad 20170122:";;
    14831483   esac
    14841484  cat <<\_ACEOF
     
    16141614if $ac_init_version; then
    16151615  cat <<\_ACEOF
    1616 cppad configure 20170120
     1616cppad configure 20170122
    16171617generated by GNU Autoconf 2.69
    16181618
     
    22432243running configure, to aid debugging if configure makes a mistake.
    22442244
    2245 It was created by cppad $as_me 20170120, which was
     2245It was created by cppad $as_me 20170122, which was
    22462246generated by GNU Autoconf 2.69.  Invocation command line was
    22472247
     
    31333133# Define the identity of the package.
    31343134 PACKAGE='cppad'
    3135  VERSION='20170120'
     3135 VERSION='20170122'
    31363136
    31373137
     
    85738573# values after options handling.
    85748574ac_log="
    8575 This file was extended by cppad $as_me 20170120, which was
     8575This file was extended by cppad $as_me 20170122, which was
    85768576generated by GNU Autoconf 2.69.  Invocation command line was
    85778577
     
    86308630ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
    86318631ac_cs_version="\\
    8632 cppad config.status 20170120
     8632cppad config.status 20170122
    86338633configured by $0, generated by GNU Autoconf 2.69,
    86348634  with options \\"\$ac_cs_config\\"
  • trunk/configure.ac

    r3870 r3871  
    1212dnl Process this file with autoconf to produce a configure script.
    1313dnl   package   version              bug-report
    14 AC_INIT([cppad], [20170120], [cppad@list.coin-or.org])
     14AC_INIT([cppad], [20170122], [cppad@list.coin-or.org])
    1515AM_SILENT_RULES([yes])
    1616
  • trunk/cppad/core/abs.hpp

    r3845 r3871  
    1 // $Id$
    21# ifndef CPPAD_CORE_ABS_HPP
    32# define CPPAD_CORE_ABS_HPP
    43
    54/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    76
    87CppAD is distributed under multiple licenses. This distribution is under
     
    6665$head Example$$
    6766$children%
    68         example/abs.cpp
     67        example/fabs.cpp
    6968%$$
    7069The file
    71 $cref abs.cpp$$
     70$cref fabs.cpp$$
    7271contains an example and test of this function.
    7372It returns true if it succeeds and false otherwise.
  • trunk/cppad/core/atan2.hpp

    r3845 r3871  
    1 // $Id$
    21# ifndef CPPAD_CORE_ATAN2_HPP
    32# define CPPAD_CORE_ATAN2_HPP
    43
    54/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    76
    87CppAD is distributed under multiple licenses. This distribution is under
     
    103102        AD<Base> pi(2. * pi2);
    104103
    105         AD<Base> ax = abs(x);
    106         AD<Base> ay = abs(y);
     104        AD<Base> ax = fabs(x);
     105        AD<Base> ay = fabs(y);
    107106
    108107        // if( ax > ay )
  • trunk/cppad/core/base_complex.hpp

    r3845 r3871  
    1 // $Id$
    21# ifndef CPPAD_CORE_BASE_COMPLEX_HPP
    32# define CPPAD_CORE_BASE_COMPLEX_HPP
    43/* --------------------------------------------------------------------------
    5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     4CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    65
    76CppAD is distributed under multiple licenses. This distribution is under
     
    237236namespace CppAD {
    238237        CPPAD_USER_MACRO(abs)
     238        CPPAD_USER_MACRO(fabs)
    239239        CPPAD_USER_MACRO(acos)
    240240        CPPAD_USER_MACRO(asin)
  • trunk/cppad/core/lu_ratio.hpp

    r3845 r3871  
    1 // $Id$
    21# ifndef CPPAD_CORE_LU_RATIO_HPP
    32# define CPPAD_CORE_LU_RATIO_HPP
    43
    54/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    76
    87CppAD is distributed under multiple licenses. This distribution is under
     
    281280                for(i = p; i < n; i++)                                       //
    282281                {       for(j = p; j < n; j++)                               //
    283                         {       etmp  = abs(LU[ ip[i] * n + jp[j] ] / emax); //
     282                        {       etmp  = fabs(LU[ ip[i] * n + jp[j] ] / emax); //
    284283                                ratio =                                      //
    285284                                CondExpGt(etmp, ratio, etmp, ratio);         //
  • trunk/cppad/core/zdouble.hpp

    r3864 r3871  
    230230                os << z1
    231231                Integer(z1)
    232                 abs(z1)
     232                fabs(z1)
    233233                pow(z1, z2)
    234                 abs_geq(z1, z2)
     234                fabs_geq(z1, z2)
    235235                fun(z1)
    236236        \endcode
     
    239239        friend std::ostream& operator << (std::ostream &os, const zdouble& z);
    240240        friend int Integer(const zdouble& z);
    241         friend zdouble abs(const zdouble& x);
    242241        friend zdouble pow(const zdouble& x, const zdouble& y);
    243242        friend bool abs_geq(const zdouble& x, const zdouble& y);
     
    505504/// Base type requirement: abs
    506505inline zdouble abs(const zdouble& x)
    507 {       return std::fabs(x.dbl_); }
     506{       return fabs(x); }
    508507
    509508/// Base type requirement: sign
  • trunk/cppad/example/base_adolc.hpp

    r3804 r3871  
    1 // $Id$
    21# ifndef CPPAD_EXAMPLE_BASE_ADOLC_HPP
    32# define CPPAD_EXAMPLE_BASE_ADOLC_HPP
    43/* --------------------------------------------------------------------------
    5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     4CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    65
    76CppAD is distributed under multiple licenses. This distribution is under
     
    344343                if( value == 0.0 )
    345344                        return code;
    346                 double log_x = std::log( abs( value ) );
     345                double log_x = std::log( fabs( value ) );
    347346                // assume log( std::numeric_limits<double>::max() ) is near 700
    348347                code = static_cast<unsigned short>(
  • trunk/cppad/local/abs_op.hpp

    r3865 r3871  
    1 // $Id$
    21# ifndef CPPAD_LOCAL_ABS_OP_HPP
    32# define CPPAD_LOCAL_ABS_OP_HPP
     
    1817/*!
    1918\file abs_op.hpp
    20 Forward and reverse mode calculations for z = abs(x).
     19Forward and reverse mode calculations for z = fabs(x).
    2120*/
    2221
     
    2625The C++ source code corresponding to this operation is
    2726\verbatim
    28         z = abs(x)
     27        z = fabs(x)
    2928\endverbatim
    3029
     
    5958The C++ source code corresponding to this operation is
    6059\verbatim
    61         z = abs(x)
     60        z = fabs(x)
    6261\endverbatim
    6362
     
    9493The C++ source code corresponding to this operation is
    9594\verbatim
    96         z = abs(x)
     95        z = fabs(x)
    9796\endverbatim
    9897
     
    116115        Base* z = taylor + i_z * cap_order;
    117116
    118         z[0] = abs(x0);
     117        z[0] = fabs(x0);
    119118}
    120119/*!
     
    123122The C++ source code corresponding to this operation is
    124123\verbatim
    125         z = abs(x)
     124        z = fabs(x)
    126125\endverbatim
    127126
  • trunk/cppad/local/op_code.hpp

    r3845 r3871  
    1 // $Id$
    21# ifndef CPPAD_LOCAL_OP_CODE_HPP
    32# define CPPAD_LOCAL_OP_CODE_HPP
    43
    54/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    76
    87CppAD is distributed under multiple licenses. This distribution is under
     
    4847// alphabetical order is checked by bin/check_op_code.sh
    4948enum OpCode {
    50         AbsOp,    // abs(variable)
     49        AbsOp,    // fabs(variable)
    5150        AcosOp,   // acos(variable)
    5251        AcoshOp,  // acosh(variable)
  • trunk/doc.omh

    r3870 r3871  
    9191$comment bin/version assumes that : follows cppad version number here$$
    9292$section
    93 cppad-20170120: A Package for Differentiation of C++ Algorithms
     93cppad-20170122: A Package for Differentiation of C++ Algorithms
    9494$$
    9595$mindex AD algorithmic differentiation automatic C++ algorithm derivative CppAD version cppad.hpp$$
  • trunk/example/CMakeLists.txt

    r3857 r3871  
    1 # $Id$
    21# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43#
    54# CppAD is distributed under multiple licenses. This distribution is under
     
    5554        ${colpack_sources}
    5655        abort_recording.cpp
    57         abs.cpp
     56        fabs.cpp
    5857        acos.cpp
    5958        acosh.cpp
  • trunk/example/ad_in_c.cpp

    r3788 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    179178        {
    180179                case op_abs:
    181                 *result = abs( *operand );
     180                *result = fabs( *operand );
    182181                break;
    183182
  • trunk/example/base_alloc.hpp

    r3864 r3871  
    294294        BASE_ALLOC_STD_MATH(cosh)
    295295        BASE_ALLOC_STD_MATH(exp)
     296        BASE_ALLOC_STD_MATH(fabs)
    296297        BASE_ALLOC_STD_MATH(log)
    297298        BASE_ALLOC_STD_MATH(log10)
     
    303304}
    304305/* %$$
    305 The absolute value function is special because its $code std$$ name is
     306The absolute value function is special because it $code std$$ name is
    306307$code fabs$$
    307308$srccode%cpp% */
    308309namespace CppAD {
    309310        inline base_alloc abs(const base_alloc& x)
    310         {       return std::fabs(*x.ptrdbl_); }
     311        {       return fabs(x); }
    311312}
    312313/* %$$
     
    383384                if( *x.ptrdbl_ == 0.0 )
    384385                        return code;
    385                 double log_x = log( abs( *x.ptrdbl_ ) );
     386                double log_x = log( std::fabs( *x.ptrdbl_ ) );
    386387                // assume log( std::numeric_limits<double>::max() ) is near 700
    387388                code = static_cast<unsigned short>(
  • trunk/example/cond_exp.cpp

    r3853 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5756        using CppAD::NearEqual;
    5857        using CppAD::log;
    59         using CppAD::abs;
    6058        double eps  = 100. * CppAD::numeric_limits<double>::epsilon();
    6159
  • trunk/example/example.cpp

    r3853 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    4443// prototype external compiled tests (this line expected by bin/new_test.sh)
    4544extern bool abort_recording(void);
    46 extern bool abs(void);
     45extern bool fabs(void);
    4746extern bool acosh(void);
    4847extern bool acos(void);
     
    218217        // run external compiled tests (this line expected by bin/new_test.sh)
    219218        ok &= Run( abort_recording,   "abort_recording"  );
    220         ok &= Run( abs,               "abs"              );
     219        ok &= Run( fabs,              "fabs"             );
    221220        ok &= Run( acos,              "acos"             );
    222221        ok &= Run( acosh,             "acosh"            );
  • trunk/example/ipopt_solve/retape.cpp

    r3788 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5150                        // statement that depends on the value of x.
    5251                        double eps = 0.1;
    53                         if( abs(x[0]) <= eps )
     52                        if( fabs(x[0]) <= eps )
    5453                                fg[0] = x[0] * x[0] / (2.0 * eps);
    5554                        else
    56                                 fg[0] = abs(x[0]) - eps / 2.0;
     55                                fg[0] = fabs(x[0]) - eps / 2.0;
    5756
    5857                        return;
  • trunk/example/lu_vec_ad.cpp

    r3757 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    231230
    232231                                // compute absolute value of element
    233                                 etmp = abs(etmp);
     232                                etmp = fabs(etmp);
    234233
    235234                                // update maximum absolute value so far
     
    267266
    268267                // update the log of absolute determinant and its sign
    269                 etmp     = abs(pivot);
     268                etmp     = fabs(pivot);
    270269                logdet   = logdet + log( etmp );
    271270                signdet  = CondExpGe(pivot, Zero, signdet, - signdet);
  • trunk/example/makefile.am

    r3853 r3871  
    1 # $Id$
    21# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43#
    54# CppAD is distributed under multiple licenses. This distribution is under
     
    7978        \
    8079        abort_recording.cpp \
    81         abs.cpp \
     80        fabs.cpp \
    8281        acos.cpp \
    8382        acosh.cpp \
  • trunk/example/makefile.in

    r3854 r3871  
    112112libeigen_a_OBJECTS = $(am_libeigen_a_OBJECTS)
    113113am__example_SOURCES_DIST = mul_level_adolc.cpp mul_level_adolc_ode.cpp \
    114         abort_recording.cpp abs.cpp acos.cpp acosh.cpp ad_assign.cpp \
     114        abort_recording.cpp fabs.cpp acos.cpp acosh.cpp ad_assign.cpp \
    115115        ad_ctor.cpp add.cpp add_eq.cpp ad_fun.cpp ad_in_c.cpp \
    116116        ad_input.cpp ad_output.cpp asin.cpp asinh.cpp atan2.cpp \
     
    151151@CppAD_ADOLC_TRUE@      mul_level_adolc_ode.$(OBJEXT)
    152152am_example_OBJECTS = $(am__objects_1) abort_recording.$(OBJEXT) \
    153         abs.$(OBJEXT) acos.$(OBJEXT) acosh.$(OBJEXT) \
     153        fabs.$(OBJEXT) acos.$(OBJEXT) acosh.$(OBJEXT) \
    154154        ad_assign.$(OBJEXT) ad_ctor.$(OBJEXT) add.$(OBJEXT) \
    155155        add_eq.$(OBJEXT) ad_fun.$(OBJEXT) ad_in_c.$(OBJEXT) \
     
    311311CYGPATH_W = @CYGPATH_W@
    312312
    313 # $Id$
    314313# -----------------------------------------------------------------------------
    315 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     314# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    316315#
    317316# CppAD is distributed under multiple licenses. This distribution is under
     
    513512        \
    514513        abort_recording.cpp \
    515         abs.cpp \
     514        fabs.cpp \
    516515        acos.cpp \
    517516        acosh.cpp \
     
    708707
    709708@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abort_recording.Po@am__quote@
    710 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs.Po@am__quote@
    711709@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Po@am__quote@
    712710@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acosh.Po@am__quote@
     
    751749@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exp.Po@am__quote@
    752750@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expm1.Po@am__quote@
     751@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fabs.Po@am__quote@
    753752@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_one.Po@am__quote@
    754753@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_hes.Po@am__quote@
  • trunk/example/num_limits.cpp

    r3788 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5958                //
    6059                Float match = (min / 100.) * 100.;
    61                 ok         &= abs(match / min - 1.0)  > 3.0 * eps;
     60                ok         &= fabs(match / min - 1.0)  > 3.0 * eps;
    6261                //
    6362                match       = (min * 100.) / 100.;
    64                 ok         &= abs(match / min - 1.0)  < 3.0 * eps;
     63                ok         &= fabs(match / min - 1.0)  < 3.0 * eps;
    6564                return ok;
    6665        }
     
    7271                //
    7372                Float match = (max * 100.) / 100.;
    74                 ok         &= abs(match / max - 1.0) > 3.0 * eps;
     73                ok         &= fabs(match / max - 1.0) > 3.0 * eps;
    7574                //
    7675                match       = (max / 100.) * 100.;
    77                 ok         &= abs(match / max - 1.0) < 3.0 * eps;
     76                ok         &= fabs(match / max - 1.0) < 3.0 * eps;
    7877                return ok;
    7978        }
  • trunk/example/par_var.cpp

    r3788 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5049        y[0] = 2.;
    5150        ok  &= Parameter(y[0]);    // y[0] does not depend on x[0]
    52         y[1] = abs(x[0]);
     51        y[1] = fabs(x[0]);
    5352        ok  &= Variable(y[1]);     // y[1] does depends on x[0]
    5453
  • trunk/example/vec_ad.cpp

    r3856 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5857                // with maximum absolute element in column zero
    5958                AD<double> zero(0), one(1);
    60                 AD<double> rmax = CondExpGt(abs(a[0]), abs(a[2]), zero, one);
     59                AD<double> rmax = CondExpGt(fabs(a[0]), fabs(a[2]), zero, one);
    6160
    6261                // divide row rmax by A(rmax, 0)
  • trunk/makefile.in

    r3864 r3871  
    409409top_srcdir = @top_srcdir@
    410410
    411 # $Id$
    412411# -----------------------------------------------------------------------------
    413 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     412# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    414413#
    415414# CppAD is distributed under multiple licenses. This distribution is under
     
    10811080        || chmod -R a+r "$(distdir)"
    10821081dist-gzip: distdir
    1083         tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
     1082        tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
    10841083        $(am__post_remove_distdir)
    10851084
     
    11071106                       "deprecated." >&2
    11081107        @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
    1109         shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
     1108        shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
    11101109        $(am__post_remove_distdir)
    11111110
     
    11251124        case '$(DIST_ARCHIVES)' in \
    11261125        *.tar.gz*) \
    1127           GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
     1126          eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
    11281127        *.tar.bz2*) \
    11291128          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
     
    11351134          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
    11361135        *.shar.gz*) \
    1137           GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
     1136          eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
    11381137        *.zip*) \
    11391138          unzip $(distdir).zip ;;\
  • trunk/omh/example_list.omh

    r3855 r3871  
    1 $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    8079$rref a11c_pthread.cpp$$
    8180$rref abort_recording.cpp$$
    82 $rref Abs.cpp$$
     81$rref fabs.cpp$$
    8382$rref acos.cpp$$
    8483$rref acosh.cpp$$
  • trunk/omh/install/download.omh

    r3870 r3871  
    9696$rnext
    9797current  $cnext EPL $cnext $href%
    98 http://www.coin-or.org/download/source/CppAD/cppad-20170120.epl.tgz%
    99 cppad-20170120.epl.tgz%$$
     98http://www.coin-or.org/download/source/CppAD/cppad-20170122.epl.tgz%
     99cppad-20170122.epl.tgz%$$
    100100$rnext
    101101current  $cnext GPL $cnext $href%
    102 http://www.coin-or.org/download/source/CppAD/cppad-20170120.gpl.tgz%
    103 cppad-20170120.gpl.tgz%$$
     102http://www.coin-or.org/download/source/CppAD/cppad-20170122.gpl.tgz%
     103cppad-20170122.gpl.tgz%$$
    104104$tend
    105105
  • trunk/test_more/CMakeLists.txt

    r3857 r3871  
    1 # $Id$
    21# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43#
    54# CppAD is distributed under multiple licenses. This distribution is under
     
    4342        old_reciprocal.cpp
    4443        old_mat_mul.cpp
    45         abs.cpp
     44        fabs.cpp
    4645        acos.cpp
    4746        acosh.cpp
  • trunk/test_more/cond_exp.cpp

    r3666 r3871  
    1 /* $Id$ */
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    416415        using CppAD::NearEqual;
    417416        using CppAD::log;
    418         using CppAD::abs;
    419417        double eps = 100. * std::numeric_limits<double>::epsilon();
    420418
     
    459457        CPPAD_TESTVECTOR(double) dw(n);  // derivative of weighted function
    460458
    461         // a case where abs( x[j] ) > 0 for all j
     459        // a case where fabs( x[j] ) > 0 for all j
    462460        double check  = 0.;
    463461        double sign   = 1.;
     
    465463        {       sign *= -1.;
    466464                x[j] = sign * double(j + 1);
    467                 check += log( abs( x[j] ) );
     465                check += log( fabs( x[j] ) );
    468466        }
    469467
     
    477475        for(j = 0; j < n; j++)
    478476        {       if( x[j] > 0. )
    479                         ok &= NearEqual(dw[j], 1./abs( x[j] ), eps, eps);
    480                 else    ok &= NearEqual(dw[j], -1./abs( x[j] ), eps, eps);
     477                        ok &= NearEqual(dw[j], 1./fabs( x[j] ), eps, eps);
     478                else    ok &= NearEqual(dw[j], -1./fabs( x[j] ), eps, eps);
    481479        }
    482480
     
    498496        for(j = 0; j < n; j++)
    499497        {       if( x[j] > 0. )
    500                         ok &= NearEqual(dw[j], 1./abs( x[j] ), eps, eps);
     498                        ok &= NearEqual(dw[j], 1./fabs( x[j] ), eps, eps);
    501499                else if( x[j] < 0. )
    502                         ok &= NearEqual(dw[j], -1./abs( x[j] ), eps, eps);
     500                        ok &= NearEqual(dw[j], -1./fabs( x[j] ), eps, eps);
    503501                else
    504502                        ok &= NearEqual(dw[j], 0.0, eps, eps);
  • trunk/test_more/cond_exp_rev.cpp

    r3666 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    3231
    3332        // AbsOp
    34         ay.push_back( CondExpGt(ax[0], azero, ax[0], abs(ax[1]) ));
     33        ay.push_back( CondExpGt(ax[0], azero, ax[0], fabs(ax[1]) ));
    3534
    3635        // AcosOp
  • trunk/test_more/forward_dir.cpp

    r3683 r3871  
    1 /* $Id$ */
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    101100                size_t m = 1;
    102101                CPPAD_TESTVECTOR(AD<double>) ay(m);
    103                 ay[0] = abs( ax[0] ) + abs( 2.0 * ax[1] );
     102                ay[0] = fabs( ax[0] ) + fabs( 2.0 * ax[1] );
    104103
    105104                // create f: x -> y and stop tape recording
     
    126125                //
    127126                // Y_0  (t)    = F[X_0(t)]
    128                 //             = abs(0.5 + 1t + 2t^2) + abs( 2*(-1.0 + 2t + 3t^2 ) )
     127                //             = fabs(0.5 + 1t + 2t^2) + fabs( 2*(-1.0 + 2t + 3t^2 ) )
    129128                double y_1_0   = -3.0;
    130129                double y_2_0   = -4.0;
    131130                //
    132131                // Y_1  (t)    = F[X_1(t)]
    133                 //             = abs(0.5 + 2t + 3t^2) + abs( 2*(-1.0 + 3t + 4t^2 ) )
     132                //             = fabs(0.5 + 2t + 3t^2) + fabs( 2*(-1.0 + 3t + 4t^2 ) )
    134133                double y_1_1   = -4.0;
    135134                double y_2_1   = -5.0;
     
    10861085                y0  = f.Forward(0, x0);
    10871086                ok &= size_t( y0.size() ) == m;
    1088                 ok &= NearEqual(y0[0], CppAD::abs(x0[0]), eps, eps);
     1087                ok &= NearEqual(y0[0], fabs(x0[0]), eps, eps);
    10891088
    10901089                // first order Taylor coefficients
  • trunk/test_more/forward_order.cpp

    r3779 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5756
    5857        // other functions
    59         Y[i] = abs( X[i] );         i++;   // AbsOp
     58        Y[i] = fabs( X[i] );        i++;   // AbsOp
    6059        Y[i] = X[i-1] + X[i] + 2.0; i++;   // AddvvOp, AddvpOp
    6160        Y[i] = cosh( X[i] );        i++;   // CoshOp
     
    109108        }
    110109
    111         // y_i = abs( x_i )
    112         y[0] = CppAD::abs( x[i] );
     110        // y_i = fabs( x_i )
     111        y[0] = fabs( x[i] );
    113112        y[1] = CppAD::sign( x[i] );
    114113        y[2] = 0.0;
  • trunk/test_more/makefile.am

    r3815 r3871  
    1 # $Id$
    21# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43#
    54# CppAD is distributed under multiple licenses. This distribution is under
     
    8988        $(OPENMP_SRC_FILES) \
    9089        test_more.cpp \
    91         abs.cpp \
     90        fabs.cpp \
    9291        acos.cpp \
    9392        acosh.cpp \
  • trunk/test_more/makefile.in

    r3839 r3871  
    113113libeigen_a_OBJECTS = $(am_libeigen_a_OBJECTS)
    114114am__test_more_SOURCES_DIST = base_adolc.cpp ipopt_solve.cpp \
    115         alloc_openmp.cpp test_more.cpp abs.cpp acos.cpp acosh.cpp \
     115        alloc_openmp.cpp test_more.cpp fabs.cpp acos.cpp acosh.cpp \
    116116        adfun_copy.cpp asin.cpp asinh.cpp assign.cpp add.cpp \
    117117        add_eq.cpp add_zero.cpp atan.cpp atanh.cpp atan2.cpp azmul.cpp \
     
    140140@CppAD_OPENMP_TRUE@am__objects_3 = alloc_openmp.$(OBJEXT)
    141141am_test_more_OBJECTS = $(am__objects_1) $(am__objects_2) \
    142         $(am__objects_3) test_more.$(OBJEXT) abs.$(OBJEXT) \
     142        $(am__objects_3) test_more.$(OBJEXT) fabs.$(OBJEXT) \
    143143        acos.$(OBJEXT) acosh.$(OBJEXT) adfun_copy.$(OBJEXT) \
    144144        asin.$(OBJEXT) asinh.$(OBJEXT) assign.$(OBJEXT) add.$(OBJEXT) \
     
    288288CYGPATH_W = @CYGPATH_W@
    289289
    290 # $Id$
    291290# -----------------------------------------------------------------------------
    292 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     291# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    293292#
    294293# CppAD is distributed under multiple licenses. This distribution is under
     
    501500        $(OPENMP_SRC_FILES) \
    502501        test_more.cpp \
    503         abs.cpp \
     502        fabs.cpp \
    504503        acos.cpp \
    505504        acosh.cpp \
     
    655654        -rm -f *.tab.c
    656655
    657 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs.Po@am__quote@
    658656@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Po@am__quote@
    659657@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acosh.Po@am__quote@
     
    690688@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expm1.Po@am__quote@
    691689@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extern_value.Po@am__quote@
     690@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fabs.Po@am__quote@
    692691@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_hess.Po@am__quote@
    693692@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_hes.Po@am__quote@
  • trunk/test_more/mul_cond_rev.cpp

    r3735 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    5655        a2y[i++]  = CondExpGt(a2x[0], a2zero, a2nan_var, a2zero);
    5756        // abs
    58         a2y[i++]  = CondExpGt(a2x[0], a2zero, abs( a2y[0] ), a2zero);
     57        a2y[i++]  = CondExpGt(a2x[0], a2zero, fabs( a2y[0] ), a2zero);
    5958        // add
    6059        a2y[i++]  = CondExpGt(a2x[0], a2zero, a2nan_var + a2nan_var, a2zero);
     
    124123        a1y[i++]  = CondExpGt(a1x[0], a1zero, a1nan_var, a1zero);
    125124        // abs
    126         a1y[i++]  = CondExpGt(a1x[0], a1zero, abs( a1y[0] ), a1zero);
     125        a1y[i++]  = CondExpGt(a1x[0], a1zero, fabs( a1y[0] ), a1zero);
    127126        // add
    128127        a1y[i++]  = CondExpGt(a1x[0], a1zero, a1nan_var + a1nan_var, a1zero);
  • trunk/test_more/mul_level.cpp

    r3869 r3871  
    266266// supress this test until ../bug/abs.sh is fixed
    267267# ifdef CPPAD_NOT_DEFINED
    268 bool abs(void)
     268bool fabs(void)
    269269{       bool ok = true;
    270270        using CppAD::AD;
     
    283283        CPPAD_TESTVECTOR(ADDdouble)  aax(n), aay(m);
    284284
    285         // create af(x) = abs(x)
     285        // create af(x) = fabs(x)
    286286        aax[0] = 1.;
    287287        Independent( aax );
    288         aay[0] = abs(aax[0]);
     288        aay[0] = fabs(aax[0]);
    289289        ADFun<ADdouble> af(aax, aay);
    290290
     
    327327        ok     &= std_math();
    328328# ifdef CPPAD_NOT_DEFINED
    329         ok     &= abs();
     329        ok     &= fabs();
    330330# endif
    331331
  • trunk/test_more/optimize.cpp

    r3856 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    425424                // unary operator where operand is arg[0]
    426425                // (note that sin corresponds to two tape variables)
    427                 not_used = CppAD::abs(x[0]);
     426                not_used = fabs(x[0]);
    428427                y[0]     = sin(x[0]);
    429428                original += 3;
     
    988987                Y[0] = X[0];
    989988                for(j = 0; j < n_operations; j++)
    990                         Y[0] = abs(Y[0]);
     989                        Y[0] = fabs(Y[0]);
    991990
    992991                // create f: X -> Y and stop tape recording
  • trunk/test_more/test_more.cpp

    r3811 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    1817
    1918// prototype external compiled tests (this line expected by bin/new_test.sh)
    20 extern bool abs(void);
     19extern bool fabs(void);
    2120extern bool acos(void);
    2221extern bool acosh(void);
     
    155154
    156155        // run external compiled tests (this line expected by bin/new_test.sh)
    157         ok &= Run( abs,             "abs"            );
     156        ok &= Run( fabs,            "fabs"           );
    158157        ok &= Run( acos,            "acos"           );
    159158        ok &= Run( acosh,           "acosh"          );
  • trunk/test_more/vec_unary.cpp

    r3856 r3871  
    1 // $Id$
    21/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    43
    54CppAD is distributed under multiple licenses. This distribution is under
     
    2120{
    2221        using namespace CppAD;
    23         using CppAD::abs;
    2422        using CppAD::sin;
    2523        using CppAD::atan;
     
    5654        j    = 2.;
    5755        Y[j] = X[2];
    58         Z[2] = abs( Y[j] );
     56        Z[2] = fabs( Y[j] );
    5957
    6058        j    = 3.;
     
    8583        for(i = 0; i < n; i++)
    8684                x[i] = 2. / double(i + 1);
    87         x[7] = abs( x[7] );
     85        x[7] = fabs( x[7] );
    8886
    8987        z    = f.Forward(0, x);
     
    9189        ok  &= NearEqual(z[0],      - x[0], eps99, eps99);
    9290        ok  &= NearEqual(z[1], sin( x[1] ), eps99, eps99);
    93         ok  &= NearEqual(z[2], abs( x[2] ), eps99, eps99);
     91        ok  &= NearEqual(z[2], fabs( x[2] ), eps99, eps99);
    9492        ok  &= NearEqual(z[3], atan(x[3] ), eps99, eps99);
    9593        ok  &= NearEqual(z[4], cos( x[4] ), eps99, eps99);
Note: See TracChangeset for help on using the changeset viewer.