https://github.com/ElsevierSoftwareX/SOFTX_2019_219
Raw File
Tip revision: c6d23f52bf7d7de2698a41518f6c2638decc9d6b authored by Konrad Werys on 26 October 2018, 15:54:52 UTC
minor changes
Tip revision: c6d23f5
OxFunctionsT1Basic.h
/*!
 * \file OxFunctionsT1Basic.h
 * \author Konrad Werys
 * \date 2018/07/29
 */

#ifndef Tomato_OXFUNCTIONST1BASIC_H
#define Tomato_OXFUNCTIONST1BASIC_H

#include "OxFunctionsT1.h"
#include <cmath>

namespace Ox {

    /**
     * \class FunctionsT1Basic
     * \brief Container for a basic model function \f$ A-B\exp(t/T_1^*) \f$, cost function and Least-Squares
     * function and derivatives.
     * \details
     * @tparam MeasureType
     */
    template< typename MeasureType >
    class FunctionsT1Basic : public FunctionsT1<MeasureType>{

    public:

        virtual MeasureType calcModelValue(MeasureType time);
        virtual void calcLSResiduals(MeasureType* residuals);
        virtual void calcLSJacobian(MeasureType* jacobian);
        virtual MeasureType calcCostValue();
        virtual void calcCostDerivative(MeasureType* derivative);

        FunctionsT1Basic() : FunctionsT1<MeasureType>(){
            this->_nDims = 3;
        }

        /**
         * cloning
         * @return
         */
        virtual FunctionsT1<MeasureType> *newByCloning() { return new FunctionsT1Basic<MeasureType>(*this); }

        /**
         * \brief do not forget about the virtual destructor, see
         * https://stackoverflow.com/questions/461203/when-to-use-virtual-destructors
         */
        virtual ~FunctionsT1Basic(){};
    };
} //namespace Ox

#include "OxFunctionsT1Basic.hxx"

#endif //Tomato_OXFUNCTIONST1BASIC_H
back to top