All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Solver.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_SOLVERS_SOLVER_H_
23 #define _BLAZE_MATH_SOLVERS_SOLVER_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <limits>
31 #include <blaze/system/Solvers.h>
32 #include <blaze/util/Types.h>
33 
34 
35 namespace blaze {
36 
37 //=================================================================================================
38 //
39 // CLASS DEFINITION
40 //
41 //=================================================================================================
42 
43 //*************************************************************************************************
50 class Solver
51 {
52  public:
53  //**Constructors********************************************************************************
56  explicit Solver();
58  //**********************************************************************************************
59 
60  //**Get functions*******************************************************************************
63  inline size_t getMaxIterations() const;
64  inline size_t getLastIterations() const;
65  inline real getLastPrecision() const;
66  inline real getThreshold() const;
68  //**********************************************************************************************
69 
70  //**Set functions***************************************************************************
73  inline void setMaxIterations( size_t maxIterations );
74  inline void setThreshold ( real threshold );
76  //**********************************************************************************************
77 
78  protected:
79  //**Member variables****************************************************************************
82  size_t maxIterations_;
83 
85  size_t lastIterations_;
88 
89  //**********************************************************************************************
90 };
91 //*************************************************************************************************
92 
93 
94 
95 
96 //=================================================================================================
97 //
98 // CONSTRUCTORS
99 //
100 //=================================================================================================
101 
102 //*************************************************************************************************
106  : maxIterations_ ( solvers::maxIterations ) // The maximum number of iterations
107  , lastIterations_( 0 ) // The number of iterations spent in the last solution process
108  , lastPrecision_ ( std::numeric_limits<real>::max() ) // The precision of the solution after the solution process
109  , threshold_ ( solvers::threshold ) // Precision threshold for the solution
110 {}
111 //*************************************************************************************************
112 
113 
114 
115 
116 //=================================================================================================
117 //
118 // GET FUNCTIONS
119 //
120 //=================================================================================================
121 
122 //*************************************************************************************************
127 inline size_t Solver::getMaxIterations() const
128 {
129  return maxIterations_;
130 }
131 //*************************************************************************************************
132 
133 
134 //*************************************************************************************************
139 inline size_t Solver::getLastIterations() const
140 {
141  return lastIterations_;
142 }
143 //*************************************************************************************************
144 
145 
146 //*************************************************************************************************
155 {
156  return lastPrecision_;
157 }
158 //*************************************************************************************************
159 
160 
161 //*************************************************************************************************
167 {
168  return threshold_;
169 }
170 //*************************************************************************************************
171 
172 
173 
174 
175 //=================================================================================================
176 //
177 // SET FUNCTIONS
178 //
179 //=================================================================================================
180 
181 //*************************************************************************************************
187 {
189 }
190 //*************************************************************************************************
191 
192 
193 //*************************************************************************************************
199 {
201 }
202 //*************************************************************************************************
203 
204 } // namespace blaze
205 
206 #endif