| 48 | typename U |
| 49 | > |
| 50 | double find_min ( |
| 51 | const funct& f, |
| 52 | T& x, |
| 53 | long npt, |
| 54 | const U& xl_, |
| 55 | const U& xu_, |
| 56 | const double rhobeg, |
| 57 | const double rhoend, |
| 58 | const long max_f_evals |
| 59 | ) const |
| 60 | { |
| 61 | const unsigned long n = x.size(); |
| 62 | const unsigned long w_size = (npt+5)*(npt+n)+3*n*(n+5)/2; |
| 63 | std::unique_ptr<doublereal[]> w(new doublereal[w_size]); |
| 64 | |
| 65 | // make these temporary matrices becuse U might be some |
| 66 | // kind of matrix_exp that doesn't support taking the address |
| 67 | // of the first element. |
| 68 | matrix<double,0,1> xl(xl_); |
| 69 | matrix<double,0,1> xu(xu_); |
| 70 | |
| 71 | |
| 72 | return bobyqa_ (f, |
| 73 | x.size(), |
| 74 | npt, |
| 75 | &x(0), |
| 76 | &xl(0), |
| 77 | &xu(0), |
| 78 | rhobeg, |
| 79 | rhoend, |
| 80 | max_f_evals, |
| 81 | w.get() ); |
| 82 | } |
| 83 | |
| 84 | private: |
| 85 |
no test coverage detected