45 #include "GlobiPack_TestLagrPolyMeritFunc1D.hpp"
60 template<
class Scalar>
61 inline Scalar sqr(
const Scalar &x) {
return x*x; }
64 template<
class Scalar>
65 inline Scalar cube(
const Scalar &x) {
return x*x*x; }
72 template<
class Scalar>
73 const RCP<TestLagrPolyMeritFunc1D<Scalar> > quadPhi()
76 typedef typename ST::magnitudeType ScalarMag;
77 Array<Scalar> alphaPoints = tuple<Scalar>(0.0, 2.0, 4.0);
78 Array<ScalarMag> phiPoints = tuple<ScalarMag>(6.0, 3.0, 6.0);
79 return testLagrPolyMeritFunc1D<Scalar>(alphaPoints, phiPoints);
101 const double cubicMut = 1e-3;
104 template<
class Scalar>
105 inline Scalar cubicPhiVal(
const Scalar &alpha)
106 {
return sqr(alpha - 2.0) + cubicMut * cube(alpha - 2.0) + 3.0; }
109 template<
class Scalar>
110 const RCP<TestLagrPolyMeritFunc1D<Scalar> > cubicPhi()
113 typedef typename ST::magnitudeType ScalarMag;
114 Array<Scalar> alphaPoints =
115 tuple<Scalar>(0.0, 1.0, 3.0, 4.0);
116 Array<ScalarMag> phiPoints =
118 cubicPhiVal(alphaPoints[0]),
119 cubicPhiVal(alphaPoints[1]),
120 cubicPhiVal(alphaPoints[2]),
121 cubicPhiVal(alphaPoints[3])
123 return testLagrPolyMeritFunc1D<Scalar>(alphaPoints, phiPoints);
const RCP< TestLagrPolyMeritFunc1D< Scalar > > testLagrPolyMeritFunc1D(const ArrayView< const Scalar > &alpha, const ArrayView< const Scalar > &phi)
Represents the evaluation point of the merit function phi(alpha) and/or is derivative Dphi(alpha)...
Lagrange Polynomial Merit Function used in testing.