Debian Codegraph @

src/xmpsolve/root.cpp

raw
1 #include "root.h"
2
3 namespace xmpsolve {
4
5 Root::Root()
6 {
7 mpc_init2 (this->value, 0);
8 mpc_set_ui (this->value, 0U, 0U);
9
10 rdpe_set (this->radius, rdpe_zero);
11 this->status = MPS_ROOT_STATUS_CLUSTERED;
12 }
13
14 Root::Root(mpc_t value, rdpe_t radius, mps_root_status status)
15 {
16 mpc_init2 (this->value, mpc_get_prec (value));
17 mpc_set (this->value, value);
18
19 rdpe_set (this->radius, radius);
20
21 this->status = status;
22 }
23
24 double
25 Root::get_radius()
26 {
27 return rdpe_get_d(radius);
28 }
29
30 double
31 Root::get_real_part()
32 {
33 return mpf_get_d (mpc_Re (value));
34 }
35
36 double
37 Root::get_imag_part()
38 {
39 return mpf_get_d (mpc_Im (value));
40 }
41
42 } // namespace xmpsolve