Scippy

SoPlex

Sequential object-oriented simPlex

statistics.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file statistics.h
17  * @brief Class for collecting statistical information
18  */
19 #ifndef _STATISTICS_H_
20 #define _STATISTICS_H_
21 
22 #include <iostream>
23 
24 #include "soplex.h"
25 #include "soplex/timer.h"
26 
27 namespace soplex
28 {
29 /**@class Statistics
30  * @brief Class for collecting statistical information
31  * @ingroup Algo
32  */
34 {
35 
36 public:
37 
38  //**@name Construction, resetting, printing */
39  //@{
40 
41  /// default constructor
43 
44  /// copy constructor
45  Statistics(const Statistics& base);
46 
47  /// assignment operator
48  Statistics& operator=(const Statistics& rhs);
49 
50  /// destructor
52  {
53  // we need to free all timers again (allocation happens in constructor)
58  syncTime->~Timer();
70  }
71 
72  /// clears all statistics
73  void clearAllData();
74 
75  /// clears statistics on solving process
76  void clearSolvingData();
77 
78  /// prints statistics
79  void print(std::ostream& os);
80 
81  //@}
82 
83 
84  //**@name Data */
85  //@{
86 
87  Timer* readingTime; ///< reading time not included in solving time
88  Timer* solvingTime; ///< solving time
89  Timer* preprocessingTime; ///< preprocessing time
90  Timer* simplexTime; ///< simplex time
91  Timer* syncTime; ///< time for synchronization between real and rational LP (included in solving time)
92  Timer* transformTime; ///< time for transforming LPs (included in solving time)
93  Timer* rationalTime; ///< time for rational LP solving (included in solving time)
94  Timer* reconstructionTime; ///< time for rational reconstructions
95  Timer::TYPE timerType; ///< type of timer (user or wallclock)
96  Real luFactorizationTimeReal; ///< time for factorizing bases matrices in real precision
97  Real luSolveTimeReal; ///< time for solving linear systems in real precision
98  Real luFactorizationTimeRational; ///< time for factorizing bases matrices in rational precision
99  Real luSolveTimeRational; ///< time for solving linear systems in rational precision
100  int iterations; ///< number of iterations/pivots
101  int iterationsPrimal; ///< number of iterations with Primal
102  int iterationsFromBasis; ///< number of iterations from Basis
103  int iterationsPolish; ///< number of iterations during solution polishing
104  int boundflips; ///< number of dual bound flips
105  int luFactorizationsReal; ///< number of basis matrix factorizations in real precision
106  int luSolvesReal; ///< number of (forward and backward) solves with basis matrix in real precision
107  int luFactorizationsRational; ///< number of basis matrix factorizations in rational precision
108  int rationalReconstructions; ///< number of rational reconstructions performed
109  int refinements; ///< number of refinement steps
110  int stallRefinements; ///< number of refinement steps without pivots
111  int pivotRefinements; ///< number of refinement steps until final basis is reached
112  int feasRefinements; ///< number of refinement steps during infeasibility test
113  int unbdRefinements; ///< number of refinement steps during undboundedness test
114 
115  // Improved dual simplex statistics
116  int callsReducedProb; ///< number of times the reduced problem is solved. This includes the initial solve.
117  int iterationsInit; ///< number of iterations in the initial LP
118  int iterationsRedProb; ///< number of iterations of the reduced problem
119  int iterationsCompProb; ///< number of iterations of the complementary problem
120  int numRedProbRows; ///< number of rows in the reduced problem
121  int numRedProbCols; ///< number of columns in the reduced problem
122  int degenPivotsPrimal; ///< number of primal degenerate pivots
123  int degenPivotsDual; ///< number of dual degenerate pivots
124  int degenPivotCandPrimal; ///< number of pivoting candidates that will produce a degenerate step in the primal
125  int degenPivotCandDual; ///< number of pivoting candidates that will produce a degenerate step in the dual
126  Real sumDualDegen; ///< the sum of the rate of dual degeneracy at each iteration
127  Real sumPrimalDegen; ///< the sum of the rate of primal degeneracy at each iteration
128  Real decompBasisCondNum; ///< the condition number for the basis used to perform the decomposition
129  Real totalBoundViol; ///< the sum of the bound violations in the original problem using the red prob sol
130  Real totalRowViol; ///< the sum of the row violations in the original problem using the red prob sol
131  Real maxBoundViol; ///< the max bound violation in the original problem using the red prob sol
132  Real maxRowViol; ///< the max row violations in the original problem using the red prob sol
133  int redProbStatus; ///< status of the reduced problem
134  int compProbStatus; ///< status of the complementary problem
135  Real finalCompObj; ///< the final objective function of the complementary problem
136 
137  // Numerics
138  Real finalBasisCondition; ///< condition number estimate of the optimal basis matrix
139 
140  //@}
141 };
142 } // namespace soplex
143 #endif // _STATISTICS_H_
int unbdRefinements
number of refinement steps during undboundedness test
Definition: statistics.h:113
int callsReducedProb
number of times the reduced problem is solved. This includes the initial solve.
Definition: statistics.h:116
Timer * syncTime
time for synchronization between real and rational LP (included in solving time)
Definition: statistics.h:91
int feasRefinements
number of refinement steps during infeasibility test
Definition: statistics.h:112
Real decompBasisCondNum
the condition number for the basis used to perform the decomposition
Definition: statistics.h:128
int stallRefinements
number of refinement steps without pivots
Definition: statistics.h:110
virtual ~Timer()
Definition: timer.h:124
int numRedProbCols
number of columns in the reduced problem
Definition: statistics.h:121
int iterationsInit
number of iterations in the initial LP
Definition: statistics.h:117
Timer * simplexTime
simplex time
Definition: statistics.h:90
int luSolvesReal
number of (forward and backward) solves with basis matrix in real precision
Definition: statistics.h:106
int refinements
number of refinement steps
Definition: statistics.h:109
int luFactorizationsReal
number of basis matrix factorizations in real precision
Definition: statistics.h:105
Real finalCompObj
the final objective function of the complementary problem
Definition: statistics.h:135
int degenPivotCandDual
number of pivoting candidates that will produce a degenerate step in the dual
Definition: statistics.h:125
int compProbStatus
status of the complementary problem
Definition: statistics.h:134
Real luFactorizationTimeReal
time for factorizing bases matrices in real precision
Definition: statistics.h:96
double Real
Definition: spxdefines.h:218
Timer * rationalTime
time for rational LP solving (included in solving time)
Definition: statistics.h:93
Real maxRowViol
the max row violations in the original problem using the red prob sol
Definition: statistics.h:132
Real sumPrimalDegen
the sum of the rate of primal degeneracy at each iteration
Definition: statistics.h:127
Real maxBoundViol
the max bound violation in the original problem using the red prob sol
Definition: statistics.h:131
Real luSolveTimeRational
time for solving linear systems in rational precision
Definition: statistics.h:99
~Statistics()
destructor
Definition: statistics.h:51
int degenPivotsDual
number of dual degenerate pivots
Definition: statistics.h:123
Preconfigured SoPlex LP solver.
int luFactorizationsRational
number of basis matrix factorizations in rational precision
Definition: statistics.h:107
Timer * preprocessingTime
preprocessing time
Definition: statistics.h:89
Real luSolveTimeReal
time for solving linear systems in real precision
Definition: statistics.h:97
Timer * reconstructionTime
time for rational reconstructions
Definition: statistics.h:94
Everything should be within this namespace.
Timer class.
Timer::TYPE timerType
type of timer (user or wallclock)
Definition: statistics.h:95
TYPE
types of timers
Definition: timer.h:99
int iterations
number of iterations/pivots
Definition: statistics.h:100
int boundflips
number of dual bound flips
Definition: statistics.h:104
void clearAllData()
clears all statistics
Definition: statistics.cpp:89
int iterationsRedProb
number of iterations of the reduced problem
Definition: statistics.h:118
void print(std::ostream &os)
prints statistics
Definition: statistics.cpp:148
void clearSolvingData()
clears statistics on solving process
Definition: statistics.cpp:96
Real finalBasisCondition
condition number estimate of the optimal basis matrix
Definition: statistics.h:138
Real totalRowViol
the sum of the row violations in the original problem using the red prob sol
Definition: statistics.h:130
Timer * readingTime
reading time not included in solving time
Definition: statistics.h:87
int iterationsFromBasis
number of iterations from Basis
Definition: statistics.h:102
int iterationsPolish
number of iterations during solution polishing
Definition: statistics.h:103
Statistics & operator=(const Statistics &rhs)
assignment operator
Definition: statistics.cpp:56
Timer * solvingTime
solving time
Definition: statistics.h:88
int degenPivotCandPrimal
number of pivoting candidates that will produce a degenerate step in the primal
Definition: statistics.h:124
Statistics(Timer::TYPE ttype=Timer::USER_TIME)
default constructor
Definition: statistics.cpp:26
int iterationsPrimal
number of iterations with Primal
Definition: statistics.h:101
int iterationsCompProb
number of iterations of the complementary problem
Definition: statistics.h:119
Timer * transformTime
time for transforming LPs (included in solving time)
Definition: statistics.h:92
int redProbStatus
status of the reduced problem
Definition: statistics.h:133
Real sumDualDegen
the sum of the rate of dual degeneracy at each iteration
Definition: statistics.h:126
Real luFactorizationTimeRational
time for factorizing bases matrices in rational precision
Definition: statistics.h:98
Wrapper for the system time query methods.
Definition: timer.h:76
Real totalBoundViol
the sum of the bound violations in the original problem using the red prob sol
Definition: statistics.h:129
int rationalReconstructions
number of rational reconstructions performed
Definition: statistics.h:108
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:110
int pivotRefinements
number of refinement steps until final basis is reached
Definition: statistics.h:111
int numRedProbRows
number of rows in the reduced problem
Definition: statistics.h:120
int degenPivotsPrimal
number of primal degenerate pivots
Definition: statistics.h:122