function.h 798 Bytes
Newer Older
1
2
#pragma once

3
4
5
#include <functional>
#include <string>

6
7
#include <QtPlugin>

8
#include "common.h"
9
#include "args.h"
10
11

class data ;
12

Laurent Belcour's avatar
Laurent Belcour committed
13
class function 
14
15
16
17
{
	public: // methods

		// Overload the function operator
18
		virtual vec operator()(const vec& x) const = 0 ;
Laurent Belcour's avatar
Laurent Belcour committed
19
		virtual vec value(const vec& x) const = 0 ;
20
21
22
		
		// IO function to text files
		virtual void load(const std::string& filename) = 0 ;
23
		virtual void save(const std::string& filename, const arguments& args) const = 0 ;
24

pacanows's avatar
pacanows committed
25
26
        virtual int dimX() const { return _nX ; }
        virtual int dimY() const { return _nY ; }
27

pacanows's avatar
pacanows committed
28
29
        virtual void setDimX(int nX) { _nX = nX ; }
        virtual void setDimY(int nY) { _nY = nY ; }
30
31
32
33

	protected:
		// Dimension of the function
		int _nX, _nY ;
34
} ;
35

36
//Q_DECLARE_INTERFACE(function, "Fitter.Function")