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-2024 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 clock.h
26 * @ingroup INTERNALAPI
27 * @brief internal methods for clocks and timing issues
28 * @author Tobias Achterberg
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_CLOCK_H__
34#define __SCIP_CLOCK_H__
35
36
37#include "scip/def.h"
38#include "scip/type_retcode.h"
39#include "scip/type_set.h"
40#include "scip/type_clock.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/** creates a clock and initializes it */
48 SCIP_CLOCK** clck, /**< pointer to clock timer */
49 SCIP_CLOCKTYPE clocktype /**< type of clock */
50 );
51
52/** frees a clock */
53void SCIPclockFree(
54 SCIP_CLOCK** clck /**< pointer to clock timer */
55 );
56
57/** initializes and resets a clock */
58void SCIPclockInit(
59 SCIP_CLOCK* clck, /**< clock timer */
60 SCIP_CLOCKTYPE clocktype /**< type of clock */
61 );
62
63/** completely stop the clock and reset the clock's counter to zero */
65 SCIP_CLOCK* clck /**< clock timer */
66 );
67
68/** enables the clock */
70 SCIP_CLOCK* clck /**< clock timer */
71 );
72
73/** disables and resets the clock */
75 SCIP_CLOCK* clck /**< clock timer */
76 );
77
78/** enables or disables \p clck, depending on the value of the flag */
80 SCIP_CLOCK* clck, /**< the clock to be disabled/enabled */
81 SCIP_Bool enable /**< should the clock be enabled? */
82 );
83
84/** sets the type of the clock, overriding the default clock type, and resets the clock */
86 SCIP_CLOCK* clck, /**< clock timer */
87 SCIP_CLOCKTYPE clocktype /**< type of clock */
88 );
89
90/** starts measurement of time in the given clock, update the clock's type if it is bound to the default type */
92 SCIP_CLOCK* clck, /**< clock timer */
93 SCIP_SET* set /**< global SCIP settings */
94 );
95
96/** stops measurement of time in the given clock */
97void SCIPclockStop(
98 SCIP_CLOCK* clck, /**< clock timer */
99 SCIP_SET* set /**< global SCIP settings */
100 );
101
102/** returns whether the clock is currently running */
104 SCIP_CLOCK* clck /**< clock timer */
105 );
106
107/** gets the used time of this clock in seconds */
109 SCIP_CLOCK* clck /**< clock timer */
110 );
111
112/** gets the last validated time of this clock in seconds */
114 SCIP_CLOCK* clck /**< clock timer */
115 );
116
117
118/** sets the used time of this clock in seconds */
120 SCIP_CLOCK* clck, /**< clock timer */
121 SCIP_Real sec /**< time in seconds to set the clock's timer to */
122 );
123
124/** gets current time of day in seconds (standard time zone) */
126 void
127 );
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif
void SCIPclockEnable(SCIP_CLOCK *clck)
Definition: clock.c:235
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:539
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:621
void SCIPclockDisable(SCIP_CLOCK *clck)
Definition: clock.c:247
void SCIPclockSetType(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:274
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:360
SCIP_Bool SCIPclockIsRunning(SCIP_CLOCK *clck)
Definition: clock.c:427
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:260
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:290
SCIP_Real SCIPclockGetLastTime(SCIP_CLOCK *clck)
Definition: clock.c:529
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:438
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:209
void SCIPclockInit(SCIP_CLOCK *clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:195
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:185
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:170
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
Definition: heur_padm.c:135
type definitions for clocks and timing issues
enum SCIP_ClockType SCIP_CLOCKTYPE
Definition: type_clock.h:47
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings