Scippy

SCIP

Solving Constraint Integer Programs

struct_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-2018 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 struct_clock.h
17  * @ingroup INTERNALAPI
18  * @brief datastructures 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_STRUCT_CLOCK_H__
25 #define __SCIP_STRUCT_CLOCK_H__
26 
27 
28 #if defined(_WIN32) || defined(_WIN64)
29 #include <time.h>
30 #else
31 #include <sys/times.h>
32 #endif
33 
34 #include "scip/def.h"
35 #include "scip/type_clock.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /** CPU clock counter */
43 {
44  clock_t user; /**< clock ticks for user CPU time */
45 };
46 
47 /** wall clock counter */
49 {
50  long sec; /**< seconds counter */
51  long usec; /**< microseconds counter */
52 };
53 
54 /** clock timer */
55 struct SCIP_Clock
56 {
57  union
58  {
59  SCIP_CPUCLOCK cpuclock; /**< CPU clock counter */
60  SCIP_WALLCLOCK wallclock; /**< wall clock counter */
61  } data;
62  SCIP_Real lasttime; /**< last validated time of clock */
63  int nruns; /**< number of SCIPclockStart() calls without SCIPclockStop() calls */
64  SCIP_CLOCKTYPE clocktype; /**< current type of clock used */
65  SCIP_Bool usedefault; /**< should the clock's type be overruled by the default clock type? */
66  SCIP_Bool enabled; /**< should the clock be used? */
67 };
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif
SCIP_Bool usedefault
Definition: struct_clock.h:65
SCIP_WALLCLOCK wallclock
Definition: struct_clock.h:60
SCIP_CLOCKTYPE clocktype
Definition: struct_clock.h:64
enum SCIP_ClockType SCIP_CLOCKTYPE
Definition: type_clock.h:38
SCIP_Bool enabled
Definition: struct_clock.h:66
SCIP_Real lasttime
Definition: struct_clock.h:62
clock_t user
Definition: struct_clock.h:44
#define SCIP_Bool
Definition: def.h:61
SCIP_CPUCLOCK cpuclock
Definition: struct_clock.h:59
type definitions for clocks and timing issues
#define SCIP_Real
Definition: def.h:149
common defines and data types used in all packages of SCIP