99#include < iostream>
1010
1111static const double a_mat_test[] = {
12- 0.470442000675409 , -0.291482508170914 , -0.44183986349643 ,
13- -0.176333746005435 , 0.007410393215614 , -0.739195206041762 ,
14- 0.481736547564898 , 0.805743972141035 , -0.468344563609981
15- };
12+ 0.470442000675409 , -0.291482508170914 , -0.44183986349643 ,
13+ -0.176333746005435 , 0.007410393215614 , -0.739195206041762 ,
14+ 0.481736547564898 , 0.805743972141035 , -0.468344563609981 };
1615
1716static const std::complex <double > w_vec_complex_test[] = {
18- { 0.558344640162537 , 0 . },
19- {-0.274418404940748 , 0.876285061400947 },
20- {-0.274418404940748 , -0.876285061400947 }
21- };
17+ {0.558344640162537 , 0 .},
18+ {-0.274418404940748 , 0.876285061400947 },
19+ {-0.274418404940748 , -0.876285061400947 }};
2220
2321static const std::complex <double > vr_mat_complex_test[] = {
24- {-0.870718618937641 , 0 . },
25- { 0.491334396303628 , 0 . },
26- { 0.020966583991578 , 0 . },
27- { 0.12292498568887 , 0.296216896839797 },
28- { 0.107429842088307 , 0.640393071981176 },
29- {-0.689565472096294 , 0 . },
30- { 0.12292498568887 , -0.296216896839797 },
31- { 0.107429842088307 , -0.640393071981176 },
32- {-0.689565472096294 , -0 . }
33- };
22+ {-0.870718618937641 , 0 .},
23+ {0.491334396303628 , 0 .},
24+ {0.020966583991578 , 0 .},
25+ {0.12292498568887 , 0.296216896839797 },
26+ {0.107429842088307 , 0.640393071981176 },
27+ {-0.689565472096294 , 0 .},
28+ {0.12292498568887 , -0.296216896839797 },
29+ {0.107429842088307 , -0.640393071981176 },
30+ {-0.689565472096294 , -0 .}};
3431
3532static const int test_size = 3 ;
3633
3734// We set these to zero, because the expectation is complex
3835// eigenvalues and eigenvectors for this test input
3936static const double wr_vec_test[] = {0 ., 0 ., 0 .};
40- static const double vr_mat_test[] = {
41- 0 ., 0 ., 0 .,
42- 0 ., 0 ., 0 .,
43- 0 ., 0 ., 0 .
44- };
37+ static const double vr_mat_test[] = {0 ., 0 ., 0 ., 0 ., 0 ., 0 ., 0 ., 0 ., 0 .};
4538
4639Eig::Eig () {
4740 a_mat = r_mat = vl_mat = vr_mat = wr_vec = wi_vec = 0 ;
@@ -68,8 +61,8 @@ void Eig::make_args(int size) {
6861 // complex eigenvalues and eigenvectors
6962 w_vec_complex =
7063 (std::complex <double > *) mkl_malloc (n * sizeof (*w_vec_complex), 64 );
71- vr_mat_complex =
72- (std:: complex < double > *) mkl_malloc ( mat_size * sizeof (*vr_mat_complex), 64 );
64+ vr_mat_complex = (std:: complex < double > *) mkl_malloc (
65+ mat_size * sizeof (*vr_mat_complex), 64 );
7366}
7467
7568void Eig::copy_args () {
@@ -129,17 +122,16 @@ bool Eig::test() {
129122 compute ();
130123
131124 if (only_real)
132- return mat_equal (wr_vec, wr_vec_test, n)
133- && mat_equal (vr_mat, vr_mat_test, mat_size);
125+ return mat_equal (wr_vec, wr_vec_test, n) &&
126+ mat_equal (vr_mat, vr_mat_test, mat_size);
134127 else
135- return mat_equal (w_vec_complex, w_vec_complex_test, n)
136- && mat_equal (vr_mat_complex, vr_mat_complex_test, mat_size);
128+ return mat_equal (w_vec_complex, w_vec_complex_test, n) &&
129+ mat_equal (vr_mat_complex, vr_mat_complex_test, mat_size);
137130}
138131
139-
140132void Eig::print_args () {
141- std::cout << " Eigenvalues and eigenvectors of " <<
142- n << " * " << n << " matrix A." << std::endl;
133+ std::cout << " Eigenvalues and eigenvectors of " << n << " * " << n
134+ << " matrix A." << std::endl;
143135 std::cout << " A =" << std::endl;
144136 print_mat (' c' , a_mat, n, n);
145137}
0 commit comments