/usr/include/boost/numeric/ublas
NameSizeModeActions
detail/-0755rm
experimental/-0755rm
opencl/-0755rm
operation/-0755rm
tensor/-0755rm
traits/-0755rm
assignment.hpp357560644editdlrm
banded.hpp868470644editdlrm
blas.hpp181320644editdlrm
doxydoc.hpp40870644editdlrm
exception.hpp88220644editdlrm
expression_types.hpp184670644editdlrm
functional.hpp808650644editdlrm
fwd.hpp72150644editdlrm
hermitian.hpp1020000644editdlrm
io.hpp136870644editdlrm
lu.hpp140440644editdlrm
matrix.hpp2160960644editdlrm
matrix_expression.hpp1690920644editdlrm
matrix_proxy.hpp2014940644editdlrm
matrix_sparse.hpp2314090644editdlrm
matrix_vector.hpp114750644editdlrm
opencl.hpp4900644editdlrm
operation.hpp321100644editdlrm
operations.hpp7390644editdlrm
operation_blocked.hpp138130644editdlrm
operation_sparse.hpp81460644editdlrm
storage.hpp675620644editdlrm
storage_sparse.hpp197620644editdlrm
symmetric.hpp881830644editdlrm
tags.hpp7310644editdlrm
tensor.hpp8000644editdlrm
traits.hpp249520644editdlrm
triangular.hpp1053040644editdlrm
vector.hpp1057690644editdlrm
vector_expression.hpp658150644editdlrm
vector_of_vector.hpp532700644editdlrm
vector_proxy.hpp645970644editdlrm
vector_sparse.hpp841560644editdlrm
Edit: /usr/include/boost/numeric/ublas/operation_blocked.hpp (13813B)
// // Copyright (c) 2000-2002 // Joerg Walter, Mathias Koch // // Distributed under 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) // // The authors gratefully acknowledge the support of // GeNeSys mbH & Co. KG in producing this work. // #ifndef _BOOST_UBLAS_OPERATION_BLOCKED_ #define _BOOST_UBLAS_OPERATION_BLOCKED_ #include #include // indexing_vector_assign #include // indexing_matrix_assign namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE V block_prod (const matrix_expression &e1, const vector_expression &e2) { typedef V vector_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename V::size_type size_type; typedef typename V::value_type value_type; const size_type block_size = BS; V v (e1 ().size1 ()); #if BOOST_UBLAS_TYPE_CHECK vector cv (v.size ()); typedef typename type_traits::real_type real_type; real_type verrorbound (norm_1 (v) + norm_1 (e1) * norm_1 (e2)); indexing_vector_assign (cv, prod (e1, e2)); #endif size_type i_size = e1 ().size1 (); size_type j_size = BOOST_UBLAS_SAME (e1 ().size2 (), e2 ().size ()); for (size_type i_begin = 0; i_begin < i_size; i_begin += block_size) { size_type i_end = i_begin + (std::min) (i_size - i_begin, block_size); // FIX: never ignore Martin Weiser's advice ;-( #ifdef BOOST_UBLAS_NO_CACHE vector_range v_range (v, range (i_begin, i_end)); #else // vector > v_range (i_end - i_begin); vector v_range (i_end - i_begin); #endif v_range.assign (zero_vector (i_end - i_begin)); for (size_type j_begin = 0; j_begin < j_size; j_begin += block_size) { size_type j_end = j_begin + (std::min) (j_size - j_begin, block_size); #ifdef BOOST_UBLAS_NO_CACHE const matrix_range e1_range (e1 (), range (i_begin, i_end), range (j_begin, j_end)); const vector_range e2_range (e2 (), range (j_begin, j_end)); v_range.plus_assign (prod (e1_range, e2_range)); #else // const matrix > e1_range (project (e1 (), range (i_begin, i_end), range (j_begin, j_end))); // const vector > e2_range (project (e2 (), range (j_begin, j_end))); const matrix e1_range (project (e1 (), range (i_begin, i_end), range (j_begin, j_end))); const vector e2_range (project (e2 (), range (j_begin, j_end))); v_range.plus_assign (prod (e1_range, e2_range)); #endif } #ifndef BOOST_UBLAS_NO_CACHE project (v, range (i_begin, i_end)).assign (v_range); #endif } #if BOOST_UBLAS_TYPE_CHECK BOOST_UBLAS_CHECK (norm_1 (v - cv) <= 2 * std::numeric_limits::epsilon () * verrorbound, internal_logic ()); #endif return v; } template BOOST_UBLAS_INLINE V block_prod (const vector_expression &e1, const matrix_expression &e2) { typedef V vector_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename V::size_type size_type; typedef typename V::value_type value_type; const size_type block_size = BS; V v (e2 ().size2 ()); #if BOOST_UBLAS_TYPE_CHECK vector cv (v.size ()); typedef typename type_traits::real_type real_type; real_type verrorbound (norm_1 (v) + norm_1 (e1) * norm_1 (e2)); indexing_vector_assign (cv, prod (e1, e2)); #endif size_type i_size = BOOST_UBLAS_SAME (e1 ().size (), e2 ().size1 ()); size_type j_size = e2 ().size2 (); for (size_type j_begin = 0; j_begin < j_size; j_begin += block_size) { size_type j_end = j_begin + (std::min) (j_size - j_begin, block_size); // FIX: never ignore Martin Weiser's advice ;-( #ifdef BOOST_UBLAS_NO_CACHE vector_range v_range (v, range (j_begin, j_end)); #else // vector > v_range (j_end - j_begin); vector v_range (j_end - j_begin); #endif v_range.assign (zero_vector (j_end - j_begin)); for (size_type i_begin = 0; i_begin < i_size; i_begin += block_size) { size_type i_end = i_begin + (std::min) (i_size - i_begin, block_size); #ifdef BOOST_UBLAS_NO_CACHE const vector_range e1_range (e1 (), range (i_begin, i_end)); const matrix_range e2_range (e2 (), range (i_begin, i_end), range (j_begin, j_end)); #else // const vector > e1_range (project (e1 (), range (i_begin, i_end))); // const matrix > e2_range (project (e2 (), range (i_begin, i_end), range (j_begin, j_end))); const vector e1_range (project (e1 (), range (i_begin, i_end))); const matrix e2_range (project (e2 (), range (i_begin, i_end), range (j_begin, j_end))); #endif v_range.plus_assign (prod (e1_range, e2_range)); } #ifndef BOOST_UBLAS_NO_CACHE project (v, range (j_begin, j_end)).assign (v_range); #endif } #if BOOST_UBLAS_TYPE_CHECK BOOST_UBLAS_CHECK (norm_1 (v - cv) <= 2 * std::numeric_limits::epsilon () * verrorbound, internal_logic ()); #endif return v; } template BOOST_UBLAS_INLINE M block_prod (const matrix_expression &e1, const matrix_expression &e2, row_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; const size_type block_size = BS; M m (e1 ().size1 (), e2 ().size2 ()); #if BOOST_UBLAS_TYPE_CHECK matrix cm (m.size1 (), m.size2 ()); typedef typename type_traits::real_type real_type; real_type merrorbound (norm_1 (m) + norm_1 (e1) * norm_1 (e2)); indexing_matrix_assign (cm, prod (e1, e2), row_major_tag ()); disable_type_check::value = true; #endif size_type i_size = e1 ().size1 (); size_type j_size = e2 ().size2 (); size_type k_size = BOOST_UBLAS_SAME (e1 ().size2 (), e2 ().size1 ()); for (size_type i_begin = 0; i_begin < i_size; i_begin += block_size) { size_type i_end = i_begin + (std::min) (i_size - i_begin, block_size); for (size_type j_begin = 0; j_begin < j_size; j_begin += block_size) { size_type j_end = j_begin + (std::min) (j_size - j_begin, block_size); // FIX: never ignore Martin Weiser's advice ;-( #ifdef BOOST_UBLAS_NO_CACHE matrix_range m_range (m, range (i_begin, i_end), range (j_begin, j_end)); #else // matrix > m_range (i_end - i_begin, j_end - j_begin); matrix m_range (i_end - i_begin, j_end - j_begin); #endif m_range.assign (zero_matrix (i_end - i_begin, j_end - j_begin)); for (size_type k_begin = 0; k_begin < k_size; k_begin += block_size) { size_type k_end = k_begin + (std::min) (k_size - k_begin, block_size); #ifdef BOOST_UBLAS_NO_CACHE const matrix_range e1_range (e1 (), range (i_begin, i_end), range (k_begin, k_end)); const matrix_range e2_range (e2 (), range (k_begin, k_end), range (j_begin, j_end)); #else // const matrix > e1_range (project (e1 (), range (i_begin, i_end), range (k_begin, k_end))); // const matrix > e2_range (project (e2 (), range (k_begin, k_end), range (j_begin, j_end))); const matrix e1_range (project (e1 (), range (i_begin, i_end), range (k_begin, k_end))); const matrix e2_range (project (e2 (), range (k_begin, k_end), range (j_begin, j_end))); #endif m_range.plus_assign (prod (e1_range, e2_range)); } #ifndef BOOST_UBLAS_NO_CACHE project (m, range (i_begin, i_end), range (j_begin, j_end)).assign (m_range); #endif } } #if BOOST_UBLAS_TYPE_CHECK disable_type_check::value = false; BOOST_UBLAS_CHECK (norm_1 (m - cm) <= 2 * std::numeric_limits::epsilon () * merrorbound, internal_logic ()); #endif return m; } template BOOST_UBLAS_INLINE M block_prod (const matrix_expression &e1, const matrix_expression &e2, column_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; const size_type block_size = BS; M m (e1 ().size1 (), e2 ().size2 ()); #if BOOST_UBLAS_TYPE_CHECK matrix cm (m.size1 (), m.size2 ()); typedef typename type_traits::real_type real_type; real_type merrorbound (norm_1 (m) + norm_1 (e1) * norm_1 (e2)); indexing_matrix_assign (cm, prod (e1, e2), column_major_tag ()); disable_type_check::value = true; #endif size_type i_size = e1 ().size1 (); size_type j_size = e2 ().size2 (); size_type k_size = BOOST_UBLAS_SAME (e1 ().size2 (), e2 ().size1 ()); for (size_type j_begin = 0; j_begin < j_size; j_begin += block_size) { size_type j_end = j_begin + (std::min) (j_size - j_begin, block_size); for (size_type i_begin = 0; i_begin < i_size; i_begin += block_size) { size_type i_end = i_begin + (std::min) (i_size - i_begin, block_size); // FIX: never ignore Martin Weiser's advice ;-( #ifdef BOOST_UBLAS_NO_CACHE matrix_range m_range (m, range (i_begin, i_end), range (j_begin, j_end)); #else // matrix > m_range (i_end - i_begin, j_end - j_begin); matrix m_range (i_end - i_begin, j_end - j_begin); #endif m_range.assign (zero_matrix (i_end - i_begin, j_end - j_begin)); for (size_type k_begin = 0; k_begin < k_size; k_begin += block_size) { size_type k_end = k_begin + (std::min) (k_size - k_begin, block_size); #ifdef BOOST_UBLAS_NO_CACHE const matrix_range e1_range (e1 (), range (i_begin, i_end), range (k_begin, k_end)); const matrix_range e2_range (e2 (), range (k_begin, k_end), range (j_begin, j_end)); #else // const matrix > e1_range (project (e1 (), range (i_begin, i_end), range (k_begin, k_end))); // const matrix > e2_range (project (e2 (), range (k_begin, k_end), range (j_begin, j_end))); const matrix e1_range (project (e1 (), range (i_begin, i_end), range (k_begin, k_end))); const matrix e2_range (project (e2 (), range (k_begin, k_end), range (j_begin, j_end))); #endif m_range.plus_assign (prod (e1_range, e2_range)); } #ifndef BOOST_UBLAS_NO_CACHE project (m, range (i_begin, i_end), range (j_begin, j_end)).assign (m_range); #endif } } #if BOOST_UBLAS_TYPE_CHECK disable_type_check::value = false; BOOST_UBLAS_CHECK (norm_1 (m - cm) <= 2 * std::numeric_limits::epsilon () * merrorbound, internal_logic ()); #endif return m; } // Dispatcher template BOOST_UBLAS_INLINE M block_prod (const matrix_expression &e1, const matrix_expression &e2) { typedef typename M::orientation_category orientation_category; return block_prod (e1, e2, orientation_category ()); } }}} #endif