Changeset 3718


Ignore:
Timestamp:
Sep 1, 2015 1:38:39 PM (4 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 48d2f6a2d4b58dc317f3f05d20b5225ce2b832b9
end hash code: 1095c07be7b4d841ad1769e702319420f834e572

commit 1095c07be7b4d841ad1769e702319420f834e572
Author: Brad Bell <bradbell@…>
Date: Tue Sep 1 09:53:36 2015 -0700

Documentation dependency patterns and fix sign dependency patterns.


sign.hpp: fix a typo in derivative of sign function.
wish_list.omh: remove an item that has been completed.
checkpoint.cpp: change std::set initialization to be c99 compliant.

Location:
trunk
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/cppad/local/for_jac_sweep.hpp

    r3717 r3718  
    522522                        case SignOp:
    523523                        CPPAD_ASSERT_NARG_NRES(op, 1, 1);
    524                         forward_sparse_jacobian_unary_op(
     524                        // derivative is identically zero but dependency is not
     525                        if( dependency ) forward_sparse_jacobian_unary_op(
    525526                                i_var, arg[0], var_sparsity
    526527                        );
  • trunk/cppad/local/for_sparse_jac.hpp

    r3714 r3718  
    130130%$$
    131131If $icode dependency$$ is true,
    132 the derivatives with respect to left and right of the
    133 $cref CondExp$$ below are considered to be non-zero:
    134 $codei%
    135         %CondExp%Rel%(%left%, %right%, %if_true%, %if_false%)
    136 %$$
    137 This is useful for determining the dependency relations
    138 between the independent and dependent variables. It is used with this purpose
    139 by the $cref/optimizer/optimize/$$ when dealing with
    140 $cref checkpoint$$ and user defined $cref/atomic/atomic_base/$$ functions.
    141 The default value $icode%dependency% = false%$$ is used when
    142 $icode dependency$$ is not present.
     132the $cref/dependency pattern/dependency.cpp/Dependency Pattern/$$
     133(instead of sparsity pattern) is computed.
    143134
    144135$head r$$
  • trunk/cppad/local/rev_jac_sweep.hpp

    r3717 r3718  
    522522                        case SignOp:
    523523                        CPPAD_ASSERT_NARG_NRES(op, 1, 1);
    524                         // derivative is identically zero
     524                        // derivative is identically zero but dependency is not
     525                        if( dependency ) reverse_sparse_jacobian_unary_op(
     526                                i_var, arg[0], var_sparsity
     527                        );
    525528                        break;
    526529                        // -------------------------------------------------
  • trunk/cppad/local/rev_sparse_jac.hpp

    r3712 r3718  
    9090%$$
    9191If $icode dependency$$ is true,
    92 the derivatives with respect to left and right of the
    93 $cref CondExp$$ below are considered to be non-zero:
    94 $codei%
    95         %CondExp%Rel%(%left%, %right%, %if_true%, %if_false%)
    96 %$$
    97 This is useful for determining the dependency relations
    98 between the independent and dependent variables. It is used with this purpose
    99 by the $cref/optimizer/optimize/$$ when dealing with
    100 $cref checkpoint$$ and user defined $cref/atomic/atomic_base/$$ functions.
    101 The default value $icode%dependency% = false%$$ is used when
    102 $icode dependency$$ is not present.
     92the $cref/dependency pattern/dependency.cpp/Dependency Pattern/$$
     93(instead of sparsity pattern) is computed.
    10394
    10495$head r$$
  • trunk/cppad/local/sign.hpp

    r3686 r3718  
    2828Evaluates the $code sign$$ function which is defined by
    2929$latex \[
    30 {\rm sign} (x ) =
     30{\rm sign} (x) =
    3131\left\{ \begin{array}{rl}
    3232        +1 & {\rm if} \; x > 0 \\
     
    4949is given by
    5050$latex \[
    51         {\rm sign}{(1)} (x) =  2 \delta (x)
     51        {\rm sign}^{(1)} (x) =  2 \delta (x)
    5252\] $$
    5353where $latex \delta (x)$$ is the Dirac Delta function.
  • trunk/cppad/local/sparse.hpp

    r2506 r3718  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
    9 the terms of the 
     9the terms of the
    1010                    Eclipse Public License Version 1.0.
    1111
     
    2727        cppad/local/for_sparse_jac.hpp%
    2828        cppad/local/rev_sparse_jac.hpp%
     29        example/dependency.cpp%
    2930        cppad/local/rev_sparse_hes.hpp
    3031%$$
  • trunk/example/CMakeLists.txt

    r3711 r3718  
    108108        cosh.cpp
    109109        cppad_vector.cpp
     110        dependency.cpp
    110111        div.cpp
    111112        div_eq.cpp
  • trunk/example/example.cpp

    r3711 r3718  
    8080extern bool Cosh(void);
    8181extern bool CppAD_vector(void);
     82extern bool dependency(void);
    8283extern bool Div(void);
    8384extern bool DivEq(void);
     
    248249        ok &= Run( Cosh,              "Cosh"             );
    249250        ok &= Run( CppAD_vector,      "CppAD_vector"     );
     251        ok &= Run( dependency,        "dependency"       );
    250252        ok &= Run( Div,               "Div"              );
    251253        ok &= Run( DivEq,             "DivEq"            );
  • trunk/example/makefile.am

    r3711 r3718  
    114114        cosh.cpp \
    115115        cppad_vector.cpp \
     116        dependency.cpp \
    116117        div.cpp \
    117118        div_eq.cpp \
  • trunk/example/makefile.in

    r3711 r3718  
    120120        check_simple_vector.cpp compare.cpp compare_change.cpp \
    121121        complex_poly.cpp cond_exp.cpp conj_grad.cpp cos.cpp cosh.cpp \
    122         cppad_vector.cpp div.cpp div_eq.cpp equal_op_seq.cpp erf.cpp \
    123         error_handler.cpp exp.cpp expm1.cpp for_one.cpp for_two.cpp \
    124         forward.cpp forward_dir.cpp forward_order.cpp \
    125         for_sparse_jac.cpp fun_assign.cpp fun_check.cpp \
    126         hes_lagrangian.cpp hes_lu_det.cpp hes_minor_det.cpp \
    127         hessian.cpp hes_times_dir.cpp independent.cpp index_sort.cpp \
    128         integer.cpp interface2c.cpp interp_onetape.cpp \
    129         interp_retape.cpp jac_lu_det.cpp jac_minor_det.cpp \
    130         jacobian.cpp limits.cpp log.cpp log1p.cpp log10.cpp \
    131         lu_factor.cpp lu_invert.cpp lu_ratio.cpp lu_solve.cpp \
    132         lu_vec_ad.cpp lu_vec_ad.hpp lu_vec_ad_ok.cpp mul.cpp \
    133         mul_eq.cpp mul_level.cpp mul_level_ode.cpp nan.cpp \
     122        cppad_vector.cpp dependency.cpp div.cpp div_eq.cpp \
     123        equal_op_seq.cpp erf.cpp error_handler.cpp exp.cpp expm1.cpp \
     124        for_one.cpp for_two.cpp forward.cpp forward_dir.cpp \
     125        forward_order.cpp for_sparse_jac.cpp fun_assign.cpp \
     126        fun_check.cpp hes_lagrangian.cpp hes_lu_det.cpp \
     127        hes_minor_det.cpp hessian.cpp hes_times_dir.cpp \
     128        independent.cpp index_sort.cpp integer.cpp interface2c.cpp \
     129        interp_onetape.cpp interp_retape.cpp jac_lu_det.cpp \
     130        jac_minor_det.cpp jacobian.cpp limits.cpp log.cpp log1p.cpp \
     131        log10.cpp lu_factor.cpp lu_invert.cpp lu_ratio.cpp \
     132        lu_solve.cpp lu_vec_ad.cpp lu_vec_ad.hpp lu_vec_ad_ok.cpp \
     133        mul.cpp mul_eq.cpp mul_level.cpp mul_level_ode.cpp nan.cpp \
    134134        near_equal.cpp near_equal_ext.cpp number_skip.cpp \
    135135        numeric_type.cpp ode_err_control.cpp ode_err_maxabs.cpp \
     
    161161        complex_poly.$(OBJEXT) cond_exp.$(OBJEXT) conj_grad.$(OBJEXT) \
    162162        cos.$(OBJEXT) cosh.$(OBJEXT) cppad_vector.$(OBJEXT) \
    163         div.$(OBJEXT) div_eq.$(OBJEXT) equal_op_seq.$(OBJEXT) \
    164         erf.$(OBJEXT) error_handler.$(OBJEXT) exp.$(OBJEXT) \
    165         expm1.$(OBJEXT) for_one.$(OBJEXT) for_two.$(OBJEXT) \
    166         forward.$(OBJEXT) forward_dir.$(OBJEXT) \
     163        dependency.$(OBJEXT) div.$(OBJEXT) div_eq.$(OBJEXT) \
     164        equal_op_seq.$(OBJEXT) erf.$(OBJEXT) error_handler.$(OBJEXT) \
     165        exp.$(OBJEXT) expm1.$(OBJEXT) for_one.$(OBJEXT) \
     166        for_two.$(OBJEXT) forward.$(OBJEXT) forward_dir.$(OBJEXT) \
    167167        forward_order.$(OBJEXT) for_sparse_jac.$(OBJEXT) \
    168168        fun_assign.$(OBJEXT) fun_check.$(OBJEXT) \
     
    543543        cosh.cpp \
    544544        cppad_vector.cpp \
     545        dependency.cpp \
    545546        div.cpp \
    546547        div_eq.cpp \
     
    735736@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cosh.Po@am__quote@
    736737@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_vector.Po@am__quote@
     738@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dependency.Po@am__quote@
    737739@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div.Po@am__quote@
    738740@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_eq.Po@am__quote@
  • trunk/omh/example_list.omh

    r3717 r3718  
    130130$rref cppad_eigen.hpp$$
    131131$rref cppad_vector.cpp$$
     132$rref dependency.cpp$$
    132133$rref det_by_lu.cpp$$
    133134$rref det_by_minor.cpp$$
  • trunk/omh/whats_new/whats_new_15.omh

    r3717 r3718  
    6464assist you in learning about changes between various versions of CppAD.
    6565
     66$head 09-01$$
     67The $cref/dependency pattern/dependency.cpp/Dependency Pattern/$$
     68was not being computed correctly for the $cref sign$$ function.
     69This has been fixed.
     70(It could have caused problems using $cref optimize$$ with an $cref ADFun$$
     71that used the $code sign$$ function.).
     72
    6673$head 08-31$$
    6774$list number$$
  • trunk/omh/wish_list.omh

    r3710 r3718  
    4545
    4646$head checkpoint$$
    47 $list number$$
    4847There should be some examples and tests for both speed and memory use
    4948that demonstrate that checkpointing is useful.
    50 $lnext
    51 There should be an option to use a
    52 $cref/vectorBool/CppAD_vector/vectorBool/$$ interface
    53 for the atomic sparsity calculations.
    54 $lend
    5549
    5650$head abort_op_index$$
  • trunk/test_more/checkpoint.cpp

    r3717 r3718  
    174174
    175175                        // check result
    176                         ok &= s[0] == std::set<size_t>{1, 2};
     176                        std::set<size_t> check;
     177                        check.insert(1);
     178                        check.insert(2);
     179                        ok &= s[0] == check;
    177180                }
    178181
Note: See TracChangeset for help on using the changeset viewer.