Ejemplo n.º 1
0
int main(int argc, char *argv[]) {
  
  // read squares from file
  if (argc <= 1) {
    printf("No order specified\n");
    return 1;
  }
  square_list squares = file2squares(argv[1]);
  if (squares == NULL) {
    return 1;
  }
  int size = squares->square->size;
  
  // initialize best metrics
  best_orthogonal = 2 * size;
  best_diagonal = size * size;
  best_2AD = 3 * size * size;
  best_2ADE = 4 * size * size;
  best_DE_for_A = size * size * size * 2;
  
  // look at all permuted combinations
  verbose = true;
  compare_pairs(size, squares);
  
  return 0;
}
Ejemplo n.º 2
0
 void compare_key(X const& x, BOOST_DEDUCED_TYPENAME X::value_type const& val)
 {
     compare_pairs(
         x.equal_range(get_key<X>(val)),
         this->equal_range(get_key<X>(val)),
         (BOOST_DEDUCED_TYPENAME X::value_type*) 0);
 }
int main(int argc, char *argv[])
{
	int i = 1, remaining = argc - 1;
	if (remaining > 0 && strcmp(argv[i], "-t") == 0) {
		technical = 1;
		remaining--;
		i++;
	}
	if (remaining > 0 && strcmp(argv[i], "-q") == 0) {
		quiet = 1;
		remaining--;
		i++;
	}
	if (remaining > 0 && strcmp(argv[i], "-t") == 0) {
		technical = 1;
		remaining--;
		i++;
	}

	if (remaining != 2) {
		usage("wrong number of arguments");
	} else {
		FILE *data_input = fopen(argv[i], "r");
		assert(data_input);
		FILE *output = fopen(argv[i + 1], "w");
		assert(output);

		read_data(data_input);
		compare_pairs();
		print_counters();
		init_scores_and_sort();
		print_pairs();
		mark_for_output();
		recalc_relevant_for_output(output);

		return 0;
	}
}