#include "test.h"

int main(int argc, char* argv[])
{
	FILE* input;
	matrix D;
	int *URT, *Filled;
	int urtCount;
	MemoryManager mem;
	nltrans_r solution;
	
	if (! (input = ParseCmdLine(argc, argv)))
	{
		return 0;
	}
	
	mem = CreateMemoryManager(5, 5, 0, 0);
	while (ParseStructure(input, "matrix D, arrayi URT", &Filled, &mem, &D, &URT, &urtCount))
	{
		DisplayStructure("matrix D, arrayi URT", Filled, &D, URT, urtCount);
		solution = nltrans(Filled[0] ? &D : 0, Filled[1] ? URT : 0, urtCount);
		printf("Solution:\n");
		Filled[0] = 1;
		Filled[1] = 1;
		DisplayStructure("arrayi FinalURTMask", Filled, solution.dtr, solution.dtrCount);
		FreeMemory(&mem);
		DeallocateNltrans(&solution);
		mem = CreateMemoryManager(5, 5, 0, 0);
	}
	FreeMemory(&mem);
	return 0;
}
