C++ main module for gpm Package  1.0
MATH_SQRTFunction.h
Go to the documentation of this file.
1 #ifndef MATH_SQRTFunction_H
2 #define MATH_SQRTFunction_H
3 
5 
15  SP_OBJECT(MATH_SQRTFunction);
16 
17  // ATTRIBUTES
18 
19 
20 protected:
21  // METHODS
22 
23  // CONSTRUCTORS
24 
28  setSymbol("sqrt");
29  }
30 
31 
32 
33  // DESTRUCTORS
34 
35 
38  virtual ~MATH_SQRTFunction(void) {
39  }
40 
41 
42 private:
43 
44 public:
47  static inline SP::MATH_SQRTFunction New() {
48  SP::MATH_SQRTFunction p(new MATH_SQRTFunction(),MATH_SQRTFunction::Delete());
49  p->setThis(p);
50  return p;
51  }
52 
55  virtual SP::MATH_FunctionNode newInstance() const {
56  return New();
57  }
58 
59 
60  // SET methods
61 
62 
63  // GET methods
64 
65 public:
66  // OTHERS methods
69  virtual double computeFunction(const double* values,const int& n) const {
70  if (values[0]<0)
71  throw CORE_Exception("MATH_SQRTFunction",
72  "computeFunction("+CORE_Real::toString(values[0])+")","arguments out of range");
73 
74  return sqrt(values[0]);
75  }
76 
77 };
78 
79 #endif
virtual ~MATH_SQRTFunction(void)
destroy
Definition: MATH_SQRTFunction.h:38
virtual SP::MATH_FunctionNode newInstance() const
create a node expression
Definition: MATH_SQRTFunction.h:55
static SP::MATH_SQRTFunction New()
create a node expression
Definition: MATH_SQRTFunction.h:47
This class decribes a numerical function.
Definition: MATH_NumericalFunction.h:14
MATH_SQRTFunction(void)
create
Definition: MATH_SQRTFunction.h:27
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
void setSymbol(const tString &tag)
set the symbol
Definition: MATH_LeafExpression.h:86
tString toString() const
return the string associated to the real
Definition: CORE_Real.h:89
virtual double computeFunction(const double *values, const int &n) const
compute the function
Definition: MATH_SQRTFunction.h:69
DEFINE_SPTR(MATH_SQRTFunction)
This class decribes a square root function.
Definition: MATH_SQRTFunction.h:14
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106