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-2022 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  */
33 template <class R>
35 {
36 
37 public:
38 
39 
40  ///@name Construction, resetting, printing
41  ///@{
42 
43  /// default constructor
45 
46  /// copy constructor
47  Statistics(const Statistics& base);
48 
49  /// assignment operator
50  Statistics& operator=(const Statistics& rhs);
51 
52  /// destructor
54  {
55  // we need to free all timers again (allocation happens in constructor)
56  readingTime->~Timer();
57  solvingTime->~Timer();
58  preprocessingTime->~Timer();
59  simplexTime->~Timer();
60  syncTime->~Timer();
61  transformTime->~Timer();
62  rationalTime->~Timer();
63  reconstructionTime->~Timer();
64  spx_free(readingTime);
65  spx_free(solvingTime);
66  spx_free(preprocessingTime);
67  spx_free(simplexTime);
68  spx_free(syncTime);
69  spx_free(transformTime);
70  spx_free(rationalTime);
71  spx_free(reconstructionTime);
72  }
73 
74  /// clears all statistics
75  void clearAllData();
76 
77  /// clears statistics on solving process
78  void clearSolvingData();
79 
80  /// prints statistics
81  void print(std::ostream& os);
82 
83 
84  ///@}
85 
86 
87  ///@name Data
88  ///@{
89 
90  Timer* readingTime; ///< reading time not included in solving time
91  Timer* solvingTime; ///< solving time
92  Timer* preprocessingTime; ///< preprocessing time
93  Timer* simplexTime; ///< simplex time
94  Timer* syncTime; ///< time for synchronization between real and rational LP (included in solving time)
95  Timer* transformTime; ///< time for transforming LPs (included in solving time)
96  Timer* rationalTime; ///< time for rational LP solving (included in solving time)
97  Timer* reconstructionTime; ///< time for rational reconstructions
98  Timer::TYPE timerType; ///< type of timer (user or wallclock)
99 
100  Real multTimeSparse; ///< time for computing A*x exploiting sparsity (setupPupdate(), PRICE step)
101  Real multTimeFull; ///< time for computing A*x ignoring sparsity (setupPupdate(), PRICE step)
102  Real multTimeColwise; ///< time for computing A*x columnwise (setupPupdate(), PRICE step)
103  Real multTimeUnsetup; ///< time for computing A*x w/o sparsity information (setupPupdate(), PRICE step)
104  int multSparseCalls; ///< number of products A*x exploiting sparsity (setupPupdate(), PRICE step)
105  int multFullCalls; ///< number of products A*x ignoring sparsity (setupPupdate(), PRICE step)
106  int multColwiseCalls; ///< number of products A*x columnwise (setupPupdate(), PRICE step)
107  int multUnsetupCalls; ///< number of products A*x w/o sparsity information (setupPupdate(), PRICE step)
108 
109  Real luFactorizationTimeReal; ///< time for factorizing bases matrices in real precision
110  Real luSolveTimeReal; ///< time for solving linear systems in real precision
111  Real luFactorizationTimeRational; ///< time for factorizing bases matrices in rational precision
112  Real luSolveTimeRational; ///< time for solving linear systems in rational precision
113  int iterations; ///< number of iterations/pivots
114  int iterationsPrimal; ///< number of iterations with Primal
115  int iterationsFromBasis; ///< number of iterations from Basis
116  int iterationsPolish; ///< number of iterations during solution polishing
117  int boundflips; ///< number of dual bound flips
118  int luFactorizationsReal; ///< number of basis matrix factorizations in real precision
119  int luSolvesReal; ///< number of (forward and backward) solves with basis matrix in real precision
120  int luFactorizationsRational; ///< number of basis matrix factorizations in rational precision
121  int rationalReconstructions; ///< number of rational reconstructions performed
122  int refinements; ///< number of refinement steps
123  int stallRefinements; ///< number of refinement steps without pivots
124  int pivotRefinements; ///< number of refinement steps until final basis is reached
125  int feasRefinements; ///< number of refinement steps during infeasibility test
126  int unbdRefinements; ///< number of refinement steps during undboundedness test
127 
128  // Improved dual simplex statistics
129  int callsReducedProb; ///< number of times the reduced problem is solved. This includes the initial solve.
130  int iterationsInit; ///< number of iterations in the initial LP
131  int iterationsRedProb; ///< number of iterations of the reduced problem
132  int iterationsCompProb; ///< number of iterations of the complementary problem
133  int numRedProbRows; ///< number of rows in the reduced problem
134  int numRedProbCols; ///< number of columns in the reduced problem
135  int degenPivotsPrimal; ///< number of primal degenerate pivots
136  int degenPivotsDual; ///< number of dual degenerate pivots
137  int degenPivotCandPrimal; ///< number of pivoting candidates that will produce a degenerate step in the primal
138  int degenPivotCandDual; ///< number of pivoting candidates that will produce a degenerate step in the dual
139  R sumDualDegen; ///< the sum of the rate of dual degeneracy at each iteration
140  R sumPrimalDegen; ///< the sum of the rate of primal degeneracy at each iteration
141  R decompBasisCondNum; ///< the condition number for the basis used to perform the decomposition
142  R totalBoundViol; ///< the sum of the bound violations in the original problem using the red prob sol
143  R totalRowViol; ///< the sum of the row violations in the original problem using the red prob sol
144  R maxBoundViol; ///< the max bound violation in the original problem using the red prob sol
145  R maxRowViol; ///< the max row violations in the original problem using the red prob sol
146  int redProbStatus; ///< status of the reduced problem
147  int compProbStatus; ///< status of the complementary problem
148  R finalCompObj; ///< the final objective function of the complementary problem
149 
150  // Numerics
151  R finalBasisCondition; ///< condition number estimate of the optimal basis matrix
152 
153  ///@}
154 
155 };
156 } // namespace soplex
157 
158 // For general templated files
159 #include "statistics.hpp"
160 
161 #endif // _STATISTICS_H_
R sumPrimalDegen
the sum of the rate of primal degeneracy at each iteration
Definition: statistics.h:140
int stallRefinements
number of refinement steps without pivots
Definition: statistics.h:123
Real luFactorizationTimeReal
time for factorizing bases matrices in real precision
Definition: statistics.h:109
Real multTimeFull
time for computing A*x ignoring sparsity (setupPupdate(), PRICE step)
Definition: statistics.h:101
Timer * simplexTime
simplex time
Definition: statistics.h:93
R finalCompObj
the final objective function of the complementary problem
Definition: statistics.h:148
Real luFactorizationTimeRational
time for factorizing bases matrices in rational precision
Definition: statistics.h:111
int pivotRefinements
number of refinement steps until final basis is reached
Definition: statistics.h:124
R decompBasisCondNum
the condition number for the basis used to perform the decomposition
Definition: statistics.h:141
int iterationsFromBasis
number of iterations from Basis
Definition: statistics.h:115
Timer * rationalTime
time for rational LP solving (included in solving time)
Definition: statistics.h:96
int callsReducedProb
number of times the reduced problem is solved. This includes the initial solve.
Definition: statistics.h:129
R finalBasisCondition
condition number estimate of the optimal basis matrix
Definition: statistics.h:151
SoPlexBase< R > & operator=(const SoPlexBase< R > &rhs)
assignment operator
int numRedProbRows
number of rows in the reduced problem
Definition: statistics.h:133
int multColwiseCalls
number of products A*x columnwise (setupPupdate(), PRICE step)
Definition: statistics.h:106
R maxRowViol
the max row violations in the original problem using the red prob sol
Definition: statistics.h:145
int rationalReconstructions
number of rational reconstructions performed
Definition: statistics.h:121
Timer * reconstructionTime
time for rational reconstructions
Definition: statistics.h:97
R totalBoundViol
the sum of the bound violations in the original problem using the red prob sol
Definition: statistics.h:142
Real multTimeColwise
time for computing A*x columnwise (setupPupdate(), PRICE step)
Definition: statistics.h:102
Real luSolveTimeRational
time for solving linear systems in rational precision
Definition: statistics.h:112
double Real
Definition: spxdefines.h:256
int multSparseCalls
number of products A*x exploiting sparsity (setupPupdate(), PRICE step)
Definition: statistics.h:104
Timer * syncTime
time for synchronization between real and rational LP (included in solving time)
Definition: statistics.h:94
int iterationsCompProb
number of iterations of the complementary problem
Definition: statistics.h:132
int feasRefinements
number of refinement steps during infeasibility test
Definition: statistics.h:125
Real luSolveTimeReal
time for solving linear systems in real precision
Definition: statistics.h:110
Timer * readingTime
reading time not included in solving time
Definition: statistics.h:90
Real multTimeUnsetup
time for computing A*x w/o sparsity information (setupPupdate(), PRICE step)
Definition: statistics.h:103
int unbdRefinements
number of refinement steps during undboundedness test
Definition: statistics.h:126
R sumDualDegen
the sum of the rate of dual degeneracy at each iteration
Definition: statistics.h:139
int iterationsPrimal
number of iterations with Primal
Definition: statistics.h:114
int refinements
number of refinement steps
Definition: statistics.h:122
R totalRowViol
the sum of the row violations in the original problem using the red prob sol
Definition: statistics.h:143
Timer::TYPE timerType
type of timer (user or wallclock)
Definition: statistics.h:98
int iterationsRedProb
number of iterations of the reduced problem
Definition: statistics.h:131
Preconfigured SoPlex LP solver.
R maxBoundViol
the max bound violation in the original problem using the red prob sol
Definition: statistics.h:144
int redProbStatus
status of the reduced problem
Definition: statistics.h:146
int luSolvesReal
number of (forward and backward) solves with basis matrix in real precision
Definition: statistics.h:119
Timer * solvingTime
solving time
Definition: statistics.h:91
Everything should be within this namespace.
Timer class.
TYPE
types of timers
Definition: timer.h:99
int multFullCalls
number of products A*x ignoring sparsity (setupPupdate(), PRICE step)
Definition: statistics.h:105
int multUnsetupCalls
number of products A*x w/o sparsity information (setupPupdate(), PRICE step)
Definition: statistics.h:107
Real multTimeSparse
time for computing A*x exploiting sparsity (setupPupdate(), PRICE step)
Definition: statistics.h:100
int boundflips
number of dual bound flips
Definition: statistics.h:117
int luFactorizationsReal
number of basis matrix factorizations in real precision
Definition: statistics.h:118
int compProbStatus
status of the complementary problem
Definition: statistics.h:147
int numRedProbCols
number of columns in the reduced problem
Definition: statistics.h:134
int iterationsInit
number of iterations in the initial LP
Definition: statistics.h:130
int degenPivotCandPrimal
number of pivoting candidates that will produce a degenerate step in the primal
Definition: statistics.h:137
Timer * transformTime
time for transforming LPs (included in solving time)
Definition: statistics.h:95
int iterationsPolish
number of iterations during solution polishing
Definition: statistics.h:116
int luFactorizationsRational
number of basis matrix factorizations in rational precision
Definition: statistics.h:120
int degenPivotsDual
number of dual degenerate pivots
Definition: statistics.h:136
int degenPivotCandDual
number of pivoting candidates that will produce a degenerate step in the dual
Definition: statistics.h:138
Timer * preprocessingTime
preprocessing time
Definition: statistics.h:92
Wrapper for the system time query methods.
Definition: timer.h:76
int iterations
number of iterations/pivots
Definition: statistics.h:113
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:111
int degenPivotsPrimal
number of primal degenerate pivots
Definition: statistics.h:135