20 #ifndef _QUADRATIC_FUNCTION_H_
21 #define _QUADRATIC_FUNCTION_H_
23 #include "mbsim/functions/function.h"
29 template<
typename Ret,
typename Arg>
37 QuadraticFunction(
double a0_,
double a1_,
double a2_) : a0(a0_), a1(a1_), a2(a2_) { }
38 Ret operator()(
const Arg &x_) {
42 typename B::DRetDArg parDer(
const Arg &x_) {
46 typename B::DRetDArg parDerDirDer(
const Arg &xDir_,
const Arg &x) {
50 Ret parDerParDer(
const double &x) {
53 void initializeUsingXML(xercesc::DOMElement *element) {
54 xercesc::DOMElement *e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"a0");
55 if(e) a0=Element::getDouble(e);
56 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"a1");
57 if(e) a1=Element::getDouble(e);
58 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"a2");
59 a2=Element::getDouble(e);
Definition: quadratic_function.h:27
Definition: planar_contour.h:31