Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
functions
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
44
class
MDL_HIPPOPLOT_API
Erfc
:
public
FunctionBase
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_
Generated for HippoDraw Class Library by