Scippy

SoPlex

Sequential object-oriented simPlex

spxdefaultrt.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 spxdefaultrt.h
26  * @brief Textbook ratio test for SoPlex.
27  */
28 #ifndef _SPXDEFAULTRT_H_
29 #define _SPXDEFAULTRT_H_
30 
31 
32 #include <assert.h>
33 
34 #include "soplex/spxdefines.h"
35 #include "soplex/spxratiotester.h"
36 
37 namespace soplex
38 {
39 
40 /**@brief Textbook ratio test for SoPlex.
41  @ingroup Algo
42 
43  Class SPxDefaultRT provides an implementation of the textbook ratio test
44  as a derived class of SPxRatioTester. This class is not intended for
45  reliably solving LPs (even though it does the job for ``numerically simple''
46  LPs). Instead, it should serve as a demonstration of how to write ratio
47  tester classes.
48 
49  See SPxRatioTester for a class documentation.
50 */
51 template <class R>
52 class SPxDefaultRT : public SPxRatioTester<R>
53 {
54 public:
55 
56  //-------------------------------------
57  /**@name Construction / destruction */
58  ///@{
59  /// default constructor
61  : SPxRatioTester<R>("Default")
62  {}
63  /// copy constructor
65  : SPxRatioTester<R>(old)
66  {}
67  /// assignment operator
69  {
70  if(this != &rhs)
71  {
73  }
74 
75  return *this;
76  }
77  /// destructor
78  virtual ~SPxDefaultRT()
79  {}
80  /// clone function for polymorphism
81  inline virtual SPxRatioTester<R>* clone() const
82  {
83  return new SPxDefaultRT(*this);
84  }
85  ///@}
86 
87  //-------------------------------------
88  /**@name Select enter/leave */
89  ///@{
90  ///
91  virtual int selectLeave(R& val, R, bool);
92  ///
93  virtual SPxId selectEnter(R& val, int, bool);
94 };
95 
96 } // namespace soplex
97 
98 #include "spxdefaultrt.hpp"
99 
100 #endif // _SPXDEFAULTRT_H_
Abstract ratio test base class.
Abstract ratio test base class.Class SPxRatioTester is the virtual base class for computing the ratio...
virtual SPxRatioTester< R > * clone() const
clone function for polymorphism
Definition: spxdefaultrt.h:81
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:94
virtual int selectLeave(R &val, R, bool)
SPxRatioTester & operator=(const SPxRatioTester &rhs)
assignment operator
SPxDefaultRT(const SPxDefaultRT &old)
copy constructor
Definition: spxdefaultrt.h:64
SPxDefaultRT()
default constructor
Definition: spxdefaultrt.h:60
virtual ~SPxDefaultRT()
destructor
Definition: spxdefaultrt.h:78
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
Textbook ratio test for SoPlex.Class SPxDefaultRT provides an implementation of the textbook ratio te...
Definition: spxdefaultrt.h:52
virtual SPxId selectEnter(R &val, int, bool)
SPxDefaultRT & operator=(const SPxDefaultRT &rhs)
assignment operator
Definition: spxdefaultrt.h:68