#include "MtxExpr.hpp"
#include "Math387.hpp"
#include "Optimization.hpp"
double __fastcall Fun(
TVec *
const x,
TVec*
const c, System::TObject*
const * o,
const int o_Size)
{
double* X = x->PValues(0);
return Sin(X[0])+
IntPower(X[0]+2,2);
// note that Pars holds only one variable !
}
void __fastcall Example();
{
// initial estimates for x1 and x2
double x;
int iter = MinBrent(-10,10,Fun,mvDouble,NULL,-1,NULL,-1,x,500,1.0E-8,NULL);
// stop if Iters >500 or Tolerance < 1e-8
// returns res = -1.8582461797
}