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-2021 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 scipopt.org. */
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 */
39  SCIP_CLOCK** clck, /**< pointer to clock timer */
40  SCIP_CLOCKTYPE clocktype /**< type of clock */
41  );
42 
43 /** frees a clock */
44 void SCIPclockFree(
45  SCIP_CLOCK** clck /**< pointer to clock timer */
46  );
47 
48 /** initializes and resets a clock */
49 void SCIPclockInit(
50  SCIP_CLOCK* clck, /**< clock timer */
51  SCIP_CLOCKTYPE clocktype /**< type of clock */
52  );
53 
54 /** completely stop the clock and reset the clock's counter to zero */
55 void SCIPclockReset(
56  SCIP_CLOCK* clck /**< clock timer */
57  );
58 
59 /** enables the clock */
60 void SCIPclockEnable(
61  SCIP_CLOCK* clck /**< clock timer */
62  );
63 
64 /** disables and resets the clock */
65 void SCIPclockDisable(
66  SCIP_CLOCK* clck /**< clock timer */
67  );
68 
69 /** enables or disables \p clck, depending on the value of the flag */
71  SCIP_CLOCK* clck, /**< the clock to be disabled/enabled */
72  SCIP_Bool enable /**< should the clock be enabled? */
73  );
74 
75 /** sets the type of the clock, overriding the default clock type, and resets the clock */
76 void SCIPclockSetType(
77  SCIP_CLOCK* clck, /**< clock timer */
78  SCIP_CLOCKTYPE clocktype /**< type of clock */
79  );
80 
81 /** starts measurement of time in the given clock, update the clock's type if it is bound to the default type */
82 void SCIPclockStart(
83  SCIP_CLOCK* clck, /**< clock timer */
84  SCIP_SET* set /**< global SCIP settings */
85  );
86 
87 /** stops measurement of time in the given clock */
88 void SCIPclockStop(
89  SCIP_CLOCK* clck, /**< clock timer */
90  SCIP_SET* set /**< global SCIP settings */
91  );
92 
93 /** returns whether the clock is currently running */
95  SCIP_CLOCK* clck /**< clock timer */
96  );
97 
98 /** gets the used time of this clock in seconds */
100  SCIP_CLOCK* clck /**< clock timer */
101  );
102 
103 /** gets the last validated time of this clock in seconds */
105  SCIP_CLOCK* clck /**< clock timer */
106  );
107 
108 
109 /** sets the used time of this clock in seconds */
110 void SCIPclockSetTime(
111  SCIP_CLOCK* clck, /**< clock timer */
112  SCIP_Real sec /**< time in seconds to set the clock's timer to */
113  );
114 
115 /** gets current time of day in seconds (standard time zone) */
117  void
118  );
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
void SCIPclockDisable(SCIP_CLOCK *clck)
Definition: clock.c:238
void SCIPclockSetType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:265
void SCIPclockEnable(SCIP_CLOCK *clck)
Definition: clock.c:226
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:351
enum SCIP_ClockType SCIP_CLOCKTYPE
Definition: type_clock.h:38
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for global SCIP settings
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:281
type definitions for return codes for SCIP methods
void SCIPclockInit(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:186
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:519
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:251
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:200
SCIP_Bool SCIPclockIsRunning(SCIP_CLOCK *clck)
Definition: clock.c:418
SCIP_Real SCIPclockGetLastTime(SCIP_CLOCK *clck)
Definition: clock.c:509
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:161
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:429
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:601
#define SCIP_Bool
Definition: def.h:70
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:176
type definitions for clocks and timing issues
#define SCIP_Real
Definition: def.h:163
common defines and data types used in all packages of SCIP