CalculatePolicy.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/MEAL/MEAL/CalculatePolicy.h
10 
11 #ifndef __MEAL_CalculatePolicy_H
12 #define __MEAL_CalculatePolicy_H
13 
14 #include "MEAL/EvaluationPolicy.h"
15 
16 namespace MEAL {
17 
19  template<class T>
20  class CalculatePolicy : public EvaluationPolicy<typename T::Result> {
21 
22  typedef typename T::Result Result;
23 
24  public:
25 
27  CalculatePolicy (T* context) : EvaluationPolicy<Result> (context)
28  { calculate_context = context; }
29 
30  void calculate (Result& r, std::vector<Result>* grad) const
31  { calculate_context->calculate (r, grad); }
32 
33  protected:
34 
37 
38  };
39 
40 }
41 
42 #endif
Managers of Function value and gradient.
Definition: EvaluationPolicy.h:26
T * calculate_context
The object that implements a calculate method.
Definition: CalculatePolicy.h:46
Namespace in which all modeling and calibration related code is declared.
Definition: ExampleComplex2.h:16
CalculatePolicy(T *context)
Default destructor.
Definition: CalculatePolicy.h:37

Generated using doxygen 1.8.17