https://github.com/ElsevierSoftwareX/SOFTX_2019_219
Revision cc7055c78202813215e6c607255bdfdf6e088dca authored by Konrad Werys on 01 November 2019, 12:51:09 UTC, committed by Konrad Werys on 01 November 2019, 12:51:09 UTC
1 parent 00b20ae
Raw File
Tip revision: cc7055c78202813215e6c607255bdfdf6e088dca authored by Konrad Werys on 01 November 2019, 12:51:09 UTC
ci: big changes to the builds v13
Tip revision: cc7055c
OxFunctionsT1AdapterLmfitLeastSquares.h
/*!
 * \file OxFunctionsT1AdapterLmfitLeastSquares.h
 * \author Konrad Werys
 * \date 2019/08/15
 */

#ifndef Tomato_OXFUNCTIONST1ADAPTERLMFITLEASTSQUARES_H
#define Tomato_OXFUNCTIONST1ADAPTERLMFITLEASTSQUARES_H

#include "CmakeConfigForTomato.h"
#ifdef USE_LMFIT

#include "OxFunctionsT1.h"

namespace Ox {

    template<typename TYPE>
    class FunctionsT1AdapterLmfitLeastSquares {

    public:

        // least squares function problem formulation
        static inline
        void
        calcLSResiduals(const double *parameters, int nSamples, const void *data_void, double *residuals, int *info ){

            FunctionsT1<TYPE> *Functor = const_cast<FunctionsT1<TYPE> *>(reinterpret_cast<const FunctionsT1<TYPE> *>(data_void));

            Functor->calcLSResiduals(parameters, residuals);

        }

    };

} // namespace Ox


#endif //USE_LMFIT

#endif //Tomato_OXFUNCTIONST1ADAPTERLMFITLEASTSQUARES_H
back to top