#include "Filtr.h"

Filter Filter::filtration(int k)
{
	std::vector<int> localTab;
	
	for (int i = 0; i < tab.size(); i++)
	{
		if (tab[i] == k) {
			continue;
		}
		else {
			localTab.push_back(tab[i]);
		}
	}
	
	Filter filtr(localTab);

	return filtr;
}

Filter Filter::reverse()
{
	std::vector<int> localTab;

	for (int i = tab.size()-1 ; i >= 0 ; i--)
	{
		localTab.push_back(tab[i]);
	}

	Filter filtr(localTab);

	return filtr;

}

void Filter::toString()
{
	for (int var : tab)
	{
		std::cout << var << " ";
	}
	std::cout << std::endl;
}
