Ejemplo n.º 1
0
int main() {

  Matrix *a, *b;
  Polyhedron *A, *B;
  Param_Polyhedron *PA;
  const char **param_name;
  
  a = Matrix_Read();
  A = Constraints2Polyhedron(a,200);
  Matrix_Free(a);
  
  b = Matrix_Read();
  B = Constraints2Polyhedron(b,200);
  Matrix_Free(b);
  
  /* Read the name of the parameters */
  param_name = Read_ParamNames(stdin,B->Dimension);  
  PA = Polyhedron2Param_Vertices(A,B,500);  
  Param_Vertices_Print(stdout,PA->V,param_name);
  Domain_Free(A);
  Domain_Free(B);
  Param_Polyhedron_Free( PA );
  free(param_name);
  return 0;
} /* main */
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
	int nchamber;
	unsigned nparam;
	Matrix *A;
	Polyhedron *P, *C;
	Param_Polyhedron *PP;
	Param_Domain *PD;
	struct barvinok_options *options = barvinok_options_new_with_defaults();

	argc = barvinok_options_parse(options, argc, argv, ISL_ARG_ALL);

	A = Matrix_Read();
	assert(A);

	nparam = A->NbRows;
	C = Universe_Polyhedron(nparam);
	P = partition2polyhedron(A, options);
	Matrix_Free(A);

	PP = Polyhedron2Param_Polyhedron(P, C, options);
	Polyhedron_Free(P);
	Polyhedron_Free(C);

	nchamber = 0;
	for (PD = PP->D; PD; PD = PD->next)
		nchamber++;

	printf("%d\n", nchamber);
	for (PD = PP->D; PD; PD = PD->next) {
		printf("\n");
		Polyhedron_PrintConstraints(stdout, P_VALUE_FMT, PD->Domain);
	}
	Param_Polyhedron_Free(PP);

	barvinok_options_free(options);
	return 0;
}