ALTA  alpha
rational_fitter.h
1 /* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
2 
3  Copyright (C) 2013, 2014 Inria
4 
5  This file is part of ALTA.
6 
7  This Source Code Form is subject to the terms of the Mozilla Public
8  License, v. 2.0. If a copy of the MPL was not distributed with this
9  file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 
11 #pragma once
12 
13 // Include STL
14 #include <vector>
15 #include <string>
16 #include <engine.h>
17 
18 // Interface
19 #include <core/function.h>
20 #include <core/data.h>
21 #include <core/fitter.h>
22 #include <core/args.h>
23 #include <core/rational_function.h>
24 #include <core/vertical_segment.h>
25 
26 //#define USE_MATLAB
27 #define DEBUG
28 
29 using namespace alta;
30 
36 {
37  public: // methods
38 
40  virtual ~rational_fitter_matlab() ;
41 
42  // Fitting a data object
43  //
44  virtual bool fit_data(const ptr<data>& d, ptr<function>& fit, const arguments& args) ;
45 
46  // Provide user parameters to the fitter
47  //
48  virtual void set_parameters(const arguments& args) ;
49 
50  protected: // function
51 
52  // Fitting a data object using np elements in the numerator and nq
53  // elements in the denominator
54  virtual bool fit_data(const ptr<vertical_segment>& d, int np, int nq, const ptr<rational_function>& fit) ;
55  virtual bool fit_data(const ptr<vertical_segment>& dat, int np, int nq, int ny, rational_function_1d* fit) ;
56 
57  protected: // data
58 
59  // min and Max usable np and nq values for the fitting
60  //
61  int _max_np, _max_nq ;
62  int _min_np, _min_nq ;
63  Engine *ep;
64 
65  // Decide which quadratic solver to use. Matlab's or the QPAS solver
66  bool _use_matlab;
67 } ;
68 
A plugin to fit rational function using the Matlab Engine.
Definition: rational_fitter.h:35
A useful class for storing the high-level arguments of a program or a function.
Definition: args.h:34
Fitting interface for generic fitting algorithms.
Definition: fitter.h:25
Definition: args.h:23