Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
solver_option.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_SOLVER_OPTION_H
2#define _RHEOLEF_SOLVER_OPTION_H
3//
4// This file is part of Rheolef.
5//
6// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7//
8// Rheolef is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//
13// Rheolef is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with Rheolef; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// =========================================================================
23// AUTHOR: Pierre.Saramito@imag.fr
24// DATE: 4 march 2011
25
26namespace rheolef {
147} // namespace rheolef
148
149#include "rheolef/diststream.h"
150#include "rheolef/csr.h"
151
152namespace rheolef {
153
154// [verbatim_solver_option]
156public:
157 typedef std::size_t size_type;
158 static const long int decide = -1;
159 mutable long int iterative;
163 mutable Float residue;
166 mutable std::string label;
170 std::string preferred_library;
177
178// allocator and default values:
179
181 : iterative (decide),
182#if defined(_RHEOLEF_HAVE_FLOAT128)
183 tol (1e6*std::numeric_limits<Float>::epsilon()),
184#else
185 tol (1e3*std::numeric_limits<Float>::epsilon()),
186#endif
187 max_iter (100000),
188 absolute_stopping (true),
189 residue (0),
190 n_iter (0),
191 p_err (&derr),
192 label (),
194 n_refinement (2),
195 compute_determinant(false),
197 verbose_level (0),
198 do_check (false),
199 force_seq (false),
200 level_of_fill (1),
201 amalgamation (10),
202 ooc (20000)
203 {
204 }
207 template <class T, class M>
208 static std::string default_preferred_library (const csr<T,M>& a);
209 template <class T, class M>
210 static std::string used_library (const csr<T,M>& a, const solver_option& sopt = solver_option());
211// [verbatim_solver_option]
212protected:
213 static std::string _default_preferred_library (size_t dis_ext_nnz, bool is_sym, bool is_dp);
214 static std::string _used_library (std::string init_preferred_library, size_t dis_ext_nnz, bool is_sym, bool is_dp);
215// [verbatim_solver_option_cont]
216};
217// [verbatim_solver_option_cont]
218
219// for backward compatibility:
221
222// ---------------------------------------------------------------
223// inlined
224// ---------------------------------------------------------------
225inline
227 : iterative (x.iterative),
228 tol (x.tol),
229 max_iter (x.max_iter),
230 absolute_stopping (x.absolute_stopping),
231 residue (x.residue),
232 n_iter (x.n_iter),
233 p_err (x.p_err),
234 label (x.label),
235 krylov_dimension (x.krylov_dimension),
236 n_refinement (x.n_refinement),
237 compute_determinant(x.compute_determinant),
238 preferred_library(x.preferred_library),
239 verbose_level (x.verbose_level),
240 do_check (x.do_check),
241 force_seq (x.force_seq),
242 level_of_fill (x.level_of_fill),
243 amalgamation (x.amalgamation),
244 ooc (x.ooc)
245{
246}
247inline
271template <class T, class M>
272inline
273std::string
275{
276 return _default_preferred_library (a.dis_ext_nnz(), a.is_symmetric(), a.is_definite_positive());
277}
278template <class T, class M>
279inline
280std::string
282{
283 return _used_library (sopt.preferred_library, a.dis_ext_nnz(), a.is_symmetric(), a.is_definite_positive());
284}
285
286} // namespace rheolef
287#endif // _RHEOLEF_SOLVER_OPTION_H
see the Float page for the full documentation
see the csr page for the full documentation
Definition csr.h:317
odiststream: see the diststream page for the full documentation
Definition diststream.h:137
see the solver_option page for the full documentation
static const long int decide
static std::string default_preferred_library(const csr< T, M > &a)
static std::string used_library(const csr< T, M > &a, const solver_option &sopt=solver_option())
solver_option & operator=(const solver_option &)
std::string preferred_library
static std::string _default_preferred_library(size_t dis_ext_nnz, bool is_sym, bool is_dp)
static std::string _used_library(std::string init_preferred_library, size_t dis_ext_nnz, bool is_sym, bool is_dp)
This file is part of Rheolef.
STL namespace.
field residue(Float p, const field &uh)
Float epsilon