x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
operation_blocked.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\numeric\ublas\operation_blocked.hpp
旋转
特效
属性
历史版本
// // 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
operation_blocked.hpp
网页地址
文件地址
上一页
15/26
下一页
下载
( 13 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.