Erfc.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
11 #ifndef _Erfc_H_
12 #define _Erfc_H_
13 
14 #include "FunctionBase.h"
15 
16 namespace hippodraw {
17 
45 {
46  private:
47  enum{MEAN,SIGMA,NORM};
48 
49  protected:
51  virtual void initialize();
52 
53  public:
55  Erfc ();
56 
58  Erfc ( double mean, double sigma, double norm );
59 
60  virtual FunctionBase * clone () const;
61 
63  virtual double operator () ( double x ) const;
64 
65  virtual void initialParameters ( const FunctionHelper * helper );
66 
67  //Help functions:
68  double calcErfc(double x) const;
69 
70  protected:
71  virtual double derivByParm ( int i, double x ) const;
72 
73  double derivByRed ( double value) const;
74 
75 private:
77  inline double calcRed(double value) const
78  {
79  if(m_parms[SIGMA] == 0.0) {
80  Erfc * p = const_cast < Erfc * > ( this );
81  p->m_parms[SIGMA] = 0.0001; //dummy lower value
82  }
83 
84  return (value - m_parms[MEAN])/m_parms[SIGMA];
85  }
86 
87 
88 
89 };
90 
91 } // namespace hippodraw
92 
93 #endif// _Erfc_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
unsigned int i
A function that can be used with a fitter.
Definition: Erfc.h:44
std::vector< double > m_parms
The parameter values.
Definition: FunctionBase.h:109
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
double norm(const std::vector< double > &a)
Computes the two norm of the vector.
Definition: NumLinAlg.cxx:285
An abstract base class to help FunctionBase objects perform some operations.
hippodraw::FunctionBase class interface
double calcRed(double value) const
compute the reduced variable:
Definition: Erfc.h:77

Generated for HippoDraw Class Library by doxygen