All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Lemke.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_SOLVERS_LEMKE_H_
23 #define _BLAZE_MATH_SOLVERS_LEMKE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <iosfwd>
35 #include <blaze/system/Precision.h>
36 #include <blaze/util/Types.h>
37 
38 
39 namespace blaze {
40 
41 //=================================================================================================
42 //
43 // CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
53 class Lemke : public Solver
54 {
55  public:
56  //**Constructors********************************************************************************
59  explicit Lemke();
61  //**********************************************************************************************
62 
63  //**Solver functions****************************************************************************
66  bool solve( LCP& lcp );
67  bool solve( LCP& lcp, const VecN& d );
69  //**********************************************************************************************
70 
71  //**Utility functions***************************************************************************
74  void printTableau( std::ostream& os ) const;
76  //**********************************************************************************************
77 
78  private:
79  //**Utility functions***************************************************************************
82  bool isComponentwiseNonnegative( const VecN& v ) const;
83  bool isComponentwisePositive ( const VecN& v ) const;
84  bool isLexicographicallyLess ( size_t i1, real f1, size_t i2, real f2 ) const;
85  bool isLexicographicallyGreater( size_t i1, real f1, size_t i2, real f2 ) const;
86  void pivot ( size_t block, size_t drive );
88  //**********************************************************************************************
89 
90  //**Member variables****************************************************************************
97 
98  //**********************************************************************************************
99 };
100 //*************************************************************************************************
101 
102 } // namespace blaze
103 
104 #endif