Changeset 2992


Ignore:
Timestamp:
Oct 22, 2013 12:45:13 PM (6 years ago)
Author:
bradbell
Message:

Add user documentation related to the conditional expression optimization.

Location:
trunk
Files:
3 edited

Legend:

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

    r2506 r2992  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
    77
    88CppAD is distributed under multiple licenses. This distribution is under
     
    119119%$$
    120120
    121 
    122 $head CondExp$$
     121$head Optimize$$
     122The $cref optimize$$ method will optimize conditional expressions
     123in the following way:
     124During $cref/zero order forward mode/ForwardZero/$$,
     125once the value of the $icode left$$ and $icode right$$ have been determined,
     126it is known if the true or false case is required.
     127From this point on, values corresponding to the case that is not required
     128are not computed.
     129This optimization is done for the rest of zero order forward mode
     130as well as forward and reverse derivatives calculations.
     131There is one exception to this optimization; see
     132$cref/wish list/WishList/Conditional Expressions/$$.
     133
     134$head Deprecated$$
    123135Previous versions of CppAD used
    124136$codei%
  • trunk/omh/whats_new/whats_new_13.omh

    r2975 r2992  
    1414$dollar @$$
    1515$spell
     16        CondExp
     17        op_arg
    1618        Adolc
    1719        aka
     
    5658assist you in learning about changes between various versions of CppAD.
    5759
     60$head 10-22$$
     61$list number$$
     62Add $cref/optimization/optimize/$$ of conditional expressions; see
     63$cref/CondExp/CondExp/Optimize/$$.
     64$lnext
     65Add a phantom argument at the beginning of the operations sequence;
     66$cref/size_op_arg/seq_property/size_op_arg/$$ and $cref seq_property.cpp$$.
     67(This helps with the optimization mentioned above.)
     68$lend
     69
    5870$head 10-16$$
    5971Fix bug in $cref/Tracing/WishList/Tracing/$$ $cref atomic$$ functions.
  • trunk/omh/wish_list.omh

    r2958 r2992  
    1212$begin WishList$$
    1313$spell
     14        Rel
     15        Gt
     16        Eq
     17        CondExpLt
    1418        Checkpointing
    1519        grep
     
    6266for $icode ad_fun$$ is called.
    6367
     68$head Conditional Expressions$$
     69The $cref/optimization/CondExp/Optimize/$$ of conditional expressions
     70$codei%
     71        CondExp%Rel%(%left%, %right%, %true_case%, %false_case%
     72%$$
     73could be more efficient when it comes to nested conditional expressions.
     74For example, give the code
     75$codep
     76        x = CondExpLt(left_x, right_x, true_x, false_x)
     77        y = CondExpGt(left_y, right_y, true_y, false_y)
     78        z = CondExpEq(left_z, right_z, x, y)
     79$$
     80not all the possible cases will be excluded by $cref optimize$$.
     81
     82
    6483$head Forward Mode Recomputation$$
    6584$index forward$$
Note: See TracChangeset for help on using the changeset viewer.