| 86 | // ---------------------------------------------------------------------------------------- |
| 87 | |
| 88 | class rosen_model |
| 89 | { |
| 90 | /*! |
| 91 | This object is a "function model" which can be used with the |
| 92 | find_min_trust_region() routine. |
| 93 | !*/ |
| 94 | |
| 95 | public: |
| 96 | typedef ::column_vector column_vector; |
| 97 | typedef matrix<double> general_matrix; |
| 98 | |
| 99 | double operator() ( |
| 100 | const column_vector& x |
| 101 | ) const { return rosen(x); } |
| 102 | |
| 103 | void get_derivative_and_hessian ( |
| 104 | const column_vector& x, |
| 105 | column_vector& der, |
| 106 | general_matrix& hess |
| 107 | ) const |
| 108 | { |
| 109 | der = rosen_derivative(x); |
| 110 | hess = rosen_hessian(x); |
| 111 | } |
| 112 | }; |
| 113 | |
| 114 | // ---------------------------------------------------------------------------------------- |
| 115 | |