4247: Fix errors with icc.

https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Fix errors with icc. * mln/core/internal/neighb_niter_impl.hh (element): Return a cpy. * mln/make/h_mat.hh: Remove overloading; it is disambiguation for icc. * tests/make/h_mat.cc: Update. mln/core/internal/neighb_niter_impl.hh | 6 +++- mln/make/h_mat.hh | 47 +-------------------------------- tests/make/h_mat.cc | 13 --------- 3 files changed, 7 insertions(+), 59 deletions(-) Index: mln/core/internal/neighb_niter_impl.hh --- mln/core/internal/neighb_niter_impl.hh (revision 4246) +++ mln/core/internal/neighb_niter_impl.hh (working copy) @@ -33,6 +33,7 @@ # include <mln/core/macros.hh> # include <mln/core/internal/force_exact.hh> + namespace mln { @@ -109,7 +110,10 @@ { typedef typename T::target S; - const mln_graph_element(S)& element() const + // Tech. note: A copy is returned since it actually is a + // temporary object; we cannot return a "const&" here for some + // compilers badly kills the temporary object... + mln_graph_element(S) element() const { return internal::force_exact<E>(*this).compute_p_().element(); } Index: mln/make/h_mat.hh --- mln/make/h_mat.hh (revision 4246) +++ mln/make/h_mat.hh (working copy) @@ -40,27 +40,8 @@ namespace make { - /// Create an mln::algebra::h_mat<d,T>. - /* - * \param[in] tab Array of values. - * - * \pre The array dimension has to be d * d. - */ - template <typename T, unsigned d> - algebra::h_mat<d,T> h_mat(const T (&tab)[(d+1)*(d+1)]); - - /// Create an mln::algebra::h_mat<d,T>. - /* - * \param[in] tab Array of values. - * - * \pre The array dimension has to be d * d. - */ - template <typename T, unsigned d> - algebra::h_mat<d,T> h_mat(const T (&tab)[d+1][d+1]); - - - /// reate an mln::algebra::mat<n,n,T>. + /// Create an mln::algebra::mat<n,n,T>. /* * \param[in] tab C-array of values. * @@ -73,31 +54,6 @@ # ifndef MLN_INCLUDE_ONLY - template <typename T, unsigned d> - inline - algebra::h_mat<d,T> - h_mat(const T (&tab)[(d)*(d)]) - { - std::cout << "plap" << std::endl; - algebra::h_mat<d,T> tmp; - for (unsigned i = 0; i < d; ++i) - tmp(i / (d), i % (d)) = tab[i]; - return tmp; - } - - - template <typename T, unsigned d> - algebra::h_mat<d,T> - h_mat(const T (&tab)[d][d]) - { - algebra::h_mat<d,T> tmp; - for (unsigned i = 0; i < d; ++i) - for (unsigned j = 0; j < d; ++j) - tmp(i, j) = tab[i][j]; - return tmp; - } - - template <typename T, unsigned N> inline algebra::h_mat<mlc_sqrt_int(N), T> @@ -117,4 +73,5 @@ } // end of namespace mln + #endif // ! MLN_MAKE_H_MAT_HH Index: tests/make/h_mat.cc --- tests/make/h_mat.cc (revision 4246) +++ tests/make/h_mat.cc (working copy) @@ -35,7 +35,6 @@ { using namespace mln; - { int vals[9] = { 2, 3, 4, 5, 6, 7, 8, 9, 10 }; @@ -45,15 +44,3 @@ for (unsigned j = 0; j < 4; ++j) mln_assertion(m(i,j) == result[i][j]); } - - { - int vals[3][3] = { { 2, 3, 4 }, - { 5, 6, 7 }, - { 8, 9, 10 } }; - algebra::h_mat<3,int> m = make::h_mat(vals); - - for (unsigned i = 0; i < 4; ++i) - for (unsigned j = 0; j < 4; ++j) - mln_assertion(m(i,j) == result[i][j]); - } -}
participants (1)
-
Thierry Geraud