// testBoostJan2014.cpp : Defines the entry point for the console application. // #include "targetver.h" #include #include #include #include #include #include #include #include #include #define BIND_FORTRAN_LOWERCASE_UNDERSCORE #define BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS #include #include #include #include #include #include #include //#include #include #include // New options to test: #include // #include // We would like this, but it isn't in the version of the numeric bindings in Boost 1.36. using namespace boost::numeric::bindings::lapack; using namespace boost::numeric::ublas; typedef matrix, column_major> cmat; typedef vector< std::complex > cvec; // Must be > > within a nested template so as not to be confused with >> operator. typedef vector vec; typedef std::complex cdouble; int _tmain(int argc, _TCHAR* argv[]) { using namespace std; cout << "TESTING..." << endl; cmat eigVec (4,4); vec eigVal (4); int idx,jdx; for (idx=0;idx<4;++idx) for (jdx=0;jdx<4;++jdx) eigVec(idx,jdx) = 10-idx-jdx; // Make this a Hermitian matrix. cout << "eigVec input = " << eigVec << endl; // Try using heev or heev because this is a Hermitian matrix: heev('V',eigVec,eigVal,boost::numeric::bindings::lapack::optimal_workspace()); cout << "eigVec output = " << eigVec << endl; // Prompt before return. cout << "Type a letter and press return to finish..." << endl; string tmp; cin >> tmp; return 0; }