Scippy

SCIP

Solving Constraint Integer Programs

clock.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 (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file clock.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for clocks and timing issues
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_CLOCK_H__
25 #define __SCIP_CLOCK_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_set.h"
31 #include "scip/type_clock.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /** creates a clock and initializes it */
38 extern
40  SCIP_CLOCK** clck, /**< pointer to clock timer */
41  SCIP_CLOCKTYPE clocktype /**< type of clock */
42  );
43 
44 /** frees a clock */
45 extern
46 void SCIPclockFree(
47  SCIP_CLOCK** clck /**< pointer to clock timer */
48  );
49 
50 /** initializes and resets a clock */
51 extern
52 void SCIPclockInit(
53  SCIP_CLOCK* clck, /**< clock timer */
54  SCIP_CLOCKTYPE clocktype /**< type of clock */
55  );
56 
57 /** completely stop the clock and reset the clock's counter to zero */
58 extern
59 void SCIPclockReset(
60  SCIP_CLOCK* clck /**< clock timer */
61  );
62 
63 /** enables the clock */
64 extern
65 void SCIPclockEnable(
66  SCIP_CLOCK* clck /**< clock timer */
67  );
68 
69 /** disables and resets the clock */
70 extern
71 void SCIPclockDisable(
72  SCIP_CLOCK* clck /**< clock timer */
73  );
74 
75 /** enables or disables \p clck, depending on the value of the flag */
76 extern
78  SCIP_CLOCK* clck, /**< the clock to be disabled/enabled */
79  SCIP_Bool enable /**< should the clock be enabled? */
80  );
81 
82 /** sets the type of the clock, overriding the default clock type, and resets the clock */
83 extern
84 void SCIPclockSetType(
85  SCIP_CLOCK* clck, /**< clock timer */
86  SCIP_CLOCKTYPE clocktype /**< type of clock */
87  );
88 
89 /** starts measurement of time in the given clock, update the clock's type if it is bound to the default type */
90 extern
91 void SCIPclockStart(
92  SCIP_CLOCK* clck, /**< clock timer */
93  SCIP_SET* set /**< global SCIP settings */
94  );
95 
96 /** stops measurement of time in the given clock */
97 extern
98 void SCIPclockStop(
99  SCIP_CLOCK* clck, /**< clock timer */
100  SCIP_SET* set /**< global SCIP settings */
101  );
102 
103 /** returns whether the clock is currently running */
104 extern
106  SCIP_CLOCK* clck /**< clock timer */
107  );
108 
109 /** gets the used time of this clock in seconds */
110 extern
112  SCIP_CLOCK* clck /**< clock timer */
113  );
114 
115 /** gets the last validated time of this clock in seconds */
116 extern
118  SCIP_CLOCK* clck /**< clock timer */
119  );
120 
121 
122 /** sets the used time of this clock in seconds */
123 extern
124 void SCIPclockSetTime(
125  SCIP_CLOCK* clck, /**< clock timer */
126  SCIP_Real sec /**< time in seconds to set the clock's timer to */
127  );
128 
129 /** gets current time of day in seconds (standard time zone) */
130 extern
132  void
133  );
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif
void SCIPclockDisable(SCIP_CLOCK *clck)
Definition: clock.c:237
void SCIPclockSetType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:264
void SCIPclockEnable(SCIP_CLOCK *clck)
Definition: clock.c:225
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
enum SCIP_ClockType SCIP_CLOCKTYPE
Definition: type_clock.h:38
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
type definitions for return codes for SCIP methods
void SCIPclockInit(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:185
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:518
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:250
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Bool SCIPclockIsRunning(SCIP_CLOCK *clck)
Definition: clock.c:417
SCIP_Real SCIPclockGetLastTime(SCIP_CLOCK *clck)
Definition: clock.c:508
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:600
#define SCIP_Bool
Definition: def.h:69
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
type definitions for clocks and timing issues
#define SCIP_Real
Definition: def.h:157
common defines and data types used in all packages of SCIP