//Boost Test #include #include #include #include #include #include int main() { using namespace boost::numeric::ublas; typedef int VectorIndexType; typedef unbounded_array IndexArrayType; typedef unbounded_array ValueArrayType; typedef compressed_matrix CompressedMatrixType; typedef compressed_vector BoostProbabilityVector; CompressedMatrixType m (3, 3, 3 * 3); for (VectorIndexType i = 0; i < m.size1 (); ++ i) for (VectorIndexType j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; BoostProbabilityVector v (3, 3); for (VectorIndexType i = 0; i < v.size (); ++ i) v (i) = i; std::cout << v << std::endl; BoostProbabilityVector u; u = prod (m,v); std::cout << u << std::endl; BoostProbabilityVector w(3); //w = m*v axpy_prod(m, v, w, true); std::cout << w << std::endl; }