1 #define START 0
2 
3 #include "TMV.h"
4 #include "TMV_Sym.h"
5 #include "TMV_Test.h"
6 #include "TMV_Test_2.h"
7 #include "TMV_TestSymArith.h"
8 
9 #define NOADDEQ
10 #define NOMULTEQ
11 #define NOELEMMULT
12 
13 #include "TMV_TestMatrixArith.h"
14 
15 template <class T>
TestSymMatrixArith_C2()16 void TestSymMatrixArith_C2()
17 {
18 #if (XTEST & 2)
19     std::vector<tmv::SymMatrixView<T> > s;
20     std::vector<tmv::SymMatrixView<std::complex<T> > > cs;
21     MakeSymList(s,cs,InDef);
22 
23     const int N = s[0].size();
24 
25     tmv::Matrix<T> a1(N,N);
26     for (int i=0; i<N; ++i) for (int j=0; j<N; ++j) a1(i,j) = T(3+i-5*j);
27     tmv::Matrix<std::complex<T> > ca1(N,N);
28     for (int i=0; i<N; ++i) for (int j=0; j<N; ++j) ca1(i,j) =
29         std::complex<T>(3+i-5*j,2-3*i);
30 
31     tmv::DiagMatrix<T> d1(a1);
32     tmv::DiagMatrix<std::complex<T> > cd1(ca1);
33     tmv::DiagMatrixView<T> d1v = d1.view();
34     tmv::DiagMatrixView<std::complex<T> > cd1v = cd1.view();
35     tmv::DiagMatrix<T> d1x = d1v;
36     tmv::DiagMatrix<std::complex<T> > cd1x = cd1v;
37 
38     for(size_t i=START;i<s.size();i++) {
39         if (showstartdone) {
40             std::cout<<"Start loop i = "<<i<<std::endl;
41             std::cout<<"si = "<<s[i]<<std::endl;
42         }
43 
44         tmv::SymMatrixView<T> si = s[i];
45         tmv::SymMatrixView<std::complex<T> > csi = cs[i];
46 
47         TestMatrixArith4(d1v,cd1v,si,csi,"Diag/Sym");
48         TestMatrixArith5(d1v,cd1v,si,csi,"Diag/Sym");
49         TestMatrixArith6x(d1v,cd1v,si,csi,"Diag/Sym");
50     }
51 #endif
52 }
53 
54 #ifdef TEST_DOUBLE
55 template void TestSymMatrixArith_C2<double>();
56 #endif
57 #ifdef TEST_FLOAT
58 template void TestSymMatrixArith_C2<float>();
59 #endif
60 #ifdef TEST_LONGDOUBLE
61 template void TestSymMatrixArith_C2<long double>();
62 #endif
63 #ifdef TEST_INT
64 template void TestSymMatrixArith_C2<int>();
65 #endif
66