Tomato
OxModelT1AdapterLmfitLeastSquares.h
Go to the documentation of this file.
1 
7 #ifndef Tomato_OXModelT1ADAPTERLMFITLEASTSQUARES_H
8 #define Tomato_OXModelT1ADAPTERLMFITLEASTSQUARES_H
9 
10 #include "CmakeConfigForTomato.h"
11 #ifdef USE_LMFIT
12 
13 #include "OxModel.h"
14 
15 namespace Ox {
16 
17  template<typename TYPE>
18  class ModelT1AdapterLmfitLeastSquares {
19 
20  public:
21 
22  // least squares function problem formulation
23  static inline
24  void
25  calcLSResiduals(const double *parameters, int nSamples, const void *data_void, double *residuals, int *info ){
26 
27  Model<TYPE> *model = const_cast<Model<TYPE> *>(reinterpret_cast<const Model<TYPE> *>(data_void));
28 
29  model->calcLSResiduals(parameters, residuals);
30 
31  }
32 
33  };
34 
35 } // namespace Ox
36 
37 
38 #endif //USE_LMFIT
39 
40 #endif //Tomato_OXModelT1ADAPTERLMFITLEASTSQUARES_H
Definition: OxCalculator.h:19