6 #include "GeoGenericFunctions/Square.h" 7 #include "GeoGenericFunctions/Variable.h" 11 FUNCTION_OBJECT_IMP(Square)
16 Square::Square(
const Square & right) : AbsFunction(right)
23 double Square::operator() (
double x)
const {
29 Derivative Square::partial(
unsigned int index)
const {
30 if (index!=0)
throw std::range_error(
"Square: partial derivative index out of range");
32 const AbsFunction & fPrime = 2*x;
33 return Derivative(&fPrime);