7 #ifndef Tomato_OXModelT1ADAPTERVNLLEASTSQUARES_H 8 #define Tomato_OXModelT1ADAPTERVNLLEASTSQUARES_H 10 #include "CmakeConfigForTomato.h" 13 #include <vnl/vnl_least_squares_function.h> 19 class ModelT1AdapterVnlLeastSquares :
public vnl_least_squares_function {
24 void f(vnl_vector<double>
const& params, vnl_vector<double> &residuals){
27 _ModelT1->calcLSResiduals(params.data_block(), residuals.data_block());
31 void gradf (vnl_vector< double >
const ¶ms, vnl_matrix< double > &jacobianVNL){
34 _ModelT1->calcLSJacobian(params.data_block(), jacobianVNL.data_block());
37 void setModel(Model<double>* _ModelT1){
38 this->_ModelT1 = _ModelT1;
42 Model<double>* getModel(){
49 ModelT1AdapterVnlLeastSquares(
int nDims,
int nSamples, UseGradient UseGradientVariable)
50 : vnl_least_squares_function (nDims, nSamples, UseGradientVariable){
58 ModelT1AdapterVnlLeastSquares(
const ModelT1AdapterVnlLeastSquares &old)
59 : vnl_least_squares_function(old){
60 _ModelT1 = old._ModelT1;
65 Model<double>* _ModelT1;
72 #endif //Tomato_OXModelT1ADAPTERVNLLEASTSQUARES_H
Definition: OxCalculator.h:19