Ignore:
Timestamp:
Oct 17, 2013 9:38:16 AM (7 years ago)
Author:
bradbell
Message:

change plan: use a bool for each operation that specifies skip or not

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/opt_cond_exp/cppad/local/optimize.hpp

    r2956 r2959  
    149149        /// There is no operation that connects this variable to the
    150150        /// independent variables.
    151         not_connected     ,
     151        not_connected        ,
    152152
    153153        /// There is one or more operations that connects this variable to the
    154154        /// independent variables.
    155         yes_connected      ,
     155        yes_connected        ,
    156156
    157157        /// There is only one parrent that connects this variable to the
    158158        /// independent variables and the parent is a summation operation; i.e.,
    159159        /// AddvvOp, AddpvOp, SubpvOp, SubvpOp, or SubvvOp.
    160         sum_connected      ,
     160        sum_connected        ,
    161161
    162162        /// Satisfies the sum_connected assumptions above and in addition
    163163        /// this variable is the result of summation operator.
    164         csum_connected
     164        csum_connected       ,
     165
     166        /// This node is only connected in the case where the comparision is
     167        /// true for the conditional expression with index \c connect_index.
     168        cexp_true_connected  ,
     169
     170        /// This node is only connected in the case where the comparision is
     171        /// false for the conditional expression with index \c connect_index.
     172        cexp_false_connected
    165173};
    166174
     
    181189        /// How is this variable connected to the independent variables
    182190        optimize_connection_type connect_type;
     191
     192        /*!
     193        The meaning of this index depends on \c connect_type as follows:
     194
     195        \par cexp_flag_connected
     196        For flag equal to ture or false, \c connect_index is the index of the
     197        conditional expression corresponding to this connection.
     198        */
     199        size_t connect_index;
    183200
    184201        /// Set during forward sweep to the index in the
     
    13471364                                mask = 1;
    13481365                                for(i = 2; i < 6; i++)
    1349                                 {       if( arg[1] & mask )
    1350                                         {       CPPAD_ASSERT_UNKNOWN( size_t(arg[i]) < i_var );
    1351                                                 tape[arg[i]].connect_type = yes_connected;
     1366                                {       CPPAD_ASSERT_UNKNOWN( size_t(arg[i]) < i_var );
     1367                                        if( arg[1] & mask )
     1368                                        {       if( i == 2 || i == 3 )
     1369                                                        tape[arg[i]].connect_type = yes_connected;
     1370                                                if( i == 4 )
     1371                                                        tape[arg[i]].connect_type =
     1372                                                                        cexp_true_connected;
     1373                                                if( i == 5 )
     1374                                                        tape[arg[i]].connect_type =
     1375                                                                        cexp_false_connected;
    13521376                                        }
    13531377                                        mask = mask << 1;
Note: See TracChangeset for help on using the changeset viewer.