Changeset 1532 for trunk/test_more


Ignore:
Timestamp:
Sep 28, 2009 7:55:30 AM (11 years ago)
Author:
bradbell
Message:

trunk: Add option for sparse Jacobians to used vector_set for calculations.

for_sparse_jac.cpp: test forward Jacobian sparsity using vector_set.
rev_sparse_jac.cpp: test reverse Jacobian sparsity using vector_set.
whats_new_09.omh: user's view of the changes.
ad_fun.hpp: add for_jac_sparse_set to private data (move private to front).
for_sparse_jac.hpp: add packed (true or false) option.
rev_sparse_jac.hpp: add packed (true or false) option.

Location:
trunk/test_more
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/for_sparse_jac.cpp

    r1475 r1532  
    7171namespace { // Begin empty namespace
    7272
    73 bool case_one(void)
     73bool case_one(bool packed)
    7474{       bool ok = true;
    7575        using namespace CppAD;
     
    160160        // evaluate the dependency matrix for F(X(x))
    161161        CPPAD_TEST_VECTOR< bool > Py(m * n);
    162         Py = F.ForSparseJac(n, Px);
     162        Py = F.ForSparseJac(n, Px, packed);
    163163
    164164        // check values
     
    171171}
    172172
    173 bool case_two(void)
     173bool case_two(bool packed)
    174174{       bool ok = true;
    175175        using namespace CppAD;
     
    246246        // evaluate the dependency matrix for F(X(x))
    247247        CPPAD_TEST_VECTOR< bool > Py(m * n);
    248         Py = F.ForSparseJac(n, Px);
     248        Py = F.ForSparseJac(n, Px, packed);
    249249
    250250        // check values
     
    261261bool for_sparse_jac(void)
    262262{       bool ok = true;
    263         ok &= case_one();
    264         ok &= case_two();
     263
     264        ok &= case_one(true);
     265        ok &= case_two(true);
     266
     267        ok &= case_one(false);
     268        ok &= case_two(false);
     269
    265270        return ok;
    266271}
  • trunk/test_more/rev_sparse_jac.cpp

    r1521 r1532  
    7070namespace { // BEGIN empty namespace
    7171
    72 bool case_one(void)
     72bool case_one(bool packed)
    7373{       bool ok = true;
    7474        using namespace CppAD;
     
    160160        // evaluate the dependency matrix for U(F(x))
    161161        CPPAD_TEST_VECTOR< bool > Px(m * n);
    162         Px = F.RevSparseJac(m, Py);
     162        Px = F.RevSparseJac(m, Py, packed);
    163163
    164164        // check values
     
    171171}
    172172
    173 bool case_two(void)
     173bool case_two(bool packed)
    174174{       bool ok = true;
    175175        using namespace CppAD;
     
    246246        // evaluate the dependency matrix for S [ F(x) ]
    247247        CPPAD_TEST_VECTOR< bool > Px(m * n);
    248         Px = F.RevSparseJac(m, Py);
     248        Px = F.RevSparseJac(m, Py, packed);
    249249
    250250        // check values
     
    262262{       bool ok = true;
    263263
    264         ok &= case_one();
    265         ok &= case_two();
     264        ok &= case_one(true);
     265        ok &= case_two(true);
     266
     267        ok &= case_one(false);
     268        ok &= case_two(false);
    266269
    267270        return ok;
Note: See TracChangeset for help on using the changeset viewer.