// A couple of examples using ublas. // #include #include #include #include #include int main() { using namespace boost::numeric::ublas; using std::size_t; matrix a(3,3), b(3,3), c(3,3); for (size_t i = 0; i < a.size1 (); ++ i) for (size_t j = 0; j < b.size2 (); ++ j) a (i, j) = 2; b = 2 * a; c = a + b; std::cout << a << '\n' << b << '\n' << c << std::endl; c = prod(a,b); std::cout << a << '\n' << b << '\n' << c << std::endl; vector > v (3); for (size_t i = 0; i < v.size (); ++ i) v (i) = std::complex (i, i); std::cout << - v << std::endl; std::cout << conj (v) << std::endl; std::cout << real (v) << std::endl; std::cout << imag (v) << std::endl; std::cout << trans (v) << std::endl; std::cout << herm (v) << std::endl; }