37#include <bliss/defs.hh>
38#include <bliss/graph.hh>
98 if (
k1->level !=
k2->level )
144 return (SCIP_Bool)(
k1->value ==
k2->value);
180 if (
k1->lhs !=
k2->lhs )
183 return (SCIP_Bool)(
k1->rhs ==
k2->rhs);
202 const unsigned int*
aut
285 for (
int v = 0; v <
matrixdata->npermvars; ++v)
287 const int color =
matrixdata->permvarcolors[v];
291 int node = (int)
G->add_vertex((
unsigned) color);
294 (
void)
G->add_vertex((
unsigned) color);
333 SCIPdebugMsg(
scip,
"Filling graph with colored coefficient nodes for linear part.\n");
344 int node = (int)
G->add_vertex((
unsigned) (
nusedcolors + color));
393 const int color =
matrixdata->matcoefcolors[idx];
524 SCIP_Real* vals =
NULL;
529 int nuniquecoefs = 0;
552 SCIPdebugMsg(
scip,
"Filling graph with colored coefficient nodes for non-linear part.\n");
582 for (
int i = 0;
i < nconss; ++
i)
617 assert( node < (
int)
G->get_nof_vertices() );
621 SCIP_Real constant = 0.0;
668 internode = (int)
G->add_vertex((
unsigned) color);
678 assert( node < (
int)
G->get_nof_vertices() );
680 G->add_edge((
unsigned) node, (
unsigned)
internode);
685 if ( constant != 0.0 )
701 ct->value = constant;
716 node = (int)
G->add_vertex((
unsigned) color);
719 assert( node < (
int)
G->get_nof_vertices() );
721 G->add_edge((
unsigned) node, (
unsigned)
parentnode);
821 node = (int)
G->add_vertex((
unsigned) color);
824 assert( node < (
int)
G->get_nof_vertices() );
834 G->add_edge((
unsigned) node, (
unsigned)
parentnode);
851 ct->value = coefs[
j];
866 internode = (int)
G->add_vertex((
unsigned) color);
873 G->add_edge((
unsigned)
internode, (
unsigned) node);
910 internode = (int)
G->add_vertex((
unsigned) color);
913 assert( node < (
int)
G->get_nof_vertices() );
915 G->add_edge((
unsigned)
internode, (
unsigned) node);
988 char* name =
new char[100];
989#ifdef BLISS_PATCH_PRESENT
1009 return "Computing Graph Automorphism Groups by T. Junttila and P. Kaski (https://users.aalto.fi/~tjunttil/bliss/)";
1033 SCIP_Real* log10groupsize,
1046 assert( maxgenerators >= 0 );
1053 *log10groupsize = 0;
1089 G.write_dot(
"debug.dot");
1092#if SCIP_DISABLED_CODE
1103 SCIPdebugMsg(
scip,
"Symmetry detection graph has %u nodes.\n",
G.get_nof_vertices());
1118 G.set_splitting_heuristic(bliss::Graph::shs_f);
1120 G.set_component_recursion(
false);
1123#ifdef BLISS_PATCH_PRESENT
1124 G.set_search_limits(0, (
unsigned) maxgenerators);
1128#if BLISS_VERSION_MAJOR >= 1 || BLISS_VERSION_MINOR >= 76
1130 auto reportglue = [&](
unsigned int n,
const unsigned int*
aut) {
1136 return (stats.get_nof_generators() >= (
long unsigned int) maxgenerators);
1143 G.find_automorphisms(stats,
blisshook, (
void*) &data);
1154 *perms = data.
perms;
interface for symmetry computations
const char * SYMsymmetryGetName(void)
const char * SYMsymmetryGetAddName(void)
static SCIP_RETCODE fillGraphByNonlinearConss(SCIP *scip, bliss::Graph *G, SYM_EXPRDATA *exprdata, int &nnodes, int &nedges, int &nusedcolors, SCIP_Bool &success)
static SCIP_RETCODE createVariableNodes(SCIP *scip, bliss::Graph *G, SYM_MATRIXDATA *matrixdata, int &nnodes, int &nusedcolors)
SCIP_Bool SYMcanComputeSymmetry(void)
static void blisshook(void *user_param, unsigned int n, const unsigned int *aut)
SCIP_RETCODE SYMcomputeSymmetryGenerators(SCIP *scip, int maxgenerators, SYM_MATRIXDATA *matrixdata, SYM_EXPRDATA *exprdata, int *nperms, int *nmaxperms, int ***perms, SCIP_Real *log10groupsize, SCIP_Real *symcodetime)
const char * SYMsymmetryGetDesc(void)
static SCIP_RETCODE fillGraphByLinearConss(SCIP *scip, bliss::Graph *G, SYM_MATRIXDATA *matrixdata, int &nnodes, int &nedges, int &nusedcolors, SCIP_Bool &success)
const char * SYMsymmetryGetAddDesc(void)
char * initStaticBlissName()
Constraint handler for linear constraints in their most general form, .
constraint handler for nonlinear constraints specified by algebraic expressions
private functions to work with algebraic expressions
power and signed power expression handlers
variable expression handler
SCIP_EXPR * SCIPgetExprNonlinear(SCIP_CONS *cons)
SCIP_Real SCIPgetRhsNonlinear(SCIP_CONS *cons)
SCIP_Real SCIPgetLhsNonlinear(SCIP_CONS *cons)
const char * SCIPgetProbName(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
#define SCIPhashTwo(a, b)
#define SCIPhashThree(a, b, c)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
static INLINE uint32_t SCIPrealHashCode(double x)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Real SCIPgetExponentExprPow(SCIP_EXPR *expr)
SCIP_Bool SCIPexpriterIsEnd(SCIP_EXPRITER *iterator)
SCIP_Bool SCIPisExprSum(SCIP *scip, SCIP_EXPR *expr)
SCIP_Real * SCIPgetCoefsExprSum(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPR * SCIPexpriterGetCurrent(SCIP_EXPRITER *iterator)
void SCIPexpriterSetStagesDFS(SCIP_EXPRITER *iterator, SCIP_EXPRITER_STAGE stopstages)
SCIP_Bool SCIPisExprVar(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExpriter(SCIP *scip, SCIP_EXPRITER **iterator)
SCIP_EXPR * SCIPexpriterGetParentDFS(SCIP_EXPRITER *iterator)
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprPower(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPR * SCIPexpriterGetNext(SCIP_EXPRITER *iterator)
SCIP_Real SCIPgetConstantExprSum(SCIP_EXPR *expr)
SCIP_VAR * SCIPgetVarExprVar(SCIP_EXPR *expr)
void SCIPfreeExpriter(SCIP_EXPRITER **iterator)
SCIP_EXPRITER_STAGE SCIPexpriterGetStageDFS(SCIP_EXPRITER *iterator)
SCIP_RETCODE SCIPexpriterInit(SCIP_EXPRITER *iterator, SCIP_EXPR *expr, SCIP_EXPRITER_TYPE type, SCIP_Bool allowrevisit)
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
int SCIPsnprintf(char *t, int len, const char *s,...)
assert(minobj< SCIPgetCutoffbound(scip))
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIP_EXPRITER_LEAVEEXPR
#define SCIP_EXPRITER_ENTEREXPR
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
enum SCIP_Retcode SCIP_RETCODE