Changeset 3713 for trunk/test_more


Ignore:
Timestamp:
Aug 28, 2015 9:01:09 AM (4 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: fc86286a32cd87ded0475c12f6a8ea5388bc0ccd
end hash code: 630f51c9e1a0037b2302ab026d1f2867b9490e91

commit 630f51c9e1a0037b2302ab026d1f2867b9490e91
Author: Brad Bell <bradbell@…>
Date: Fri Aug 28 05:49:06 2015 -0700

Make checkpoint rev_sparse_jac bool case more like set case.


checkpoint.hpp: fix formating in documentation, set n, m in normal way.
checkpoint.cpp: extend test from set to both bool and set cases.

commit 4f295ecc0efcaead27b701c5e7265ebb6c9e29ba
Author: Brad Bell <bradbell@…>
Date: Thu Aug 27 09:21:25 2015 -0700

automatic freeing of sparsity patterns during forward mode calculations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/checkpoint.cpp

    r3712 r3713  
    160160                ADFun<double> h(ax, ay);
    161161
    162                 // compute sparsity pattern h_1(x) = x[1] + x[2]
    163                 CppAD::vector< std::set<size_t> > r(1), s(1);
    164                 r[0].insert(1);
    165                 s = h.RevSparseJac(1, r);
     162                for(size_t k = 0; k < 2; k++)
     163                {       if( k == 0 )
     164                                h_check.option(CppAD::atomic_base<double>::bool_sparsity_enum);
     165                        else
     166                                h_check.option(CppAD::atomic_base<double>::set_sparsity_enum);
    166167
    167                 // check result
    168                 ok &= s[0] == std::set<size_t>{1, 2};
     168                        // compute sparsity pattern h_1(x) = x[1] + x[2]
     169                        CppAD::vector< std::set<size_t> > r(1), s(1);
     170                        r[0].insert(1);
     171                        s = h.RevSparseJac(1, r);
     172
     173                        // check result
     174                        ok &= s[0] == std::set<size_t>{1, 2};
     175                }
    169176
    170177                return ok;
Note: See TracChangeset for help on using the changeset viewer.