Changeset 3062


Ignore:
Timestamp:
Dec 28, 2013 5:40:48 AM (6 years ago)
Author:
bradbell
Message:

merge in whats_new 2013-12-27

Location:
stable/20140000
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • stable/20140000

  • stable/20140000/bin/run_cmake.sh

    r2897 r3062  
    8181#
    8282# simple options
     83cmake_args="$cmake_args -D cppad_implicit_ctor_from_any_type=NO"
    8384cmake_args="$cmake_args -D cppad_documentation=YES"
    8485cmake_args="$cmake_args -D cppad_sparse_list=YES"
  • stable/20140000/bin/svn_merge.sh

    r2991 r3062  
    3333#
    3434# Name of the directory where the changes have been committed
    35 from_branch='branches/opt_cond_exp'
     35from_branch='trunk'
    3636#
    3737# Version of the repository corresponding to from_branch just before changes
    38 Start=2952
     38Start=3059
    3939#
    4040# Version of the repository corresponding to from_branch after the changes
    41 End=2990
     41End=3061
    4242#
    4343# the svn merge command
  • stable/20140000/cppad/CMakeLists.txt

    r2769 r3062  
    2525# command line arguments
    2626#
    27 #
    2827# cppad_testvector
    2928command_line_arg(cppad_testvector cppad STRING
     
    4948"type used to identify variables on one tape, size must be <= sizeof(size_t)"
    5049)
     50#
     51# cppad_implicit_ctor_from_any_type
     52command_line_arg(cppad_implicit_ctor_from_any_type NO BOOL
     53        "implicit (instead of explicit) conversion from any type to AD<Base>"
     54)
     55# -----------------------------------------------------------------------------
     56# cppad_explicit_ctor
     57IF( cppad_implicit_ctor_from_any_type )
     58        SET(cppad_implicit_ctor 1)
     59ELSE( cppad_implicit_ctor_from_any_type )
     60        SET(cppad_implicit_ctor 0)
     61ENDIF( cppad_implicit_ctor_from_any_type )
    5162# -----------------------------------------------------------------------------
    5263# cppad_internal_sparse_set
  • stable/20140000/cppad/base_require.hpp

    r2506 r3062  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    7979$head Include Order$$
    8080If you are linking a non-standard base type to CppAD,
    81 you must first include the file $code cppad/base_require.hpp/$$,
     81you must first include the file $code cppad/base_require.hpp$$,
    8282then provide the specifications below,
    8383and then include the file $code cppad/cppad.hpp$$.
  • stable/20140000/cppad/configure.hpp.in

    r2939 r3062  
    6060*/
    6161# define CPPAD_INTERNAL_SPARSE_SET @cppad_internal_sparse_set@
     62
     63/*!
     64\def CPPAD_IMPLICIT_CTOR
     65If this symbol is one, an implicit constor of AD<Base> is defined
     66where the argument has any type.
     67Otherwise this constructor is explicit.
     68*/
     69# define CPPAD_IMPLICIT_CTOR @cppad_implicit_ctor@
    6270
    6371/*!
  • stable/20140000/cppad/local/ad.hpp

    r2910 r3062  
    147147        typedef Base value_type;
    148148
    149         // default constructor
     149        // implicit default constructor
    150150        inline AD(void);
    151151
    152         // use default copy constructor and assignment operator
     152        // use default implicit copy constructor and assignment operator
    153153        // inline AD(const AD &x);
    154154        // inline AD& operator=(const AD &x);
    155155
    156         // construction and assingment from base type
     156        // implicit construction and assingment from base type
    157157        inline AD(const Base &b);
    158158        inline AD& operator=(const Base &b);
    159159
    160         // contructor and assignment from VecAD<Base>::reference
     160        // implicit contructor and assignment from VecAD<Base>::reference
    161161        inline AD(const VecAD_reference<Base> &x);
    162162        inline AD& operator=(const VecAD_reference<Base> &x);
    163163
    164         // construction and assignment from some other type
     164# if CPPAD_IMPLICIT_CTOR
     165        // implicit construction from some other type (depricated)
    165166        template <class T> inline AD(const T &t);
     167# else
     168        // explicit construction from some other type (depricated)
     169        template <class T> inline explicit AD(const T &t);
     170# endif
     171
     172        // assignment from some other type
    166173        template <class T> inline AD& operator=(const T &right);
    167174
  • stable/20140000/cppad/local/ad_ctor.hpp

    r2910 r3062  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    1919$begin ad_ctor$$
    2020$spell
     21        cppad
     22        ctor
    2123        initializes
    2224        Vec
     
    4446
    4547$head x$$
    46 The argument $icode x$$ has prototype
     48
     49$subhead implicit$$
     50There is an implicit constructor where $icode x$$ has one of the following
     51prototypes:
    4752$codei%
    48         const %Type% &%x%
     53        const %Base%&        %x%
     54        const VecAD<%Base%>& %x%
    4955%$$
    50 where $icode Type$$ is
    51 $codei%VecAD<%Base%>::reference%$$,
    52 $codei%AD<%Base%>%$$,
    53 $icode Base$$,
    54 or any type that has a constructor of the form
     56
     57$subhead explicit$$
     58There is an explicit constructor where $icode x$$ has prototype
     59$codei%
     60        const %Type%&        %x%
     61%$$
     62for any type that has an explicit constructor of the form
     63$icode%Base%(%x%)%$$.
     64
     65$subhead deprecated$$
     66$index deprecated, constructor$$
     67$index constructor, deprecated$$
     68If you set $cref/cppad_implicit_ctor/cmake/cppad_implicit_ctor/$$
     69to be $code YES$$ during the install procedure,
     70you will get an implicit constructor with prototype
     71$codei%
     72        const %Type%&        %x%
     73%$$
     74for any type that has an explicit constructor of the form
    5575$icode%Base%(%x%)%$$.
    5676
  • stable/20140000/cppad/local/undef.hpp

    r2939 r3062  
    6767# undef CPPAD_HAS_GETTIMEOFDAY
    6868# undef CPPAD_HAS_NULLPTR
     69# undef CPPAD_IMPLICIT_CTOR
    6970# undef CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
    7071# undef CPPAD_MAX_NUM_CAPACITY
  • stable/20140000/cppad/speed/det_of_minor.hpp

    r2506 r3062  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    236236
    237237        // initialize determinant of the minor M
    238         Scalar detM = 0;
     238        Scalar detM = Scalar(0);
    239239
    240240        // initialize sign of factor for next sub-minor
  • stable/20140000/omh/install/cmake.omh

    r2762 r3062  
    1414$escape $$
    1515$spell
     16        ctor
    1617        op
    1718        arg
     
    105106        -D cppad_tape_id_type=%cppad_tape_id_type%                   \
    106107        -D cppad_tape_addr_type=%cppad_tape_addr_type%               \
     108        -D cppad_implicit_ctor_from_any_type=%cppad_implicit_ctor%   \
    107109        \
    108110        ..
     
    338340$cref/size_par/seq_property/size_VecAD/$$.
    339341
     342$head cppad_implicit_ctor$$
     343$index ctor, implicit or explicit$$
     344$index implicit, ctor$$
     345$index explicit, ctor$$
     346The default value for $icode cppad_implicit_ctor$$ is $code NO$$.
     347If it is $code YES$$,
     348there is an implicit type constructor (type conversion)
     349from any type to $codei%AD<%Base%>%$$.
     350Otherwise this constructor is explicit.
     351
    340352
    341353$children%
  • stable/20140000/omh/install/download.omh

    r3037 r3062  
    6262The download files below are for the current version of CppAD.
    6363$table
    64 EPL License $pre  $$ $cnext $href%cppad-20130918.epl.tgz%$$
     64EPL License $pre  $$ $cnext $href%cppad-20140000.0.epl.tgz%$$
    6565$rnext
    66 GPL License $pre  $$ $cnext $href%cppad-20130918.gpl.tgz%$$
     66GPL License $pre  $$ $cnext $href%cppad-20140000.0.gpl.tgz%$$
    6767$tend
    6868These tarballs only last for a few days.
  • stable/20140000/omh/whats_new/whats_new_13.omh

    r3037 r3062  
    1414$dollar @$$
    1515$spell
     16        ctor
    1617        Num
    1718        autotools
     
    6263assist you in learning about changes between various versions of CppAD.
    6364
     65$head 12-27$$
     66The constructor from an arbitrary type to $codei%AD<%Base%>%$$ was
     67implicit, but there was no specification to this effect.
     68The caused problems when using CppAD with
     69$cref/eigen/eigen_prefix/$$.
     70The default for this constructor has been changed to be
     71$cref/explicit/ad_ctor/x/explicit/$$.
     72In addition, other
     73$cref/implicit/ad_ctor/x/implicit/$$ constructors
     74are now listed in the documentation.
     75$pre
     76
     77$$
     78If you get a compiler error on an assignment to an
     79$icode%AD%<%Base%>%$$ variable (that used to work)
     80try an explicit conversion to
     81$icode Base$$ or $codei%AD<%Base%>%$$ before the assignment.
     82A deprecated alternative is to make this constructor implicit using the
     83$cref/cppad_implicit_ctor/cmake/cppad_implicit_ctor/$$ option
     84during the install procedure.
     85
    6486$head 12-26$$
    6587Document fact that
  • stable/20140000/test_more/cppad_eigen.cpp

    r3022 r3062  
    2222        using CppAD::AD;
    2323        using Eigen::Dynamic;
     24        using Eigen::Matrix;
    2425
    2526        typedef Eigen::NumTraits<AD<double> >         traits;
     
    4849        ok  &= abs2(x)  == 4.0;
    4950
    50         // Outputing a matrix used to fail before paritali specialization of
     51        // Outputing a matrix used to fail before partial specialization of
    5152        // struct significant_decimals_default_impl in cppad_eigen.hpp.
    52         Eigen::Matrix< AD<double>, 1, 1> X;
     53        Matrix< AD<double>, 1, 1> X;
    5354        X(0, 0) = AD<double>(1);
    5455        std::stringstream stream_out;
    5556        stream_out << X;
    5657        ok &= "1" == stream_out.str();
     58
     59        // multiplying three matrices together used to cause warning
     60        // before making ctor from arbitrary type to AD<Base> explicit.
     61        typedef CppAD::AD<double> AScalar;
     62        Matrix<AScalar, Dynamic, Dynamic> A(1,1), B(1,1), C(1,1), D(1,1);
     63        A(0,0) = 1.0;
     64        B(0,0) = 2.0;
     65        C(0,0) = 3.0;
     66        D      = A * B * C;
     67        ok    &= D(0,0) == 6.0 ;
    5768       
    5869        return ok;
  • stable/20140000/test_more/erf.cpp

    r2506 r3062  
    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
     
    5858
    5959                // test using erf with AD< AD<double> >
    60                 AD< AD<double> > X0 = x[0];
     60                AD< AD<double> > X0 = AD<double>( x[0] );
    6161                AD< AD<double> > Y0 = erf(X0);
    6262
  • stable/20140000/test_more/romberg_one.cpp

    r2506 r3062  
    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
     
    4646                Float operator () (const Float &x)
    4747                {       size_t i;
    48                         Float   f = 1;
     48                        Float   f(1);
    4949                        for(i = 0; i < degree; i++)
    5050                                f *= x;
     
    6262
    6363                // arguments to RombergOne
    64                 Float a = 0.;
    65                 Float b = 1.;
     64                Float a(0);
     65                Float b(1);
    6666                Float r;
    6767                size_t n = 4;
     
    7171                // int_a^b F(x) dx =
    7272                //      [ b^(degree+1) - a^(degree+1) ] / (degree+1)
    73                 Float bpow = 1.;
    74                 Float apow = 1.;
     73                Float bpow(1);
     74                Float apow(1);
    7575                for(i = 0; i <= degree; i++)
    7676                {       bpow *= b;
     
    8484                step *= Float(2.);
    8585                // step size raised to a power
    86                 Float spow = Float(1.);
     86                Float spow = Float(1);
    8787
    8888                for(p = 0; p < n; p++)
  • stable/20140000/test_more/std_math.cpp

    r2506 r3062  
    11/* $Id$ */
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 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
     
    2323{       using CppAD::NearEqual;
    2424        bool ok = true;
    25         ADDdouble half   = .5;
    26         ADDdouble one    = 1.;
    27         ADDdouble two    = 2.;
    28         ADDdouble ten    = 10.;
    29         ADDdouble small  = 1e-6;
    30         ADDdouble pi_4   = 3.141592653 / 4.;
    31         ADDdouble root_2 =  sqrt(two);
     25        ADDdouble half(.5);
     26        ADDdouble one(1.);
     27        ADDdouble two(2.);
     28        ADDdouble ten(10.);
     29        ADDdouble small(1e-6);
     30        ADDdouble pi_4(3.141592653 / 4.);
     31        ADDdouble root_2( sqrt(two) );
    3232
    33         ADDdouble y = acos(one / root_2);
     33        ADDdouble y( acos(one / root_2) );
    3434        ok &= NearEqual( pi_4, y, small, small );
    3535
Note: See TracChangeset for help on using the changeset viewer.