data.h 878 Bytes
Newer Older
1 2 3
#pragma once

#include <string>
4
#include <utility>
5

6 7
#include <QtPlugin>

8
#include "common.h"
Laurent Belcour's avatar
Laurent Belcour committed
9
#include "args.h"
10

11
class data
12 13 14 15 16
{
		public: // methods

		// Load data from a file
		virtual void load(const std::string& filename) = 0 ;
Laurent Belcour's avatar
Laurent Belcour committed
17
		virtual void load(const std::string& filename, const arguments& args) = 0 ;
18 19

		// Acces to data
20 21
		virtual vec get(int i) const = 0 ;
		virtual vec operator[](int i) const = 0 ;
22 23 24 25
		virtual vec value(vec in, vec out) const 
		{
			return vec(_nY) ;
		}
26

27
		// Get data size, e.g. the number of samples to fit
28 29
		virtual int size() const = 0 ;

30
		// Get min and max input space values
31 32 33 34 35 36 37 38 39
		virtual vec min() const = 0 ;
		virtual vec max() const = 0 ;

		virtual int dimX() const { return _nX ; } ;
		virtual int dimY() const { return _nY ; } ;
	
	protected:
		// Dimension of the function
		int _nX, _nY ;
40
} ;
41 42
	 
Q_DECLARE_INTERFACE(data, "Fitter.Data")