Path: blob/master/src/sage/groups/perm_gps/partn_ref2/refinement_generic.h
8815 views
/*******************************************************************************1# Copyright (C) 2012 Thomas Feulner <[email protected]>2#3# Distributed under the terms of the GNU General Public License (GPL)4# as published by the Free Software Foundation; either version 2 of5# the License, or (at your option) any later version.6# http://www.gnu.org/licenses/7#******************************************************************************/89#include <stdio.h>10#include <stdlib.h>1112#ifndef BACKTRACK_WITHLATEX_DEBUG13#define BACKTRACK_WITHLATEX_DEBUG 0 // set to 1 if you have to debug14#endif1516static long *global_refine_vals_array = 0;1718static int my_comp_func(const void *a, const void *b)19{20long val_a = global_refine_vals_array[*((int *) a)];21long val_b = global_refine_vals_array[*((int *) b)];2223if(val_a == val_b)24return 0;25if(val_a < val_b)26return -1;27return 1;28}2930int in_array(int *list, int length, int el){31int i=0;32for(; i < length; i++ )33{34if ( el == list[i] )35{36return 1;37}38}39return 0;40}41424344