int main(void) 
{
  set s1, s2;
  int m = 10;

  s1 = set_init(m);
  set_add(s1, 1);
  set_add(s1, 3);
  set_add(s1, 5);
  s2 = set_init(m + 2);
  set_add(s2, 0);
  set_add(s2, 2);
  set_add(s2, 3);
  set_add(s2, 4);
  set_add(s2, 5);
  set_add(s2, 11);
  set_print(s1);
  printf("\n");
  set_print(s2);
  printf("\nIntersection: ");
  set_print(set_intersection(s1, s2));
  printf("\nUnion: ");
  set_print(set_union(s1, s2));
  printf("\nComplement for s2: ");
  set_print(set_complement(s2));
  printf("\n");  
  return 0;
}
INT andre_construction_line_element::rank(INT verbose_level)
{
	INT f_v = (verbose_level >= 1);
	INT i, j, a, rk, idx;

	if (f_v) {
		cout << "andre_construction_line_element::rank" << endl;
		}
	line_rank = 0;
	if (f_is_at_infinity) {
		line_rank = 0;
		}
	else {
		line_rank = 1;

		F->Gauss_simple(coordinates, k, n, pivots, 0 /* verbose_level */);
		set_complement(pivots, k, non_pivots, a, n);

		for (i = 0; i < k; i++) {
			F->Gauss_step(coordinates + i * n, coordinates + k * n, n, pivots[i], 0 /* verbose_level */);
				// afterwards: v2[idx] = 0 and v1,v2 span the same space as before
				// v1 is not changed if v1[idx] is nonzero
			}
		for (i = 0; i < n - k; i++) {
			j = non_pivots[i];
			a = coordinates[k * n + j];
			coset[i] = a;
			}
		AG_element_rank(q, coset, 1, n - k, coset_idx);

		rk = Andre->Grass->rank_INT_here(coordinates, 0 /* verbose_level*/);
		if (!INT_vec_search(Andre->spread_elements_numeric_sorted, spread_size, rk, idx)) {
			cout << "andre_construction_line_element::rank annot find the spread element in the sorted list" << endl;
			exit(1);
			}
		parallel_class_idx = Andre->spread_elements_perm_inv[idx];
		line_rank += parallel_class_idx * Andre->order + coset_idx;
		}
	if (f_v) {
		cout << "andre_construction_line_element::unrank done" << endl;
		}
	return line_rank;
}