ConstantF.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 #include "msdevstudio/MSconfig.h"
14 #endif
15 
16 #include "ConstantF.h"
17 
18 #include "FunctionHelper.h"
19 
20 #include <cassert>
21 
22 #ifdef ITERATOR_MEMBER_DEFECT
23 using namespace std;
24 #else
25 using std::vector;
26 #endif
27 
28 namespace hippodraw {
29 
30 ConstantF::ConstantF ( )
31 {
32  initialize ();
33 }
34 
35 ConstantF::ConstantF ( double value )
36 {
37  initialize ();
38 
39  m_parms[0] = value;
40 }
41 
42 void ConstantF::initialize ()
43 {
44  m_name = "Constant";
45  m_parm_names.push_back ( "value" );
46 
47  resize ();
48 }
49 
51 {
52  return new ConstantF ( *this );
53 }
54 
55 double ConstantF::operator () ( double ) const
56 {
57  return m_parms[0];
58 }
59 
60 void
61 ConstantF::
62 initialParameters ( const FunctionHelper * helper )
63 {
64  m_parms[0] = helper->meanValue ();
65 }
66 
67 double ConstantF::derivByParm ( int i, double ) const
68 {
69  assert ( i == 0 );
70 
71  return 1.0;
72 }
73 
74 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen