/* * $Rev: 5266 $ * Author: Jesse Perla (c) 2010 * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #define BOOST_TEST_MODULE test_boost_ublas_SFINAE_patches #include #include #include #include using namespace boost::numeric::ublas; BOOST_AUTO_TEST_CASE( test_matrix_SFINAE ) { matrix m, m2; m2 = 2 * m; m2 = m * 2; } BOOST_AUTO_TEST_CASE( test_vector_SFINAE ) { vector v, v2; v2 = 2 * v; v2 = v * 2; } BOOST_AUTO_TEST_CASE (test_overloaded_multiply){ matrix A = identity_matrix(2); vector y(2); std::fill(y.begin(), y.end(), 1.0); std::cout << prod(A, y) << std::endl; std::cout << 2.0 * y << std::endl; std::cout << y * 2 << std::endl; std::cout << A * 2 << std::endl; std::cout << 2 * A << std::endl; std::cout << A * y << std::endl; std::cout << y * A << std::endl; std::cout << A * A << std::endl; }