SoPlex Documentation
Loading...
Searching...
No Matches
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-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 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
43THREADLOCAL Real Param::s_epsilon = DEFAULT_EPS_ZERO;
44
45THREADLOCAL Real Param::s_epsilon_factorization = DEFAULT_EPS_FACTOR;
46
47THREADLOCAL Real Param::s_epsilon_update = DEFAULT_EPS_UPDATE;
48
49THREADLOCAL Real Param::s_epsilon_pivot = DEFAULT_EPS_PIVOT;
50
51bool msginconsistent(const char* name, const char* file, int line)
52{
53 assert(name != 0);
54 assert(file != 0);
55 assert(line >= 0);
56
57 MSG_ERROR(std::cerr << file << "(" << line << ") "
58 << "Inconsistency detected in " << name << std::endl;)
59
60 return 0;
61}
62
63
64Real Param::epsilon()
65{
66 return (s_epsilon);
67}
68
69void Param::setEpsilon(Real eps)
70{
71 s_epsilon = eps;
72}
73
74
75Real Param::epsilonFactorization()
76{
78}
79
80void Param::setEpsilonFactorization(Real eps)
81{
83}
84
85
86Real Param::epsilonUpdate()
87{
88 return s_epsilon_update;
89}
90
91void Param::setEpsilonUpdate(Real eps)
92{
93 s_epsilon_update = eps;
94}
95
96Real Param::epsilonPivot()
97{
98 return s_epsilon_pivot;
99}
100
101void Param::setEpsilonPivot(Real eps)
102{
103 s_epsilon_pivot = eps;
104}
105
106} // namespace soplex
Safe arrays of data objects.
Definition dataarray.h:75
static THREADLOCAL Real s_epsilon_update
epsilon for factorization update
Definition spxdefines.h:313
static THREADLOCAL Real s_epsilon_factorization
epsilon for factorization
Definition spxdefines.h:311
static THREADLOCAL Real s_epsilon
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition spxdefines.h:309
static THREADLOCAL Real s_epsilon_pivot
epsilon for pivot zero tolerance in factorization
Definition spxdefines.h:315
Everything should be within this namespace.
THREADLOCAL const Real infinity
bool msginconsistent(const char *name, const char *file, int line)
double Real
Definition spxdefines.h:266
bool EQ(int a, int b)
Debugging, floating point type and parameter definitions.
#define DEFAULT_EPS_FACTOR
Definition spxdefines.h:281
#define THREADLOCAL
SOPLEX_DEBUG.
Definition spxdefines.h:193
#define DEFAULT_INFINITY
Definition spxdefines.h:289
#define DEFAULT_EPS_ZERO
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition spxdefines.h:278
#define DEFAULT_EPS_UPDATE
Definition spxdefines.h:284
#define MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
Definition spxdefines.h:162
#define DEFAULT_EPS_PIVOT
Definition spxdefines.h:287
Wrapper for different output streams and verbosity levels.