methods for creating and manipulating symmetry detection graphs
Below you find a list of functions to create and manipulate symmetry detection graphs.
SCIP_RETCODE SCIPcreateSymgraph | ( | SCIP * | scip, |
SYM_SYMTYPE | symtype, | ||
SYM_GRAPH ** | graph, | ||
SCIP_VAR ** | symvars, | ||
int | nsymvars, | ||
int | nopnodes, | ||
int | nvalnodes, | ||
int | nconsnodes, | ||
int | nedges ) |
creates and initializes a symmetry detection graph with memory for the given number of nodes and edges
scip | SCIP data structure |
symtype | type of symmetries encoded in graph |
graph | pointer to hold symmetry detection graph |
symvars | variables used in symmetry detection |
nsymvars | number of variables used in symmetry detection |
nopnodes | number of operator nodes |
nvalnodes | number of value nodes |
nconsnodes | number of constraint nodes |
nedges | number of edges |
Definition at line 44 of file symmetry_graph.c.
References assert(), FALSE, nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPallocClearBlockMemoryArray, and SCIPinfinity().
Referenced by checkSymmetriesAreSymmetries(), computeSymmetryGroup(), and SCIPcopySymgraph().
SCIP_RETCODE SCIPfreeSymgraph | ( | SCIP * | scip, |
SYM_GRAPH ** | graph ) |
frees a symmetry detection graph
scip | SCIP data structure |
graph | pointer to symmetry detection graph |
Definition at line 111 of file symmetry_graph.c.
References assert(), NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SYM_SYMTYPE_PERM, and SYM_SYMTYPE_SIGNPERM.
Referenced by checkSymmetriesAreSymmetries(), and computeSymmetryGroup().
SCIP_RETCODE SCIPcopySymgraph | ( | SCIP * | scip, |
SYM_GRAPH ** | graph, | ||
SYM_GRAPH * | origgraph, | ||
int * | perm, | ||
SYM_SPEC | fixedtype ) |
copies an existing graph and changes variable nodes according to a permutation
scip | SCIP data structure |
graph | pointer to hold copy of symmetry detection graph |
origgraph | graph to be copied |
perm | permutation of variables |
fixedtype | variable types that must be fixed by symmetries |
Definition at line 151 of file symmetry_graph.c.
References assert(), SYM_Graph::conss, SYM_Graph::edgevals, i, SYM_Graph::lhs, SYM_Graph::nconsnodes, SYM_Graph::nedges, nnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, SYM_Graph::nopnodes, SYM_Graph::nsymvars, NULL, SYM_Graph::nvalnodes, SYM_Graph::ops, SYM_Graph::rhs, SCIP_CALL, SCIP_OKAY, SCIPaddSymgraphConsnode(), SCIPaddSymgraphEdge(), SCIPaddSymgraphOpnode(), SCIPaddSymgraphValnode(), SCIPcomputeSymgraphColors(), SCIPcreateSymgraph(), SCIPgetSymgraphEdgeFirst(), SCIPgetSymgraphEdgeSecond(), SCIPisInfinity(), SYM_NODETYPE_CONS, SYM_NODETYPE_OPERATOR, SYM_NODETYPE_VAL, SYM_Graph::symtype, SYM_Graph::symvars, and SYM_Graph::vals.
Referenced by checkSymmetriesAreSymmetries().
SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
SCIP_VAR ** | vars, | ||
SCIP_Real * | vals, | ||
int | nvars, | ||
SCIP_CONS * | cons, | ||
SCIP_Real | lhs, | ||
SCIP_Real | rhs, | ||
SCIP_Bool * | success ) |
adds a symmetry detection graph for a linear constraint to existing graph
For permutation symmetries, a constraint node is added that is connected to all variable nodes in the constraint. Edges are colored according to the variable coefficients. For signed permutation symmetries, also edges connecting the constraint node and the negated variable nodes are added, these edges are colored by the negative coefficients.
scip | SCIP data structure |
graph | symmetry detection graph |
vars | variable array of linear constraint |
vals | coefficients of linear constraint |
nvars | number of variables in linear constraint |
cons | constraint for which we encode symmetries |
lhs | left-hand side of constraint |
rhs | right-hand side of constraint |
success | pointer to store whether graph could be built |
Definition at line 226 of file symmetry_graph.c.
References assert(), i, SYM_Graph::islocked, SYM_Graph::nsymvars, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddSymgraphConsnode(), SCIPaddSymgraphEdge(), SCIPgetSymgraphNegatedVarnodeidx(), SCIPgetSymgraphSymtype(), SCIPgetSymgraphVarnodeidx(), SCIPvarGetProbindex(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, TRUE, and vars.
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), and addSymmetryInformation().
SCIP_RETCODE SCIPaddSymgraphVarAggregation | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
int | rootidx, | ||
SCIP_VAR ** | vars, | ||
SCIP_Real * | vals, | ||
int | nvars, | ||
SCIP_Real | constant ) |
adds nodes and edges corresponding to the aggregation of a variable to a symmetry detection graph
For permutation symmetries, the root node is connected with all variable nodes in the aggregation. Edges are colored according to the variable coefficients. For signed permutation symmetries, also edges connecting the root node and the negated variable nodes are added, these edges are colored by the negative coefficients.
adds nodes and edges corresponding to the aggregation of a variable to a symmetry detection graph
For permutation symmetries, the root node is connected with all variable nodes in the aggregation. Edges are colored according to the variable coefficients. For signed permutation symmetries, also edges connecting the root node and the negated variable nodes are added, these edges are colored by the negative coefficients. If the variable is fixed, a node representing the constant value is added.
scip | SCIP data structure |
graph | symmetry detection graph |
rootidx | index of root node of the aggegration |
vars | array of variables in aggregation |
vals | coefficients of variables |
nvars | number of variables in aggregation |
constant | constant of aggregation |
Definition at line 295 of file symmetry_graph.c.
References assert(), FALSE, SYM_Graph::nsymvars, NULL, nvars, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddSymgraphEdge(), SCIPaddSymgraphValnode(), SCIPgetSymgraphNegatedVarnodeidx(), SCIPgetSymgraphSymtype(), SCIPgetSymgraphVarnodeidx(), SCIPisZero(), SCIPvarGetProbindex(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, TRUE, and vars.
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), and SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH().
SCIP_RETCODE SCIPaddSymgraphOpnode | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
int | op, | ||
int * | nodeidx ) |
adds an operator node to a symmetry detection graph and returns its node index
scip | SCIP data structure |
graph | symmetry detection graph |
op | int associated with operator of node |
nodeidx | pointer to hold index of created node |
Definition at line 383 of file symmetry_graph.c.
References assert(), ensureNodeArraysSize(), SYM_Graph::islocked, SYM_Graph::maxnopnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, SYM_Graph::nopnodes, NULL, SYM_Graph::ops, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPerrorMessage, SCIPreallocBlockMemoryArray, and SYM_NODETYPE_OPERATOR.
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPcopySymgraph(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPaddSymgraphValnode | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
SCIP_Real | val, | ||
int * | nodeidx ) |
adds a value node to a symmetry detection graph and returns its node index
scip | SCIP data structure |
graph | symmetry detection graph |
val | value of node |
nodeidx | pointer to hold index of created node |
Definition at line 424 of file symmetry_graph.c.
References assert(), ensureNodeArraysSize(), SYM_Graph::islocked, SYM_Graph::maxnvalnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::nvalnodes, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPcalcMemGrowSize(), SCIPerrorMessage, SCIPreallocBlockMemoryArray, SYM_NODETYPE_VAL, and SYM_Graph::vals.
Referenced by addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPaddSymgraphVarAggregation(), SCIPcopySymgraph(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPaddSymgraphConsnode | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
SCIP_CONS * | cons, | ||
SCIP_Real | lhs, | ||
SCIP_Real | rhs, | ||
int * | nodeidx ) |
adds a constraint node to a symmetry detection graph and returns its node index
scip | SCIP data structure |
graph | symmetry detection graph |
cons | constraint of node |
lhs | left-hand side of node |
rhs | right-hand side of node |
nodeidx | pointer to hold index of created node |
Definition at line 465 of file symmetry_graph.c.
References assert(), SYM_Graph::conss, ensureNodeArraysSize(), SYM_Graph::infinity, SYM_Graph::islocked, SYM_Graph::lhs, MAX, SYM_Graph::maxnconsnodes, MIN, SYM_Graph::nconsnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::rhs, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPcalcMemGrowSize(), SCIPerrorMessage, SCIPreallocBlockMemoryArray, and SYM_NODETYPE_CONS.
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPcopySymgraph(), and SCIPextendPermsymDetectionGraphLinear().
returns the (hypothetical) node index of a variable
scip | SCIP data structure |
graph | symmetry detection graph |
var | variable |
Definition at line 513 of file symmetry_graph.c.
References assert(), NULL, SCIPvarGetProbindex(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, and var.
Referenced by addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPaddSymgraphVarAggregation(), SCIPextendPermsymDetectionGraphLinear(), SCIPgetSymgraphNegatedVarnodeidx(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
returns the (hypothetical) node index of a negated variable
scip | SCIP data structure |
graph | symmetry detection graph |
var | variable |
Definition at line 533 of file symmetry_graph.c.
References assert(), SYM_Graph::nsymvars, NULL, SCIPgetSymgraphVarnodeidx(), SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, and var.
Referenced by addSymmetryInformation(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPaddSymgraphVarAggregation(), SCIPextendPermsymDetectionGraphLinear(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPupdateSymgraphLhs | ( | SYM_GRAPH * | graph, |
int | nodeidx, | ||
SCIP_Real | newlhs ) |
updates the lhs of a constraint node
graph | symmetry detection graph |
nodeidx | index of constraint node in graph |
newlhs | new left-hand side of node |
Definition at line 554 of file symmetry_graph.c.
References assert(), SYM_Graph::lhs, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SCIP_OKAY, SCIP_Real, and SYM_NODETYPE_CONS.
SCIP_RETCODE SCIPupdateSymgraphRhs | ( | SYM_GRAPH * | graph, |
int | nodeidx, | ||
SCIP_Real | newrhs ) |
updates the rhs of a constraint node
graph | symmetry detection graph |
nodeidx | index of constraint node in graph |
newrhs | new reft-hand side of node |
Definition at line 570 of file symmetry_graph.c.
References assert(), SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::rhs, SCIP_OKAY, SCIP_Real, and SYM_NODETYPE_CONS.
SCIP_RETCODE SCIPfixSymgraphVarnode | ( | SYM_GRAPH * | graph, |
SCIP_VAR * | var ) |
registers a variable node (corresponding to active variable) to be fixed by symmetry
graph | symmetry detection graph |
var | active variable that needs to be fixed |
Definition at line 586 of file symmetry_graph.c.
References assert(), SYM_Graph::isfixedvar, NULL, SCIP_OKAY, SCIPvarGetProbindex(), TRUE, var, and varidx.
SCIP_RETCODE SCIPaddSymgraphEdge | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
int | first, | ||
int | second, | ||
SCIP_Bool | hasval, | ||
SCIP_Real | val ) |
adds an edge to a symmetry detection graph
scip | SCIP data structure |
graph | symmetry detection graph |
first | first node index of edge |
second | second node index of edge |
hasval | whether the edge has a value |
val | value of the edge (is it has a value) |
Definition at line 635 of file symmetry_graph.c.
References assert(), SYM_Graph::edgefirst, SYM_Graph::edgesecond, SYM_Graph::edgevals, ensureEdgeArraysSize(), SYM_Graph::islocked, SYM_Graph::nedges, NULL, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, and SCIPinfinity().
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPaddSymgraphVarAggregation(), SCIPcopySymgraph(), SCIPextendPermsymDetectionGraphLinear(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPcomputeSymgraphColors | ( | SCIP * | scip, |
SYM_GRAPH * | graph, | ||
SYM_SPEC | fixedtype ) |
computes colors of nodes and edges
computes colors of nodes and edges
Colors are detected by sorting different types of nodes (variables, operators, values, and constraint) and edges. If two consecutive nodes of the same type differ (e.g., different variable type), they are assigned a new color.
scip | SCIP data structure |
graph | symmetry detection graph |
fixedtype | variable types that must be fixed by symmetries |
Definition at line 1186 of file symmetry_graph.c.
References assert(), compareConsnodes(), compareOps(), compareVars(), compareVarsSignedPerm(), SYM_Graph::conscolors, SYM_Graph::edgecolors, FALSE, i, isFixedVar(), SYM_Graph::isfixedvar, SYM_Graph::islocked, SYM_Graph::nconsnodes, SYM_Graph::nedges, SYM_Graph::nopnodes, SYM_Graph::nsymvars, NULL, SYM_Graph::nvalnodes, SYM_Graph::opcolors, SYM_Graph::ops, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPisEQ(), SCIPisInfinity(), SCIPsort(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, SYM_Graph::symvars, TRUE, SYM_Graph::valcolors, SYM_Graph::vals, and SYM_Graph::varcolors.
Referenced by checkSymmetriesAreSymmetries(), computeSymmetryGroup(), and SCIPcopySymgraph().
SYM_SYMTYPE SCIPgetSymgraphSymtype | ( | SYM_GRAPH * | graph | ) |
returns the type of symmetries encoded in graph
graph | symmetry detection graph |
Definition at line 1429 of file symmetry_graph.c.
References assert(), NULL, and SYM_Graph::symtype.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), SCIPaddSymgraphVarAggregation(), SCIPextendPermsymDetectionGraphLinear(), SYMcheckGraphsAreIdentical(), SYMcomputeSymmetryGenerators(), and SYMcomputeSymmetryGenerators().
returns the variables in a symmetry detection graph
graph | symmetry detection graph |
Definition at line 1439 of file symmetry_graph.c.
References assert(), NULL, and SYM_Graph::symvars.
int SCIPgetSymgraphNVars | ( | SYM_GRAPH * | graph | ) |
returns the number of variables in a symmetry detection graph
graph | symmetry detection graph |
Definition at line 1449 of file symmetry_graph.c.
References assert(), SYM_Graph::nsymvars, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), SYMcheckGraphsAreIdentical(), SYMcomputeSymmetryGenerators(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphNConsnodes | ( | SYM_GRAPH * | graph | ) |
returns the number of constraint nodes in a symmetry detection graph
graph | symmetry detection graph |
Definition at line 1459 of file symmetry_graph.c.
References assert(), SYM_Graph::nconsnodes, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphNNodes | ( | SYM_GRAPH * | graph | ) |
returns the number of non-variable nodes in a graph
graph | symmetry detection graph |
Definition at line 1469 of file symmetry_graph.c.
References assert(), SYM_Graph::nnodes, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), SYMcomputeSymmetryGenerators(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetEvenOperator().
int SCIPgetSymgraphNEdges | ( | SYM_GRAPH * | graph | ) |
returns the number of edges in a graph
graph | symmetry detection graph |
Definition at line 1479 of file symmetry_graph.c.
References assert(), SYM_Graph::nedges, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphEdgeFirst | ( | SYM_GRAPH * | graph, |
int | edgeidx ) |
return the first node index of an edge
graph | symmetry detection graph |
edgeidx | index of edge |
Definition at line 1489 of file symmetry_graph.c.
References assert(), SYM_Graph::edgefirst, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), isEdgeGroupable(), isEdgeGroupable(), SCIPcopySymgraph(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphEdgeSecond | ( | SYM_GRAPH * | graph, |
int | edgeidx ) |
return the second node index of an edge
graph | symmetry detection graph |
edgeidx | index of edge |
Definition at line 1501 of file symmetry_graph.c.
References assert(), SYM_Graph::edgesecond, and NULL.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), isEdgeGroupable(), isEdgeGroupable(), SCIPcopySymgraph(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphVarnodeColor | ( | SYM_GRAPH * | graph, |
int | nodeidx ) |
returns the color of a variable node
graph | symmetry detection graph |
nodeidx | index of variable node |
Definition at line 1513 of file symmetry_graph.c.
References assert(), SYM_Graph::islocked, NULL, SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, and SYM_Graph::varcolors.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().
SYM_NODETYPE SCIPgetSymgraphNodeType | ( | SYM_GRAPH * | graph, |
int | nodeidx ) |
returns the type of a node
graph | symmetry detection graph |
nodeidx | index of node |
Definition at line 1535 of file symmetry_graph.c.
References assert(), nnodes, SYM_Graph::nodetypes, NULL, and SYM_NODETYPE_VAR.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), isEdgeGroupable(), isEdgeGroupable(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphNodeColor | ( | SYM_GRAPH * | graph, |
int | nodeidx ) |
returns the color of a non-variable node
graph | symmetry detection graph |
nodeidx | index of node |
Definition at line 1550 of file symmetry_graph.c.
References assert(), SYM_Graph::conscolors, SYM_Graph::islocked, nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::opcolors, SYM_NODETYPE_CONS, SYM_NODETYPE_OPERATOR, SYM_NODETYPE_VAL, and SYM_Graph::valcolors.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().
returns whether an edge is colored
graph | symmetry detection graph |
edgeidx | index of edge |
Definition at line 1573 of file symmetry_graph.c.
References assert(), SYM_Graph::edgecolors, FALSE, SYM_Graph::islocked, NULL, SCIP_Bool, and TRUE.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), isEdgeGroupable(), isEdgeGroupable(), SCIPgetSymgraphEdgeColor(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphEdgeColor | ( | SYM_GRAPH * | graph, |
int | edgeidx ) |
returns color of an edge
graph | symmetry detection graph |
edgeidx | index of edge |
Definition at line 1588 of file symmetry_graph.c.
References assert(), SYM_Graph::edgecolors, NULL, and SCIPisSymgraphEdgeColored().
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().
int SCIPgetSymgraphNVarcolors | ( | SYM_GRAPH * | graph | ) |
returns the number of unique variable colors in the graph
graph | symmetry detection graph |
Definition at line 1601 of file symmetry_graph.c.
References assert(), SYM_Graph::nsymvars, NULL, and SYM_Graph::nvarcolors.
Referenced by computeSymmetryGroup().
returns whether the graph has a unique edge type
graph | symmetry detection graph |
Definition at line 1614 of file symmetry_graph.c.
References assert(), NULL, SCIP_Bool, and SYM_Graph::uniqueedgetype.
Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().
SCIP_RETCODE SCIPallocateSymgraphConsnodeperm | ( | SCIP * | scip, |
SYM_GRAPH * | graph ) |
SCIP_RETCODE SCIPcreateSymgraphConsnodeperm | ( | SCIP * | scip, |
SYM_GRAPH * | graph ) |
creates consnodeperm array for symmetry detection graph
colors
of symmetry detection graph must have been computed scip | SCIP data structure |
graph | symmetry detection graph |
Definition at line 1627 of file symmetry_graph.c.
References assert(), SYM_Graph::consnodeperm, SYM_Graph::islocked, SYM_Graph::nconsnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, and SCIPsort().
Referenced by checkSymmetriesAreSymmetries(), and SCIPgetSymgraphConsnodeperm().
returns consnodeperm array for symmetry detection graph
colors
of symmetry detection graph must have been computed scip | SCIP data structure |
graph | symmetry detection graph |
Definition at line 1665 of file symmetry_graph.c.
References assert(), SYM_Graph::consnodeperm, SYM_Graph::islocked, NULL, SCIP_CALL_ABORT, and SCIPcreateSymgraphConsnodeperm().
SCIP_RETCODE SCIPfreeSymgraphConsnodeperm | ( | SCIP * | scip, |
SYM_GRAPH * | graph ) |
frees consnodeperm array for symmetry detection graph
scip | SCIP data structure |
graph | symmetry detection graph |
Definition at line 1647 of file symmetry_graph.c.
References assert(), SYM_Graph::consnodeperm, SYM_Graph::islocked, SYM_Graph::nconsnodes, NULL, SCIP_OKAY, and SCIPfreeBlockMemoryArrayNull.
Referenced by checkSymmetriesAreSymmetries().
SCIP_RETCODE SCIPgetSymActiveVariables | ( | SCIP * | scip, |
SYM_SYMTYPE | symtype, | ||
SCIP_VAR *** | vars, | ||
SCIP_Real ** | scalars, | ||
int * | nvars, | ||
SCIP_Real * | constant, | ||
SCIP_Bool | transformed ) |
Transforms given variables, scalars, and constant to the corresponding active variables, scalars, and constant.
For permutation symmetries, active variables as encoded in SCIP are used. For signed permutation symmetries, active variables are shifted such that their domain is centered at 0 (if both their upper and lower bounds are finite).
constant
needs to be initialized! scip | SCIP data structure |
symtype | type of symmetries for which variables are required |
vars | pointer to vars array to get active variables for |
scalars | pointer to scalars a_1, ..., a_n in linear sum a_1*x_1 + ... + a_n*x_n + c |
nvars | pointer to number of variables and values in vars and vals array |
constant | pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c |
transformed | transformed constraint? |
Definition at line 1687 of file symmetry_graph.c.
References assert(), NULL, nvars, scalars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetProbvarLinearSum(), SCIPisInfinity(), SCIPreallocBufferArray, SCIPvarGetLbGlobal(), SCIPvarGetOrigvarSum(), SCIPvarGetUbGlobal(), SYM_SYMTYPE_SIGNPERM, TRUE, and vars.
Referenced by addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPfreeSymDataExpr | ( | SCIP * | scip, |
SYM_EXPRDATA ** | symdata ) |
frees symmetry information of an expression
scip | SCIP data structure |
symdata | symmetry information of an expression |
Definition at line 1751 of file symmetry_graph.c.
References assert(), NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.
Referenced by addSymmetryInformation(), isEvenOperator(), SCIPgetCoefSymData(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().
int SCIPgetSymExprdataNConstants | ( | SYM_EXPRDATA * | symdata | ) |
returns number of coefficients from exprdata
symdata | symmetry information of an expression |
Definition at line 1774 of file symmetry_graph.c.
References assert(), SYM_ExprData::nconstants, and NULL.
Referenced by addSymmetryInformation(), isEvenOperator(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().
SCIP_Real * SCIPgetSymExprdataConstants | ( | SYM_EXPRDATA * | symdata | ) |
returns number of coefficients form exprdata
symdata | symmetry information of an expression |
Definition at line 1784 of file symmetry_graph.c.
References assert(), SYM_ExprData::constants, NULL, and SCIP_Real.
Referenced by addSymmetryInformation(), isEvenOperator(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().
SCIP_RETCODE SCIPgetCoefSymData | ( | SCIP * | scip, |
SCIP_EXPR * | expr, | ||
SCIP_EXPR * | parentexpr, | ||
SCIP_Real * | coef, | ||
SCIP_Bool * | success ) |
gets coefficient of expression from parent expression
scip | SCIP data structure |
expr | expression for which coefficient needs to be found |
parentexpr | parent of expr |
coef | buffer to store coefficient |
success | whether a coefficient is found |
Definition at line 1794 of file symmetry_graph.c.
References assert(), SYM_ExprData::children, SYM_ExprData::coefficients, FALSE, i, SYM_ExprData::ncoefficients, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPexprGetHdlr(), SCIPexprhdlrHasGetSymData(), SCIPfreeSymDataExpr(), SCIPgetSymDataExpr(), and TRUE.
Referenced by addSymmetryInformation().