Scippy

SCIP

Solving Constraint Integer Programs

scip_randnumgen.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright 2002-2022 Zuse Institute Berlin */
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 scip_randnumgen.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for random numbers
28  * @author Tobias Achterberg
29  * @author Timo Berthold
30  * @author Thorsten Koch
31  * @author Alexander Martin
32  * @author Marc Pfetsch
33  * @author Kati Wolter
34  * @author Gregor Hendel
35  * @author Leona Gottwald
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_SCIP_RANDNUMGEN_H__
41 #define __SCIP_SCIP_RANDNUMGEN_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_misc.h"
46 #include "scip/type_retcode.h"
47 #include "scip/type_scip.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /**@addtogroup RandomNumbers
54  *
55  * @{
56  */
57 
58 /** creates and initializes a random number generator
59  *
60  * @note The initial seed is changed using SCIPinitializeRandomSeed()
61  */
62 SCIP_EXPORT
64  SCIP* scip, /**< SCIP data structure */
65  SCIP_RANDNUMGEN** randnumgen, /**< random number generator */
66  unsigned int initialseed, /**< initial random seed */
67  SCIP_Bool useglobalseed /**< should SCIP's global seed be used to initialise the supplied seed? */
68  );
69 
70 /** frees a random number generator */
71 SCIP_EXPORT
72 void SCIPfreeRandom(
73  SCIP* scip, /**< SCIP data structure */
74  SCIP_RANDNUMGEN** randnumgen /**< random number generator */
75  );
76 
77 /** initializes a random number generator with a given seed
78  *
79  * @note The seed is changed using SCIPinitializeRandomSeed()
80  */
81 SCIP_EXPORT
83  SCIP* scip, /**< SCIP data structure */
84  SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
85  unsigned int seed /**< new random seed */
86  );
87 
88 
89 /** modifies an initial seed value with the global shift of random seeds */
90 SCIP_EXPORT
91 unsigned int SCIPinitializeRandomSeed(
92  SCIP* scip, /**< SCIP data structure */
93  unsigned int initialseedvalue /**< initial seed value to be modified */
94  );
95 
96 /**@} */
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
type definitions for miscellaneous datastructures
void SCIPsetRandomSeed(SCIP *scip, SCIP_RANDNUMGEN *randnumgen, unsigned int seed)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
#define SCIP_Bool
Definition: def.h:93
unsigned int SCIPinitializeRandomSeed(SCIP *scip, unsigned int initialseedvalue)
common defines and data types used in all packages of SCIP