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