Skip to content

Commit

Permalink
Scip patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Jul 21, 2020
1 parent 421e294 commit faeb2d2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CFLAGS += -Wall
CFLAGS += --pedantic
CFLAGS += -O9
#CFLAGS += -DBLISS_DEBUG
CFLAGS += -fPIC
CFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden

SRCS = defs.cc graph.cc partition.cc orbit.cc uintseqhash.cc heap.cc
SRCS += timer.cc utils.cc bliss_C.cc
Expand Down
21 changes: 12 additions & 9 deletions graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ AbstractGraph::AbstractGraph()

report_hook = 0;
report_user_param = 0;

limit_search_nodes = 0;
limit_generators = 0;
}


Expand Down Expand Up @@ -609,13 +612,7 @@ class TreeNode




typedef struct {
unsigned int splitting_element;
unsigned int certificate_index;
unsigned int subcertificate_length;
UintSeqHash eqref_hash;
} PathInfo;
// struct PathInfo moved to graph.hh by Thomas Rehn, 2011-07-12


void
Expand Down Expand Up @@ -745,7 +742,7 @@ AbstractGraph::search(const bool canonical, Stats& stats)
initialize_certificate();

std::vector<TreeNode> search_stack;
std::vector<PathInfo> first_path_info;
// first_path_info moved to graph.hh by Thomas Rehn, 2011-07-12
std::vector<PathInfo> best_path_info;

search_stack.clear();
Expand Down Expand Up @@ -1054,6 +1051,8 @@ AbstractGraph::search(const bool canonical, Stats& stats)
const unsigned int child_level = current_level+1;
/* Update some statistics */
stats.nof_nodes++;
if (limit_search_nodes && stats.nof_nodes >= limit_search_nodes)
break;
if(search_stack.size() > stats.max_level)
stats.max_level = search_stack.size();

Expand Down Expand Up @@ -1642,6 +1641,8 @@ AbstractGraph::search(const bool canonical, Stats& stats)
best_path_automorphism);
/* Update statistics */
stats.nof_generators++;
if (limit_generators && stats.nof_generators >= limit_generators)
break;
}

/*
Expand Down Expand Up @@ -1733,6 +1734,8 @@ AbstractGraph::search(const bool canonical, Stats& stats)

/* Update statistics */
stats.nof_generators++;
if (limit_generators && stats.nof_generators >= limit_generators)
break;
continue;

} /* while(!search_stack.empty()) */
Expand Down Expand Up @@ -5452,7 +5455,7 @@ Graph::nucr_find_first_component(const unsigned int level,
component.clear();
component_elements = 0;
sh_return = 0;
unsigned int sh_first = 0;
unsigned int sh_first = 1 << 31;
unsigned int sh_size = 0;
unsigned int sh_nuconn = 0;

Expand Down
29 changes: 29 additions & 0 deletions graph.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
along with bliss. If not, see <http://www.gnu.org/licenses/>.
*/

/** This is a patched version of bliss by Thomas Rehn extended by method AbstractGraph::set_search_limits() */
#define BLISS_PATCH_PRESENT

/**
* \namespace bliss
* The namespace bliss contains all the classes and functions of the bliss
Expand Down Expand Up @@ -111,6 +114,14 @@ public:



/** moved here from graph.cc by Thomas Rehn, 2011-07-12 */
typedef struct {
unsigned int splitting_element;
unsigned int certificate_index;
unsigned int subcertificate_length;
UintSeqHash eqref_hash;
} PathInfo;




Expand Down Expand Up @@ -284,7 +295,20 @@ public:
opt_use_long_prune = active;
}

/// information vector about first path
/** added by Thomas Rehn, 2011-07-12 */
std::vector<PathInfo> get_first_path_info() { return first_path_info; }

/// limits number of search nodes and generators during the backtrack search
/** added by Thomas Rehn, 2012-01-12
*
* \param searchNodeLimit if non-zero, limits the number of search nodes in search tree
* \param generatorLimit if non-zero, limits the maximal number of automorphism group generators to be found
*/
void set_search_limits(const unsigned int searchNodeLimit, const unsigned int generatorLimit) {
limit_search_nodes = searchNodeLimit;
limit_generators = generatorLimit;
}

protected:
/** \internal
Expand Down Expand Up @@ -519,6 +543,11 @@ protected:



/** added by Thomas Rehn, 2011-07-12 */
std::vector<PathInfo> first_path_info;

unsigned int limit_search_nodes;
unsigned int limit_generators;
};


Expand Down

0 comments on commit faeb2d2

Please sign in to comment.