39#pragma GCC diagnostic ignored "-Wunused-variable"
40#pragma GCC diagnostic ignored "-Wredundant-decls"
41#pragma GCC diagnostic ignored "-Wpedantic"
44#include "nauty/nauty.h"
45#include "nauty/nausparse.h"
47#include "nauty/traces.h"
50#pragma GCC diagnostic warning "-Wunused-variable"
51#pragma GCC diagnostic warning "-Wredundant-decls"
52#pragma GCC diagnostic warning "-Wpedantic"
110 if (
k1->level !=
k2->level )
158 return (SCIP_Bool)(
k1->value ==
k2->value);
194 if (
k1->lhs !=
k2->lhs )
197 return (SCIP_Bool)(
k1->rhs ==
k2->rhs);
546 SCIP_Real* vals =
NULL;
571 for (
i = 0;
i < nconss; ++
i)
612 SCIP_Real constant = 0.0;
653 ++(*nnonlinearedges);
661 ++(*nnonlinearedges);
665 if ( constant != 0.0 )
669 ++(*nnonlinearnodes);
673 (*degrees)[node] = 0;
677 ++(*nnonlinearedges);
702 ++(*nnonlinearnodes);
719 ++(*nnonlinearnodes);
723 (*degrees)[node] = 0;
738 ++(*nnonlinearedges);
751 ++(*nnonlinearnodes);
765 ++(*nnonlinearedges);
774 ++(*nnonlinearnodes);
782 ++(*nnonlinearedges);
895 SCIP_Real* vals =
NULL;
907 int nuniquecoefs = 0;
934 SCIPdebugMsg(
scip,
"Filling graph with colored coefficient nodes for linear part.\n");
958 SG->d[
i] = degrees[
i];
959 SG->v[
i] = (size_t) (
unsigned) cnt;
1104 SCIPdebugMsg(
scip,
"Filling graph with colored coefficient nodes for non-linear part.\n");
1142 for (
i = 0;
i < nconss; ++
i)
1182 SCIP_Real constant = 0.0;
1216 ct->value = vals[
k];
1221 ct->color = (*nusedcolors)++;
1248 assert( node ==
nnodes - 1 || pos[node] <= (
int)
SG->v[node+1] );
1254 if ( constant != 0.0 )
1263 ct->value = constant;
1268 ct->color = (*nusedcolors)++;
1285 assert( node ==
nnodes - 1 || pos[node] <= (
int)
SG->v[node+1] );
1313 ct->color = (*nusedcolors)++;
1337 ot->color = (*nusedcolors)++;
1361 rt->color = (*nusedcolors)++;
1384 colors[node] = color;
1404 assert( node ==
nnodes - 1 || pos[node] <= (
int)
SG->v[node+1] );
1424 ct->value = coefs[
j];
1429 ct->color = (*nusedcolors)++;
1452 assert( node ==
nnodes - 1 || pos[node] <= (
int)
SG->v[node+1] );
1472 ct->color = (*nusedcolors)++;
1489 assert( node ==
nnodes - 1 || pos[node] <= (
int)
SG->v[node+1] );
1579 return "Computing Graph Automorphism Groups by Brendan D. McKay (https://users.cecs.anu.edu.au/~bdm/nauty/)";
1581 return "Computing Graph Automorphism Groups by Adolfo Piperno (https://pallini.di.uniroma1.it/)";
1606 SCIP_Real* log10groupsize,
1652 *log10groupsize = 0;
1688 SG.nde = (size_t) (
unsigned) (2 * nedges);
1703 for (v = 0; v <
nnodes; ++v)
1710 for (v = 0; v <
nnodes; ++v)
1712 if ( v <
nnodes-1 && colors[v] == colors[v+1] )
1758 *log10groupsize = (
SCIP_Real) stats.grpsize2;
interface for symmetry computations
const char * SYMsymmetryGetName(void)
static const char nautyname[]
static SCIP_RETCODE determineGraphSize(SCIP *scip, SYM_MATRIXDATA *matrixdata, SYM_EXPRDATA *exprdata, int *nnodes, int *nedges, int *nlinearnodes, int *nnonlinearnodes, int *nlinearedges, int *nnonlinearedges, int **degrees, int *maxdegrees, SCIP_Bool *success)
static SCIP_RETCODE fillGraphByConss(SCIP *scip, sparsegraph *SG, SYM_MATRIXDATA *matrixdata, SYM_EXPRDATA *exprdata, int nnodes, int nedges, int nlinearnodes, int nnonlinearnodes, int nlinearedges, int nnonlinearedges, int *degrees, int *colors, int *nusedcolors)
static void nautyhook(int count, int *p, int *orbits, int numorbits, int stabvertex, int n)
const char * SYMsymmetryGetAddName(void)
static struct NAUTY_Data data_
SCIP_Bool SYMcanComputeSymmetry(void)
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)
const char * SYMsymmetryGetAddDesc(void)
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)
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)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
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)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, 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)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
assert(minobj< SCIPgetCutoffbound(scip))
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for memory management
#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