Changeset 1558 for trunk/test_more


Ignore:
Timestamp:
Oct 23, 2009 11:46:58 AM (11 years ago)
Author:
bradbell
Message:

trunk: Extend sparse Hessian driver to optionally use set representation of sparsity.

check_doxygen.sh: add sparse_hessian.hpp to list of documented files.
*/sparse_hessian.cpp: example and test of using sets for sparse calculations.
makefile.am: add sparse_hessian to list of tests.
makefile.in: changes automatically generated by change in makefile.am.
test_more.cpp: add sparse_hessian to list of tests.
sparse_jacobina.cpp: minor edits.
whats_new_09.omh: user's view of the changes.
ad_fun.hpp: add new sparse Hessian private helper functions to class.
sparse_jacobian.hpp: minor edits.
sparse_hessian.cpp: change to allow for vectors of sets sparsity patterns.

Location:
trunk/test_more
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/makefile.am

    r1556 r1558  
    120120        sin_cos.cpp \
    121121        sinh.cpp \
     122        sparse_hessian.cpp \
    122123        sparse_jacobian.cpp \
    123124        sparse_vec_ad.cpp \
  • trunk/test_more/sparse_jacobian.cpp

    r1554 r1558  
    264264bool sparse_jacobian(void)
    265265{       bool ok = true;
    266         typedef std::vector< std::set<size_t> >   std_vector_set;
    267         typedef std::valarray< std::set<size_t> > std_valarray_set;
    268         typedef CppAD::vector< std::set<size_t> > cppad_vector_set;
    269266        // ---------------------------------------------------------------
    270267        // vector of bool cases
     
    279276        // ---------------------------------------------------------------
    280277        // vector of set cases
     278        typedef std::vector< std::set<size_t> >   std_vector_set;
     279        typedef std::valarray< std::set<size_t> > std_valarray_set;
     280        typedef CppAD::vector< std::set<size_t> > cppad_vector_set;
     281        //
    281282        ok &= forward_set< CppAD::vector<double>, std_vector_set   >();
    282283        ok &= reverse_set< std::valarray<double>, std_vector_set   >();
     
    285286        ok &= reverse_set< CppAD::vector<double>, cppad_vector_set >();
    286287        //
    287 # ifndef _MSC_VER
    288         // there appears to be a bug in valarray on Microsoft compilers
    289         ok &= forward_set< std::valarray<double>, std_valarray_set >();
    290         ok &= reverse_set< std::valarray<double>, std_valarray_set >();
    291 # endif
     288        // According to section 26.3.2.3 of the 1998 C++ standard
     289        // a const valarray does not return references to its elements.
     290        // ok &= forward_set< std::valarray<double>, std_valarray_set >();
     291        // ok &= reverse_set< std::valarray<double>, std_valarray_set >();
    292292        // ---------------------------------------------------------------
    293293        return ok;
  • trunk/test_more/test_more.cpp

    r1556 r1558  
    7272extern bool SinCos(void);
    7373extern bool Sinh(void);
     74extern bool sparse_hessian(void);
    7475extern bool sparse_jacobian(void);
    7576extern bool sparse_vec_ad(void);
     
    168169        ok &= Run( SinCos,          "SinCos"         );
    169170        ok &= Run( Sinh,            "Sinh"           );
     171        ok &= Run( sparse_hessian,  "sparse_hessian" );
    170172        ok &= Run( sparse_jacobian, "sparse_jacobian");
    171173        ok &= Run( sparse_vec_ad,   "sparse_vec_ad"  );
Note: See TracChangeset for help on using the changeset viewer.