1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB) */ 7 /* */ 8 /* Licensed under the Apache License, Version 2.0 (the "License"); */ 9 /* you may not use this file except in compliance with the License. */ 10 /* You may obtain a copy of the License at */ 11 /* */ 12 /* http://www.apache.org/licenses/LICENSE-2.0 */ 13 /* */ 14 /* Unless required by applicable law or agreed to in writing, software */ 15 /* distributed under the License is distributed on an "AS IS" BASIS, */ 16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 17 /* See the License for the specific language governing permissions and */ 18 /* limitations under the License. */ 19 /* */ 20 /* You should have received a copy of the Apache-2.0 license */ 21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */ 22 /* */ 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 25 /**@file symmetry_orbital.c 26 * @ingroup OTHER_CFILES 27 * @brief methods for handling symmetries based on orbits 28 * @author Jasper van Doornmalen 29 */ 30 31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 32 33 #ifndef __SCIP_SYMMETRY_ORBITAL_H__ 34 #define __SCIP_SYMMETRY_ORBITAL_H__ 35 36 #include "scip/def.h" 37 #include "scip/type_retcode.h" 38 #include "scip/type_scip.h" 39 #include "scip/type_var.h" 40 #include "scip/type_event.h" 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /* 47 * Data structures 48 */ 49 50 /** data for orbital reduction propagator */ 51 struct SCIP_OrbitalReductionData; 52 typedef struct SCIP_OrbitalReductionData SCIP_ORBITALREDDATA; /**< data for orbital reduction propagator */ 53 54 /* 55 * Interface methods 56 */ 57 58 /** prints orbital reduction data */ 59 SCIP_EXPORT 60 SCIP_RETCODE SCIPorbitalReductionGetStatistics( 61 SCIP* scip, /**< SCIP data structure */ 62 SCIP_ORBITALREDDATA* orbireddata, /**< orbital reduction data structure */ 63 int* nred, /**< pointer to store the total number of reductions applied */ 64 int* ncutoff /**< pointer to store the total number of cutoffs applied */ 65 ); 66 67 68 /** prints orbital reduction data */ 69 SCIP_EXPORT 70 SCIP_RETCODE SCIPorbitalReductionPrintStatistics( 71 SCIP* scip, /**< SCIP data structure */ 72 SCIP_ORBITALREDDATA* orbireddata /**< orbital reduction data structure */ 73 ); 74 75 76 /** propagates orbital reduction */ 77 SCIP_EXPORT 78 SCIP_RETCODE SCIPorbitalReductionPropagate( 79 SCIP* scip, /**< SCIP data structure */ 80 SCIP_ORBITALREDDATA* orbireddata, /**< orbital reduction data structure */ 81 SCIP_Bool* infeasible, /**< pointer to store whether infeasibility is found */ 82 int* nred, /**< pointer to store the number of domain reductions */ 83 SCIP_Bool* didrun /**< a global pointer maintaining if any symmetry propagator has run 84 * only set this to TRUE when a reduction is found, never set to FALSE */ 85 ); 86 87 88 /** adds component for orbital reduction */ 89 SCIP_EXPORT 90 SCIP_RETCODE SCIPorbitalReductionAddComponent( 91 SCIP* scip, /**< SCIP data structure */ 92 SCIP_ORBITALREDDATA* orbireddata, /**< orbital reduction data structure */ 93 SCIP_VAR** permvars, /**< variable array of the permutation */ 94 int npermvars, /**< number of variables in that array */ 95 int** perms, /**< permutations in the component */ 96 int nperms, /**< number of permutations in the component */ 97 SCIP_Bool* success /**< to store whether the component is successfully added */ 98 ); 99 100 101 /** resets orbital reduction data structure (clears all components) */ 102 SCIP_EXPORT 103 SCIP_RETCODE SCIPorbitalReductionReset( 104 SCIP* scip, /**< SCIP data structure */ 105 SCIP_ORBITALREDDATA* orbireddata /**< orbital reduction data structure */ 106 ); 107 108 109 /** frees orbital reduction data */ 110 SCIP_EXPORT 111 SCIP_RETCODE SCIPorbitalReductionFree( 112 SCIP* scip, /**< SCIP data structure */ 113 SCIP_ORBITALREDDATA** orbireddata /**< orbital reduction data structure */ 114 ); 115 116 117 /** initializes structures needed for orbital reduction 118 * 119 * This is only done exactly once. 120 */ 121 SCIP_EXPORT 122 SCIP_RETCODE SCIPincludeOrbitalReduction( 123 SCIP* scip, /**< SCIP data structure */ 124 SCIP_ORBITALREDDATA** orbireddata, /**< pointer to orbital reduction data structure to populate */ 125 SCIP_EVENTHDLR* shadowtreeeventhdlr /**< pointer to the shadow tree eventhdlr */ 126 ); 127 128 #ifdef __cplusplus 129 } 130 #endif 131 132 #endif 133