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   	
33   	namespace soplex
34   	{
35   	// Overloaded EQ function
36   	bool EQ(int a, int b)
37   	{
38   	   return (a == b);
39   	}
40   	
41   	SOPLEX_THREADLOCAL const Real infinity                 = SOPLEX_DEFAULT_INFINITY;
42   	
43   	bool msginconsistent(const char* name, const char* file, int line)
44   	{
45   	   assert(name != 0);
46   	   assert(file != 0);
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   	
56   	Real Tolerances::epsilon()
57   	{
58   	   return (s_epsilon);
59   	}
60   	
61   	void Tolerances::setEpsilon(Real eps)
62   	{
63   	   s_epsilon = eps;
64   	   s_epsilon_multiplier = std::sqrt(s_epsilon / SOPLEX_DEFAULT_EPS_ZERO);
65   	}
66   	
67   	
68   	Real Tolerances::epsilonFactorization()
69   	{
70   	   return s_epsilon_factorization;
71   	}
72   	
73   	void Tolerances::setEpsilonFactorization(Real eps)
74   	{
75   	   s_epsilon_factorization = eps;
76   	}
77   	
78   	
79   	Real Tolerances::epsilonUpdate()
80   	{
81   	   return s_epsilon_update;
82   	}
83   	
84   	void Tolerances::setEpsilonUpdate(Real eps)
85   	{
86   	   s_epsilon_update = eps;
87   	}
88   	
89   	Real Tolerances::epsilonPivot()
90   	{
91   	   return s_epsilon_pivot;
92   	}
93   	
94   	void Tolerances::setEpsilonPivot(Real eps)
95   	{
96   	   s_epsilon_pivot = eps;
97   	}
98   	
99   	Real Tolerances::feastol()
100  	{
101  	   return s_feastol;
102  	}
103  	
104  	void Tolerances::setFeastol(Real ftol)
105  	{
106  	   s_feastol = ftol;
107  	}
108  	
109  	Real Tolerances::opttol()
110  	{
111  	   return s_opttol;
112  	}
113  	
114  	void Tolerances::setOpttol(Real otol)
115  	{
116  	   s_opttol = otol;
117  	}
118  	
119  	Real Tolerances::floatingPointFeastol()
120  	{
121  	   return s_floating_point_feastol;
122  	}
123  	
124  	void Tolerances::setFloatingPointFeastol(Real ftol)
125  	{
126  	   s_floating_point_feastol = ftol;
127  	}
128  	
129  	Real Tolerances::floatingPointOpttol()
130  	{
131  	   return s_floating_point_opttol;
132  	}
133  	
134  	void Tolerances::setFloatingPointOpttol(Real otol)
135  	{
136  	   s_floating_point_opttol = otol;
137  	}
138  	// namespace soplex
139  	}
140