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-2016 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file clock.h
17  * @brief internal methods for clocks and timing issues
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_CLOCK_H__
24 #define __SCIP_CLOCK_H__
25 
26 
27 #include "scip/def.h"
28 #include "scip/type_retcode.h"
29 #include "scip/type_set.h"
30 #include "scip/type_clock.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** creates a clock and initializes it */
37 extern
39  SCIP_CLOCK** clck, /**< pointer to clock timer */
40  SCIP_CLOCKTYPE clocktype /**< type of clock */
41  );
42 
43 /** frees a clock */
44 extern
45 void SCIPclockFree(
46  SCIP_CLOCK** clck /**< pointer to clock timer */
47  );
48 
49 /** initializes and resets a clock */
50 extern
51 void SCIPclockInit(
52  SCIP_CLOCK* clck, /**< clock timer */
53  SCIP_CLOCKTYPE clocktype /**< type of clock */
54  );
55 
56 /** completely stop the clock and reset the clock's counter to zero */
57 extern
58 void SCIPclockReset(
59  SCIP_CLOCK* clck /**< clock timer */
60  );
61 
62 /** enables the clock */
63 extern
64 void SCIPclockEnable(
65  SCIP_CLOCK* clck /**< clock timer */
66  );
67 
68 /** disables and resets the clock */
69 extern
70 void SCIPclockDisable(
71  SCIP_CLOCK* clck /**< clock timer */
72  );
73 
74 /** enables or disables \p clck, depending on the value of the flag */
75 extern
77  SCIP_CLOCK* clck, /**< the clock to be disabled/enabled */
78  SCIP_Bool enable /**< should the clock be enabled? */
79  );
80 
81 /** sets the type of the clock, overriding the default clock type, and resets the clock */
82 extern
83 void SCIPclockSetType(
84  SCIP_CLOCK* clck, /**< clock timer */
85  SCIP_CLOCKTYPE clocktype /**< type of clock */
86  );
87 
88 /** starts measurement of time in the given clock, update the clock's type if it is bound to the default type */
89 extern
90 void SCIPclockStart(
91  SCIP_CLOCK* clck, /**< clock timer */
92  SCIP_SET* set /**< global SCIP settings */
93  );
94 
95 /** stops measurement of time in the given clock */
96 extern
97 void SCIPclockStop(
98  SCIP_CLOCK* clck, /**< clock timer */
99  SCIP_SET* set /**< global SCIP settings */
100  );
101 
102 /** returns whether the clock is currently running */
103 extern
105  SCIP_CLOCK* clck /**< clock timer */
106  );
107 
108 /** gets the used time of this clock in seconds */
109 extern
111  SCIP_CLOCK* clck /**< clock timer */
112  );
113 
114 /** gets the last validated time of this clock in seconds */
115 extern
117  SCIP_CLOCK* clck /**< clock timer */
118  );
119 
120 
121 /** sets the used time of this clock in seconds */
122 extern
123 void SCIPclockSetTime(
124  SCIP_CLOCK* clck, /**< clock timer */
125  SCIP_Real sec /**< time in seconds to set the clock's timer to */
126  );
127 
128 /** gets current time of day in seconds (standard time zone) */
129 extern
131  void
132  );
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #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:53
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
type definitions for clocks and timing issues
#define SCIP_Real
Definition: def.h:127
common defines and data types used in all packages of SCIP