| 49 | // ---------------------------------------------------------------------------------------- |
| 50 | |
| 51 | class chebyquad_function_model |
| 52 | { |
| 53 | public: |
| 54 | |
| 55 | // Define the type used to represent column vectors |
| 56 | typedef matrix<double,0,1> column_vector; |
| 57 | // Define the type used to represent the hessian matrix |
| 58 | typedef matrix<double> general_matrix; |
| 59 | |
| 60 | double operator() ( |
| 61 | const column_vector& x |
| 62 | ) const |
| 63 | { |
| 64 | return chebyquad(x); |
| 65 | } |
| 66 | |
| 67 | void get_derivative_and_hessian ( |
| 68 | const column_vector& x, |
| 69 | column_vector& d, |
| 70 | general_matrix& h |
| 71 | ) const |
| 72 | { |
| 73 | d = chebyquad_derivative(x); |
| 74 | h = chebyquad_hessian(x); |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | // ---------------------------------------------------------------------------------------- |
| 79 | // ---------------------------------------------------------------------------------------- |
no outgoing calls