Changeset 3068


Ignore:
Timestamp:
Dec 31, 2013 8:37:16 AM (6 years ago)
Author:
bradbell
Message:

Change the default for conversion from any type to AD<Base> from explicit
to implicit (same as before 2013-12-27).

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/jenkins.sh

    r3065 r3068  
    123123        $build_type \\
    124124        --disable-silent-rules \\
    125         --with-implicit_ctor \\
     125        --with-explicit_ctor \\
    126126        ADOLC_DIR="$trunk_dir/build/prefix" \\
    127127        SACADO_DIR="$trunk_dir/build/prefix" \\
     
    133133if ! $trunk_dir/configure $build_type \
    134134        --disable-silent-rules \
    135         --with-implicit_ctor \
     135        --with-explicit_ctor \
    136136        ADOLC_DIR="$trunk_dir/build/prefix" \
    137137        SACADO_DIR="$trunk_dir/build/prefix" \
  • trunk/bin/run_cmake.sh

    r3066 r3068  
    104104#
    105105# simple options
    106 cmake_args="$cmake_args -D cppad_implicit_ctor_from_any_type_from_any_type=NO"
     106cmake_args="$cmake_args -D cppad_explicit_ctor_from_any_type_from_any_type=YES"
    107107cmake_args="$cmake_args -D cppad_documentation=YES"
    108108cmake_args="$cmake_args -D cppad_sparse_list=YES"
  • trunk/build.sh

    r3065 r3068  
    228228$special_types OPENMP_FLAGS=-fopenmp \\
    229229--with-sparse_list --with-Documentation \\
    230 --with-implicit_ctor
     230--with-explicit_ctor
    231231EOF
    232232        #
     
    236236                $special_types OPENMP_FLAGS=-fopenmp \
    237237                --with-sparse_list --with-Documentation \
    238                 --with-implicit_ctor
     238                --with-explicit_ctor
    239239        #
    240240        for file in $configure_file_list
  • trunk/configure.ac

    r3065 r3068  
    204204
    205205
    206 dnl Are we including an implicit constructor from any type -----------
    207 AC_MSG_CHECKING([--with-implicit_ctor])
    208 AC_ARG_WITH(implicit_ctor,
     206dnl Are we including an explicit constructor from any type -----------
     207AC_MSG_CHECKING([--with-explicit_ctor])
     208AC_ARG_WITH(explicit_ctor,
    209209        AC_HELP_STRING(
    210                 [--with-implicit_ctor],
    211                 [include an implicit AD<Base> constructor from any type]
     210                [--with-explicit_ctor],
     211                [include an explicit AD<Base> constructor from any type]
    212212        ),
    213         [implicit_ctor="yes"],
    214         [implicit_ctor="no"]
    215 )
    216 AC_MSG_RESULT([$implicit_ctor])
    217 if test "$implicit_ctor" = "yes" ; then
    218         AC_SUBST(cppad_implicit_ctor_from_any_type, "1")
    219 else
    220         AC_SUBST(cppad_implicit_ctor_from_any_type, "0")
     213        [explicit_ctor="yes"],
     214        [explicit_ctor="no"]
     215)
     216AC_MSG_RESULT([$explicit_ctor])
     217if test "$explicit_ctor" = "yes" ; then
     218        AC_SUBST(cppad_explicit_ctor_from_any_type, "1")
     219else
     220        AC_SUBST(cppad_explicit_ctor_from_any_type, "0")
    221221fi
    222222
  • trunk/cppad/CMakeLists.txt

    r3063 r3068  
    4949)
    5050#
    51 # cppad_implicit_ctor_from_any_type_from_any_type
    52 command_line_arg(cppad_implicit_ctor_from_any_type_from_any_type NO BOOL
    53         "implicit (instead of explicit) conversion from any type to AD<Base>"
     51# cppad_explicit_ctor_from_any_type_from_any_type
     52command_line_arg(cppad_explicit_ctor_from_any_type_from_any_type NO BOOL
     53        "explicit (instead of implicit) conversion from any type to AD<Base>"
    5454)
    5555# -----------------------------------------------------------------------------
    5656# cppad_explicit_ctor
    57 IF( cppad_implicit_ctor_from_any_type_from_any_type )
    58         SET(cppad_implicit_ctor_from_any_type 1)
    59 ELSE( cppad_implicit_ctor_from_any_type_from_any_type )
    60         SET(cppad_implicit_ctor_from_any_type 0)
    61 ENDIF( cppad_implicit_ctor_from_any_type_from_any_type )
     57IF( cppad_explicit_ctor_from_any_type_from_any_type )
     58        SET(cppad_explicit_ctor_from_any_type 1)
     59ELSE( cppad_explicit_ctor_from_any_type_from_any_type )
     60        SET(cppad_explicit_ctor_from_any_type 0)
     61ENDIF( cppad_explicit_ctor_from_any_type_from_any_type )
    6262# -----------------------------------------------------------------------------
    6363# cppad_internal_sparse_set
  • trunk/cppad/configure.hpp.in

    r3063 r3068  
    6262
    6363/*!
    64 \def CPPAD_IMPLICIT_CTOR_FROM_ANY_TYPE
    65 If this symbol is one, an implicit constor of AD<Base> is defined
     64\def CPPAD_EXPLICIT_CTOR_FROM_ANY_TYPE
     65If this symbol is one, an explicit constor of AD<Base> is defined
    6666where the argument has any type.
    67 Otherwise this constructor is explicit.
     67Otherwise this constructor is implicit.
    6868*/
    69 # define CPPAD_IMPLICIT_CTOR_FROM_ANY_TYPE @cppad_implicit_ctor_from_any_type@
     69# define CPPAD_EXPLICIT_CTOR_FROM_ANY_TYPE @cppad_explicit_ctor_from_any_type@
    7070
    7171/*!
  • trunk/cppad/local/ad.hpp

    r3063 r3068  
    162162        inline AD& operator=(const VecAD_reference<Base> &x);
    163163
    164 # if CPPAD_IMPLICIT_CTOR_FROM_ANY_TYPE
     164# if CPPAD_EXPLICIT_CTOR_FROM_ANY_TYPE
     165        // explicit construction from some other type (depricated)
     166        template <class T> inline explicit AD(const T &t);
     167# else
    165168        // implicit construction from some other type (depricated)
    166169        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);
    170170# endif
    171171
  • trunk/cppad/local/ad_ctor.hpp

    r3063 r3068  
    4646
    4747$head x$$
    48 
    49 $subhead implicit$$
    5048There is an implicit constructor where $icode x$$ has one of the following
    5149prototypes:
     
    5553%$$
    5654
    57 $subhead explicit$$
    58 There is an explicit constructor where $icode x$$ has prototype
     55$subhead Other Types$$
     56By default, there is an implicit constructor where $icode x$$ has prototype
    5957$codei%
    6058        const %Type%&        %x%
    6159%$$
    62 for any type that has an explicit constructor of the form
     60for any $icode Type$$ that has an explicit constructor of the form
    6361$icode%Base%(%x%)%$$.
    64 
    65 $subhead deprecated$$
    66 $index deprecated, constructor$$
    67 $index constructor, deprecated$$
    6862If you set
    69 $cref/cppad_implicit_ctor_from_any_type
     63$cref/cppad_explicit_ctor_from_any_type
    7064        /cmake
    71         /cppad_implicit_ctor_from_any_type
     65        /cppad_explicit_ctor_from_any_type
    7266/$$
    7367to be $code YES$$ during the install procedure,
    74 you will get an implicit constructor with prototype
    75 $codei%
    76         const %Type%&        %x%
    77 %$$
    78 for any type that has an explicit constructor of the form
    79 $icode%Base%(%x%)%$$.
     68This constructor is explicit.
    8069
    8170$head y$$
  • trunk/cppad/local/undef.hpp

    r3065 r3068  
    5252# undef CppADvector           deprecated version of CPPAD_TEST_VECTOR
    5353
    54 // for conditional testing when implicit conversion is not present
    55 # undef CPPAD_IMPLICIT_CTOR_FROM_ANY_TYPE
     54// for conditional testing when explicit conversion is present
     55# undef CPPAD_EXPLICIT_CTOR_FROM_ANY_TYPE
    5656-----------------------------------------------------------------------------
    5757*/
  • trunk/omh/install/cmake.omh

    r3063 r3068  
    106106        -D cppad_tape_id_type=%cppad_tape_id_type%                               \
    107107        -D cppad_tape_addr_type=%cppad_tape_addr_type%                           \
    108         -D cppad_implicit_ctor_from_any_type=%cppad_implicit_ctor_from_any_type% \
     108        -D cppad_explicit_ctor_from_any_type=%cppad_explicit_ctor_from_any_type% \
    109109        \
    110110        ..
     
    340340$cref/size_par/seq_property/size_VecAD/$$.
    341341
    342 $head cppad_implicit_ctor_from_any_type$$
     342$head cppad_explicit_ctor_from_any_type$$
    343343$index ctor, implicit or explicit$$
    344344$index implicit, ctor$$
    345345$index explicit, ctor$$
    346 The default value for $icode cppad_implicit_ctor_from_any_type$$ is $code NO$$.
    347 If it is $code YES$$, there is a
    348 $cref/deprecated/ad_ctor/x/deprecated/$$
    349 implicit type constructor (type conversion)
    350 from any type to $codei%AD<%Base%>%$$.
    351 Otherwise this constructor is
    352 $cref/explicit/ad_ctor/x/explicit/$$.
     346The default the $cref/constructor/ad_ctor/x/Other Types/$$ (type conversion)
     347from any type to $codei%AD<%Base%>%$$ is implicit.
     348If $icode cppad_explicit_ctor_from_any_type$$ is $code YES$$,
     349this constructor is explicit.
    353350
    354351
  • trunk/omh/install/unix.omh

    r3065 r3068  
    106106        --with-%test%vector                       \ 
    107107        --with-sparse_%option%                    \
    108         --with-implicit_ctor                    \
     108        --with-explicit_ctor                    \
    109109        MAX_NUM_THREADS=%max_num_threads%         \
    110110        CXX_FLAGS=%cxx_flags%                     \
     
    316316$cref/sparse drivers/sparse/$$.
    317317
    318 $head --with-implicit_ctor$$
     318$head --with-explicit_ctor$$
    319319$index ctor, implicit or explicit$$
    320320$index implicit, ctor$$
    321321$index explicit, ctor$$
    322 If this configure argument is present, there is a
    323 $cref/deprecated/ad_ctor/x/deprecated/$$
    324 implicit type constructor (type conversion)
    325 from any type to $codei%AD<%Base%>%$$.
    326 Otherwise this constructor is
    327 $cref/explicit/ad_ctor/x/explicit/$$.
    328 
     322If this configure argument is present, the
     323$cref/constructor/ad_ctor/x/Other Types/$$ (type conversion)
     324from any type to $codei%AD<%Base%>%$$ is explicit.
     325Otherwise this constructor is implicit.
    329326
    330327$head max_num_threads$$
  • trunk/omh/whats_new/whats_new_13.omh

    r3065 r3068  
    1414$dollar @$$
    1515$spell
     16        eval
    1617        ctor
    1718        Num
     
    6364assist you in learning about changes between various versions of CppAD.
    6465
     66$head 12-31$$
     67There is a problem when using
     68$cref/eigen 3.2/eigen_prefix/$$ matrix expressions of the form
     69$code A * B * C$$ with AD scalars.
     70This is expected to be fixed in eigen 3.3.
     71One temporary solution is to change these expressions to
     72$code A * (B * C).eval()$$.
     73Another solution is to use
     74$cref/cppad_explicit_ctor_from_any_type
     75        /cmake
     76        /cppad_explicit_ctor_from_any_type
     77/$$
     78The default (see below) for this option has been changed from
     79explicit to implicit (as it was before 2013-12-27).
     80If you choose to use the explicit constructor,
     81you may get a compiler error on an assignment to an
     82$icode%AD%<%Base%>%$$ variable (that works with the implicit constructor).
     83Try conversion to
     84$icode Base$$ or $codei%AD<%Base%>%$$ before the assignment.
     85
    6586$head 12-29$$
    6687$list number$$
    6788The include file
    6889$cref cppad_eigen.hpp$$ now automatically includes $code cppad.hpp$$.
     90$lnext
    6991There was a problem with this automation
    7092when $code eigen$$ was used for the cppad
     
    7597(created when optional implicit constructor from any type was added).
    7698This has been fixed by adding the
    77 $cref/--with-implicit_ctor/InstallUnix/--with-implicit_ctor/$$ option.
     99$code --with-implicit_ctor$$ option.
    78100$lend
    79101
     
    82104implicit, but there was no specification to this effect.
    83105The caused problems when using CppAD with
    84 $cref/eigen/eigen_prefix/$$.
    85 The default for this constructor has been changed to be
    86 $cref/explicit/ad_ctor/x/explicit/$$.
    87 In addition, other
    88 $cref/implicit/ad_ctor/x/implicit/$$ constructors
     106$cref/eigen 3.2/eigen_prefix/$$.
     107The default for this constructor has been changed to be explicit
     108(changed back to implicit on 12-31).
     109In addition, other implicit
     110$cref/constructors/ad_ctor/x/$$
    89111are now listed in the documentation.
    90 $pre
    91 
    92 $$
    93 If you get a compiler error on an assignment to an
    94 $icode%AD%<%Base%>%$$ variable (that used to work)
    95 try an explicit conversion to
    96 $icode Base$$ or $codei%AD<%Base%>%$$ before the assignment.
    97 A deprecated alternative is to make this constructor implicit using the
    98 $cref/cppad_implicit_ctor_from_any_type
    99         /cmake
    100         /cppad_implicit_ctor_from_any_type
    101 /$$
    102 option during the install procedure.
    103112
    104113$head 12-26$$
  • trunk/test_more/cppad_eigen.cpp

    r3065 r3068  
    5656        ok &= "1" == stream_out.str();
    5757
    58 # if ! CPPAD_IMPLICIT_CTOR_FROM_ANY_TYPE
     58# if CPPAD_EXPLICIT_CTOR_FROM_ANY_TYPE
    5959        // multiplying three matrices together used to cause warning
    6060        // before making ctor from arbitrary type to AD<Base> explicit.
Note: See TracChangeset for help on using the changeset viewer.