Changeset 3614


Ignore:
Timestamp:
Jan 24, 2015 2:08:16 PM (5 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 8c08938a11089ec844c1e781799f8a83a7ca11f8
end hash code: 978735a7ae061e368f3df3ba16390458f1b473b2

commit 978735a7ae061e368f3df3ba16390458f1b473b2
Author: Brad Bell <bradbell@…>
Date: Sat Jan 24 12:02:49 2015 -0700

CMakeLists.txt: Change sense of test so Success is what one usually wants.

commit 6fafdaaffe31746b85e5e2ec4b452d9c9d30b254
Author: Brad Bell <bradbell@…>
Date: Sat Jan 24 11:31:26 2015 -0700

new_release.sh: copy of stable/2015000.3 release version.

commit 1bc228d1c24542b2c4b66ef51e485e4cc3737a14
Author: Brad Bell <bradbell@…>
Date: Sat Jan 24 07:30:41 2015 -0700

whats_new_15.omh: User's view of change a8fa46dfc6 commit.

commit d21e454c5c98afc2f686b6e2eb77be03590abecd
Author: Brad Bell <bradbell@…>
Date: Sat Jan 24 06:29:34 2015 -0700

sparse_list.hpp: Change Element -> pair_size_t (elements are size_t), fix use of typename outside of template.
whats_new_15.omh: User's view of changes yesterday.

commit 6e21da85b94ec563a413129ba2c2d82b6df673ba
Author: Brad Bell <bradbell@…>
Date: Fri Jan 23 13:20:55 2015 -0700

check_source_runs.cmake: result is a global, so make it different for each call to this function.

commit fa45110b304a9ad76e9b9f589bce8b970a4580d4
Author: Brad Bell <bradbell@…>
Date: Fri Jan 23 11:44:20 2015 -0700

check_source_runs.cmake: CHECK_CXX_SOURCE_RUNS seems to need "" in place of NOTFOUND (for some machines).
ad_fun.hpp: minor correction ot spelling in comments.

commit aedab8d9cb41c2026bfdef12b8b494cc9af36e03
Author: Brad Bell <bradbell@…>
Date: Fri Jan 23 08:16:43 2015 -0700

run_cmake.sh: add --no_sparse_list option.

commit 5837079bd4253fbf8342c51b3fd3dd88a908d7e2
Author: Brad Bell <bradbell@…>
Date: Fri Jan 23 06:53:03 2015 -0700

sparse_list.hpp: declare that Element is a pod type, avoid reallocation of data_tmp.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/new_release.sh

    r3593 r3614  
    2222}
    2323# -----------------------------------------------------------------------------
    24 repository="https://projects.coin-or.org/svn/CppAD"
     24svn_repository="https://projects.coin-or.org/svn/CppAD"
    2525stable_version="20150000"
    26 release='2'
     26release='3'
    2727release_version="$stable_version.$release"
    2828# -----------------------------------------------------------------------------
    2929# Check release version
    30 if svn list $repository/releases | grep "$release_version" > /dev/null
     30if svn list $svn_repository/releases | grep "$release_version" > /dev/null
    3131then
    3232        echo bin/"new_release.sh: Release number $release_version already exists."
     
    3939echo_eval git checkout stable/$stable_version
    4040# -----------------------------------------------------------------------------
    41 #
     41# check that local branch is up to date
     42list=`git status -s`
     43if [ "$list" != '' ]
     44then
     45        echo "new_release.sh: 'git status -s' is not empty"
     46        exit 1
     47fi
     48# -----------------------------------------------------------------------------
     49# check that remote branch agrees with local branch
     50local_hash=`git show-ref stable/$stable_version | \
     51        grep "refs/heads/stable/$stable_version" | \
     52        sed -e "s| *refs/heads/stable/$stable_version||"`
     53remote_hash=`git show-ref stable/$stable_version | \
     54        grep "refs/remotes/origin/stable/$stable_version" | \
     55        sed -e "s| *refs/remotes/origin/stable/$stable_version||"`
     56if [ "$local_hash" != "$remote_hash" ]
     57then
     58        echo_eval git show-ref stable/$stable_version
     59        echo 'new_release.sh: exiting because local and remote branch differ'
     60        exit 1
     61fi
     62# -----------------------------------------------------------------------------
    4263check_one=`bin/version.sh get`
    4364echo_eval git checkout doc.omh
     
    5172        echo '  bin/version.sh copy'
    5273        echo 'Then test and then commit the changes.'
    53         echo 'Then push changes to github.'
     74fi
     75# -----------------------------------------------------------------------------
     76svn_hash=`svn log $svn_repository/stable/$stable_version --stop-on-copy | \
     77        grep 'end *hash *code:' | head -1 | sed -e 's|end *hash *code: *||'`
     78if [ "$svn_hash" != "$remote_hash" ]
     79then
     80        echo "svn hash code = $svn_hash"
     81        echo "git hash code = $remote_hash"
    5482        echo 'Then execute the following command:'
    55         echo "  bin/push_git2svn.sh stable/$stable_version"
     83        echo "  bin/push_git2svn.py stable/$stable_version"
    5684        exit 1
    5785fi
     
    6391fi
    6492git tag -a \
    65         -m "corresponds $repository/releases/$release_version" \
     93        -m "corresponds $svn_repository/releases/$release_version" \
    6694        $release_version
    6795# -----------------------------------------------------------------------------
    6896msg="Creating releases/$release_version"
    69 rep_stable="$repository/stable/$stable_version"
    70 rep_release="$repository/releases/$release_version"
     97rep_stable="$svn_repository/stable/$stable_version"
     98rep_release="$svn_repository/releases/$release_version"
    7199echo_eval svn copy $rep_stable $rep_release -m \"$msg\"
    72100# -----------------------------------------------------------------------------
     
    76104fi
    77105echo_eval cd build
    78 echo_eval svn checkout $repository/conf conf
     106echo_eval svn checkout $svn_repository/conf conf
    79107#
    80108echo_eval cd conf
  • trunk/bin/run_cmake.sh

    r3583 r3614  
    2929clang='no'
    3030no_colpack='no'
     31no_sparse_list='no'
    3132testvector='boost'
    3233while [ "$1" != "" ]
     
    4344        [--clang ] \\
    4445        [--no_colpack] \\
     46        [--no_sparse_list] \\
    4547        [--<package>_vector]
    4648The --help option just prints this message and exits.
     
    6971        then
    7072                no_colpack='yes'
     73        elif [ "$1" == '--no_sparse_list' ]
     74        then
     75                no_sparse_list='yes'
    7176        elif [ "$1" == '--cppad_vector' ]
    7277        then
     
    153158done
    154159#
     160# sparse_list
     161if [ "$no_sparse_list" == 'yes' ]
     162then
     163        cmake_args="$cmake_args -D cppad_sparse_list=NO"
     164else
     165        cmake_args="$cmake_args -D cppad_sparse_list=YES"
     166fi
     167#
    155168# cppad_cxx_flags
    156169cppad_cxx_flags="-Wall -pedantic-errors -std=$standard"
     
    170183# simple options
    171184cmake_args="$cmake_args -D cppad_implicit_ctor_from_any_type=NO"
    172 cmake_args="$cmake_args -D cppad_sparse_list=YES"
    173185cmake_args="$cmake_args -D cppad_testvector=$testvector"
    174186cmake_args="$cmake_args -D cppad_tape_id_type='int32_t'"
  • trunk/cmake/check_source_runs.cmake

    r3608 r3614  
    2121#
    2222MACRO(check_source_runs source variable)
    23         SET(CMAKE_REQUIRED_INCLUDES  "")
    24         SET(CMAKE_REQUIRED_LIBRARIES "")
    25         SET(CMAKE_REQUIRED_DEFINITIONS "")
    26         SET(CMAKE_REQUIRED_FLAGS     ${cppad_cxx_flags} )
    27         CHECK_CXX_SOURCE_RUNS("${source}" result)
    28         IF( result )
     23        SET(CMAKE_REQUIRED_INCLUDES    "" )
     24        SET(CMAKE_REQUIRED_LIBRARIES   "" )
     25        SET(CMAKE_REQUIRED_DEFINITIONS "" )
     26        IF( cppad_cxx_flags )
     27                SET(CMAKE_REQUIRED_FLAGS   "${cppad_cxx_flags}" )
     28        ELSE( cppad_cxx_flags )
     29                SET(CMAKE_REQUIRED_FLAGS   "" )
     30        ENDIF( cppad_cxx_flags )
     31        CHECK_CXX_SOURCE_RUNS("${source}" ${variable}_result)
     32        IF( ${variable}_result )
    2933                SET(${variable} 1)
    30         ELSE( result )
     34        ELSE( ${variable}_result )
    3135                SET(${variable} 0)
    32         ENDIF( result )
     36        ENDIF( ${variable}_result )
    3337        MESSAGE(STATUS "${variable} = ${${variable}}" )
    3438ENDMACRO( check_source_runs )
  • trunk/cppad/CMakeLists.txt

    r3531 r3614  
    1 # $Id:$
     1# $Id$
    22# -----------------------------------------------------------------------------
    33# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     
    188188# include <limits>
    189189int main(void)
    190 {       bool is_signed = std::numeric_limits<${${cmake_var}}>::is_signed;
    191         return int(! is_signed);
     190{       bool is_unsigned = ! std::numeric_limits<${${cmake_var}}>::is_signed;
     191        return int(! is_unsigned);
    192192}
    193193"
    194194        )
    195         check_source_runs("${source}" ${cmake_var}_is_signed)
    196         IF( ${cmake_var}_is_signed STREQUAL 1  )
     195        check_source_runs("${source}" ${cmake_var}_is_unsigned)
     196        IF( ${cmake_var}_is_unsigned STREQUAL 0  )
    197197                MESSAGE(STATUS
    198 "Warning: using a signed ${cmake_var} (for CppAD developers not users)"
     198"Warning: using a signed ${cmake_var} is for CppAD developers only !"
    199199        )
    200         ENDIF( ${cmake_var}_is_signed STREQUAL 1  )
     200        ENDIF( ${cmake_var}_is_unsigned STREQUAL 0  )
    201201ENDFOREACH( cmake_var )
    202202# -----------------------------------------------------------------------------
  • trunk/cppad/local/ad_fun.hpp

    r3607 r3614  
    324324        );
    325325
    326         /// amount of memeory used for Jacobain sparsity pattern
     326        /// amount of memory used for Jacobain sparsity pattern
    327327        size_t size_forward_bool(void) const
    328328        {       return for_jac_sparse_pack_.memory(); }
    329329
    330         /// free memeory used for Jacobain sparsity pattern
     330        /// free memory used for Jacobain sparsity pattern
    331331        void size_forward_bool(size_t zero)
    332332        {       CPPAD_ASSERT_KNOWN(
     
    341341        {       return for_jac_sparse_set_.number_elements(); }
    342342
    343         /// free memeory used for Jacobain sparsity pattern
     343        /// free memory used for Jacobain sparsity pattern
    344344        void size_forward_set(size_t zero)
    345345        {       CPPAD_ASSERT_KNOWN(
  • trunk/cppad/local/sparse_list.hpp

    r3608 r3614  
    2727*/
    2828class sparse_list {
    29 private:
     29public:
    3030        /// type used for each set in the vector of sets
    3131        /// (note that next is index in data_ for next element in this set).
    32         struct Element { size_t value; size_t next; };
    33 
     32        struct pair_size_t { size_t value; size_t next; };
     33private:
     34        // -----------------------------------------------------------------
    3435        /// Number of sets that we are representing
    3536        /// (set by constructor and resize).
     
    4041
    4142        /// The data for all the elements in all the sets
    42         CppAD::pod_vector<Element> data_;
     43        CppAD::pod_vector<pair_size_t> data_;
    4344
    4445        /// next element
    45         Element next_element_;
     46        pair_size_t next_pair_;
    4647
    4748        /// number of elements in data_ that are no longer being used.
    4849        size_t data_not_used_;
    49 private:
     50
     51        /// temporary data vector used for garbage collection
     52        CppAD::pod_vector<pair_size_t> data_tmp_;
    5053        // -----------------------------------------------------------------
    5154        /*! Private member function that counts number of elements in a set.
     
    7982                );
    8083
    81                 // copy the sets to a new data vector
    82                 pod_vector<Element> data_new;
    83                 data_new.extend(n_set_);
     84                // copy the sets to a temporary data vector
     85                data_tmp_.erase();
     86                data_tmp_.extend(n_set_);
    8487                for(size_t i = 0; i < n_set_; i++)
    8588                {       size_t next     = i;
    86                         size_t next_new = i;
     89                        size_t next_tmp = i;
    8790                        //
    8891                        size_t value    = data_[next].value;
    8992                        while( value < end_ )
    90                         {       data_new[next_new].value = value;       
    91                                 // data_new[next_new].next  = data_new.extend(1);
     93                        {       data_tmp_[next_tmp].value = value;     
     94                                // data_tmp_[next_tmp].next  = data_tmp_.extend(1);
    9295                                // does not seem to work ?
    93                                 size_t index_new         = data_new.extend(1);
    94                                 data_new[next_new].next  = index_new;
     96                                size_t index_tmp         = data_tmp_.extend(1);
     97                                data_tmp_[next_tmp].next = index_tmp;
    9598                                //
    9699                                next                     = data_[next].next;
    97                                 next_new                 = data_new[next_new].next;
     100                                next_tmp                 = data_tmp_[next_tmp].next;
    98101                                //
    99102                                value                    = data_[next].value;
    100103                        }
    101                         data_new[next_new].value = end_;
     104                        data_tmp_[next_tmp].value = end_;
    102105                }
    103106                CPPAD_ASSERT_UNKNOWN(
    104                         data_new.size() + data_not_used_ == data_.size()
     107                        data_tmp_.size() + data_not_used_ == data_.size()
    105108                );
    106109
    107                 // swap the new and old data vectors
    108                 data_.swap(data_new);
     110                // swap the tmp and old data vectors
     111                data_.swap(data_tmp_);
    109112
    110113                // all of the elements are used in this new version of data_
    111114                data_not_used_ = 0;
    112115        }
    113 
    114116public:
    115117        // -----------------------------------------------------------------
     
    120122        end_(0)                   ,
    121123        data_not_used_(0)
    122         {       next_element_.value = end_; }
     124        {       next_pair_.value = end_; }
    123125        // -----------------------------------------------------------------
    124126        /*! Using copy constructor is a programing (not user) error
     
    152154        {       n_set_                 = n_set_in;
    153155                end_                   = end_in;
    154                 next_element_.value    = end_in;
     156                next_pair_.value       = end_in;
    155157                data_not_used_         = 0;
    156158                if( n_set_in == 0 )
     
    251253        {       // initialize element to search for in this set
    252254                CPPAD_ASSERT_UNKNOWN( index < n_set_ );
    253                 next_element_  = data_[index];
     255                next_pair_  = data_[index];
    254256
    255257                return;
     
    268270        */
    269271        size_t next_element(void)
    270         {       size_t element = next_element_.value;
     272        {       size_t element = next_pair_.value;
    271273                if( element != end_ )
    272                         next_element_ = data_[next_element_.next];
     274                        next_pair_ = data_[next_pair_.next];
    273275
    274276                return element;
     
    466468        {       return end_; }
    467469};
     470// Tell pod_vector class that each pair_size_t is plain old data and hence
     471// the corresponding constructor need not be called.
     472template <> inline bool is_pod<sparse_list::pair_size_t>(void)
     473{       return true; }
    468474
    469475/*!
  • trunk/omh/whats_new/whats_new_15.omh

    r3607 r3614  
    2121        cppad
    2222        Jacobian
     23        gettimeofday
     24        cmake
    2325$$
    2426
     
    3032The purpose of this section is to
    3133assist you in learning about changes between various versions of CppAD.
     34
     35$head 01-23$$
     36There was a bug in the $cref cmake$$ install detection of compiler features.
     37One symptom of this bug was that on systems that had the $code gettimeofday$$
     38function, the cmake install would sometimes report
     39$codei%
     40        cppad_has_gettimeofday = 0
     41%$$
     42This has been fixed.
     43
     44$head 01-21$$
     45The deprecated $cref InstallUnix$$ procedure had a bug in the
     46detection of when the size of an $code unsigned int$$
     47was the same as the size of a $code size_t$$. This has been fixed.
     48
    3249
    3350$head 01-20$$
Note: See TracChangeset for help on using the changeset viewer.