Changeset 3703


Ignore:
Timestamp:
Aug 1, 2015 8:07:50 AM (5 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: a9c9db06c0d12ee455d057eb2eb6283e0ee60365
end hash code: 4211b637c3ed2df88a58ca06c6b215d41b2b5e61

commit 4211b637c3ed2df88a58ca06c6b215d41b2b5e61
Author: Brad Bell <bradbell@…>
Date: Sat Aug 1 05:05:03 2015 -0700

Add example of computing Hessian for a subset of variables without using
multiple levels of AD.

Location:
trunk
Files:
1 added
6 edited

Legend:

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

    r3702 r3703  
    282282$children%
    283283        example/sparse_hessian.cpp%
    284         example/sub_sparse_hes.cpp
     284        example/sub_sparse_hes.cpp%
     285        example/sparse_sub_hes.cpp
    285286%$$
    286287
     
    292293
    293294$head Subset Hessian$$
    294 The routine
    295 $cref sub_sparse_hes.cpp$$
    296 is examples and test for computing a sparse Hessian
     295The routines
     296$cref sub_sparse_hes.cpp$$ and $cref sparse_sub_hes.cpp$$
     297are examples and tests that compute a sparse Hessian
    297298for a subset of the variables.
    298 It return $code true$$, if it succeeds and $code false$$ otherwise.
     299They return $code true$$, if they succeed and $code false$$ otherwise.
    299300
    300301$end
  • trunk/example/CMakeLists.txt

    r3688 r3703  
    191191        sparse_hessian.cpp
    192192        sparse_jacobian.cpp
     193        sparse_sub_hes.cpp
    193194        sqrt.cpp
    194195        stack_machine.cpp
  • trunk/example/example.cpp

    r3688 r3703  
    165165extern bool sparse_hessian(void);
    166166extern bool sparse_jacobian(void);
     167extern bool sparse_sub_hes(void);
    167168extern bool Sqrt(void);
    168169extern bool StackMachine(void);
     
    326327        ok &= Run( sparse_hessian,    "sparse_hessian"   );
    327328        ok &= Run( sparse_jacobian,   "sparse_jacobian"  );
     329        ok &= Run( sparse_sub_hes,    "sparse_sub_hes"   );
    328330        ok &= Run( Sqrt,              "Sqrt"             );
    329331        ok &= Run( StackMachine,      "StackMachine"     );
  • trunk/example/sub_sparse_hes.cpp

    r3652 r3703  
    1313/*
    1414$begin sub_sparse_hes.cpp$$
    15 $index subset, sparse hessian$$
    16 $index sparse, subset hessian$$
    17 $index hessian, sparse subset$$
    1815
    1916$section Computing Sparse Hessian for a Subset of Variables$$
    2017
    2118$head Purpose$$
    22 This example shows how to compute the Hessian for a subset of the variables
     19This example uses
     20$cref/multiple levels of AD/mul_level/$$
     21to compute the Hessian for a subset of the variables
    2322without having to compute the sparsity pattern for the entire function.
     23
     24$head See Also$$
     25$cref sparse_sub_hes.cpp$$
    2426
    2527$head Function$$
     
    116118                {       j = *itr;
    117119                        if( j <= i )
    118                         {       row.push_back(i);
     120                        {       row.push_back(i);
    119121                                col.push_back(j);
    120122                        }
  • trunk/omh/example_list.omh

    r3688 r3703  
    238238$rref sparse_jac_fun.cpp$$
    239239$rref sparse_jacobian.cpp$$
     240$rref sparse_sub_hes.cpp$$
    240241$rref speed_example.cpp$$
    241242$rref speed_program.cpp$$
  • trunk/omh/whats_new/whats_new_15.omh

    r3702 r3703  
    6060assist you in learning about changes between various versions of CppAD.
    6161
     62$head 07-31$$
     63Added the $cref sparse_sub_hes.cpp$$ example,
     64a way to compute the sparsity for a subset of variables without
     65using $cref/multiple levels of AD/mul_level/$$.
     66
    6267$head 06-16$$
    6368$list number$$
     
    252257$codep
    253258        Error detected by false result for
    254         ! ( hasnan(value) && check_for_nan_ )
     259        ! ( hasnan(value) && check_for_nan_ )
    255260$$
    256261This has been fixed so that only the conditional expression case that is used
Note: See TracChangeset for help on using the changeset viewer.