#pragma once
#include "armadillo"

using namespace arma;
ref class discrete
{
private:
	static array<double>^ x; //matice stavovych promennych, nemuzu ji udelat mat x, pac je to rizena trida, bez ref by to slo
	static array<double>^ numZ, ^denZ; 
public:
	discrete(void);
	discrete(array<double>^ _num, array<double>^ _den, float Tvz);//konstruktor
	void create_transfer_function(array<double>^ _num, array<double>^ _den, float Tvz);
	void clear_states(void);
	mat c2d (mat num, mat den, float Tvz);
	double output (mat Fz, double _u);
	double output (double _u);
	static array<double>^ mat2array(mat _M, int rowcol, bool how);
	static mat array2mat(array<double>^ pole, bool how);
private:
	mat matT(mat _R, int _rad);
	mat matW(mat _T, mat _S, int _rad);
	unsigned int factorial(unsigned int cislo);
//	mat matW(mat T, mat _S);
};
