Ticket #5176: test_assignment.cpp.patch

File test_assignment.cpp.patch, 1.1 KB (added by hstong@…, 12 years ago)

Add cast so fabs() call is proper.

Line 
1*** libs/numeric/ublas/test/test_assignment.cpp.orig Mon Jul 5 02:35:22 2010
2--- libs/numeric/ublas/test/test_assignment.cpp Thu Feb 10 15:29:37 2011
3***************
4*** 26,32 ****
5 typename AE::size_type i, j;
6 for (i=0; i!= me().size1(); i++) {
7 for (j=0; j!= me().size2(); j++) {
8! s+=std::fabs(me()(i,j));
9 }
10 }
11 return s/me().size1()*me().size2();
12--- 26,32 ----
13 typename AE::size_type i, j;
14 for (i=0; i!= me().size1(); i++) {
15 for (j=0; j!= me().size2(); j++) {
16! s+=std::fabs(static_cast<float>(me()(i,j)));
17 }
18 }
19 return s/me().size1()*me().size2();
20***************
21*** 39,45 ****
22 typename AE::value_type s(0);
23 typename AE::size_type i;
24 for (i=0; i!= ve().size(); i++) {
25! s+=std::fabs(ve()(i));
26 }
27 return s/ve().size();
28 }
29--- 39,45 ----
30 typename AE::value_type s(0);
31 typename AE::size_type i;
32 for (i=0; i!= ve().size(); i++) {
33! s+=std::fabs(static_cast<float>(ve()(i)));
34 }
35 return s/ve().size();
36 }