ScalarConstant.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/MEAL/MEAL/ScalarConstant.h
10 
11 #ifndef __ScalarConstant_H
12 #define __ScalarConstant_H
13 
14 #include "MEAL/Scalar.h"
15 
16 namespace MEAL {
17 
19  class ScalarConstant : public Scalar {
20 
21  public:
22 
24  ScalarConstant (double value = 0);
25 
27  const ScalarConstant& operator = (const ScalarConstant& scalar);
28 
30  void set_value (double val) { value = val; }
31 
32  // ///////////////////////////////////////////////////////////////////
33  //
34  // Function implementation
35  //
36  // ///////////////////////////////////////////////////////////////////
37 
39  std::string get_name () const;
40 
41  // ///////////////////////////////////////////////////////////////////
42  //
43  // Scalar implementation
44  //
45  // ///////////////////////////////////////////////////////////////////
46 
48  void calculate (double& result, std::vector<double>* gradient);
49 
50  protected:
51 
53  double value;
54 
55  };
56 
57 }
58 
59 #endif
void set_value(double val)
Set the value.
Definition: ScalarConstant.h:40
Represents a constant model with no parameters.
Definition: Constant.h:28
std::string get_name() const
Return the name of the class.
Definition: ScalarConstant.C:31
void calculate(double &result, std::vector< double > *gradient)
Return the value.
Definition: ScalarConstant.C:36
Represents a constant scalar value with no parameters or arguments.
Definition: ScalarConstant.h:24
ScalarConstant(double value=0)
Default constructor.
Definition: ScalarConstant.C:14
double value
The value returned by evaluate.
Definition: ScalarConstant.h:63
const ScalarConstant & operator=(const ScalarConstant &scalar)
Assignment operator.
Definition: ScalarConstant.C:24
Namespace in which all modeling and calibration related code is declared.
Definition: ExampleComplex2.h:16
An evaluation policy that does not cache calculations.
Definition: NotCached.h:27

Generated using doxygen 1.8.17