Changeset 3941


Ignore:
Timestamp:
Jun 2, 2017 1:36:10 AM (2 years ago)
Author:
bradbell
Message:

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

commit c8c4cc081accff3628e7e66370ec01e4c99afe8d
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 23:16:39 2017 -0600

Changes automatically generated by the autotools.

commit f4392bc3eee8f6d0ccd45a0bb3be51181e211680
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 23:11:56 2017 -0600

  1. Add colpack_jac.cpp example (rename colpack_jac.cpp->colpack_jacobian.cpp).
  2. Add colpack_hescpp example (rename colpack_hes.cpp->colpack_hessian.cpp).


test_one.sh.in: adapt to using test_boolofvoid for testing.
sparse_hes.hpp: fix bug in cppad.symmetric case.

commit 086b8a8709b0c9cb01ce2cf8bc7910e903105ff7
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 08:54:59 2017 -0600

  1. Fix bug in use of colpack (see kludge in comments).
  2. Fix colpack.symmetric (not general) and add colpack.general.
  3. Deprecate colpack.star.
  4. More autotools from install to deprecated.
  5. Advance to cppad-20170601.

commit 23f26c060648f5c6fc62a1598c659aeccc5ca46f
Author: Brad Bell <bradbell@…>
Date: Tue May 30 08:14:04 2017 -0700

Advance to cppad-20170530.

commit 97f8c08509865d1bfb7ec2e5cd557ddc979f8412
Author: Brad Bell <bradbell@…>
Date: Tue May 30 07:38:47 2017 -0700

debug_rel branch:
There is a problem with speed sparse_hessian debug that goes back to master.
Supresss debug in cppad speed tests until it is fixed.

commit 39ea0d7d9c041784ccd26ce80d19a7ab02752818
Author: Brad Bell <bradbell@…>
Date: Mon May 29 22:34:22 2017 -0700

debug_rel branch:
run_cmake.sh: fix debug_none case.
CMakeLists.txt: use cppad_debug_which to determine debug or release.
CMakeLists.txt: let set_compile_flags determkine build type.

commit 191553e54dca407207789cf0d7c6c27fe6188775
Author: Brad Bell <bradbell@…>
Date: Mon May 29 19:53:08 2017 -0700

debug_rel branch:
Use set_compile_flags in introduction.

commit fba276a84e58d9a0d0944168d5706b7446beb32c
Author: Brad Bell <bradbell@…>
Date: Mon May 29 19:46:30 2017 -0700

debug_rel branch:
Use set_compile_flags in eample/multi_thread subdirectories.

commit 66c8cdb266fa3af29b211b8c870a3aed7a13b021
Author: Brad Bell <bradbell@…>
Date: Mon May 29 18:56:48 2017 -0700

debug_rel branch:
Use set_compile_flags in speed directory.

commit c431b15ee7714d3106234bc527ba2f9a836750e1
Author: Brad Bell <bradbell@…>
Date: Mon May 29 18:36:51 2017 -0700

debug_rel branch:
Convert cppad_ipopt to use set_compile_flags and cppad_debug_which.


CMakeLists.txt: alwasy compile for release to reduce testing time.

commit 2c95b0019f1b665fb14b9f00b049e8b5fb11f89d
Author: Brad Bell <bradbell@…>
Date: Mon May 29 16:55:07 2017 -0700

debug_rel branch:
Add cppad_debug_which to the cmake command line.

commit fd8d1498cf6dc092deca41f764cbb2a001a4cc88
Author: Brad Bell <bradbell@…>
Date: Mon May 29 08:14:23 2017 -0700

debug_rel branch:
Change random_debug_release -> set_compile_flags.

commit 159f5a5aa09012213a52f4ed1c9f0607129a5fe7
Author: Brad Bell <bradbell@…>
Date: Mon May 29 06:50:43 2017 -0700

debug_rel branch:
Update the autotools automatically generated build files.


batch_edit.sh: Start comments about a plan for editing all the source files.
get_sacado.sh: advance to trilions-12.10.11.
makefile.am: advance to trilinos-12.10.1

commit 302153317cd296ec6f927c3202cf96bf38594bbb
Author: Brad Bell <bradbell@…>
Date: Mon May 29 05:20:00 2017 -0700

debug_rel branch:
Add error message if sacado configuration file does not exist.

commit 3f01a631ae808c3a1359e53e1cd55e9a0ea88711
Author: Brad Bell <bradbell@…>
Date: Mon May 29 04:24:00 2017 -0700

debug_rel branch:
CMakeLists.txt: automate naming of libraries Sacado needs.
checkpoint.cpp: fix warnings.

commit dd240928c0c8b6972a8197c985ccc01f08b8886b
Author: Brad Bell <bradbell@…>
Date: Sun May 28 08:25:20 2017 -0700

debug_rel branch:
sparse_sub_hes.cpp: add missing cases found by clang compiler.

commit 30a0c35f1ac50ec425be9a2b7b026284026eccd7
Author: Brad Bell <bradbell@…>
Date: Sun May 28 07:57:36 2017 -0700

debug_rel branch:
eigen_cholesky.hpp: fix compiler warning.
harmonic_time.cpp: remove include that is not used.
forward_active.cpp: fix compiler warning.

commit 4876d14e49dc235865b1574fb38a55cf5ea7a422
Author: Brad Bell <bradbell@…>
Date: Sun May 28 06:19:48 2017 -0700

debug_rel branch:
random_debug_release.cmake: fix comment, remove message replaced by random_choice_0123 in output.
multiple_solution.cpp: fix warnings with clang compiler.
eigen_cholesky.hpp: fix warnings with clang compiler.
compare_change.cpp: fix CPPAD_DEBUG_AND_RELEASE case.

commit 2c51a18f35188d04d2f94069382439580e23f4ac
Author: Brad Bell <bradbell@…>
Date: Sat May 27 21:04:37 2017 -0700

debug_rel branch:
Advance version to cppad-20170527.

commit 4500887b362537774b05e954ad2a95b65a7b8ba0
Author: Brad Bell <bradbell@…>
Date: Sat May 27 09:04:56 2017 -0700

debug_rel branch:
Ramdomly select debug or release flags in example directory.


CMakeLists.txt: always debug for multi_threed examples.

commit 140b5269a0b1a30643894e5a7a8c9a5eb1310301
Author: Brad Bell <bradbell@…>
Date: Sat May 27 08:10:51 2017 -0700

debug_rel branch:
Changing how we set all debug and release flags.

commit e6fb2639db1288fb75de4030b5906df1e41756f9
Author: Brad Bell <bradbell@…>
Date: Sat May 27 07:30:24 2017 -0700

debug_rel branch:
Replace use of cppad_extra_debug by CPPAD_DEBUG_AND_RELEASE.

commit fbbfd0f6e94862174a8a7a17308489ffddb28084
Author: Brad Bell <bradbell@…>
Date: Sat May 27 05:55:58 2017 -0700

debug_rel branch:
Improve random selection of which files are build for release or debug.


forward.cpp: use new -DCPPAD_DEBUG_AND_RELEASE flag.

commit 284be366fb5e2f685a0c71ea6a0e3f74584bf187
Author: Brad Bell <bradbell@…>
Date: Thu May 25 07:39:32 2017 -0700

debug_rel branch:
Add test that failed before change to player.


player.hpp: Fix so it has the same size in debug and release more.
checkpoint.cpp: fix warning when compiling for release.
run_cmake.sh: prepare to use random number to switch debug and release set.
CMakeLists.txt: switch to only test debug (for now).

commit f32375b77e3825628fee6cb160f691a32c48b796
Author: Brad Bell <bradbell@…>
Date: Wed May 24 12:04:27 2017 -0700

debug_rel branch:
forward.cpp: fix a warning during release build.

commit 5fcc7eb78ae8de9f1dbc6c4f0c76fe38e8aeba95
Author: Brad Bell <bradbell@…>
Date: Wed May 24 10:11:12 2017 -0700

debug_rel branch:
CMakeLists.txt: make easy to mix debug and release builds.
eigen_mat_inv.hpp: fix release version warning.

commit 696266f3d62079f5e3bfb1a0f60a7e4f8134e068
Author: Brad Bell <bradbell@…>
Date: Wed May 24 05:43:29 2017 -0700

push_git2svn.py: user ./build in place of ./build/work.
testvector.hpp: improve comments about replacing CPPAD_TESTVECTOR.

Location:
trunk
Files:
3 added
1 deleted
109 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r3938 r3941  
    2020#
    2121# cppad_version is used by set_version.sh to get the version number.
    22 SET(cppad_version      "20170522" )
     22SET(cppad_version      "20170601" )
    2323SET(cppad_url          "http://www.coin-or.org/CppAD" )
    2424SET(cppad_description  "Differentiation of C++ Algorithms" )
     
    7070# print_variable(variable)
    7171INCLUDE(cmake/print_variable.cmake)
     72#
     73# set_compile_flags( program_name debug_which source_list)
     74INCLUDE(cmake/set_compile_flags.cmake)
    7275# =============================================================================
    7376# command line arguments
     
    177180)
    178181#
     182# cppad_debug_which
     183command_line_arg(cppad_debug_which "debug_all" STRING
     184        "debug_even, debug_odd, debug_all, or debug_none"
     185)
    179186# cppad_deprecated
    180187command_line_arg(cppad_deprecated NO BOOL
     
    184191        MESSAGE(FATAL_ERROR "cppad_deprecated must be NO" )
    185192ENDIF( cppad_deprecated )
    186 #
    187 # cppad_extra_debug
    188 command_line_arg(cppad_extra_debug NO BOOL
    189         "if this is true, and NDEBUG is not defined, do extra cppad debugging"
    190 )
    191193# =============================================================================
    192194# cppad_has_colpack, colpack_libs, cppad_lib
  • trunk/authors

    r3938 r3941  
    22             ===========================================
    33
    4 To date, 2017-05-22, Bradley M. Bell is the sole author of CppAD.
     4To date, 2017-06-01, 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/bin/batch_edit.sh

    r3931 r3941  
    99# A copy of this license is included in the COPYING file of this distribution.
    1010# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
     11# -----------------------------------------------------------------------------
     12# Plan for batch edit of all files:
     13# 1. Remove an svn Id commands.
     14# 2. "included in the COPYING file" -> "included in the epl-v10.txt file"
     15# 3. Remove all omhelp index commands.
     16# 4. Do not update copyright date when do this edit
    1117# -----------------------------------------------------------------------------
    1218spell_list='
  • trunk/bin/check_all.sh

    r3931 r3941  
    9090if [ "$random_zero_one" == '0' ]
    9191then
    92         echo_log_eval bin/run_cmake.sh --boost_vector
     92        echo_log_eval bin/run_cmake.sh --boost_vector --debug_odd
    9393else
    94         echo_log_eval bin/run_cmake.sh --eigen_vector
     94        echo_log_eval bin/run_cmake.sh --eigen_vector --debug_even
    9595fi
    9696echo_log_eval cd build
  • trunk/bin/get_sacado.sh

    r3730 r3941  
    22# $Id$
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    2020#
    2121# $section Download and Install Sacado in Build Directory$$
    22 # $index sacado, download and install$$
    23 # $index download, install sacado$$
    24 # $index install, sacado$$
    2522#
    2623# $head Syntax$$
     
    6562# -----------------------------------------------------------------------------
    6663echo 'Download sacado to build/external and install it to build/prefix'
    67 version="11.12.1"
     64version="12.10.1"
    6865trilinos_dir="trilinos-$version-Source"
    6966web_page="http://trilinos.org/oldsite/download/files"
     
    137134        echo_eval wget --no-check-certificate $web_page/$trilinos_dir.tar.gz
    138135fi
    139 for package in Sacado Teuchos Trilinois
    140 do
    141         echo_eval rm -rf $prefix/include/$package*
    142 done
    143136if [ ! -e "$trilinos_dir" ]
    144137then
    145138        echo_eval tar -xzf $trilinos_dir.tar.gz
    146         # ------------------------------------------------------------------------
    147         # patch the cmake/tribits/modules/FindPythonInterp.cmake file
    148         file="$trilinos_dir/cmake/tribits/modules/FindPythonInterp.cmake"
    149         line='[HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\2.8\\\\'
    150         line="${line}InstallPath]"
    151         if [ -e "$file" ]
    152         then
    153                 echo "patch $file"
    154                 sed \
    155                         -e 's|NAMES \(python2.7 python2.6\)|NAMES python2.8 \1|' \
    156                         -e "s|^\( *\)\[HKEY_LOCAL_MACHINE.*2\.7.*|\1$line\n&|" \
    157                         -i $file
    158         fi
    159         # ------------------------------------------------------------------------
    160139fi
    161140echo_eval cd $trilinos_dir
  • trunk/bin/push_git2svn.py

    r3937 r3941  
    3737svn_repository = 'https://projects.coin-or.org/svn/CppAD'
    3838git_repository = 'https://github.com/coin-or/CppAD'
    39 work_directory = 'build/work'
     39work_directory = 'build'
    4040# -----------------------------------------------------------------------------
    4141# some simple functions
  • trunk/bin/run_cmake.sh

    r3938 r3941  
    1515        exit 1
    1616fi
    17 # -----------------------------------------------
     17# -----------------------------------------------------------------------------
    1818# bash function that echos and executes a command
    1919echo_eval() {
     
    2121        eval $*
    2222}
    23 # -----------------------------------------------
     23# -----------------------------------------------------------------------------
    2424verbose='no'
    2525standard='c++11'
    2626debug_speed='no'
    27 debug_cppad_ipopt='no'
    28 release_example='no'
    2927profile_speed='no'
    3028clang='no'
    31 extra_debug='no'
    3229no_colpack='no'
    3330no_eigen='no'
     
    3532no_documentation='no'
    3633testvector='boost'
     34debug_which='debug_all'
    3735while [ "$1" != "" ]
    3836do
     
    4543        [--c++98] \\
    4644        [--debug_speed] \\
    47         [--debug_cppad_ipopt] \\
    48         [--release_example] \\
    4945        [--profile_speed] \\
    5046        [--clang ] \\
    51         [--extra_debug] \\
    5247        [--no_colpack] \\
    5348        [--no_eigen] \\
    5449        [--no_ipopt] \\
    5550        [--no_documentation] \\
    56         [--<package>_vector]
     51        [--<package>_vector] \\
     52        [--debug_<which>]
    5753The --help option just prints this message and exits.
    5854The value <package> above must be one of: cppad, boost, or eigen.
     55The value <which> must be one of: odd, even, all, none.
    5956
    6057EOF
    6158                exit 0
    62         elif [ "$1" == '--verbose' ]
    63         then
     59        fi
     60        case "$1" in
     61
     62                --verbose)
    6463                verbose='yes'
    65         elif [ "$1" == '--c++98' ]
    66         then
     64                ;;
     65
     66                --c++98)
    6767                standard='c++98'
    68         elif [ "$1" == '--debug_speed' ]
    69         then
     68                ;;
     69
     70                --debug_speed)
    7071                debug_speed='yes'
    7172                profile_speed='no'
    72         elif [ "$1" == '--debug_cppad_ipopt' ]
    73         then
    74                 debug_cppad_ipopt='yes'
    75         elif [ "$1" == '--release_example' ]
    76         then
    77                 release_example='yes'
    78         elif [ "$1" == '--profile_speed' ]
    79         then
     73                ;;
     74
     75                --profile_speed)
    8076                profile_speed='yes'
    8177                debug_speed='no'
    82         elif [ "$1" == '--clang' ]
    83         then
     78                ;;
     79
     80                --clang)
    8481                clang='yes'
    85         elif [ "$1" == '--extra_debug' ]
    86         then
    87                 extra_debug='yes'
    88         elif [ "$1" == '--no_colpack' ]
    89         then
     82                ;;
     83
     84                --no_colpack)
    9085                no_colpack='yes'
    91         elif [ "$1" == '--no_eigen' ]
    92         then
     86                ;;
     87
     88                --no_eigen)
    9389                no_eigen='yes'
    94         elif [ "$1" == '--no_ipopt' ]
    95         then
     90                ;;
     91
     92                --no_ipopt)
    9693                no_ipopt='yes'
    97         elif [ "$1" == '--no_documentation' ]
    98         then
     94                ;;
     95
     96                --no_documentation)
    9997                no_documentation='yes'
    100         elif [ "$1" == '--cppad_vector' ]
    101         then
     98                ;;
     99
     100                --cppad_vector)
    102101                testvector='cppad'
    103         elif [ "$1" == '--boost_vector' ]
    104         then
     102                ;;
     103
     104                --boost_vector)
    105105                testvector='boost'
    106         elif [ "$1" == '--eigen_vector' ]
    107         then
     106                ;;
     107
     108                --eigen_vector)
    108109                testvector='eigen'
    109         else
     110                ;;
     111
     112                --debug_odd)
     113                debug_which='debug_odd'
     114                ;;
     115
     116                --debug_even)
     117                debug_which='debug_even'
     118                ;;
     119
     120                --debug_all)
     121                debug_which='debug_all'
     122                ;;
     123
     124                --debug_none)
     125                debug_which='debug_none'
     126                ;;
     127
     128                *)
    110129                echo "$1 is an invalid option, try bin/run_cmake.sh --help"
    111130                exit 1
    112         fi
     131        esac
    113132        shift
    114133done
     
    121140        sed -e 's|^SET(CMAKE_BUILD_TYPE .*|SET(CMAKE_BUILD_TYPE RELEASE)|' \
    122141                -i speed/CMakeLists.txt
    123 fi
    124 # ---------------------------------------------------------------------------
    125 if [ "$debug_cppad_ipopt" == 'yes' ]
    126 then
    127         sed -e 's|^SET(CMAKE_BUILD_TYPE .*|SET(CMAKE_BUILD_TYPE DEBUG)|' \
    128                 -i  cppad_ipopt/CMakeLists.txt
    129 else
    130         sed -e 's|^SET(CMAKE_BUILD_TYPE .*|SET(CMAKE_BUILD_TYPE RELEASE)|' \
    131                 -i  cppad_ipopt/CMakeLists.txt
    132 fi
    133 # ---------------------------------------------------------------------------
    134 if [ "$release_example" == 'yes' ]
    135 then
    136         sed -e 's|^SET(CMAKE_BUILD_TYPE .*|SET(CMAKE_BUILD_TYPE RELEASE)|' \
    137                 -i  example/CMakeLists.txt
    138 else
    139         sed -e 's|^SET(CMAKE_BUILD_TYPE .*|SET(CMAKE_BUILD_TYPE DEBUG)|' \
    140                 -i example/CMakeLists.txt
    141142fi
    142143# ---------------------------------------------------------------------------
     
    218219#
    219220# cppad_cxx_flags
    220 cppad_cxx_flags="-Wall -pedantic-errors -std=$standard"
    221 if [ "$testvector" != 'eigen' ]
    222 then
    223         cppad_cxx_flags="$cppad_cxx_flags -Wshadow"
    224 fi
     221cppad_cxx_flags="-Wall -pedantic-errors -std=$standard -Wshadow"
    225222cmake_args="$cmake_args -D cppad_cxx_flags='$cppad_cxx_flags'"
    226223#
     
    240237# simple options
    241238cmake_args="$cmake_args -D cppad_testvector=$testvector"
     239cmake_args="$cmake_args -D cppad_debug_which=$debug_which"
    242240cmake_args="$cmake_args -D cppad_tape_id_type='int32_t'"
    243241cmake_args="$cmake_args -D cppad_tape_addr_type=int32_t"
    244242cmake_args="$cmake_args -D cppad_max_num_threads=48"
    245 cmake_args="$cmake_args -D cppad_extra_debug=$extra_debug"
    246243#
    247244echo_eval cmake $cmake_args ..
  • trunk/bin/test_one.sh.in

    r3843 r3941  
    11#! /bin/bash -e
    2 # $Id$
    32# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    54#
    65# CppAD is distributed under multiple licenses. This distribution is under
     
    1716usage: bin/test_one.sh dir/file [extra]
    1817
    19 dir:   example, example/atomic, example/ipopt_solve, or test_more
     18dir:   directory in front of file name
    2019file:  name of *.cpp file, with extension, that contains the test
    2120extra: extra options for the g++ command
     
    2625file=`echo $1 | sed -e 's|.*/||'`
    2726extra="$2"
    28 if [ "$dir" == 'test_more/local' ]
     27if [ "$dir" == 'test_more/general/local' ]
    2928then
    30         dir='test_more'
     29        dir='test_more/general'
    3130        file="local/$file"
    3231fi
     
    3433if [ "$dir" == '' ]
    3534then
    36         echo "test_one.sh: cannot find dir in front of file"
     35        echo "test_one.sh: cannot find dir before front of file"
    3736        exit 1
    3837fi
     
    8079# create test_one.cpp
    8180sed < $dir/$main > test_one.cpp \
    82 -e '/ok *\&= *Run( /d' \
    83 -e "s/.*This line is used by test_one.sh.*/     ok \&= Run( $fun, \"$fun\");/"
     81-e '/^\tRun( /d' \
     82-e "s/.*This line is used by test_one.sh.*/\tRun( $fun, \"$fun\");/"
    8483#
    8584# compiler flags
     
    115114$compile_command
    116115# --------------------------------------------------------------------------
    117 new_library_path='@PROJECT_BINARY_DIR@/cppad_lib'
    118 has_library_path='yes'
    119 if ! echo $LD_LIBRARY_PATH | grep "$new_library_path"
     116library_path='@PROJECT_BINARY_DIR@/cppad_lib'
     117if ! echo $LD_LIBRARY_PATH | grep "$library_path"
    120118then
    121         has_library_path='no'
    122         export LD_LIBRARY_PATH="$new_library_path:$LD_LIBRARY_PATH"
     119        echo 'LD_LIBRARY_PATH=\'
     120        echo "$library_path:$LD_LIBRARY_PATH"
     121        export LD_LIBRARY_PATH="$library_path:$LD_LIBRARY_PATH"
    123122fi
    124123# --------------------------------------------------------------------------
    125 #
    126 echo "./test_one.exe"
    127 if ! ./test_one.exe
    128 then
    129         if [ "$has_library_path" == 'no' ]
    130         then
    131                 echo 'Must execute the following command before running in debugger'
    132                 echo "export LD_LIBRARY_PATH=\"$new_library_path:\$LD_LIBRARY_PATH\""
    133         fi
    134         exit 1
    135 fi
     124echo_eval ./test_one.exe
    136125exit 0
  • trunk/configure

    r3939 r3941  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.69 for cppad 20170522.
     3# Generated by GNU Autoconf 2.69 for cppad 20170601.
    44#
    55# Report bugs to <cppad@list.coin-or.org>.
     
    581581PACKAGE_NAME='cppad'
    582582PACKAGE_TARNAME='cppad'
    583 PACKAGE_VERSION='20170522'
    584 PACKAGE_STRING='cppad 20170522'
     583PACKAGE_VERSION='20170601'
     584PACKAGE_STRING='cppad 20170601'
    585585PACKAGE_BUGREPORT='cppad@list.coin-or.org'
    586586PACKAGE_URL=''
     
    678678cppad_has_colpack
    679679cppad_deprecated_01
    680 cppad_extra_debug_01
    681680cppad_cxx_flags
    682681CppAD_HAVE_AR_FALSE
     
    14171416  # This message is too long to be a string in the A/UX 3.1 sh.
    14181417  cat <<_ACEOF
    1419 \`configure' configures cppad 20170522 to adapt to many kinds of systems.
     1418\`configure' configures cppad 20170601 to adapt to many kinds of systems.
    14201419
    14211420Usage: $0 [OPTION]... [VAR=VALUE]...
     
    14871486if test -n "$ac_init_help"; then
    14881487  case $ac_init_help in
    1489      short | recursive ) echo "Configuration of cppad 20170522:";;
     1488     short | recursive ) echo "Configuration of cppad 20170601:";;
    14901489   esac
    14911490  cat <<\_ACEOF
     
    16211620if $ac_init_version; then
    16221621  cat <<\_ACEOF
    1623 cppad configure 20170522
     1622cppad configure 20170601
    16241623generated by GNU Autoconf 2.69
    16251624
     
    22502249running configure, to aid debugging if configure makes a mistake.
    22512250
    2252 It was created by cppad $as_me 20170522, which was
     2251It was created by cppad $as_me 20170601, which was
    22532252generated by GNU Autoconf 2.69.  Invocation command line was
    22542253
     
    31403139# Define the identity of the package.
    31413140 PACKAGE='cppad'
    3142  VERSION='20170522'
     3141 VERSION='20170601'
    31433142
    31443143
     
    62236222
    62246223
    6225 cppad_extra_debug_01=0
    6226 
    6227 
    62286224cppad_deprecated_01=0
    6229 
    62306225
    62316226
     
    86038598# values after options handling.
    86048599ac_log="
    8605 This file was extended by cppad $as_me 20170522, which was
     8600This file was extended by cppad $as_me 20170601, which was
    86068601generated by GNU Autoconf 2.69.  Invocation command line was
    86078602
     
    86608655ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
    86618656ac_cs_version="\\
    8662 cppad config.status 20170522
     8657cppad config.status 20170601
    86638658configured by $0, generated by GNU Autoconf 2.69,
    86648659  with options \\"\$ac_cs_config\\"
  • trunk/configure.ac

    r3939 r3941  
    1212dnl Process this file with autoconf to produce a configure script.
    1313dnl   package   version              bug-report
    14 AC_INIT([cppad], [20170522], [cppad@list.coin-or.org])
     14AC_INIT([cppad], [20170601], [cppad@list.coin-or.org])
    1515AM_SILENT_RULES([yes])
    1616
     
    490490AC_SUBST(cppad_cxx_flags, "-g -O0")
    491491
    492 dnl autotools version does not support extra debugging
    493 AC_SUBST(cppad_extra_debug_01, 0)
    494 
    495492dnl autotools version does not support installing deprecated features
    496493AC_SUBST(cppad_deprecated_01,  0)
    497 
    498494
    499495dnl autotools version does not colpack
  • trunk/cppad/configure.hpp.in

    r3938 r3941  
    102102*/
    103103# define CPPAD_DEPRECATED @cppad_deprecated_01@
    104 
    105 /*!
    106 \def CPPAD_EXTRA_DEBUG
    107 If this is one, extra cppad debugging is done
    108 when NDEBUG is not defined.
    109 */
    110 # define CPPAD_EXTRA_DEBUG @cppad_extra_debug_01@
    111104
    112105/*!
  • trunk/cppad/core/sparse_hes.hpp

    r3904 r3941  
    153153which does not take advantage of symmetry.
    154154
    155 $subhead colpack.star$$
     155$subhead colpack.symmetric$$
    156156If $cref colpack_prefix$$ was specified on the
    157157$cref/cmake command/cmake/CMake Command/$$ line,
    158 you can set $icode coloring$$ to $code colpack.star$$.
     158you can set $icode coloring$$ to $code colpack.symmetric$$.
    159159This also takes advantage of the fact that the Hessian matrix is symmetric.
     160
     161$subhead colpack.general$$
     162If $cref colpack_prefix$$ was specified on the
     163$cref/cmake command/cmake/CMake Command/$$ line,
     164you can set $icode coloring$$ to $code colpack.general$$.
     165This is the same as the sparse Jacobian
     166$cref/colpack/sparse_jac/coloring/colpack/$$ method
     167which does not take advantage of symmetry.
     168
     169$subhead colpack.star Deprecated 2017-06-01$$
     170The $code colpack.star$$ method is deprecated.
     171It is the same as the $code colpack.symmetric$$ method
     172which should be used instead.
     173
    160174
    161175$head work$$
     
    287301\param coloring
    288302determines which coloring algorithm is used.
    289 This must be cppad.symmetric, cppad.general, or colpack.star.
     303This must be cppad.symmetric, cppad.general, colpack.symmetic,
     304or colpack.star.
    290305
    291306\param work
     
    415430                        local::color_general_cppad(internal_pattern, col, row, color);
    416431                else if( coloring == "cppad.symmetric" )
    417                         local::color_general_cppad(internal_pattern, col, row, color);
    418                 else if( coloring == "colpack.star" )
     432                        local::color_symmetric_cppad(internal_pattern, col, row, color);
     433                else if( coloring == "colpack.general" )
    419434                {
    420435# if CPPAD_HAS_COLPACK
     
    428443# endif
    429444                }
     445                else if(
     446                        coloring == "colpack.symmetric" ||
     447                        coloring == "colpack.star"
     448                )
     449                {
     450# if CPPAD_HAS_COLPACK
     451                        local::color_symmetric_colpack(internal_pattern, col, row, color);
     452# else
     453                        CPPAD_ASSERT_KNOWN(
     454                                false,
     455                                "sparse_hes: coloring = colpack.symmetic or colpack.star "
     456                                "and colpack_prefix not in cmake command line."
     457                        );
     458# endif
     459                }
    430460                else CPPAD_ASSERT_KNOWN(
    431461                        false,
     
    461491        size_t k = 0;
    462492        for(size_t ell = 0; ell < n_color; ell++)
     493        if( k  == K )
     494        {       // kludge because colpack returns colors that are not used
     495                // (it does not know about the subset corresponding to row, col)
     496                CPPAD_ASSERT_UNKNOWN(
     497                        coloring == "colpack.general" ||
     498                        coloring == "colpack.symmetric" ||
     499                        coloring == "colpack.star"
     500                );
     501        }
     502        else if( color[ col[ order[k] ] ] != ell )
     503        {       // kludge because colpack returns colors that are not used
     504                // (it does not know about the subset corresponding to row, col)
     505                CPPAD_ASSERT_UNKNOWN(
     506                        coloring == "colpack.general" ||
     507                        coloring == "colpack.symmetic" ||
     508                        coloring == "colpack.star"
     509                );
     510        }
     511        else
    463512        {       CPPAD_ASSERT_UNKNOWN( color[ col[ order[k] ] ] == ell );
    464513                //
     
    482531                }
    483532        }
     533        // check that all the required entries have been set
     534        CPPAD_ASSERT_UNKNOWN( k == K );
    484535        return n_color;
    485536}
  • trunk/cppad/core/sparse_hessian.hpp

    r3904 r3941  
    217217$codei%
    218218
    219 "colpack.star"
     219"colpack.symmetric"
    220220%$$
    221221This method requires that
     
    223223$cref/cmake command/cmake/CMake Command/$$ line.
    224224It also takes advantage of the fact that the Hessian matrix is symmetric.
     225$codei%
     226
     227"colpack.general"
     228%$$
     229This is the same as the $code "colpack"$$ method for the
     230$cref/sparse_jacobian/sparse_jacobian/work/color_method/$$ calculation.
     231
     232$subhead colpack.star Deprecated 2017-06-01$$
     233The $code colpack.star$$ method is deprecated.
     234It is the same as the $code colpack.symmetric$$
     235which should be used instead.
    225236
    226237$subhead p$$
     
    470481                else if( work.color_method == "cppad.symmetric" )
    471482                        local::color_symmetric_cppad(sparsity, row, col, color);
    472                 else if( work.color_method == "colpack.star" )
     483                else if( work.color_method == "colpack.general" )
     484                {
     485# if CPPAD_HAS_COLPACK
     486                        local::color_general_colpack(sparsity, row, col, color);
     487# else
     488                        CPPAD_ASSERT_KNOWN(
     489                                false,
     490                                "SparseHessian: work.color_method = colpack.general "
     491                                "and colpack_prefix missing from cmake command line."
     492                        );
     493# endif
     494                }
     495                else if(
     496                        work.color_method == "colpack.symmetric" ||
     497                        work.color_method == "colpack.star"
     498                )
    473499                {
    474500# if CPPAD_HAS_COLPACK
     
    477503                        CPPAD_ASSERT_KNOWN(
    478504                                false,
    479                                 "SparseHessian: work.color_method = colpack.star "
     505                                "SparseHessian: work.color_method is "
     506                                "colpack.symmetric or colpack.star\n"
    480507                                "and colpack_prefix missing from cmake command line."
    481508                        );
     
    512539
    513540        // loop over colors
     541# ifndef NDEBUG
     542        const std::string& coloring = work.color_method;
     543# endif
    514544        k = 0;
    515545        for(ell = 0; ell < n_color; ell++)
     546        if( k == K )
     547        {       // kludge because colpack returns colors that are not used
     548                // (it does not know about the subset corresponding to row, col)
     549                CPPAD_ASSERT_UNKNOWN(
     550                        coloring == "colpack.general" ||
     551                        coloring == "colpack.symmetic" ||
     552                        coloring == "colpack.star"
     553                );
     554        }
     555        else if( color[ row[ order[k] ] ] != ell )
     556        {       // kludge because colpack returns colors that are not used
     557                // (it does not know about the subset corresponding to row, col)
     558                CPPAD_ASSERT_UNKNOWN(
     559                        coloring == "colpack.general" ||
     560                        coloring == "colpack.symmetic" ||
     561                        coloring == "colpack.star"
     562                );
     563        }
     564        else
    516565        {       CPPAD_ASSERT_UNKNOWN( color[ row[ order[k] ] ] == ell );
    517566
  • trunk/cppad/core/sparse_jac.hpp

    r3904 r3941  
    589589        size_t k = 0;
    590590        for(size_t ell = 0; ell < n_color; ell++)
     591        if( k  == K )
     592        {       // kludge because colpack returns colors that are not used
     593                // (it does not know about the subset corresponding to row, col)
     594                CPPAD_ASSERT_UNKNOWN( coloring == "colpack" );
     595        }
     596        else if( color[ row[ order[k] ] ] != ell )
     597        {       // kludge because colpack returns colors that are not used
     598                // (it does not know about the subset corresponding to row, col)
     599                CPPAD_ASSERT_UNKNOWN( coloring == "colpack" );
     600        }
     601        else
    591602        {       CPPAD_ASSERT_UNKNOWN( color[ row[ order[k] ] ] == ell );
    592603                //
  • trunk/cppad/core/testvector.hpp

    r3940 r3941  
    5353This shows that any
    5454$cref/simple vector/SimpleVector/$$ class can be used in place of
    55 $codei%CPPAD_TESTVECTOR(%Type%)%$$; i.e.,
    56 users can choose one they prefer.
     55$codei%
     56        CPPAD_TESTVECTOR(%Type%)
     57%$$
     58When writing their own code,
     59users can choose a specific simple vector they prefer; for example,
     60$codei%
     61        CppAD::vector<%Type%>
     62%$$
    5763
    5864
  • trunk/cppad/core/undef.hpp

    r3845 r3941  
    1 // $Id$
    21# ifndef CPPAD_CORE_UNDEF_HPP
    32# define CPPAD_CORE_UNDEF_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
     
    2726# undef CPPAD_BOOL_BINARY         in user api
    2827# undef CPPAD_BOOL_UNARY          in user api
     28# undef CPPAD_DEBUG_AND_RELEASE   in user api
    2929# undef CPPAD_DISCRETE_FUNCTION   in user api
    3030# undef CPPAD_EIGENVECTOR         in user api
  • trunk/cppad/example/eigen_cholesky.hpp

    r3832 r3941  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    140140                size_t nr      = size_t( CppAD::Integer( tx[ 0 * n_order + 0 ] ) );
    141141                size_t ny      = ((nr + 1) * nr) / 2;
     142# ifndef NDEBUG
    142143                size_t nx      = 1 + ny;
     144# endif
    143145                assert( vx.size() == 0 || nx == vx.size() );
    144146                assert( vx.size() == 0 || ny == vy.size() );
     
    238240        {       size_t n_order = q + 1;
    239241                size_t nr = size_t( CppAD::Integer( tx[ 0 * n_order + 0 ] ) );
     242# ifndef NDEBUG
    240243                size_t ny = ( (nr + 1 ) * nr ) / 2;
    241244                size_t nx = 1 + ny;
     245# endif
    242246                //
    243247                assert( nx * n_order == tx.size() );
  • trunk/cppad/example/eigen_mat_inv.hpp

    r3829 r3941  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    231231                size_t nr      = size_t( CppAD::Integer( tx[ 0 * n_order + 0 ] ) );
    232232                size_t ny      = nr * nr;
     233# ifndef NDEBUG
    233234                size_t nx      = 1 + ny;
     235# endif
    234236                assert( vx.size() == 0 || nx == vx.size() );
    235237                assert( vx.size() == 0 || ny == vy.size() );
     
    309311                size_t nr      = size_t( CppAD::Integer( tx[ 0 * n_order + 0 ] ) );
    310312                size_t ny      = nr * nr;
     313# ifndef NDEBUG
    311314                size_t nx      = 1 + ny;
     315# endif
    312316                //
    313317                assert( nx * n_order == tx.size() );
  • trunk/cppad/example/eigen_mat_mul.hpp

    r3881 r3941  
    152152                size_t  nc_right  = size_t( right.cols() );
    153153                assert( n_middle  == size_t( right.rows() )  );
    154 # ifndef NDEBUG
    155                 size_t  nx        = 3 + (nr_left + nc_right) * n_middle;
    156                 size_t  ny        = nr_left * nc_right;
    157 # endif
     154                size_t  nx      = 3 + (nr_left + nc_right) * n_middle;
     155                size_t  ny      = nr_left * nc_right;
    158156                size_t n_left   = nr_left * n_middle;
    159157                size_t n_right  = n_middle * nc_right;
  • trunk/cppad/local/player.hpp

    r3853 r3941  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    7979        size_t user_index_;
    8080
    81 # ifndef NDEBUG
    8281        /// Flag indicating that a special function must be called before next
     82        /// This flags is not used when NDEBUG is defined, but kept in this case
     83        /// so that debug and release versions of CppAD can be mixed.
    8384        bool      special_before_next_;
    84 # endif
    85 
    8685
    8786public:
  • trunk/cppad/utility/thread_alloc.hpp

    r3938 r3941  
    141141                /*!
    142142                root of inuse list for this thread and each capacity
    143                 If NDEBUG is defined or CPPAD_EXTRA_DEBUG is false, this memory is not
     143                If NDEBUG or CPPAD_DEBUG_AND_RELEASE is defined, this memory is not
    144144                used, but it still helps to separate this structure from the structure
    145145                for the next thread.
     
    805805                }
    806806
    807 # if CPPAD_EXTRA_DEBUG
     807# ifndef CPPAD_DEBUG_AND_RELEASE
    808808                // Root nodes for both lists. Note these are different for different
    809809                // threads because tc_index is different for different threads.
     
    825825                        void* v_ptr = reinterpret_cast<void*>(node + 1);
    826826# ifndef NDEBUG
    827 # if CPPAD_EXTRA_DEBUG
     827# ifndef CPPAD_DEBUG_AND_RELEASE
    828828                        // add node to inuse list
    829829                        node->next_           = inuse_root->next_;
     
    854854
    855855# ifndef NDEBUG
    856 # if CPPAD_EXTRA_DEBUG
     856# ifndef CPPAD_DEBUG_AND_RELEASE
    857857                // add node to inuse list
    858858                node->next_       = inuse_root->next_;
     
    952952                thread_alloc_info* info = thread_info(thread);
    953953# ifndef NDEBUG
    954 # if CPPAD_EXTRA_DEBUG
     954# ifndef CPPAD_DEBUG_AND_RELEASE
    955955                // remove node from inuse list
    956956                void* v_node         = reinterpret_cast<void*>(node);
  • trunk/cppad_ipopt/CMakeLists.txt

    r3857 r3941  
    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
     
    109# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1110# -----------------------------------------------------------------------------
    12 
    13 # Specify build type for this directory and all its subdirectories
    14 # (subdirectories do not specify build type).
    15 SET(CMAKE_BUILD_TYPE RELEASE)
    1611
    1712# Initialize list of tests as empty
  • trunk/cppad_ipopt/example/CMakeLists.txt

    r3857 r3941  
    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
     
    2120#                 source1 source2 ... sourceN
    2221# )
    23 ADD_EXECUTABLE(cppad_ipopt_example EXCLUDE_FROM_ALL
     22SET(source_list
    2423        example.cpp
    2524        get_started.cpp
     
    3332        ode_simple.hpp
    3433)
    35 
    36 # Extra compiler flags
    37 add_cppad_cxx_flags( cppad_ipopt_example )
     34set_compile_flags( cppad_ipopt_example "${cppad_debug_which}" "${source_list}" )
     35#
     36ADD_EXECUTABLE( cppad_ipopt_example EXCLUDE_FROM_ALL ${source_list} )
    3837
    3938# List of libraries to be linked into the specified target
  • trunk/cppad_ipopt/example/makefile.in

    r3939 r3941  
    298298cppad_description = @cppad_description@
    299299cppad_eigenvector = @cppad_eigenvector@
    300 cppad_extra_debug_01 = @cppad_extra_debug_01@
    301300cppad_has_adolc = @cppad_has_adolc@
    302301cppad_has_boost = @cppad_has_boost@
  • trunk/cppad_ipopt/speed/CMakeLists.txt

    r3857 r3941  
    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
     
    2423# )
    2524# Include source for cppad_ipopt library so we build it without debugging
    26 ADD_EXECUTABLE(cppad_ipopt_speed EXCLUDE_FROM_ALL
     25SET(source_list
    2726        speed.cpp
    2827        ../src/cppad_ipopt_nlp.cpp
     
    3433        ode_speed.cpp
    3534)
    36 
    37 # Add extra compiler flags
    38 add_cppad_cxx_flags( cppad_ipopt_speed )
     35set_compile_flags( cppad_ipopt_speed "debug_none" "${source_list}" )
     36#
     37ADD_EXECUTABLE( cppad_ipopt_speed EXCLUDE_FROM_ALL ${source_list} )
    3938
    4039# List of libraries to be linked into the specified target
  • trunk/cppad_ipopt/speed/makefile.in

    r3939 r3941  
    300300cppad_description = @cppad_description@
    301301cppad_eigenvector = @cppad_eigenvector@
    302 cppad_extra_debug_01 = @cppad_extra_debug_01@
    303302cppad_has_adolc = @cppad_has_adolc@
    304303cppad_has_boost = @cppad_has_boost@
  • trunk/cppad_ipopt/src/CMakeLists.txt

    r3853 r3941  
    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
     
    1615#       source1 source2 ... sourceN)
    1716# )
    18 ADD_LIBRARY(cppad_ipopt
     17SET(source_list
    1918        cppad_ipopt_nlp.cpp
    2019        hes_fg_map.cpp
     
    2322        vec_fun_pattern.cpp
    2423)
    25 
    26 # Add extra compiler flags
    27 add_cppad_cxx_flags( cppad_ipopt )
     24ADD_LIBRARY(cppad_ipopt ${source_list})
     25set_compile_flags( cppad_ipopt "${cppad_debug_which}" "${source_list}" )
    2826
    2927# install(FILES files... DESTINATION <dir>
  • trunk/cppad_ipopt/src/makefile.in

    r3939 r3941  
    335335cppad_description = @cppad_description@
    336336cppad_eigenvector = @cppad_eigenvector@
    337 cppad_extra_debug_01 = @cppad_extra_debug_01@
    338337cppad_has_adolc = @cppad_has_adolc@
    339338cppad_has_boost = @cppad_has_boost@
  • trunk/cppad_ipopt/test/CMakeLists.txt

    r3857 r3941  
    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
     
    2221#                 source1 source2 ... sourceN
    2322# )
    24 ADD_EXECUTABLE(cppad_ipopt_test EXCLUDE_FROM_ALL test_more.cpp
     23SET(source_list test_more.cpp
    2524        k_gt_one.cpp
    2625        multiple_solution.cpp
     
    2827        retape_k1_l2.cpp
    2928)
    30 add_cppad_cxx_flags(cppad_ipopt_test)
     29set_compile_flags( cppad_ipopt_test "${cppad_debug_which}" "${source_list}" )
     30#
     31ADD_EXECUTABLE( cppad_ipopt_test EXCLUDE_FROM_ALL ${source_list} )
    3132
    3233# List of libraries to be linked into the specified target
  • trunk/cppad_ipopt/test/makefile.in

    r3939 r3941  
    286286cppad_description = @cppad_description@
    287287cppad_eigenvector = @cppad_eigenvector@
    288 cppad_extra_debug_01 = @cppad_extra_debug_01@
    289288cppad_has_adolc = @cppad_has_adolc@
    290289cppad_has_boost = @cppad_has_boost@
  • trunk/cppad_ipopt/test/multiple_solution.cpp

    r3779 r3941  
    11// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    4141        {       return 1; }
    4242        size_t domain_size(size_t k)
    43         {       size_t q;
    44                 switch(k)
    45                 {       case 0:  q = 1;  break;
    46                         default: assert(0);
    47                 }
     43        {       size_t q = 1;
     44                assert(k == 0);
    4845                return q;
    4946        }
    5047        size_t range_size(size_t k)
    51         {       size_t p;
    52                 switch(k)
    53                 {       case 0:  p = 1;  break;
    54                         default: assert(0);
    55                 }
     48        {       size_t p = 1;
     49                assert(k == 0);
    5650                return p;
    5751        }
    5852        size_t number_terms(size_t k)
    59         {       size_t L;
    60                 switch(k)
    61                 {       case 0:  L = 3;   break;
    62                         default: assert(0);
    63                 }
     53        {       size_t L = 3;
     54                assert(k == 0);
    6455                return L;
    6556        }
  • trunk/cppad_lib/CMakeLists.txt

    r3859 r3941  
    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
     
    3837#       source1 source2 ... sourceN)
    3938# )
    40 ADD_LIBRARY( cppad_lib SHARED
    41         cppad_colpack.cpp
    42 )
     39SET(source_list cppad_colpack.cpp)
     40set_compile_flags(cppad_lib "${cppad_debug_which}" "${source_list}" )
     41ADD_LIBRARY( cppad_lib SHARED ${source_list} )
     42#
    4343# set_target_properties(target1 target2 ...
    4444# PROPERTIES prop1 value1 prop2 value2 ...)
  • trunk/cppad_lib/cppad_colpack.cpp

    r3845 r3941  
    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
     
    8786        {       for(i = 0; i < m; i++)
    8887                {       if( seed_matrix[k][i] != 0.0 )
    89                         {       // check that no row appears twice in the coloring
     88                        {       // check that entries in the seed matrix are zero or one
     89                                CPPAD_ASSERT_UNKNOWN( seed_matrix[k][i] == 1.0 );
     90                                // check that no row appears twice in the coloring
    9091                                CPPAD_ASSERT_UNKNOWN( color[i] == m );
    91                                 color[i] = k;
     92                                // only need include rows with non-zero entries
     93                                if( adolc_pattern[i][0] != 0 )
     94                                {       // set color for this row
     95                                        color[i] = k;
     96                                }
    9297                        }
    9398                }
    9499        }
    95100# ifndef NDEBUG
    96         // check that all non-zero rows appear in the coloring
    97         for(i = 0; i < m; i++)
    98                 CPPAD_ASSERT_UNKNOWN(color[i] < m || adolc_pattern[i][0] == 0);
    99 
    100         // check that no rows with the same color have overlapping entries
     101        // check non-zero versus color for each row
     102        for(i = 0; i < m; i++)
     103        {
     104                // if there is a color for row i, check that it has non-zero entries
     105                if(color[i] < m )
     106                        CPPAD_ASSERT_UNKNOWN( adolc_pattern[i][0] != 0 );
     107
     108                // if there is no color for row i, check that it is empty
     109                if( color[i] == m )
     110                        CPPAD_ASSERT_UNKNOWN( adolc_pattern[i][0] == 0 );
     111        }
     112
     113        // check that no rows with the same color have non-zero entries
     114        // with the same column index
    101115        CppAD::vector<bool> found(n);
    102116        for(k = 0; k < size_t(n_seed_row); k++)
    103         {       size_t j, ell;
    104                 for(j = 0; j < n; j++)
     117        {       // k is the color index
     118                // found: column already has a non-zero entries for this color
     119                for(size_t j = 0; j < n; j++)
    105120                        found[j] = false;
     121                // for each row with color k
    106122                for(i = 0; i < m; i++) if( color[i] == k )
    107                 {       for(ell = 0; ell < adolc_pattern[i][0]; ell++)
    108                         {       j = adolc_pattern[i][1 + ell];
     123                {       // for each non-zero entry in this row
     124                        for(size_t ell = 0; ell < adolc_pattern[i][0]; ell++)
     125                        {       // column index for this entry
     126                                size_t j = adolc_pattern[i][1 + ell];
     127                                // check that this is the first non-zero in this column
    109128                                CPPAD_ASSERT_UNKNOWN( ! found[j] );
     129                                // found a non-zero in this column
    110130                                found[j] = true;
    111131                        }
     
    168188        {       for(size_t k = 0; k < size_t(n_seed_col); k++)
    169189                {       if( seed_matrix[i][k] != 0.0 )
    170                         {       CPPAD_ASSERT_UNKNOWN( color[i] == m );
    171                                 color[i] = k;
     190                        {       // check that entries in seed matrix are zero or one
     191                                CPPAD_ASSERT_UNKNOWN( seed_matrix[i][k] == 1.0 );
     192                                // check that now row appears twice in the coloring
     193                                CPPAD_ASSERT_UNKNOWN( color[i] == m );
     194                                // only need include rows with non-zero entries
     195                                if( adolc_pattern[i][0] != 0 )
     196                                {       // set color for this row
     197                                        color[i] = k;
     198                                }
    172199                        }
    173200                }
     
    181208                for(k1 = 1; k1 <= nz1; k1++)
    182209                {       j1 = adolc_pattern[i1][k1];
     210                        // (i1, j1) is a non-zero in the sparsity pattern
    183211
    184212                        // check of a forward on color[i1] followed by a reverse
  • trunk/doc.omh

    r3938 r3941  
    9191$comment bin/version assumes that : follows cppad version number here$$
    9292$section
    93 cppad-20170522: A Package for Differentiation of C++ Algorithms
     93cppad-20170601: 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

    r3933 r3941  
    1111# Build the example directory tests
    1212# Inherit environment from ../CMakeList.txt
    13 
    14 # Specifies build type for all the example subdirectories:
    15 SET(CMAKE_BUILD_TYPE DEBUG)
    1613
    1714# initialize check_depends
  • trunk/example/atomic/CMakeLists.txt

    r3928 r3941  
    1717ENDIF( cppad_has_eigen )
    1818#
    19 ADD_EXECUTABLE(example_atomic EXCLUDE_FROM_ALL
     19SET(source_list
    2020        ${eigen_sources}
    2121        atomic.cpp
     
    3737        tangent.cpp
    3838)
    39 
    40 # Extra compiler flags
    41 add_cppad_cxx_flags( example_atomic )
    42 
     39set_compile_flags( example_atomic "${cppad_debug_which}" "${source_list}" )
     40#
     41ADD_EXECUTABLE(example_atomic EXCLUDE_FROM_ALL ${source_list})
     42#
    4343# Add the check_example_atomic target
    4444ADD_CUSTOM_TARGET(check_example_atomic
     
    4747)
    4848MESSAGE(STATUS "make check_example_atomic: available")
    49 
     49#
    5050# add to check check_example_depends in parent environment
    5151add_to_list(check_example_depends check_example_atomic)
  • trunk/example/atomic/makefile.in

    r3939 r3941  
    296296cppad_description = @cppad_description@
    297297cppad_eigenvector = @cppad_eigenvector@
    298 cppad_extra_debug_01 = @cppad_extra_debug_01@
    299298cppad_has_adolc = @cppad_has_adolc@
    300299cppad_has_boost = @cppad_has_boost@
  • trunk/example/deprecated/CMakeLists.txt

    r3933 r3941  
    1010# -----------------------------------------------------------------------------
    1111# Build the example/deprecated tests
    12 
    13 ADD_EXECUTABLE(example_deprecated EXCLUDE_FROM_ALL deprecated.cpp
     12#
     13SET(source_list
     14        deprecated.cpp
    1415        old_reciprocal.cpp
    1516        old_usead_1.cpp
     
    2122        zdouble.cpp
    2223)
    23 
    24 # Compiler flags for cppad source
    25 add_cppad_cxx_flags(example_deprecated)
    26 
     24set_compile_flags( example_deprecated "${cppad_debug_which}" "${source_list}" )
     25#
     26ADD_EXECUTABLE(example_deprecated EXCLUDE_FROM_ALL ${source_list})
     27#
    2728# Add the check_example_deprecated target
    2829ADD_CUSTOM_TARGET(check_example_deprecated
     
    3233)
    3334MESSAGE(STATUS "make check_example_deprecated: available")
    34 
     35#
    3536# Change check depends in parent environment
    3637add_to_list(check_example_depends check_example_deprecated)
  • trunk/example/deprecated/makefile.in

    r3939 r3941  
    282282cppad_description = @cppad_description@
    283283cppad_eigenvector = @cppad_eigenvector@
    284 cppad_extra_debug_01 = @cppad_extra_debug_01@
    285284cppad_has_adolc = @cppad_has_adolc@
    286285cppad_has_boost = @cppad_has_boost@
  • trunk/example/general/CMakeLists.txt

    r3928 r3941  
    2727ENDIF( cppad_has_eigen )
    2828#
    29 ADD_EXECUTABLE(example_general EXCLUDE_FROM_ALL general.cpp
     29SET(source_list
     30        general.cpp
    3031        ${adolc_sources}
    3132        ${eigen_sources}
     
    135136        vec_ad.cpp
    136137)
     138set_compile_flags( example_general "${cppad_debug_which}" "${source_list}" )
    137139#
    138 # Extra compiler flags
    139 add_cppad_cxx_flags(example_general)
     140ADD_EXECUTABLE(example_general EXCLUDE_FROM_ALL ${source_list})
    140141#
    141142# List of libraries to be linked into the specified target
  • trunk/example/general/compare_change.cpp

    r3928 r3941  
    139139                }
    140140        }
     141# ifdef CPPAD_DEBUG_AND_RELEASE
     142        if( missed_error )
     143        {       // This routine is compiled for debugging, but the routine that checks
     144                // operator indices was compiled for release.
     145                missed_error = false;
     146                AD<double>::abort_recording();
     147        }
     148# endif
    141149        ok &= ! missed_error;
    142 
    143150
    144151        // set count to zero to demonstrate case where comparisons are not checked
  • trunk/example/general/general.cpp

    r3928 r3941  
    185185        Run( capacity_order,    "capacity_order"   );
    186186        Run( change_param,      "change_param"     );
    187         Run( check_for_nan,     "check_for_nan"    );
    188187        Run( compare_change,    "compare_change"   );
    189188        Run( Compare,           "Compare"          );
     
    262261        Run( Var2Par,           "Var2Par"          );
    263262        Run( vec_ad,            "vec_ad"           );
     263# ifndef CPPAD_DEBUG_AND_RELEASE
     264        Run( check_for_nan,     "check_for_nan"    );
     265# endif
    264266# if CPPAD_HAS_ADOLC
    265267        Run( mul_level_adolc,      "mul_level_adolc"     );
  • trunk/example/general/makefile.in

    r3939 r3941  
    379379cppad_description = @cppad_description@
    380380cppad_eigenvector = @cppad_eigenvector@
    381 cppad_extra_debug_01 = @cppad_extra_debug_01@
    382381cppad_has_adolc = @cppad_has_adolc@
    383382cppad_has_boost = @cppad_has_boost@
  • trunk/example/get_started/CMakeLists.txt

    r3930 r3941  
    1111# Build the example/get_started directory tests
    1212#
    13 ADD_EXECUTABLE(example_get_started EXCLUDE_FROM_ALL
    14         get_started.cpp
    15 )
    16 # Compiler flags for cppad source
    17 add_cppad_cxx_flags( example_get_started )
     13SET(source_list get_started.cpp)
     14#
     15set_compile_flags( example_get_started "${cppad_debug_which}" "${source_list}" )
     16#
     17ADD_EXECUTABLE(example_get_started EXCLUDE_FROM_ALL ${source_list})
    1818#
    1919# Add the check for this target
  • trunk/example/get_started/makefile.in

    r3939 r3941  
    280280cppad_description = @cppad_description@
    281281cppad_eigenvector = @cppad_eigenvector@
    282 cppad_extra_debug_01 = @cppad_extra_debug_01@
    283282cppad_has_adolc = @cppad_has_adolc@
    284283cppad_has_boost = @cppad_has_boost@
  • trunk/example/ipopt_solve/CMakeLists.txt

    r3930 r3941  
    1313# Local link directories to search, as determined by pkg-config for ipopt
    1414LINK_DIRECTORIES( ${ipopt_LIBRARY_DIRS} )
    15 
    16 ADD_EXECUTABLE(example_ipopt_solve EXCLUDE_FROM_ALL
     15#
     16SET(source_list
    1717        get_started.cpp
    1818        ipopt_solve.cpp
     
    2020        retape.cpp
    2121)
    22 
    23 # Extra compiler flags
    24 add_cppad_cxx_flags( example_ipopt_solve )
    25 
     22set_compile_flags( example_ipopt_solve "${cppad_debug_which}" "${source_list}" )
     23#
     24ADD_EXECUTABLE(example_ipopt_solve EXCLUDE_FROM_ALL ${source_list})
     25#
    2626# libraries to be linked into the specified target,
    2727# as determined by pkg-config for ipopt
  • trunk/example/ipopt_solve/makefile.in

    r3939 r3941  
    285285cppad_description = @cppad_description@
    286286cppad_eigenvector = @cppad_eigenvector@
    287 cppad_extra_debug_01 = @cppad_extra_debug_01@
    288287cppad_has_adolc = @cppad_has_adolc@
    289288cppad_has_boost = @cppad_has_boost@
  • trunk/example/multi_thread/bthread/CMakeLists.txt

    r3931 r3941  
    1818#                 source1 source2 ... sourceN
    1919# )
    20 ADD_EXECUTABLE(example_multi_thread_bthread EXCLUDE_FROM_ALL ../thread_test.cpp
     20SET(source_list ../thread_test.cpp
    2121        ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
    2222        ../multi_newton_time.cpp
     
    3131        team_bthread.cpp
    3232)
    33 
    34 # Compiler flags for cppad source
    35 add_cppad_cxx_flags( example_multi_thread_bthread )
     33set_compile_flags( example_multi_thread_bthread "${cppad_debug_which}" "${source_list}" )
     34#
     35ADD_EXECUTABLE( example_multi_thread_bthread EXCLUDE_FROM_ALL ${source_list} )
    3636
    3737# Paths in which the linker will search for libraries,
  • trunk/example/multi_thread/harmonic_time.cpp

    r3931 r3941  
    101101*/
    102102// BEGIN C++
    103 # include <omp.h>
    104103# include <cstring>
    105104# include <limits>
  • trunk/example/multi_thread/makefile.in

    r3939 r3941  
    322322cppad_description = @cppad_description@
    323323cppad_eigenvector = @cppad_eigenvector@
    324 cppad_extra_debug_01 = @cppad_extra_debug_01@
    325324cppad_has_adolc = @cppad_has_adolc@
    326325cppad_has_boost = @cppad_has_boost@
  • trunk/example/multi_thread/openmp/CMakeLists.txt

    r3931 r3941  
    2222#                 source1 source2 ... sourceN
    2323# )
    24 ADD_EXECUTABLE(example_multi_thread_openmp EXCLUDE_FROM_ALL ../thread_test.cpp
     24SET(source_list ../thread_test.cpp
    2525        ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
    2626        ../multi_newton_time.cpp
     
    3535        team_openmp.cpp
    3636)
    37 
    38 # Compiler flags for cppad source
    39 add_cppad_cxx_flags( example_multi_thread_openmp )
     37set_compile_flags( example_multi_thread_openmp "${cppad_debug_which}" "${source_list}" )
     38#
     39ADD_EXECUTABLE( example_multi_thread_openmp EXCLUDE_FROM_ALL ${source_list} )
    4040
    4141# Extra flags used by linker for openmp support
  • trunk/example/multi_thread/pthread/CMakeLists.txt

    r3931 r3941  
    1818#                 source1 source2 ... sourceN
    1919# )
    20 ADD_EXECUTABLE(example_multi_thread_pthread EXCLUDE_FROM_ALL ../thread_test.cpp
     20SET(source_list ../thread_test.cpp
    2121        ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
    2222        ../multi_newton_time.cpp
     
    3131        team_pthread.cpp
    3232)
    33 
    34 # Compiler flags for cppad source
    35 add_cppad_cxx_flags( example_multi_thread_pthread )
     33set_compile_flags( example_multi_thread_pthread "${cppad_debug_which}" "${source_list}" )
     34#
     35ADD_EXECUTABLE( example_multi_thread_pthread EXCLUDE_FROM_ALL ${source_list} )
    3636
    3737# Paths in which the linker will search for libraries,
  • trunk/example/multi_thread/test_multi/makefile.in

    r3939 r3941  
    279279cppad_description = @cppad_description@
    280280cppad_eigenvector = @cppad_eigenvector@
    281 cppad_extra_debug_01 = @cppad_extra_debug_01@
    282281cppad_has_adolc = @cppad_has_adolc@
    283282cppad_has_boost = @cppad_has_boost@
  • trunk/example/optimize/CMakeLists.txt

    r3928 r3941  
    1010# -----------------------------------------------------------------------------
    1111# Build the example/optimize directory tests
    12 
    1312#
    14 ADD_EXECUTABLE(example_optimize EXCLUDE_FROM_ALL
     13#
     14SET(source_list
    1515        conditional_skip.cpp
    1616        compare_op.cpp
     
    2222        reverse_active.cpp
    2323)
    24 
    25 # Extra compiler flags
    26 add_cppad_cxx_flags( example_optimize )
     24set_compile_flags( example_optimize "${cppad_debug_which}" "${source_list}" )
     25#
     26ADD_EXECUTABLE(example_optimize EXCLUDE_FROM_ALL ${source_list})
    2727
    2828# Add the check_example_optimize target
  • trunk/example/optimize/forward_active.cpp

    r3856 r3941  
    11// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    7676                after.n_var  += 1; after.n_op   += 1;
    7777
     78                // Use two, three, four and six in order to avoid a compiler warning
     79                // Note that addition of two and three does not take any operations.
     80                // Also note that optimizer reconizes four * six == five * seven.
     81                scalar nine  = eight + four * six * (two + three);
     82                before.n_var += 3; before.n_op  += 3;
     83                after.n_var  += 2; after.n_op   += 2;
     84
    7885                // results for this operation sequence
    79                 y[0] = eight;
     86                y[0] = nine;
    8087                before.n_var += 0; before.n_op  += 0;
    8188                after.n_var  += 0; after.n_op   += 0;
  • trunk/example/optimize/makefile.in

    r3939 r3941  
    283283cppad_description = @cppad_description@
    284284cppad_eigenvector = @cppad_eigenvector@
    285 cppad_extra_debug_01 = @cppad_extra_debug_01@
    286285cppad_has_adolc = @cppad_has_adolc@
    287286cppad_has_boost = @cppad_has_boost@
  • trunk/example/print_for/CMakeLists.txt

    r3930 r3941  
    1010# -----------------------------------------------------------------------------
    1111# Build the example/print_for directory tests
    12 
    13 ADD_EXECUTABLE(example_print_for EXCLUDE_FROM_ALL print_for.cpp)
    14 
    15 # Add extra compiler flags
    16 add_cppad_cxx_flags(example_print_for)
     12#
     13SET(source_list print_for.cpp)
     14#
     15set_compile_flags( example_print_for "${cppad_debug_which}" "${source_list}" )
     16#
     17ADD_EXECUTABLE(example_print_for EXCLUDE_FROM_ALL ${source_list})
    1718
    1819# check_example_print_for target
  • trunk/example/print_for/makefile.in

    r3939 r3941  
    279279cppad_description = @cppad_description@
    280280cppad_eigenvector = @cppad_eigenvector@
    281 cppad_extra_debug_01 = @cppad_extra_debug_01@
    282281cppad_has_adolc = @cppad_has_adolc@
    283282cppad_has_boost = @cppad_has_boost@
  • trunk/example/sparse/CMakeLists.txt

    r3930 r3941  
    1010# -----------------------------------------------------------------------------
    1111#
    12 ADD_EXECUTABLE(example_sparse EXCLUDE_FROM_ALL
     12SET(source_list
    1313        sparse.cpp
    1414        sub_sparse_hes.cpp
     
    3131        conj_grad.cpp
    3232        colpack_jac.cpp
     33        colpack_jacobian.cpp
    3334        colpack_hes.cpp
     35        colpack_hessian.cpp
    3436        rc_sparsity.cpp
    3537)
    36 
    37 # Extra compiler flags
    38 add_cppad_cxx_flags( example_sparse )
     38set_compile_flags( example_sparse "${cppad_debug_which}" "${source_list}" )
     39#
     40ADD_EXECUTABLE(example_sparse EXCLUDE_FROM_ALL ${source_list})
    3941
    4042# List of libraries to be linked into the specified target
  • trunk/example/sparse/colpack_hes.cpp

    r3875 r3941  
    1717$$
    1818
    19 $section Using ColPack: Example and Test$$
    20 $mindex colpack hessian sparse$$
     19$section ColPack: Sparse Hessian Example and Test$$
    2120
    2221
     
    3433        using CppAD::AD;
    3534        using CppAD::NearEqual;
    36         typedef CPPAD_TESTVECTOR(AD<double>) a_vector;
    37         typedef CPPAD_TESTVECTOR(double)     d_vector;
    38         typedef CppAD::vector<size_t>        i_vector;
    39         size_t i, j, k, ell;
     35        typedef CPPAD_TESTVECTOR(AD<double>)            a_vector;
     36        typedef CPPAD_TESTVECTOR(double)                d_vector;
     37        typedef CppAD::vector<size_t>                   i_vector;
     38        typedef CppAD::sparse_rc<i_vector>              sparsity;
     39        typedef CppAD::sparse_rcv<i_vector, d_vector>   sparse_matrix;
    4040        double eps = 10. * CppAD::numeric_limits<double>::epsilon();
    41 
     41        //
    4242        // domain space vector
    4343        size_t n = 5;
    4444        a_vector  a_x(n);
    45         for(j = 0; j < n; j++)
     45        for(size_t j = 0; j < n; j++)
    4646                a_x[j] = AD<double> (0);
    47 
     47        //
    4848        // declare independent variables and starting recording
    4949        CppAD::Independent(a_x);
     
    5454        // partial_0 partial_j = x[j]
    5555        // partial_j partial_j = x[0]
    56         for(j = 1; j < n; j++)
     56        for(size_t j = 1; j < n; j++)
    5757                sum += a_x[0] * a_x[j] * a_x[j] / 2.0;
    5858        //
    5959        // partial_i partial_i = 2 * x[i]
    60         for(i = 0; i < n; i++)
     60        for(size_t i = 0; i < n; i++)
    6161                sum += a_x[i] * a_x[i] * a_x[i] / 3.0;
    6262
     
    7171        // new value for the independent variable vector
    7272        d_vector x(n);
    73         for(j = 0; j < n; j++)
     73        for(size_t j = 0; j < n; j++)
    7474                x[j] = double(j + 1);
    7575
     
    8181              [ 5  0  0  0 11 ]
    8282        */
    83         d_vector check(n * n);
    84         for(i = 0; i < n; i++)
    85         {       for(j = 0; j < n; j++)
    86                 {       size_t index = i * n + j;
    87                         check[index] = 0.0;
    88                         if( i == 0 && 1 <= j )
    89                                 check[index] += x[j];
    90                         if( 1 <= i && j == 0 )
    91                                 check[index] += x[i];
    92                         if( i == j )
    93                         {       check[index] += 2.0 * x[i];
    94                                 if( i != 0 )
    95                                         check[index] += x[0];
    96                         }
     83        // Normally one would use CppAD to compute sparsity pattern, but for this
     84        // example we set it directly
     85        size_t nr  = n;
     86        size_t nc  = n;
     87        size_t nnz = n + 2 * (n - 1);
     88        sparsity pattern(nr, nc, nnz);
     89        for(size_t k = 0; k < n; k++)
     90        {       size_t r = k;
     91                size_t c = k;
     92                pattern.set(k, r, c);
     93        }
     94        for(size_t i = 1; i < n; i++)
     95        {       size_t k = n + 2 * (i - 1);
     96                size_t r = i;
     97                size_t c = 0;
     98                pattern.set(k,   r, c);
     99                pattern.set(k+1, c, r);
     100        }
     101
     102        // subset of elements to compute
     103        // (only compute lower traingle)
     104        nnz = n + (n - 1);
     105        sparsity lower_triangle(nr, nc, nnz);
     106        d_vector check(nnz);
     107        for(size_t k = 0; k < n; k++)
     108        {       size_t r = k;
     109                size_t c = k;
     110                lower_triangle.set(k, r, c);
     111                check[k] = 2.0 * x[k];
     112                if( k > 0 )
     113                        check[k] += x[0];
     114        }
     115        for(size_t j = 1; j < n; j++)
     116        {       size_t k = n + (j - 1);
     117                size_t r = 0;
     118                size_t c = j;
     119                lower_triangle.set(k, r, c);
     120                check[k] = x[c];
     121        }
     122        sparse_matrix subset( lower_triangle );
     123
     124        // check results for both CppAD and Colpack
     125        for(size_t i_method = 0; i_method < 5; i_method++)
     126        {       // coloring method
     127                std::string coloring;
     128                switch(i_method)
     129                {       case 0:
     130                        coloring = "cppad.symmetric";
     131                        break;
     132
     133                        case 1:
     134                        coloring = "cppad.general";
     135                        break;
     136
     137                        case 2:
     138                        coloring = "colpack.symmetric";
     139                        break;
     140
     141                        case 3:
     142                        coloring = "colpack.general";
     143                        break;
     144
     145                        case 4:
     146                        coloring = "colpack.star";
     147                        break;
    97148                }
    98         }
    99         // Normally one would use f.RevSparseHes to compute
    100         // sparsity pattern, but for this example we extract it from check.
    101         std::vector< std::set<size_t> >  p(n);
    102         i_vector row, col;
    103         for(i = 0; i < n; i++)
    104         {       for(j = 0; j < n; j++)
    105                 {       ell = i * n + j;
    106                         if( check[ell] != 0. )
    107                         {       // insert this non-zero entry in sparsity pattern
    108                                 p[i].insert(j);
    109 
    110                                 // the Hessian is symmetric, so only upper lower triangle
    111                                 if( j <= i )
    112                                 {       row.push_back(i);
    113                                         col.push_back(j);
    114                                 }
    115                         }
    116                 }
    117         }
    118         size_t K = row.size();
    119         d_vector hes(K);
    120 
    121         // contrast and check results using both cppad and colpack
    122         CppAD::sparse_hessian_work work;
    123         for(size_t i_method = 0; i_method < 3; i_method++)
    124         {       // empty work structure
    125                 ok &= work.color_method == "cppad.symmetric";
    126                 if( i_method == 2 )
    127                         work.color_method = "colpack.star";
    128 
     149                //
    129150                // compute Hessian
     151                CppAD::sparse_hes_work work;
    130152                d_vector w(m);
    131153                w[0] = 1.0;
    132                 size_t n_sweep = f.SparseHessian(x, w, p, row, col, hes, work);
    133 
     154                size_t n_sweep = f.sparse_hes(
     155                        x, w, subset, pattern, coloring, work
     156                );
     157                //
    134158                // check result
    135                 for(k = 0; k < K; k++)
    136                 {       ell = row[k] * n + col[k];
    137                         ok &= NearEqual(check[ell], hes[k], eps, eps);
    138                 }
    139                 if( work.color_method != "cppad.general" )
     159                const d_vector& hes( subset.val() );
     160                for(size_t k = 0; k < nnz; k++)
     161                        ok &= NearEqual(check[k], hes[k], eps, eps);
     162                if(
     163                        coloring == "cppad.symmetric"
     164                ||      coloring == "colpack.symmetric"
     165                ||      coloring == "colpack.star"
     166                )
    140167                        ok &= n_sweep == 2;
    141168                else
    142169                        ok &= n_sweep == 5;
    143                 //
    144                 // check that clear resets color_method to cppad.symmetric
    145                 work.clear();
    146                 ok &= work.color_method == "cppad.symmetric";
    147170        }
    148171
  • trunk/example/sparse/colpack_jac.cpp

    r3875 r3941  
    1717$$
    1818
    19 $section Using ColPack: Example and Test$$
    20 $mindex colpack jacobian sparse$$
     19$section ColPack: Sparse Jacobian Example and Test$$
    2120
    2221
     
    3433        using CppAD::AD;
    3534        using CppAD::NearEqual;
    36         typedef CPPAD_TESTVECTOR(AD<double>) a_vector;
    37         typedef CPPAD_TESTVECTOR(double)     d_vector;
    38         typedef CppAD::vector<size_t>        i_vector;
    39         size_t i, j, k, ell;
    40         double eps = 10. * CppAD::numeric_limits<double>::epsilon();
     35        typedef CPPAD_TESTVECTOR(AD<double>)            a_vector;
     36        typedef CPPAD_TESTVECTOR(double)                d_vector;
     37        typedef CppAD::vector<size_t>                   i_vector;
     38        typedef CppAD::sparse_rc<i_vector>              sparsity;
     39        typedef CppAD::sparse_rcv<i_vector, d_vector>   sparse_matrix;
    4140
    4241        // domain space vector
    4342        size_t n = 4;
    4443        a_vector  a_x(n);
    45         for(j = 0; j < n; j++)
     44        for(size_t j = 0; j < n; j++)
    4645                a_x[j] = AD<double> (0);
    4746
     
    6059        // new value for the independent variable vector
    6160        d_vector x(n);
    62         for(j = 0; j < n; j++)
     61        for(size_t j = 0; j < n; j++)
    6362                x[j] = double(j);
    6463
     
    6867              [ 1 1 1 x_3]
    6968        */
    70         d_vector check(m * n);
    71         check[0] = 1.; check[1] = 1.; check[2]  = 0.; check[3]  = 0.;
    72         check[4] = 0.; check[5] = 0.; check[6]  = 1.; check[7]  = 1.;
    73         check[8] = 1.; check[9] = 1.; check[10] = 1.; check[11] = x[3];
    74 
    75         // Normally one would use f.ForSparseJac or f.RevSparseJac to compute
    76         // sparsity pattern, but for this example we extract it from check.
    77         std::vector< std::set<size_t> >  p(m);
     69        // Normally one would use CppAD to compute sparsity pattern, but for this
     70        // example we set it directly
     71        size_t nr  = m;
     72        size_t nc  = n;
     73        size_t nnz = 8;
     74        sparsity pattern(nr, nc, nnz);
     75        d_vector check(nnz);
     76        for(size_t k = 0; k < nnz; k++)
     77        {       size_t r, c;
     78                if( k < 2 )
     79                {       r = 0;
     80                        c = k;
     81                }
     82                else if( k < 4 )
     83                {       r = 1;
     84                        c = k;
     85                }
     86                else
     87                {       r = 2;
     88                        c = k - 4;
     89                }
     90                pattern.set(k, r, c);
     91                if( k == nnz - 1 )
     92                        check[k] = x[3];
     93                else
     94                        check[k] = 1.0;
     95        }
    7896
    7997        // using row and column indices to compute non-zero in rows 1 and 2
    80         i_vector row, col;
    81         for(i = 0; i < m; i++)
    82         {       for(j = 0; j < n; j++)
    83                 {       ell = i * n + j;
    84                         if( check[ell] != 0. )
    85                         {       row.push_back(i);
    86                                 col.push_back(j);
    87                                 p[i].insert(j);
    88                         }
     98        sparse_matrix subset( pattern );
     99
     100        // check results for both CppAD and Colpack
     101        for(size_t i_method = 0; i_method < 4; i_method++)
     102        {       // coloring method
     103                std::string coloring;
     104                if( i_method % 2 == 0 )
     105                        coloring = "cppad";
     106                else
     107                        coloring = "colpack";
     108                //
     109                CppAD::sparse_jac_work work;
     110                size_t group_max = 1;
     111                if( i_method / 2 == 0 )
     112                {       size_t n_sweep = f.sparse_jac_for(
     113                                group_max, x, subset, pattern, coloring, work
     114                        );
     115                        ok &= n_sweep == 4;
    89116                }
     117                else
     118                {       size_t n_sweep = f.sparse_jac_rev(
     119                                x, subset, pattern, coloring, work
     120                        );
     121                        ok &= n_sweep == 2;
     122                }
     123                const d_vector& hes( subset.val() );
     124                for(size_t k = 0; k < nnz; k++)
     125                        ok &= check[k] == hes[k];
    90126        }
    91         size_t K = row.size();
    92         d_vector jac(K);
    93 
    94         // empty work structure
    95         CppAD::sparse_jacobian_work work;
    96         ok &= work.color_method == "cppad";
    97 
    98         // choose to use ColPack
    99         work.color_method = "colpack";
    100 
    101         // forward mode
    102         size_t n_sweep = f.SparseJacobianForward(x, p, row, col, jac, work);
    103         for(k = 0; k < K; k++)
    104         {       ell = row[k] * n + col[k];
    105                 ok &= NearEqual(check[ell], jac[k], eps, eps);
    106         }
    107         ok &= n_sweep == 4;
    108 
    109         // reverse mode
    110         work.clear();
    111         work.color_method = "colpack";
    112         n_sweep = f.SparseJacobianReverse(x, p, row, col, jac, work);
    113         for(k = 0; k < K; k++)
    114         {       ell = row[k] * n + col[k];
    115                 ok &= NearEqual(check[ell], jac[k], eps, eps);
    116         }
    117         ok &= n_sweep == 2;
    118 
    119127        return ok;
    120128}
  • trunk/example/sparse/makefile.am

    r3890 r3941  
    3333        rev_hes_sparsity.cpp \
    3434        rev_sparse_jac.cpp \
     35        rev_sparse_jacobian.cpp \
    3536        rev_sparse_hes.cpp \
     37        rev_sparse_hessian.cpp \
    3638        for_hes_sparsity.cpp \
    3739        for_jac_sparsity.cpp \
     
    4143        conj_grad.cpp \
    4244        colpack_jac.cpp \
     45        colpack_jacobian.cpp \
    4346        colpack_hes.cpp \
    4447        rc_sparsity.cpp
  • trunk/example/sparse/makefile.in

    r3939 r3941  
    104104        sparse_hessian.$(OBJEXT) rev_jac_sparsity.$(OBJEXT) \
    105105        rev_hes_sparsity.$(OBJEXT) rev_sparse_jac.$(OBJEXT) \
    106         rev_sparse_hes.$(OBJEXT) for_hes_sparsity.$(OBJEXT) \
     106        rev_sparse_jacobian.$(OBJEXT) rev_sparse_hes.$(OBJEXT) \
     107        rev_sparse_hessian.$(OBJEXT) for_hes_sparsity.$(OBJEXT) \
    107108        for_jac_sparsity.$(OBJEXT) for_sparse_jac.$(OBJEXT) \
    108109        for_sparse_hes.$(OBJEXT) dependency.$(OBJEXT) \
    109110        conj_grad.$(OBJEXT) colpack_jac.$(OBJEXT) \
    110         colpack_hes.$(OBJEXT) rc_sparsity.$(OBJEXT)
     111        colpack_jacobian.$(OBJEXT) colpack_hes.$(OBJEXT) \
     112        rc_sparsity.$(OBJEXT)
    111113sparse_OBJECTS = $(am_sparse_OBJECTS)
    112114sparse_LDADD = $(LDADD)
     
    289291cppad_description = @cppad_description@
    290292cppad_eigenvector = @cppad_eigenvector@
    291 cppad_extra_debug_01 = @cppad_extra_debug_01@
    292293cppad_has_adolc = @cppad_has_adolc@
    293294cppad_has_boost = @cppad_has_boost@
     
    369370        rev_hes_sparsity.cpp \
    370371        rev_sparse_jac.cpp \
     372        rev_sparse_jacobian.cpp \
    371373        rev_sparse_hes.cpp \
     374        rev_sparse_hessian.cpp \
    372375        for_hes_sparsity.cpp \
    373376        for_jac_sparsity.cpp \
     
    377380        conj_grad.cpp \
    378381        colpack_jac.cpp \
     382        colpack_jacobian.cpp \
    379383        colpack_hes.cpp \
    380384        rc_sparsity.cpp
     
    429433@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_hes.Po@am__quote@
    430434@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jac.Po@am__quote@
     435@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jacobian.Po@am__quote@
    431436@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conj_grad.Po@am__quote@
    432437@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dependency.Po@am__quote@
     
    439444@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_jac_sparsity.Po@am__quote@
    440445@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_hes.Po@am__quote@
     446@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_hessian.Po@am__quote@
    441447@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_jac.Po@am__quote@
     448@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_jacobian.Po@am__quote@
    442449@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse.Po@am__quote@
    443450@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_hes.Po@am__quote@
  • trunk/example/sparse/rc_sparsity.cpp

    r3900 r3941  
    262262                        else
    263263                        {       ok &= check_hes(i, x, subset);
    264                                 ok &= n_sweep == 2;
     264                                ok &= n_sweep == 1;
    265265                        }
    266266                }
     
    318318                        else
    319319                        {       ok &= check_hes(i, x, subset);
    320                                 ok &= n_sweep == 2;
     320                                ok &= n_sweep == 1;
    321321                        }
    322322                }
  • trunk/example/sparse/sparse.cpp

    r3926 r3941  
    4545extern bool conj_grad(void);
    4646extern bool colpack_jac(void);
     47extern bool colpack_jacobian(void);
    4748extern bool colpack_hes(void);
     49extern bool colpack_hessian(void);
    4850extern bool rc_sparsity(void);
    4951
     
    7880# if CPPAD_HAS_COLPACK
    7981        Run( colpack_jac,               "colpack_jac" );
     82        Run( colpack_jacobian,          "colpack_jacobian" );
    8083        Run( colpack_hes,               "colpack_hes" );
     84        Run( colpack_hessian,           "colpack_hessian" );
    8185# endif
    8286        //
  • trunk/example/utility/CMakeLists.txt

    r3928 r3941  
    1010# -----------------------------------------------------------------------------
    1111#
    12 ADD_EXECUTABLE(example_utility EXCLUDE_FROM_ALL
     12SET(source_list
    1313        check_numeric_type.cpp
    1414        check_simple_vector.cpp
     
    3737        vector_bool.cpp
    3838)
    39 
    40 # Extra compiler flags
    41 add_cppad_cxx_flags( example_utility )
    42 
     39set_compile_flags( example_utility "${cppad_debug_which}" "${source_list}" )
     40#
     41ADD_EXECUTABLE(example_utility EXCLUDE_FROM_ALL ${source_list})
     42#
    4343# Add the check_example_utility target
    4444ADD_CUSTOM_TARGET(check_example_utility
  • trunk/example/utility/makefile.in

    r3939 r3941  
    289289cppad_description = @cppad_description@
    290290cppad_eigenvector = @cppad_eigenvector@
    291 cppad_extra_debug_01 = @cppad_extra_debug_01@
    292291cppad_has_adolc = @cppad_has_adolc@
    293292cppad_has_boost = @cppad_has_boost@
  • trunk/introduction/CMakeLists.txt

    r3934 r3941  
    1111# Build the introduction/exp_apx directory tests
    1212
    13 # Specifies build type for this directory. Possible values are
    14 # empty, Debug, Release, RelWithDebInfo and MinSizeRel
    15 SET(CMAKE_BUILD_TYPE DEBUG)
    16 #
    17 ADD_EXECUTABLE(introduction EXCLUDE_FROM_ALL
     13SET(source_list
    1814        introduction.cpp
    1915        exp_2.cpp
     
    3430        exp_eps_rev2.cpp
    3531)
    36 # Compiler flags for cppad source
    37 add_cppad_cxx_flags( introduction )
     32set_compile_flags( introduction "${cppad_debug_which}" "${source_list}" )
     33#
     34ADD_EXECUTABLE( introduction EXCLUDE_FROM_ALL ${source_list} )
    3835
    3936# Add this check target
  • trunk/introduction/makefile.in

    r3939 r3941  
    297297cppad_description = @cppad_description@
    298298cppad_eigenvector = @cppad_eigenvector@
    299 cppad_extra_debug_01 = @cppad_extra_debug_01@
    300299cppad_has_adolc = @cppad_has_adolc@
    301300cppad_has_boost = @cppad_has_boost@
  • trunk/makefile.in

    r3939 r3941  
    353353cppad_description = @cppad_description@
    354354cppad_eigenvector = @cppad_eigenvector@
    355 cppad_extra_debug_01 = @cppad_extra_debug_01@
    356355cppad_has_adolc = @cppad_has_adolc@
    357356cppad_has_boost = @cppad_has_boost@
  • trunk/omh/appendix/deprecated/deprecated.omh

    r3921 r3941  
    1616        jac
    1717        hes
     18        colpack
    1819$$
    1920
     
    3233        cppad_ipopt/src/cppad_ipopt_nlp.hpp%
    3334        cppad/core/old_atomic.hpp%
    34         cppad/core/zdouble.hpp
     35        cppad/core/zdouble.hpp%
     36        omh/install/autotools.omh
    3537%$$
    3638
     39
     40$head Name Changes$$
    3741$table
    3842$cref/CppADCreateUnaryBool/BoolFun/Deprecated 2007-07-31/$$  $cnext
     
    4246        $title Discrete$$
    4347$rnext
    44 $cref autotools$$   $cnext $title autotools$$
     48$cref/nan(zero)/nan/nan(zero)/$$ $cnext $codei%nan(%zero%)%$$
    4549$rnext
    46 $cref/nan(zero)/nan/nan(zero)/$$ $cnext $codei%nan(%zero%)%$$
     50$code colpack.star$$ coloring $cnext see
     51$cref/sparse_hes/sparse_hes/coloring/colpack.star Deprecated 2017-06-01/$$
     52and
     53$cref/sparse_hessian
     54        /sparse_hessian
     55        /work
     56        /colpack.star Deprecated 2017-06-01
     57/$$
     58
    4759$tend
    4860
  • trunk/omh/appendix/whats_new/whats_new_17.omh

    r3938 r3941  
    3636        autotools
    3737        ipopt
     38        colpack
    3839$$
    3940
    4041$section Changes and Additions to CppAD During 2017$$
     42
     43$head 06-01$$
     44$list number$$
     45$lnext
     46There was a bug in the
     47$cref sparse_hes$$ routine and it was using the general coloring algorithm when
     48$cref/cppad.symmetric/sparse_hes/coloring/cppad.symmetric/$$ was specified.
     49This has been fixed and improves the efficiency in this case.
     50$lnext
     51Some bugs were fixed in the use of
     52$cref/colpack/colpack_prefix/$$ as the coloring algorithm for
     53sparse Jacobian and Hessian calculations.
     54This has improved the efficiency of Colpack colorings for computing Hessians
     55(when $code colpack.symmetric$$ is used).
     56$lnext
     57The $code colpack.star$$ coloring method for sparse Hessians has
     58been deprecated; see
     59$cref/sparse_hes/sparse_hes/coloring/colpack.star Deprecated 2017-06-01/$$
     60and
     61$cref/sparse_hessian
     62        /sparse_hessian
     63        /work
     64        /colpack.star Deprecated 2017-06-01
     65/$$.
     66Use the $code colpack.symmetric$$ method instead; see
     67$cref/sparse_hes/sparse_hes/coloring/colpack.symmetric/$$ and
     68$cref/sparse_hes/sparse_hes/coloring/colpack.general/$$.
     69$lend
     70
     71$head 05-29$$
     72$list number$$
     73Add the capability to compile so that CppAD debug and release mode
     74can be mixed; see
     75$cref/CPPAD_DEBUG_AND_RELEASE
     76        /preprocessor
     77        /Documented Here
     78        /CPPAD_DEBUG_AND_RELEASE
     79/$$.
     80$lnext
     81Add the $cref/cppad_debug_which/cmake/cppad_debug_which/$$ flags
     82that determines which files are compiled for debugging versus release
     83during the CppAD testing; see $cref cmake_check$$.
     84$lend
    4185
    4286$head 05-19$$
  • trunk/omh/example_list.omh

    r3933 r3941  
    131131$rref check_simple_vector.cpp$$
    132132$rref colpack_hes.cpp$$
     133$rref colpack_hessian.cpp$$
    133134$rref colpack_jac.cpp$$
     135$rref colpack_jacobian.cpp$$
    134136$rref compare_change.cpp$$
    135137$rref compare.cpp$$
  • trunk/omh/install/cmake.omh

    r3938 r3941  
    113113    -D cppad_tape_id_type=%cppad_tape_id_type%                               \
    114114    -D cppad_tape_addr_type=%cppad_tape_addr_type%                           \
    115     -D cppad_extra_debug=%cppad_extra_debug% \
    116     -D cppad_deprecated=%cppad_deprecated% \
     115    -D cppad_debug_which=%cppad_debug_which%                                \
     116    -D cppad_deprecated=%cppad_deprecated%                                   \
    117117    \
    118118    ..
     
    253253
    254254$head cppad_cxx_flags$$
    255 This specifies the addition compiler flags,
    256 besides the debug and release flags,
     255This specifies the addition compiler flags
    257256that are used when compiling the CppAD examples and tests.
    258257The default value for these flags is the empty string $code ""$$.
     
    269268(unless it is a Microsoft compiler; i.e., $code _MSC_VER$$ is defined).
    270269
     270$subhead debug and release$$
     271The CppAD examples and tests decide which files to compile for debugging
     272and which to compile for release. Hence debug and release flags should
     273not be included in $icode cppad_cxx_flags$$.
     274See also the
     275$cref/CPPAD_DEBUG_AND_RELEASE
     276        /preprocessor
     277        /Documented Here
     278        /CPPAD_DEBUG_AND_RELEASE
     279/$$
     280compiler flag (which should not be included in $icode cppad_cxx_flags$$).
     281
    271282$head cppad_profile_flag$$
    272283This specifies an addition compiler and link flag that is used
     
    349360$code uint64_t$$.
    350361
    351 $head cppad_extra_debug$$
    352 If this is $code YES$$ and $code NDEBUG$$ is not defined,
    353 CppAD does extra debugging checks.
    354 This extra error checking makes CppAD debug and release object code
    355 incompatible.
    356 
    357 $subhead Under Construction$$
    358 This option is currently under construction.
    359 To be specific, the debug and release object code are not yet compatible
    360 even if $icode cppad_extra_debug$$ is $code NO$$.
     362$head cppad_debug_which$$
     363All of the CppAD examples and test can optionally be tested
     364in debug or release mode (see exception below).
     365This option controls which mode is chosen for the corresponding files.
     366The value $icode cppad_debug_which$$ be one of the following:
     367$code debug_even$$, $code debug_odd$$, $code debug_all$$, $code debug_none$$.
     368If it is $code debug_even$$ ($code debug_odd$$),
     369files with an even (old) index in a list for each case will be compiled
     370in debug mode. The remaining files will be compiled in release mode.
     371If it is $code debug_all$$ ($code debug_none$$),
     372all the files will be compiled in debug (release) mode.
     373If $icode cppad_debug_which$$ does not appear on the command line,
     374the default value $code debug_all$$ is used.
     375
     376$subhead Exception$$
     377The test corresponding to $code make cppad_ipopt_speed$$
     378always get complied in release more (to avoid the extra time
     379it would take to run in debug mode).
     380Note that this test corresponds a deprecated interface; see
     381$cref cppad_ipopt_nlp$$.
    361382
    362383$head cppad_deprecated$$
  • trunk/omh/install/colpack_prefix.omh

    r3875 r3941  
    5656
    5757$children%example/sparse/colpack_jac.cpp
     58        %example/sparse/colpack_jacobian.cpp
    5859        %example/sparse/colpack_hes.cpp
     60        %example/sparse/colpack_hessian.cpp
    5961        %bin/get_colpack.sh
    6062%$$
  • trunk/omh/install/download.omh

    r3938 r3941  
    9696$rnext
    9797current  $cnext EPL $cnext $href%
    98 http://www.coin-or.org/download/source/CppAD/cppad-20170522.epl.tgz%
    99 cppad-20170522.epl.tgz%$$
     98http://www.coin-or.org/download/source/CppAD/cppad-20170601.epl.tgz%
     99cppad-20170601.epl.tgz%$$
    100100$rnext
    101101current  $cnext GPL $cnext $href%
    102 http://www.coin-or.org/download/source/CppAD/cppad-20170522.gpl.tgz%
    103 cppad-20170522.gpl.tgz%$$
     102http://www.coin-or.org/download/source/CppAD/cppad-20170601.gpl.tgz%
     103cppad-20170601.gpl.tgz%$$
    104104$tend
    105105
  • trunk/omh/install/install.omh

    r3921 r3941  
    5555        omh/install/cmake.omh%
    5656        omh/install/cmake_check.omh%
    57         omh/install/pkgconfig.omh%
    58         omh/install/autotools.omh
     57        omh/install/pkgconfig.omh
    5958%$$
     59
     60$head Deprecated$$
     61$cref autotools$$
    6062
    6163
  • trunk/omh/preprocessor.omh

    r3768 r3941  
    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
     
    2221
    2322$head Purpose$$
    24 The CppAD include files define preprocessor symbols all of which begin
     23The CppAD include files defines preprocessor symbols all of which begin
    2524with $code CPPAD_$$.
    2625Note that there are some old, deprecated preprocessor symbols that
     
    3029
    3130$head Documented Here$$
     31
     32$subhead CPPAD_DEBUG_AND_RELEASE$$
     33This flag is an exception because it is defined (or not) by the user when
     34compiling programs that include CppAD source code.
     35If it is defined, less error checking is done and the
     36debug and release versions of CppAD can be mixed in the same program.
     37Of particular note is that $cref thread_alloc$$ does less error checking.
     38For programs that do a lot of memory allocation,
     39this can be a significant time savings when $code NDEBUG$$ is defined.
    3240
    3341$subhead CPPAD_NULL$$
  • trunk/omh/speed/speed.omh

    r3757 r3941  
    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
     
    1514        cppad
    1615        CppAD
    17         Cygwin
    18         Microsoft
    19         chdir
    20         Workspace
    21         dsw
    22         exe
    23         sln
     16        cmake
    2417$$
    2518
     
    4740        Sacado
    4841%$$.
     42
     43$head Debug or Release$$
     44Usually, one wants to compile the speed tests in release mode.
     45This can be done by setting
     46$cref/cppad_debug_which/cmake/cppad_debug_which/$$ to $code debug_none$$
     47in the cmake command.
     48Correctness tests are included for all the speed tests,
     49so it is possible you will want to compile these tests for debugging; i.e.,
     50set $icode cppad_debug_which$$ to $code debug_all$$.
     51
    4952The sections below explain how you can run these tests on your computer.
    5053
  • trunk/speed/CMakeLists.txt

    r3922 r3941  
    99# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1010# -----------------------------------------------------------------------------
    11 
    12 # Specify build type for this directory and all its subdirectories
    13 # (subdirectories do not specify build type).
    14 # Possible values are DEBUG, RELEASE, RelWithDebInfo and MinSizeRel
    15 # CppAD developers can use DEBUG for debugging speed tests.
    16 SET(CMAKE_BUILD_TYPE RELEASE)
    1711
    1812# Initialize list of tests as empty
  • trunk/speed/adolc/CMakeLists.txt

    r3857 r3941  
    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
     
    3231#                 source1 source2 ... sourceN
    3332# )
    34 ADD_EXECUTABLE(speed_adolc EXCLUDE_FROM_ALL ../main.cpp alloc_mat.cpp
     33SET(source_list ../main.cpp alloc_mat.cpp
    3534        det_lu.cpp
    3635        det_minor.cpp
     
    4140        sparse_jacobian.cpp
    4241)
    43 
    44 # Compiler flags for cppad source
    45 add_cppad_cxx_flags( speed_adolc )
     42set_compile_flags( speed_adolc "${cppad_debug_which}" "${source_list}" )
     43#
     44ADD_EXECUTABLE( speed_adolc EXCLUDE_FROM_ALL ${source_list} )
    4645
    4746# List of libraries to be linked into the specified target
  • trunk/speed/adolc/makefile.in

    r3939 r3941  
    284284cppad_description = @cppad_description@
    285285cppad_eigenvector = @cppad_eigenvector@
    286 cppad_extra_debug_01 = @cppad_extra_debug_01@
    287286cppad_has_adolc = @cppad_has_adolc@
    288287cppad_has_boost = @cppad_has_boost@
  • trunk/speed/cppad/CMakeLists.txt

    r3857 r3941  
    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
     
    2423#                 source1 source2 ... sourceN
    2524# )
    26 ADD_EXECUTABLE(speed_cppad EXCLUDE_FROM_ALL ../main.cpp
     25SET(source_list ../main.cpp
    2726        det_lu.cpp
    2827        det_minor.cpp
     
    3332        sparse_jacobian.cpp
    3433)
    35 
    36 # Compiler flags for cppad source
    37 add_cppad_cxx_flags( speed_cppad )
     34# 2DO: fix problem with the test
     35#       ./speed_cppad sparse_hessian 123 colpack
     36# when speed_cppad is compiled for debugging.
     37set_compile_flags( speed_cppad "${cppad_debug_which}" "${source_list}" )
     38#
     39ADD_EXECUTABLE( speed_cppad EXCLUDE_FROM_ALL ${source_list} )
    3840
    3941# List of libraries to be linked into the specified target
  • trunk/speed/cppad/makefile.in

    r3939 r3941  
    271271cppad_description = @cppad_description@
    272272cppad_eigenvector = @cppad_eigenvector@
    273 cppad_extra_debug_01 = @cppad_extra_debug_01@
    274273cppad_has_adolc = @cppad_has_adolc@
    275274cppad_has_boost = @cppad_has_boost@
  • trunk/speed/cppad/sparse_hessian.cpp

    r3876 r3941  
    147147# if CPPAD_HAS_COLPACK
    148148        if( global_option["colpack"] )
    149                 coloring = "colpack.star";
     149                coloring = "colpack.symmetric";
    150150# endif
    151151        // -----------------------------------------------------------------------
  • trunk/speed/double/CMakeLists.txt

    r3857 r3941  
    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
     
    2423#                 source1 source2 ... sourceN
    2524# )
    26 ADD_EXECUTABLE(speed_double EXCLUDE_FROM_ALL ../main.cpp
     25SET(source_list ../main.cpp
    2726        det_lu.cpp
    2827        det_minor.cpp
     
    3332        sparse_jacobian.cpp
    3433)
    35 
    36 # Compiler flags for cppad source
    37 add_cppad_cxx_flags( speed_double )
     34set_compile_flags( speed_double "${cppad_debug_which}" "${source_list}" )
     35#
     36ADD_EXECUTABLE( speed_double EXCLUDE_FROM_ALL ${source_list} )
    3837
    3938# double does not use any external library
  • trunk/speed/double/makefile.in

    r3939 r3941  
    271271cppad_description = @cppad_description@
    272272cppad_eigenvector = @cppad_eigenvector@
    273 cppad_extra_debug_01 = @cppad_extra_debug_01@
    274273cppad_has_adolc = @cppad_has_adolc@
    275274cppad_has_boost = @cppad_has_boost@
  • trunk/speed/example/CMakeLists.txt

    r3857 r3941  
    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
     
    1817# We do not add ../src/speed_src library to avoid undefined externals.
    1918# Instead we build our own copy of ../src/microsoft_timer.cpp.
    20 ADD_EXECUTABLE(speed_example EXCLUDE_FROM_ALL example.cpp
     19SET(source_list example.cpp
    2120        det_by_lu.cpp
    2221        det_by_minor.cpp
     
    3130        "../src/microsoft_timer.cpp"
    3231)
    33 
    34 # Compiler flags for cppad source
    35 add_cppad_cxx_flags( speed_example )
     32set_compile_flags( speed_example "${cppad_debug_which}" "${source_list}" )
     33#
     34ADD_EXECUTABLE( speed_example EXCLUDE_FROM_ALL ${source_list} )
    3635
    3736# Add the check_speed_example target
  • trunk/speed/example/makefile.in

    r3939 r3941  
    287287cppad_description = @cppad_description@
    288288cppad_eigenvector = @cppad_eigenvector@
    289 cppad_extra_debug_01 = @cppad_extra_debug_01@
    290289cppad_has_adolc = @cppad_has_adolc@
    291290cppad_has_boost = @cppad_has_boost@
  • trunk/speed/fadbad/CMakeLists.txt

    r3857 r3941  
    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
     
    3130#                 source1 source2 ... sourceN
    3231# )
    33 ADD_EXECUTABLE(speed_fadbad EXCLUDE_FROM_ALL ../main.cpp
     32SET(source_list ../main.cpp
    3433        det_lu.cpp
    3534        det_minor.cpp
     
    4039        sparse_jacobian.cpp
    4140)
    42 
    43 # Compiler flags for cppad source
    44 add_cppad_cxx_flags( speed_fadbad )
     41set_compile_flags( speed_fadbad "${cppad_debug_which}" "${source_list}" )
     42#
     43ADD_EXECUTABLE( speed_fadbad EXCLUDE_FROM_ALL ${source_list} )
    4544
    4645# fadbad is an include file only library
  • trunk/speed/fadbad/makefile.in

    r3939 r3941  
    272272cppad_description = @cppad_description@
    273273cppad_eigenvector = @cppad_eigenvector@
    274 cppad_extra_debug_01 = @cppad_extra_debug_01@
    275274cppad_has_adolc = @cppad_has_adolc@
    276275cppad_has_boost = @cppad_has_boost@
  • trunk/speed/profile/CMakeLists.txt

    r3857 r3941  
    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
     
    2726#                 source1 source2 ... sourceN
    2827# )
    29 ADD_EXECUTABLE(speed_profile EXCLUDE_FROM_ALL ../main.cpp
     28SET(source_list ../main.cpp
    3029        ../cppad/ode.cpp
    3130        ../cppad/det_lu.cpp
     
    4443        ../src/microsoft_timer.cpp
    4544)
    46 
    47 # Compiler flags for cppad source
    48 add_cppad_cxx_flags( speed_profile )
     45set_compile_flags( speed_profile "${cppad_debug_which}" "${source_list}" )
     46#
     47ADD_EXECUTABLE( speed_profile EXCLUDE_FROM_ALL ${source_list} )
    4948
    5049# profile builds it own copy of src/speed library (see ADD_EXECUTABLE above)
  • trunk/speed/profile/makefile.in

    r3939 r3941  
    275275cppad_description = @cppad_description@
    276276cppad_eigenvector = @cppad_eigenvector@
    277 cppad_extra_debug_01 = @cppad_extra_debug_01@
    278277cppad_has_adolc = @cppad_has_adolc@
    279278cppad_has_boost = @cppad_has_boost@
  • trunk/speed/sacado/CMakeLists.txt

    r3857 r3941  
    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
     
    3130#                 source1 source2 ... sourceN
    3231# )
    33 ADD_EXECUTABLE(speed_sacado EXCLUDE_FROM_ALL ../main.cpp
     32SET(source_list ../main.cpp
    3433        det_lu.cpp
    3534        det_minor.cpp
     
    4039        sparse_jacobian.cpp
    4140)
     41set_compile_flags( speed_sacado "${cppad_debug_which}" "${source_list}" )
     42#
     43ADD_EXECUTABLE( speed_sacado EXCLUDE_FROM_ALL ${source_list} )
    4244
    43 # Compiler flags for cppad source
    44 add_cppad_cxx_flags( speed_sacado )
    45 
    46 # Find name used for teuchos library
    47 SET(teuchos_lib NOTFOUND)
    48 FOREACH(dir ${cmake_install_libdirs})
    49         FILE(GLOB file_list ${sacado_prefix}/${dir}/libteuchoscore.*)
    50         IF(file_list)
    51                 SET(teuchos_lib teuchoscore)
    52         ENDIF(file_list)
    53         FILE(GLOB file_list ${sacado_prefix}/${dir}/libteuchos.*)
    54         IF(file_list)
    55                 SET(teuchos_lib teuchos)
    56         ENDIF(file_list)
    57 ENDFOREACH(dir)
    58 
    59 # List of libraries to be linked into the specified target
    60 IF(teuchos_lib)
    61         TARGET_LINK_LIBRARIES(speed_sacado speed_src sacado ${teuchos_lib})
    62 ELSE(teuchos_lib)
    63         MESSAGE(FATAT_ERROR
    64 "
    65 For all dir in cmake_install_libdirs, cannot find either
    66         sacado_prefix/dir/teuchos
    67         sacado_prefix/dir/teuchoscore
    68 where
    69         sacado_prefix = ${sacado_prefix}
    70         cmake_install_libdirs = ${cmake_install_libdirs}
    71         teuchos_lib= ${teuchos_lib}
    72 "
     45# determine libraries necessary to link Sacado
     46SET(config_file "${sacado_prefix}/include/Makefile.export.Sacado")
     47IF(NOT EXISTS ${config_file})
     48        MESSAGE(FATAL_ERROR
     49"the file sacado_prefix/include/Makefile.export.Sacado does not exist
     50where sacado_prefix=${sacado_prefix}"
    7351        )
    74 ENDIF(teuchos_lib)
     52ENDIF(NOT EXISTS ${config_file})
     53SET(cmd "grep" "Sacado_LIBRARIES=" "${config_file}")
     54EXECUTE_PROCESS(
     55        COMMAND         ${cmd}
     56        OUTPUT_VARIABLE temp1
     57)
     58STRING(REGEX REPLACE "Sacado_LIBRARIES= *-l" "" temp2  ${temp1})
     59STRING(STRIP ${temp2} temp3)
     60STRING(REGEX REPLACE " *-l" ";" sacado_lib_list ${temp3})
     61#
     62# include the dl library if it is in the system path
     63CHECK_LIBRARY_EXISTS( dl dlopen "${CMAKE_SYSTEM_LIBRARY_PATH}" dl_found )
     64IF( dl_found )
     65        TARGET_LINK_LIBRARIES(speed_sacado speed_src ${sacado_lib_list} dl)
     66ELSE( dl_found )
     67        TARGET_LINK_LIBRARIES(speed_sacado speed_src ${sacado_lib_list})
     68ENDIF( dl_found )
    7569#
    7670# Add the check_speed_sacado target
  • trunk/speed/sacado/makefile.am

    r3757 r3941  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
     
    3737# END DEBUG
    3838#
    39 LDADD            = -lspeed -lsacado -lteuchoscore
     39# include Sacado_LIBRARIES in SACADO_DIR/include/Makefile.export.Sacado
     40LDADD  = \
     41        -lspeed \
     42        -lsacado \
     43        -lteuchoskokkoscomm \
     44        -lteuchoskokkoscompat \
     45        -lteuchosremainder \
     46        -lteuchosnumerics \
     47        -lteuchoscomm \
     48        -lteuchosparameterlist \
     49        -lteuchoscore \
     50        -lkokkoscore \
     51        -lsacado \
     52        -lteuchoscore
    4053AM_LDFLAGS       = -L../src -L$(SACADO_DIR)/lib -L$(SACADO_DIR)/lib64
    4154#
  • trunk/speed/sacado/makefile.in

    r3939 r3941  
    272272cppad_description = @cppad_description@
    273273cppad_eigenvector = @cppad_eigenvector@
    274 cppad_extra_debug_01 = @cppad_extra_debug_01@
    275274cppad_has_adolc = @cppad_has_adolc@
    276275cppad_has_boost = @cppad_has_boost@
     
    337336# $Id$
    338337# -----------------------------------------------------------------------------
    339 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     338# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
    340339#
    341340# CppAD is distributed under multiple licenses. This distribution is under
     
    367366# END DEBUG
    368367#
    369 LDADD = -lspeed -lsacado -lteuchoscore
     368# include Sacado_LIBRARIES in SACADO_DIR/include/Makefile.export.Sacado
     369LDADD = \
     370        -lspeed \
     371        -lsacado \
     372        -lteuchoskokkoscomm \
     373        -lteuchoskokkoscompat \
     374        -lteuchosremainder \
     375        -lteuchosnumerics \
     376        -lteuchoscomm \
     377        -lteuchosparameterlist \
     378        -lteuchoscore \
     379        -lkokkoscore \
     380        -lsacado \
     381        -lteuchoscore
     382
    370383AM_LDFLAGS = -L../src -L$(SACADO_DIR)/lib -L$(SACADO_DIR)/lib64
    371384#
  • trunk/speed/src/CMakeLists.txt

    r3853 r3941  
    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
     
    1817# Make libspeed_src a static library because this is just for testing
    1918# and is not installed (do not have to worry about library search path).
    20 ADD_LIBRARY(speed_src STATIC EXCLUDE_FROM_ALL
     19SET(source_list
    2120        link_det_lu.cpp
    2221        link_det_minor.cpp
     
    2827        microsoft_timer.cpp
    2928)
     29# 2DO: fix problem with the test
     30#       ./speed_cppad sparse_hessian 123 colpack
     31# when speed_cppad is compiled for debugging.
     32#
     33set_compile_flags( speed_src "${cppad_debug_which}" "${source_list}" )
     34#
     35ADD_LIBRARY(speed_src STATIC EXCLUDE_FROM_ALL ${source_list} )
    3036
    31 # Compiler flags for cppad source
    32 add_cppad_cxx_flags( speed_src )
  • trunk/speed/src/makefile.in

    r3939 r3941  
    290290cppad_description = @cppad_description@
    291291cppad_eigenvector = @cppad_eigenvector@
    292 cppad_extra_debug_01 = @cppad_extra_debug_01@
    293292cppad_has_adolc = @cppad_has_adolc@
    294293cppad_has_boost = @cppad_has_boost@
  • trunk/test_more/compare_c/CMakeLists.txt

    r3935 r3941  
    3636# $end
    3737# -----------------------------------------------------------------------------
    38 
    39 # Specifies build type for this directory. Possible values are
    40 # empty, Debug, Release, RelWithDebInfo and MinSizeRel
    41 SET(CMAKE_BUILD_TYPE RELEASE)
    42 
     38#
     39# use cppad_debug_which to determine build type
     40IF( "${cppad_debug_which}" STREQUAL debug_all )
     41        SET(CMAKE_BUILD_TYPE DEBUG)
     42ELSEIF( "${cppad_debug_which}" STREQUAL debug_odd )
     43        SET(CMAKE_BUILD_TYPE DEBUG)
     44ELSE( "${cppad_debug_which}" STREQUAL debug_odd )
     45        SET(CMAKE_BUILD_TYPE RELEASE)
     46ENDIF( "${cppad_debug_which}" STREQUAL debug_all )
     47#
    4348# Loop though the C and C++ compilers
    4449FOREACH( com c cpp )
  • trunk/test_more/compare_c/makefile.in

    r3939 r3941  
    282282cppad_description = @cppad_description@
    283283cppad_eigenvector = @cppad_eigenvector@
    284 cppad_extra_debug_01 = @cppad_extra_debug_01@
    285284cppad_has_adolc = @cppad_has_adolc@
    286285cppad_has_boost = @cppad_has_boost@
  • trunk/test_more/debug_rel/CMakeLists.txt

    r3938 r3941  
    1111# Build the test_more/general tests
    1212
    13 # set debugging compiler flags for debug_rel.cpp and debug.cpp
    14 SET(debug_flags "${cppad_cxx_flags} ${CMAKE_CXX_FLAGS_DEBUG}")
     13# set compiler flags for debug_rel.cpp and debug.cpp
    1514SET_SOURCE_FILES_PROPERTIES(
    16         debug_rel.cpp debug.cpp PROPERITIES COMPILE_FLAGS "${debug_flags}"
     15        debug_rel.cpp debug.cpp PROPERITIES COMPILE_FLAGS
     16        "${cppad_cxx_flags} ${CMAKE_CXX_FLAGS_DEBUG} -DCPPAD_DEBUG_AND_RELEASE"
    1717)
    1818
    19 # If doing extra debugging, set compiler flags for release to debug_flags,
    20 # otherwise set them to release_flags.
    21 SET(release_flags "${cppad_cxx_flags} ${CMAKE_CXX_FLAGS_RELEASE}")
    22 IF( cppad_extra_debug )
    23         SET_SOURCE_FILES_PROPERTIES(
    24                 release.cpp PROPERITIES COMPILE_FLAGS "${debug_flags}"
    25         )
    26 ELSE( cppad_extra_debug )
    27         SET_SOURCE_FILES_PROPERTIES(
    28                 release.cpp PROPERITIES COMPILE_FLAGS "${release_flags}"
    29         )
    30 ENDIF( cppad_extra_debug )
     19# et compiler flags for release,cpp
     20SET_SOURCE_FILES_PROPERTIES(
     21        release.cpp PROPERITIES COMPILE_FLAGS
     22        "${cppad_cxx_flags} ${CMAKE_CXX_FLAGS_RELEASE} -DCPPAD_DEBUG_AND_RELEASE"
     23)
    3124
    3225# now that we have the properties, add the executable
  • trunk/test_more/debug_rel/debug.cpp

    r3938 r3941  
    2020        return ok;
    2121}
     22
     23// just use ADFun<double> constructor
     24void debug_adfun_ctor(void)
     25{
     26        CppAD::vector< CppAD::AD<double> > ax(1), ay(1);
     27        ax[0] = 0.;
     28        CppAD::Independent(ax);
     29        ay[0] = fabs(ax[0]);
     30        CppAD::ADFun<double> f(ax, ay);
     31        return;
     32}
  • trunk/test_more/debug_rel/debug_rel.cpp

    r3938 r3941  
    4040bool      debug_thread_alloc(double* d_ptr);
    4141
     42// adfun_ctor
     43void debug_adfun_ctor(void);
     44void release_adfun_ctor(void);
     45
    4246// main program that runs all the tests
    4347int main(void)
     
    4953                bool ok       = debug_thread_alloc(d_ptr);
    5054                print_test(ok, "thead_alloc");
     55        }
     56        // adfun_ctor
     57        {       // this test would fail with an assert during release_adfun_ctor
     58                release_adfun_ctor();
     59                debug_adfun_ctor();
     60                bool ok = true;
     61                print_test(ok, "adfun_ctor");
    5162        }
    5263        // memory
  • trunk/test_more/debug_rel/release.cpp

    r3938 r3941  
    2121        return d_ptr;
    2222}
     23
     24// just use ADFun<double> constructor
     25void release_adfun_ctor(void)
     26{
     27        CppAD::vector< CppAD::AD<double> > ax(1), ay(1);
     28        ax[0] = 0.;
     29        CppAD::Independent(ax);
     30        ay[0] = fabs(ax[0]);
     31        CppAD::ADFun<double> f(ax, ay);
     32        return;
     33}
  • trunk/test_more/general/CMakeLists.txt

    r3935 r3941  
    1010# -----------------------------------------------------------------------------
    1111# Build the test_more/general tests
    12 
    13 # Specifies build type for test_more/general
    14 SET(CMAKE_BUILD_TYPE DEBUG)
    15 
     12#
    1613# adolc_sources, adolc_libs
    1714IF( cppad_has_adolc )
     
    2219        SET(adolc_libs "")
    2320ENDIF( cppad_has_adolc )
    24 
     21#
    2522# eigen_sources
    2623IF( cppad_has_eigen )
     
    2926        SET(eigen_sources "")
    3027ENDIF( cppad_has_eigen )
    31 
     28#
    3229# ipopt_prefix
    3330IF( cppad_has_ipopt )
     
    3835        SET(ipopt_libs "")
    3936ENDIF( cppad_has_ipopt )
    40 
    41 ADD_EXECUTABLE(test_more_general EXCLUDE_FROM_ALL general.cpp
     37#
     38SET(source_list
    4239        ${adolc_sources}
    4340        ${eigen_sources}
    4441        ${ipopt_sources}
     42        general.cpp
    4543        fabs.cpp
    4644        acos.cpp
     
    138136        local/vector_set.cpp
    139137)
    140 
     138set_compile_flags( test_more_general "${cppad_debug_which}" "${source_list}" )
     139#
     140ADD_EXECUTABLE(test_more_general EXCLUDE_FROM_ALL ${source_list})
     141#
    141142# must first build cppad_lib
    142143ADD_DEPENDENCIES(test_more_general cppad_lib)
    143 
     144#
    144145# Compiler flags for cppad source
    145146add_cppad_cxx_flags(test_more_general)
    146 
     147#
    147148# List of libraries to be linked into the specified target
    148149TARGET_LINK_LIBRARIES(test_more_general
     
    152153        ${colpack_libs}
    153154)
    154 
     155#
    155156# Add the check_test_more_general target
    156157ADD_CUSTOM_TARGET(check_test_more_general
     
    160161)
    161162MESSAGE(STATUS "make check_test_more_general: available")
    162 
     163#
    163164# Change check depends in parent environment
    164165add_to_list(check_test_more_depends check_test_more_general)
  • trunk/test_more/general/checkpoint.cpp

    r3932 r3941  
    1717
    1818        bool f_algo(const ADVector& x, ADVector& y)
    19         {       size_t n = x.size();
    20                 size_t m = y.size();
    21                 assert( n == m + 1);
     19        {       size_t m = y.size();
     20                assert( size_t(x.size()) == m + 1);
    2221                for(size_t i = 0; i < m; i++)
    2322                        y[i] = x[i] * x[i+1];
     
    2524        }
    2625        bool g_algo(const ADVector& y, ADVector& z)
    27         {       size_t n = y.size();
    28                 size_t m = z.size();
    29                 assert( n + 1 == m );
     26        {       size_t m = z.size();
     27                assert( size_t(y.size()) + 1 == m );
    3028                z[0] = 0.0;
    3129                for(size_t i = 1; i < m; i++)
  • trunk/test_more/general/forward.cpp

    r3932 r3941  
    186186}
    187187
     188# ifndef NDEBUG
     189# ifndef CPPAD_DEBUG_AND_RELEASE
    188190void my_error_handler(
    189191        bool known           ,
     
    231233        return ok;
    232234}
     235# endif
     236# endif
    233237} // END empty namespace
    234238
     
    242246        ok &= ForwardOlder();
    243247# ifndef NDEBUG
     248# ifndef CPPAD_DEBUG_AND_RELEASE
    244249        // CppAD does not check for nan when NDEBUG is defined
    245250        ok &= forward_nan();
    246251# endif
    247         return ok;
    248 }
     252# endif
     253        return ok;
     254}
  • trunk/test_more/general/makefile.in

    r3939 r3941  
    378378cppad_description = @cppad_description@
    379379cppad_eigenvector = @cppad_eigenvector@
    380 cppad_extra_debug_01 = @cppad_extra_debug_01@
    381380cppad_has_adolc = @cppad_has_adolc@
    382381cppad_has_boost = @cppad_has_boost@
  • trunk/test_more/general/sparse_sub_hes.cpp

    r3932 r3941  
    131131                        ok &= hes[ell] == 2.0 * x[i];
    132132                }
    133                 ell++;
    134133        }
    135134        return ok;
     
    207206                        ok &= hes[ell] == 2.0 * x[i];
    208207                }
    209                 ell++;
    210208        }
    211209        return ok;
Note: See TracChangeset for help on using the changeset viewer.