// CuddPlaLoadTest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include "cudd.h"
#include "CuddPlaLoad.h"
#include "time.h"
#include "string.h"

int main(int argc, char* argv[])
{
	time_t start, end;

	DdManager *manager;	
	int i;
	int k;
	char s[10];
	manager=Cudd_Init(0,0,CUDD_UNIQUE_SLOTS,CUDD_CACHE_SLOTS,0);
	BddArray result;
	char path[50] = "C:\\Testy\\Vystupy\\i50o250t1000dc50";
	char fullPath[50];
	
	strcpy(fullPath, path);
	strcat(fullPath , ".pla");
	start = clock();
	Cudd_PlaLoad(manager, fullPath, &result);
	end = clock();
	
	/* Soubor pro zaznam reportu funkce PlaLoad*/
	FILE *f;
	strcpy(fullPath, path);
	strcat(fullPath , ".txt");
	f = fopen(fullPath, "w");
	//Cudd_PrintInfo(manager, f);
	fprintf(f, "Time to build BDD:%d\n" , (int)(end - start));
	fprintf(f, "Count of Nodes:%d\n" , (int)Cudd_ReadNodeCount(manager));
	fclose(f);
	for(i=0;i<result.o;i++){
		if(result.fRoot[i]){
			k=Cudd_DagSize(result.fRoot[i]);
      printf("%2d   %d\n",i,k);
      }
    }
	return 0;
}
