Changeset 1529


Ignore:
Timestamp:
Sep 25, 2009 10:54:21 AM (11 years ago)
Author:
bradbell
Message:

trunk: Use Vector_set to denote choice between vector_pack and vector_set.

check_doxygen.sh: add vector_set.hpp to list of error checked files.
makefile.am: add vector_set.hpp to distribution.
makefile.in: changes automatically generated by change in makefile.am.
prototype_op.hpp: convert vector_pack to Vector_set template parameter.
for_jac_sweep.hpp: convert vector_pack to Vector_set template parameter.
load_op.hpp: convert vector_pack to Vector_set template parameter.
store_op.hpp: convert vector_pack to Vector_set template parameter.
rev_jac_sweep.hpp: convert vector_pack to Vector_set template parameter.
cond_op.hpp: convert vector_pack to Vector_set template parameter.
rev_hes_sweep.hpp: convert vector_pack to Vector_set template parameter.
sparse_binary_op.hpp: convert vector_pack to Vector_set template parameter.
sparse_unary_op.hpp: convert vector_pack to Vector_set template parameter.
op.hpp: add vector_set.hpp to list of included files.

Location:
trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/check_doxygen.sh

    r1528 r1529  
    5050        sub_op.hpp
    5151        vector_pack.hpp
     52        vector_set.hpp
    5253"
    5354for name in $list
  • trunk/cppad/local/cond_op.hpp

    r1526 r1529  
    340340depends on.
    341341*/
     342template <class Vector_set>
    342343inline void forward_sparse_jacobian_cond_op(
    343344        size_t             i_z           ,
    344345        const size_t*      arg           ,
    345346        size_t             num_par       ,
    346         vector_pack&       sparsity      )
     347        Vector_set&        sparsity      )
    347348{
    348349        CPPAD_ASSERT_UNKNOWN( arg[0] < static_cast<size_t> (CompareNe) );
     
    424425On input and output, this pattern corresponds to the function G.
    425426*/
     427template <class Vector_set>
    426428inline void reverse_sparse_jacobian_cond_op(
    427429        size_t              i_z           ,
    428430        const size_t*       arg           ,
    429431        size_t              num_par       ,
    430         vector_pack&        sparsity      )
     432        Vector_set&         sparsity      )
    431433{       
    432434        CPPAD_ASSERT_UNKNOWN( arg[0] < static_cast<size_t> (CompareNe) );
     
    524526On output, this pattern corresponds to the function H.
    525527*/
     528template <class Vector_set>
    526529inline void reverse_sparse_hessian_cond_op(
    527530        size_t               i_z           ,
     
    529532        size_t               num_par       ,
    530533        bool*                jac_reverse   ,
    531         vector_pack&         hes_sparsity  )
     534        Vector_set&          hes_sparsity  )
    532535{       
    533536
  • trunk/cppad/local/for_jac_sweep.hpp

    r1527 r1529  
    3535using AD< \a Base > and computations by this routine are done using type
    3636\a Base.
     37
     38\tparam Vector_set
     39is the type used for vectors of sets. It can be either
     40\c vector_pack or \c vector_set.
    3741
    3842\param n
     
    7276
    7377
    74 template <class Base>
     78template <class Base, class Vector_set>
    7579void ForJacSweep(
    7680        size_t                n            ,
    7781        size_t                numvar       ,
    7882        player<Base>*         play         ,
    79         vector_pack&          var_sparsity )
     83        Vector_set&           var_sparsity )
    8084{
    8185        OpCode           op;
     
    105109        size_t num_vecad_ind   = play->num_rec_vecad_ind();
    106110        size_t num_vecad_vec   = play->num_rec_vecad_vec();
    107         vector_pack      vecad_sparsity;
     111        Vector_set  vecad_sparsity;
    108112        vecad_sparsity.resize(num_vecad_vec, limit);
    109113        size_t* vecad_ind      = CPPAD_NULL;
  • trunk/cppad/local/load_op.hpp

    r1525 r1529  
    298298\copydetails sparse_load_op
    299299*/
     300template <class Vector_set>
    300301inline void forward_sparse_load_op(
    301302        OpCode             op             ,
     
    304305        size_t             num_combined   ,
    305306        const size_t*      combined       ,
    306         vector_pack&       var_sparsity   ,
    307         vector_pack&       vecad_sparsity )
     307        Vector_set&        var_sparsity   ,
     308        Vector_set&        vecad_sparsity )
    308309{
    309310        CPPAD_ASSERT_UNKNOWN( NumArg(op) == 3 );
     
    325326\copydetails sparse_load_op
    326327*/
     328template <class Vector_set>
    327329inline void reverse_sparse_jacobian_load_op(
    328330        OpCode             op             ,
     
    331333        size_t             num_combined   ,
    332334        const size_t*      combined       ,
    333         vector_pack&       var_sparsity   ,
    334         vector_pack&       vecad_sparsity )
     335        Vector_set&        var_sparsity   ,
     336        Vector_set&        vecad_sparsity )
    335337{
    336338        CPPAD_ASSERT_UNKNOWN( NumArg(op) == 3 );
     
    372374
    373375*/
     376template <class Vector_set>
    374377inline void reverse_sparse_hessian_load_op(
    375378        OpCode             op             ,
     
    378381        size_t             num_combined   ,
    379382        const size_t*      combined       ,
    380         vector_pack&       var_sparsity   ,
    381         vector_pack&       vecad_sparsity ,
     383        Vector_set&        var_sparsity   ,
     384        Vector_set&        vecad_sparsity ,
    382385        bool*              var_jacobian   ,
    383386        bool*              vecad_jacobian )
  • trunk/cppad/local/op.hpp

    r1528 r1529  
    1616// used by the sparse operators
    1717# include <cppad/local/vector_pack.hpp>
     18# include <cppad/local/vector_set.hpp>
    1819
     20// operations
    1921# include <cppad/local/std_math_ad.hpp>
    2022# include <cppad/local/abs_op.hpp>
  • trunk/cppad/local/prototype_op.hpp

    r1526 r1529  
    10371037where v is a VecAD<Base> vector and x is an AD<Base> index.
    10381038
     1039\tparam Vector_set
     1040is the type used for vectors of sets. It can be either
     1041\c vector_pack or \c vector_set.
     1042
    10391043\param op
    10401044is the code corresponding to this operator; i.e., LdpOp or LdvOp
     
    10831087\li i_v       < \a vecad_sparsity.n_set()
    10841088*/
     1089template <class Vector_set>
    10851090inline void sparse_load_op(
    10861091        OpCode              op             ,
     
    10891094        size_t              num_combined   ,
    10901095        const size_t*       combined       ,
    1091         vector_pack&        var_sparsity   ,
    1092         vector_pack&        vecad_sparsity )
     1096        Vector_set&         var_sparsity   ,
     1097        Vector_set&         vecad_sparsity )
    10931098{
    10941099        // This routine is only for documentaiton, it should not be used
     
    12191224where i_vec is defined under the heading \a arg[1] below:
    12201225
     1226\tparam Vector_set
     1227is the type used for vectors of sets. It can be either
     1228\c vector_pack or \c vector_set.
     1229
     1230
    12211231\param op
    12221232is the code corresponding to this operator; i.e., StpvOp or StvvOp
     
    12951305\endverbatim
    12961306
     1307\tparam Vector_set
     1308is the type used for vectors of sets. It can be either
     1309\c vector_pack or \c vector_set.
     1310
    12971311\param i_z
    12981312variable index corresponding to the result for this operation;
     
    13331347\li \a i_x < \a i_z
    13341348*/
     1349
     1350template <class Vector_set>
    13351351inline void reverse_sparse_hessian_unary_op(
    13361352        size_t              i_z               ,
    13371353        size_t              i_x               ,
    13381354        bool*               rev_jacobian      ,
    1339         vector_pack&        for_jac_sparsity  ,
    1340         vector_pack&        rev_hes_sparsity  )
     1355        Vector_set&         for_jac_sparsity  ,
     1356        Vector_set&         rev_hes_sparsity  )
    13411357{       
    13421358        // This routine is only for documentaiton, it should not be used
     
    13531369        H( y, x, w , u , ... ) = G[ z(x,y) , y , x , w , u , ... ]
    13541370\endverbatim
     1371
     1372\tparam Vector_set
     1373is the type used for vectors of sets. It can be either
     1374\c vector_pack or \c vector_set.
    13551375
    13561376\param i_z
     
    14181438\li \a arg[1] < \a i_z
    14191439*/
     1440template <class Vector_set>
    14201441inline void reverse_sparse_hessian_binary_op(
    14211442        size_t            i_z                ,
    14221443        const size_t*     arg                ,
    14231444        bool*             jac_reverse        ,
    1424         vector_pack&      for_jac_sparsity   ,
    1425         vector_pack&      rev_hes_sparsity   )
     1445        Vector_set&       for_jac_sparsity   ,
     1446        Vector_set&       rev_hes_sparsity   )
    14261447{       
    14271448        // This routine is only for documentaiton, it should not be used
     
    15271548where Rel is one of the following: Lt, Le, Eq, Ge, Gt.
    15281549
     1550\tparam Vector_set
     1551is the type used for vectors of sets. It can be either
     1552\c vector_pack or \c vector_set.
     1553
    15291554\param i_z
    15301555is the AD variable index corresponding to the variable z.
     
    15831608\li For j = 0, 1, 2, 3 if y_j is a variable, arg[2+j] < iz.
    15841609*/
     1610template <class Vector_set>
    15851611inline void sparse_conditional_exp_op(
    15861612        size_t         i_z           ,
  • trunk/cppad/local/rev_hes_sweep.hpp

    r1527 r1529  
    3838using AD< \a Base > and computations by this routine are done using type
    3939\a Base.
     40
     41\tparam Vector_set
     42is the type used for vectors of sets. It can be either
     43\c vector_pack or \c vector_set.
    4044
    4145\param n
     
    9599*/
    96100
    97 template <class Base>
     101template <class Base, class Vector_set>
    98102void RevHesSweep(
    99103        size_t                n,
    100104        size_t                numvar,
    101105        player<Base>         *play,
    102         vector_pack&          for_jac_sparse, // should be const
     106        Vector_set&           for_jac_sparse, // should be const
    103107        bool*                 RevJac,
    104         vector_pack&          rev_hes_sparse
     108        Vector_set&           rev_hes_sparse
    105109)
    106110{
     
    136140        size_t num_vecad_ind   = play->num_rec_vecad_ind();
    137141        size_t num_vecad_vec   = play->num_rec_vecad_vec();
    138         vector_pack      vecad_sparse;
     142        Vector_set vecad_sparse;
    139143        vecad_sparse.resize(num_vecad_vec, limit);
    140144        size_t* vecad_ind   = CPPAD_NULL;
  • trunk/cppad/local/rev_jac_sweep.hpp

    r1527 r1529  
    3636using AD< \a Base > and computations by this routine are done using type
    3737\a Base.
     38
     39\tparam Vector_set
     40is the type used for vectors of sets. It can be either
     41\c vector_pack or \c vector_set.
    3842
    3943\param n
     
    7781*/
    7882
    79 template <class Base>
     83template <class Base, class Vector_set>
    8084void RevJacSweep(
    8185        size_t                n,
    8286        size_t                numvar,
    8387        player<Base>         *play,
    84         vector_pack&          var_sparsity
     88        Vector_set&           var_sparsity
    8589)
    8690{
     
    109113        size_t num_vecad_ind   = play->num_rec_vecad_ind();
    110114        size_t num_vecad_vec   = play->num_rec_vecad_vec();
    111         vector_pack      vecad_sparsity;
     115        Vector_set  vecad_sparsity;
    112116        vecad_sparsity.resize(num_vecad_vec, limit);
    113117        size_t* vecad_ind      = CPPAD_NULL;
  • trunk/cppad/local/sparse_binary_op.hpp

    r1526 r1529  
    3333\endverbatim
    3434where op is a C++ binary unary operator and both x and y are variables.
     35
     36\tparam Vector_set
     37is the type used for vectors of sets. It can be either
     38\c vector_pack or \c vector_set.
    3539
    3640\param i_z
     
    7377*/
    7478
    75 
     79template <class Vector_set>
    7680inline void forward_sparse_jacobian_binary_op(
    7781        size_t            i_z           ,
    7882        const size_t*     arg           ,
    79         vector_pack&      sparsity      )
     83        Vector_set&       sparsity      )
    8084{       
    8185        // check assumptions
     
    109113\endverbatim
    110114
    111 \tparam Pack
    112 is the type used to pack the sparsity pattern bit values; i.e.,
    113 there is more that one bit per Pack value.
     115\tparam Vector_set
     116is the type used for vectors of sets. It can be either
     117\c vector_pack or \c vector_set.
    114118
    115119\param i_z
     
    149153\li \a arg[1] < \a i_z
    150154*/
     155template <class Vector_set>
    151156inline void reverse_sparse_jacobian_binary_op(
    152157        size_t              i_z           ,
    153158        const size_t*       arg           ,
    154         vector_pack&        sparsity      )
     159        Vector_set&         sparsity      )
    155160{       
    156161        // check assumptions
     
    175180\copydetails reverse_sparse_hessian_binary_op
    176181*/
     182template <class Vector_set>
    177183inline void reverse_sparse_hessian_addsub_op(
    178184        size_t               i_z                ,
    179185        const size_t*        arg                ,
    180186        bool*                jac_reverse        ,
    181         vector_pack&         for_jac_sparsity   ,
    182         vector_pack&         rev_hes_sparsity   )
     187        Vector_set&          for_jac_sparsity   ,
     188        Vector_set&          rev_hes_sparsity   )
    183189{       
    184190        // check assumptions
     
    206212\copydetails reverse_sparse_hessian_binary_op
    207213*/
     214template <class Vector_set>
    208215inline void reverse_sparse_hessian_mul_op(
    209216        size_t               i_z                ,
    210217        const size_t*        arg                ,
    211218        bool*                jac_reverse        ,
    212         vector_pack&         for_jac_sparsity   ,
    213         vector_pack&         rev_hes_sparsity   )
     219        Vector_set&          for_jac_sparsity   ,
     220        Vector_set&          rev_hes_sparsity   )
    214221{       
    215222        // check assumptions
     
    243250\copydetails reverse_sparse_hessian_binary_op
    244251*/
     252template <class Vector_set>
    245253inline void reverse_sparse_hessian_div_op(
    246254        size_t               i_z                ,
    247255        const size_t*        arg                ,
    248256        bool*                jac_reverse        ,
    249         vector_pack&         for_jac_sparsity   ,
    250         vector_pack&         rev_hes_sparsity   )
     257        Vector_set&          for_jac_sparsity   ,
     258        Vector_set&          rev_hes_sparsity   )
    251259{       
    252260        // check assumptions
     
    282290\copydetails reverse_sparse_hessian_binary_op
    283291*/
     292template <class Vector_set>
    284293inline void reverse_sparse_hessian_pow_op(
    285294        size_t               i_z                ,
    286295        const size_t*        arg                ,
    287296        bool*                jac_reverse        ,
    288         vector_pack&         for_jac_sparsity   ,
    289         vector_pack&         rev_hes_sparsity   )
     297        Vector_set&          for_jac_sparsity   ,
     298        Vector_set&          rev_hes_sparsity   )
    290299{       
    291300        // check assumptions
  • trunk/cppad/local/sparse_unary_op.hpp

    r1526 r1529  
    3333where op is a C++ binary unary operator and p is a parameter.
    3434
    35 \tparam Pack
    36 is the type used to pack the sparsity pattern bit values; i.e.,
    37 there is more that one bit per Pack value.
     35\tparam Vector_set
     36is the type used for vectors of sets. It can be either
     37\c vector_pack or \c vector_set.
    3838
    3939\param i_z
     
    6363*/
    6464
     65template <class Vector_set>
    6566inline void forward_sparse_jacobian_unary_op(
    6667        size_t            i_z           ,
    6768        size_t            i_x           ,
    68         vector_pack&      sparsity      )
     69        Vector_set&       sparsity      )
    6970{       
    7071        // check assumptions
     
    9394        H( x , w , u , ... ) = G[ z(x) , x , w , u , ... ]
    9495\endverbatim
     96
     97\tparam Vector_set
     98is the type used for vectors of sets. It can be either
     99\c vector_pack or \c vector_set.
     100
    95101
    96102\param i_z
     
    119125*/
    120126
     127template <class Vector_set>
    121128inline void reverse_sparse_jacobian_unary_op(
    122129        size_t     i_z                     ,
    123130        size_t     i_x                     ,
    124         vector_pack&           sparsity    )
     131        Vector_set&            sparsity    )
    125132{       
    126133        // check assumptions
     
    147154\copydetails reverse_sparse_hessian_unary_op
    148155*/
     156template <class Vector_set>
    149157inline void reverse_sparse_hessian_linear_unary_op(
    150158        size_t              i_z               ,
    151159        size_t              i_x               ,
    152160        bool*               rev_jacobian      ,
    153         vector_pack&        for_jac_sparsity  ,
    154         vector_pack&        rev_hes_sparsity  )
     161        Vector_set&         for_jac_sparsity  ,
     162        Vector_set&         rev_hes_sparsity  )
    155163{       
    156164        // check assumptions
     
    179187\copydetails reverse_sparse_hessian_unary_op
    180188*/
     189template <class Vector_set>
    181190inline void reverse_sparse_hessian_nonlinear_unary_op(
    182191        size_t              i_z               ,
    183192        size_t              i_x               ,
    184193        bool*               rev_jacobian      ,
    185         vector_pack&        for_jac_sparsity  ,
    186         vector_pack&        rev_hes_sparsity  )
     194        Vector_set&         for_jac_sparsity  ,
     195        Vector_set&         rev_hes_sparsity  )
    187196{       
    188197        // check assumptions
  • trunk/cppad/local/store_op.hpp

    r1525 r1529  
    161161\copydetails sparse_store_op
    162162*/
     163template <class Vector_set>
    163164inline void forward_sparse_store_op(
    164165        OpCode              op             ,
     
    166167        size_t              num_combined   ,
    167168        const size_t*       combined       ,
    168         vector_pack&        var_sparsity   ,
    169         vector_pack&        vecad_sparsity )
     169        Vector_set&         var_sparsity   ,
     170        Vector_set&         vecad_sparsity )
    170171{
    171172        CPPAD_ASSERT_UNKNOWN( NumArg(op) == 3 );
     
    194195\copydetails sparse_store_op
    195196*/
     197template <class Vector_set>
    196198inline void reverse_sparse_jacobian_store_op(
    197199        OpCode             op              ,
     
    199201        size_t             num_combined    ,
    200202        const size_t*      combined        ,
    201         vector_pack&       var_sparsity    ,
    202         vector_pack&       vecad_sparsity  )
     203        Vector_set&        var_sparsity    ,
     204        Vector_set&        vecad_sparsity  )
    203205{
    204206        CPPAD_ASSERT_UNKNOWN( NumArg(op) == 3 );
     
    239241and on output it corresponds to the function H.
    240242*/
     243template <class Vector_set>
    241244inline void reverse_sparse_hessian_store_op(
    242245        OpCode             op           ,
     
    244247        size_t             num_combined ,
    245248        const size_t*      combined     ,
    246         vector_pack&       var_sparsity ,
    247         vector_pack&       vecad_sparsity ,
     249        Vector_set&        var_sparsity ,
     250        Vector_set&        vecad_sparsity ,
    248251        bool*              var_jacobian   ,
    249252        bool*              vecad_jacobian )
  • trunk/makefile.am

    r1528 r1529  
    180180        cppad/local/vec_ad.hpp \
    181181        cppad/local/vector_pack.hpp \
     182        cppad/local/vector_set.hpp \
    182183        cppad/local/undef.hpp \
    183184        cppad/local/value.hpp \
  • trunk/makefile.in

    r1528 r1529  
    236236@CppAD_POSTFIX_FALSE@postfix_dir = .
    237237
    238 # $Id: makefile.am 1524 2009-09-22 03:07:03Z bradbell $
     238# $Id: makefile.am 1528 2009-09-22 15:49:50Z bradbell $
    239239# -----------------------------------------------------------------------------
    240240# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
     
    413413        cppad/local/vec_ad.hpp \
    414414        cppad/local/vector_pack.hpp \
     415        cppad/local/vector_set.hpp \
    415416        cppad/local/undef.hpp \
    416417        cppad/local/value.hpp \
Note: See TracChangeset for help on using the changeset viewer.