All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Solver.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SOLVERS_SOLVER_H_
36 #define _BLAZE_MATH_SOLVERS_SOLVER_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <limits>
44 #include <blaze/system/Solvers.h>
45 #include <blaze/util/Types.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
63 class Solver
64 {
65  public:
66  //**Constructors********************************************************************************
69  explicit Solver();
71  //**********************************************************************************************
72 
73  //**Get functions*******************************************************************************
76  inline size_t getMaxIterations() const;
77  inline size_t getLastIterations() const;
78  inline real getLastPrecision() const;
79  inline real getThreshold() const;
81  //**********************************************************************************************
82 
83  //**Set functions***************************************************************************
86  inline void setMaxIterations( size_t maxIterations );
87  inline void setThreshold ( real threshold );
89  //**********************************************************************************************
90 
91  protected:
92  //**Member variables****************************************************************************
95  size_t maxIterations_;
96 
98  size_t lastIterations_;
101 
102  //**********************************************************************************************
103 };
104 //*************************************************************************************************
105 
106 
107 
108 
109 //=================================================================================================
110 //
111 // CONSTRUCTORS
112 //
113 //=================================================================================================
114 
115 //*************************************************************************************************
119  : maxIterations_ ( solvers::maxIterations ) // The maximum number of iterations
120  , lastIterations_( 0 ) // The number of iterations spent in the last solution process
121  , lastPrecision_ ( std::numeric_limits<real>::max() ) // The precision of the solution after the solution process
122  , threshold_ ( solvers::threshold ) // Precision threshold for the solution
123 {}
124 //*************************************************************************************************
125 
126 
127 
128 
129 //=================================================================================================
130 //
131 // GET FUNCTIONS
132 //
133 //=================================================================================================
134 
135 //*************************************************************************************************
140 inline size_t Solver::getMaxIterations() const
141 {
142  return maxIterations_;
143 }
144 //*************************************************************************************************
145 
146 
147 //*************************************************************************************************
152 inline size_t Solver::getLastIterations() const
153 {
154  return lastIterations_;
155 }
156 //*************************************************************************************************
157 
158 
159 //*************************************************************************************************
168 {
169  return lastPrecision_;
170 }
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
180 {
181  return threshold_;
182 }
183 //*************************************************************************************************
184 
185 
186 
187 
188 //=================================================================================================
189 //
190 // SET FUNCTIONS
191 //
192 //=================================================================================================
193 
194 //*************************************************************************************************
200 {
202 }
203 //*************************************************************************************************
204 
205 
206 //*************************************************************************************************
212 {
214 }
215 //*************************************************************************************************
216 
217 } // namespace blaze
218 
219 #endif
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:994
real lastPrecision_
The precision of the solution after the solution process.
Definition: Solver.h:99
size_t getLastIterations() const
Returns the number of iterations spent in the last solution process.
Definition: Solver.h:152
System settings for for the mathematical solvers.
size_t maxIterations_
The maximum number of iterations.
Definition: Solver.h:95
real getThreshold() const
Returns the threshold that classifies a solution as good enough.
Definition: Solver.h:179
Solver()
The default constructor.
Definition: Solver.h:118
const real threshold
Residuum threshold for the LSE/LCP solution of the mathematical solvers.This value specifies the thre...
Definition: Solvers.h:73
void setMaxIterations(size_t maxIterations)
Sets the maximum number of iterations the solver may spend solving the problem.
Definition: Solver.h:199
const size_t maxIterations
Maximum number of iterations of the mathematical solvers.This value specifies the default maximum num...
Definition: Solvers.h:55
double real
Floating point data type of the Blaze library.This type definition offers the possibility to switch t...
Definition: Precision.h:47
real getLastPrecision() const
Returns the precision of the solution after the solution process.
Definition: Solver.h:167
real threshold_
Precision threshold for the solution.
Definition: Solver.h:100
Header file for basic type definitions.
size_t lastIterations_
The number of iterations spent in the last solution process.
Definition: Solver.h:98
void setThreshold(real threshold)
Sets the threshold which classifies a solution as good enough.
Definition: Solver.h:211
size_t getMaxIterations() const
Returns the maximum number of iterations the solver may spend solving the problem.
Definition: Solver.h:140
Base class for all solver classes.TODO: description of the Solver class TODO: description of its func...
Definition: Solver.h:63