30 template <
typename Real>
35 Minimize1(std::function<Real(Real)>
const& F,
int maxLevel,
41 void GetMinimum(Real
t0, Real
t1, Real tInitial, Real& tMin, Real& fMin);
48 void GetMinimum(Real t0, Real f0, Real tm, Real fm, Real t1, Real f1,
62 template <
typename Real>
72 template <
typename Real>
74 Real& tMin, Real& fMin)
76 LogAssert(t0 <= tInitial && tInitial <= t1,
"Invalid initial t value.");
78 mTMin = std::numeric_limits<Real>::max();
79 mFMin = std::numeric_limits<Real>::max();
108 template <
typename Real>
117 if ((t1 - tm)*(f0 - fm) > (tm - t0)*(fm - f1))
176 template <
typename Real>
185 Real tm = ((Real)0.5)*(t0 +
t1);
193 if (f0 - ((Real)2)*fm + f1 >(Real)0)
252 template <
typename Real>
254 Real fm, Real
t1, Real f1,
int level)
267 Real
const epsilon = (Real)1e-08;
268 Real
const tolerance = (Real)1e-04;
281 Real denom = tmp1 - tmp0;
287 Real tv = tm + ((Real)0.5)*(dt1*tmp1 - dt0*tmp0) / denom;
288 LogAssert(t0 <= tv && tv <= t1,
"Vertex not in interval.");
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
#define LogAssert(condition, message)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
void GetBracketedMinimum(Real t0, Real f0, Real tm, Real fm, Real t1, Real f1, int level)
std::function< Real(Real)> mFunction
Minimize1(std::function< Real(Real)> const &F, int maxLevel, int maxBracket)
void GetMinimum(Real t0, Real t1, Real tInitial, Real &tMin, Real &fMin)