CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Square.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: Square.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
5 #include <assert.h>
6 
7 namespace Genfun {
9 
11 {}
12 
13 Square::Square(const Square & right) : AbsFunction(right)
14 {
15 }
16 
18 }
19 
20 double Square::operator() (double x) const {
21  return x*x;
22 }
23 
24 
25 
26 Derivative Square::partial(unsigned int index) const {
27  assert(index==0);
28  Variable x;
29  const AbsFunction & fPrime = 2*x;
30  return Derivative(&fPrime);
31 }
32 
33 
34 } // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Derivative partial(unsigned int) const
Definition: Square.cc:26
virtual double operator()(double argument) const
Definition: Square.cc:20
virtual ~Square()
Definition: Square.cc:17