Changeset 1506


Ignore:
Timestamp:
Sep 13, 2009 1:06:17 PM (11 years ago)
Author:
bradbell
Message:

trunk: Preperation for using sets instead of bit patterns for sparsity.

doxyfile.in: include private member variables and static members of a file.
example/makefile.in: update corresponding version of makefile.am.
makefile.am: include connection.hpp in distribution.
makefile.in: changes automatically transferred from makefile.am
prototype.hpp: fix comment about check assumptions in doxygen.
forward_jac_sweep.hpp: start conversion to using connection for sparisty.
sparse_binary_op.hpp: start conversion to using connection for sparisty.

Location:
trunk
Files:
1 added
7 edited

Legend:

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

    r1482 r1506  
    22# ifndef CPPAD_FOR_JAC_SWEEP_INCLUDED
    33# define CPPAD_FOR_JAC_SWEEP_INCLUDED
    4 CPPAD_BEGIN_NAMESPACE
    5 
    64/* --------------------------------------------------------------------------
    75CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
     
    1412Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1513-------------------------------------------------------------------------- */
     14# include <cppad/local/connection.hpp>
     15CPPAD_BEGIN_NAMESPACE
    1616
    1717/*!
     
    9797
    9898        size_t            i, j, k;
     99
     100        // a connection object that uses same memrory as ForJac
     101        connection<Pack> sparsity(numvar, npv, ForJac);
    99102
    100103        // check numvar argument
     
    163166                        CPPAD_ASSERT_NARG_NRES(op, 2, 1);
    164167                        forward_sparse_jacobian_binary_op(
    165                                 i_var, arg, npv, ForJac
     168                                i_var, arg, sparsity
    166169                        );
    167170                        break;
     
    258261                        CPPAD_ASSERT_NARG_NRES(op, 2, 1);
    259262                        forward_sparse_jacobian_binary_op(
    260                                 i_var, arg, npv, ForJac
     263                                i_var, arg, sparsity
    261264                        );
    262265                        break;
     
    334337                        CPPAD_ASSERT_NARG_NRES(op, 2, 1);
    335338                        forward_sparse_jacobian_binary_op(
    336                                 i_var, arg, npv, ForJac
     339                                i_var, arg, sparsity
    337340                        );
    338341                        break;
     
    393396                        CPPAD_ASSERT_NARG_NRES(op, 2, 3);
    394397                        forward_sparse_jacobian_binary_op(
    395                                 i_var + 2, arg, npv, ForJac
     398                                i_var + 2, arg, sparsity
    396399                        );
    397400                        break;
     
    483486                        CPPAD_ASSERT_NARG_NRES(op, 2, 1);
    484487                        forward_sparse_jacobian_binary_op(
    485                                 i_var, arg, npv, ForJac
     488                                i_var, arg, sparsity
    486489                        );
    487490                        break;
  • trunk/cppad/local/prototype_op.hpp

    r1497 r1506  
    5858is the j-th order Taylor coefficient corresponding to z.
    5959
    60 \par Checked Assertions where op is a unary operator with one result:
     60\par Checked Assertions
    6161\li NumArg(op) == 1
    6262\li NumRes(op) == 1
     
    101101is the zero order Taylor coefficient corresponding to z.
    102102
    103 \par Checked Assertions where op is the unary operator with one result:
     103\par Checked Assertions
    104104\li NumArg(op) == 1
    105105\li NumRes(op) == 1
     
    181181
    182182
    183 \par Checked Assumptions where op is a unary operator with one result:
     183\par Checked Assumptions
    184184\li NumArg(op) == 1
    185185\li NumRes(op) == 1
     
    247247the autillary result y.
    248248
    249 \par Checked Assertions where op is a unary operator with two results:
     249\par Checked Assertions
    250250\li NumArg(op) == 1
    251251\li NumRes(op) == 2
     
    295295the autillary result y.
    296296
    297 \par Checked Assertions where op is the unary operator with two result:
     297\par Checked Assertions
    298298\li NumArg(op) == 1
    299299\li NumRes(op) == 2
     
    391391
    392392
    393 \par Checked Assumptions where op is a unary operator with one result:
     393\par Checked Assumptions
    394394\li NumArg(op) == 1
    395395\li NumRes(op) == 2
     
    463463is the \a d-th order Taylor coefficient corresponding to z.
    464464
    465 \par Checked Assertions where op is a binary operator:
     465\par Checked Assertions
    466466\li NumArg(op) == 2
    467467\li NumRes(op) == 1
     
    525525is the zero order Taylor coefficient corresponding to z.
    526526
    527 \par Checked Assertions where op is a binary operator:
     527\par Checked Assertions
    528528\li NumArg(op) == 2
    529529\li NumRes(op) == 1
     
    628628the k-th order Taylor coefficient for y.
    629629
    630 \par Checked Assumptions where op is a binary operator with one result:
     630\par Checked Assumptions
    631631\li NumArg(op) == 2
    632632\li NumRes(op) == 1
     
    709709is the \a d-th order Taylor coefficient corresponding to z_j.
    710710
    711 \par Checked Assertions where op is a binary operator:
     711\par Checked Assertions
    712712\li NumArg(op) == 2
    713713\li NumRes(op) == 3
     
    777777is the zero order Taylor coefficient corresponding to z_j.
    778778
    779 \par Checked Assertions where op is a binary operator:
     779\par Checked Assertions
    780780\li NumArg(op) == 2
    781781\li NumRes(op) == 3
     
    887887the k-th order Taylor coefficient for y.
    888888
    889 \par Checked Assumptions where op is a binary operator with one result:
     889\par Checked Assumptions
    890890\li NumArg(op) == 2
    891891\li NumRes(op) == 3
  • trunk/cppad/local/sparse_binary_op.hpp

    r1504 r1506  
    22# ifndef CPPAD_SPARSE_BINARY_OP_INCLUDED
    33# define CPPAD_SPARSE_BINARY_OP_INCLUDED
    4 CPPAD_BEGIN_NAMESPACE
    5 
    64/* --------------------------------------------------------------------------
    75CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
     
    1412Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1513-------------------------------------------------------------------------- */
    16 
     14# include <cppad/local/connection.hpp>
     15CPPAD_BEGIN_NAMESPACE
    1716
    1817/*!
     
    5352i.e. the row index in sparsity corresponding to y.
    5453
    55 \param nc_sparsity
    56 number of packed values corresponding to each variable; i.e.,
    57 the number of columns in the sparsity pattern matrix.
    58 
    5954\param sparsity
    60 \b Input: \a sparsity [ \a arg[0] * \a nc_sparsity + j ]
    61 for j = 0 , ... , \a nc_sparsity - 1
    62 is the sparsity bit pattern for x.
     55\b Input: The from node with index \a arg[0] in \a sparsity
     56contains the sparsity bit pattern for x.
    6357This identifies which of the independent variables the variable x
    6458depends on.
    6559\n
    6660\n
    67 \b Input: \a sparsity [ \a arg[1] * \a nc_sparsity + j ]
    68 for j = 0 , ... , \a nc_sparsity - 1
    69 is the sparsity bit pattern for y.
     61\b Input: The from node with index \a arg[1] in \a sparsity
     62contains the sparsity bit pattern for y.
    7063This identifies which of the independent variables the variable y
    7164depends on.
    7265\n
    7366\n
    74 \b Output: \a sparsity [ \a i_z * \a nc_sparsity + j ]
    75 for j = 0 , ... , \a nc_sparsity - 1
    76 is the sparsity bit pattern for z.
     67\b Output: The from node with index \a i_z in \a sparsity
     68contains the sparsity bit pattern for z.
     69This identifies which of the independent variables the variable z
     70depends on.
    7771
    7872\par Checked Assertions:
     
    8074\li \a arg[1] < \a i_z
    8175*/
     76
     77
    8278template <class Pack>
    8379inline void forward_sparse_jacobian_binary_op(
    8480        size_t            i_z           ,
    8581        const size_t*     arg           ,
    86         size_t            nc_sparsity   ,
    87         Pack*             sparsity      )
    88 {       
    89         // check assumptions
    90         CPPAD_ASSERT_UNKNOWN( arg[0] < i_z );
    91         CPPAD_ASSERT_UNKNOWN( arg[1] < i_z );
    92 
    93         Pack* z  = sparsity + i_z * nc_sparsity;
    94         Pack* x  = sparsity + arg[0] * nc_sparsity;
    95         Pack* y  = sparsity + arg[1] * nc_sparsity;
    96         size_t j = nc_sparsity;
    97         while(j--)
    98                 z[j] = x[j] | y[j];
     82        connection<Pack>& sparsity      )
     83{       
     84        // check assumptions
     85        CPPAD_ASSERT_UNKNOWN( arg[0] < i_z );
     86        CPPAD_ASSERT_UNKNOWN( arg[1] < i_z );
     87
     88        sparsity.binary_union(i_z, arg[0], arg[1]);
     89
    9990        return;
    10091}       
  • trunk/doxyfile.in

    r1381 r1506  
    285285# will be included in the documentation.
    286286
    287 EXTRACT_PRIVATE        = NO
     287EXTRACT_PRIVATE        = YES
    288288
    289289# If the EXTRACT_STATIC tag is set to YES all static members of a file
    290290# will be included in the documentation.
    291291
    292 EXTRACT_STATIC         = NO
     292EXTRACT_STATIC         = YES
    293293
    294294# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
  • trunk/example/makefile.in

    r1505 r1506  
    161161CYGPATH_W = @CYGPATH_W@
    162162
    163 # $Id: makefile.am 1501 2009-08-15 03:42:24Z bradbell $
     163# $Id: makefile.am 1505 2009-08-25 15:36:49Z bradbell $
    164164# -----------------------------------------------------------------------------
    165165# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
  • trunk/makefile.am

    r1497 r1506  
    9696        cppad/local/comp_op.hpp \
    9797        cppad/local/cond_op.hpp \
     98        cppad/local/connection.hpp \
    9899        cppad/local/convert.hpp \
    99100        cppad/local/cos_op.hpp \
  • trunk/makefile.in

    r1501 r1506  
    329329        cppad/local/comp_op.hpp \
    330330        cppad/local/cond_op.hpp \
     331        cppad/local/connection.hpp \
    331332        cppad/local/convert.hpp \
    332333        cppad/local/cos_op.hpp \
Note: See TracChangeset for help on using the changeset viewer.