forked from parnet/plugin_AMDSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiteration_control.hpp
More file actions
59 lines (43 loc) · 1.31 KB
/
iteration_control.hpp
File metadata and controls
59 lines (43 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
namespace ug {
class AMD_IterationControl {
public:
/*void init(double abs_tol, double rel_tol, double div_tol, int max_iter) {
tolerance_absolute = abs_tol;
tolerance_reduction = rel_tol;
tolerance_divergence = div_tol;
iterations_max = max_iter;
};*/
void init(double abs_tol, double rel_tol, double div_tol, int min_iter, int max_iter) {
tolerance_absolute = abs_tol;
tolerance_reduction = rel_tol;
tolerance_divergence = div_tol;
iterations_min = min_iter;
iterations_max = max_iter;
};
void init_tol(double abs_tol, double rel_tol, double div_tol) {
tolerance_absolute = abs_tol;
tolerance_reduction = rel_tol;
tolerance_divergence = div_tol;
};
void init_min_iter(int min_iter) {
iterations_min = min_iter;
};
void init_max_iter(int max_iter) {
iterations_max = max_iter;
};
void set_residual_norm(int resnorm) {
resnorm_ = resnorm;
};
void set_verbose(bool verbose) {
verbose_ = verbose;
};
int resnorm_ = 2;
int iterations_max = 100;
int iterations_min = 0;
double tolerance_absolute = 1e-14;
double tolerance_reduction = 1e-10;
double tolerance_divergence = 1e10;
bool verbose_ = false;
};
}