Scippy

SoPlex

Sequential object-oriented simPlex

spxdefines.cpp
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-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 SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file spxdefines.cpp
26 * @brief Debugging, floating point type and parameter definitions.
27 */
28#include "assert.h"
29#include "soplex/spxdefines.h"
30#include "soplex/spxout.h"
31#include "soplex/rational.h"
32
33namespace soplex
34{
35// Overloaded EQ function
36bool EQ(int a, int b)
37{
38 return (a == b);
39}
40
42
43bool msginconsistent(const char* name, const char* file, int line)
44{
45 assert(name != nullptr);
46 assert(file != nullptr);
47 assert(line >= 0);
48
49 SPX_MSG_ERROR(std::cerr << file << "(" << line << ") "
50 << "Inconsistency detected in " << name << std::endl;)
51
52 return 0;
53}
54
55
57{
58 return (s_epsilon);
59}
60
62{
63 s_epsilon = eps;
65}
66
67
69{
71}
72
74{
76}
77
78
80{
81 return s_epsilon_update;
82}
83
85{
86 s_epsilon_update = eps;
87}
88
90{
91 return s_epsilon_pivot;
92}
93
95{
96 s_epsilon_pivot = eps;
97}
98
100{
101 return s_feastol;
102}
103
105{
106 s_feastol = ftol;
107}
108
110{
111 return s_opttol;
112}
113
115{
116 s_opttol = otol;
117}
118
120{
122}
123
125{
127}
128
130{
132}
133
135{
137}
138// namespace soplex
139}
Real s_epsilon_factorization
epsilon for factorization
Definition: spxdefines.h:314
Real feastol()
global feasibility tolerance
Definition: spxdefines.cpp:99
Real floatingPointFeastol()
floating point feasibility tolerance used within the solver
Definition: spxdefines.cpp:119
void setFloatingPointFeastol(Real ftol)
set floating point feasibility tolerance used within the solver
Definition: spxdefines.cpp:124
Real s_floating_point_opttol
floating point optimality tolerance
Definition: spxdefines.h:326
Real s_floating_point_feastol
floating point feasibility tolerance
Definition: spxdefines.h:324
Real epsilon()
global zero epsilon
Definition: spxdefines.cpp:56
Real s_epsilon_update
epsilon for factorization update
Definition: spxdefines.h:316
Real s_epsilon_pivot
epsilon for pivot zero tolerance in factorization
Definition: spxdefines.h:318
Real epsilonFactorization()
zero espilon used in factorization
Definition: spxdefines.cpp:68
Real s_feastol
feasibility tolerance
Definition: spxdefines.h:320
void setFeastol(Real ftol)
set global feasibility tolerance
Definition: spxdefines.cpp:104
void setEpsilonUpdate(Real eps)
set zero espilon used in factorization update
Definition: spxdefines.cpp:84
Real epsilonPivot()
zero espilon used in pivot
Definition: spxdefines.cpp:89
void setOpttol(Real otol)
set global optimality tolerance
Definition: spxdefines.cpp:114
void setEpsilonFactorization(Real eps)
set zero espilon used in factorization
Definition: spxdefines.cpp:73
Real floatingPointOpttol()
floating point optimality tolerance used within the solver
Definition: spxdefines.cpp:129
void setFloatingPointOpttol(Real otol)
set floating point optimality tolerance used within the solver
Definition: spxdefines.cpp:134
void setEpsilon(Real eps)
set global zero epsilon
Definition: spxdefines.cpp:61
Real s_epsilon
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition: spxdefines.h:312
void setEpsilonPivot(Real eps)
set zero espilon used in pivot
Definition: spxdefines.cpp:94
Real s_epsilon_multiplier
multiplier for fixed numbers that should change if s_epsilon changes
Definition: spxdefines.h:328
Real epsilonUpdate()
zero espilon used in factorization update
Definition: spxdefines.cpp:79
Real s_opttol
optimality tolerance
Definition: spxdefines.h:322
Real opttol()
global optimality tolerance
Definition: spxdefines.cpp:109
Everything should be within this namespace.
bool msginconsistent(const char *name, const char *file, int line)
Definition: spxdefines.cpp:43
double Real
Definition: spxdefines.h:269
bool EQ(int a, int b)
Definition: spxdefines.cpp:36
SOPLEX_THREADLOCAL const Real infinity
Definition: spxdefines.cpp:41
Debugging, floating point type and parameter definitions.
#define SOPLEX_DEFAULT_EPS_ZERO
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition: spxdefines.h:281
#define SPX_MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
Definition: spxdefines.h:163
#define SOPLEX_THREADLOCAL
SOPLEX_DEBUG.
Definition: spxdefines.h:196
#define SOPLEX_DEFAULT_INFINITY
Definition: spxdefines.h:292
Wrapper for different output streams and verbosity levels.