[shark] 70/79: clang error on travis-ci lead me to the path of a much simpler implementation of eval_block - a simple implicit cast/copy

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Nov 26 15:41:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository shark.

commit 241e77b1cd7c769d360560fcdda35ab03a3948f8
Author: Oswin Krause <oswin.krause at di.ku.dk>
Date:   Thu Oct 29 12:08:45 2015 +0100

    clang error on travis-ci lead me to the path of a much simpler implementation of eval_block - a simple implicit cast/copy
---
 include/shark/LinAlg/BLAS/assignment.hpp | 34 ++------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/include/shark/LinAlg/BLAS/assignment.hpp b/include/shark/LinAlg/BLAS/assignment.hpp
index 76ad075..7661c11 100644
--- a/include/shark/LinAlg/BLAS/assignment.hpp
+++ b/include/shark/LinAlg/BLAS/assignment.hpp
@@ -566,36 +566,6 @@ noalias_proxy<C> noalias(temporary_proxy<C> lvalue) {
 //////////////////////////////////////////////////////////////////////
 /////Evaluate blockwise expressions
 //////////////////////////////////////////////////////////////////////
-namespace detail{
-	template<class E>
-	E const& evaluate_block(
-		blas::vector_expression<E> const& e,
-		elementwise_tag
-	){
-		return e();
-	}
-	template<class E>
-	typename vector_temporary<E>::type evaluate_block(
-		blas::vector_expression<E> const& e,
-		blockwise_tag
-	){
-		return e();
-	}
-	template<class E>
-	E const& evaluate_block(
-		blas::matrix_expression<E> const& e,
-		elementwise_tag
-	){
-		return e();
-	}
-	template<class E>
-	typename matrix_temporary<E>::type evaluate_block(
-		blas::matrix_expression<E> const& e,
-		blockwise_tag
-	){
-		return e();
-	}
-}
 
 ///\brief conditionally evaluates a vector expression if it is a block expression
 ///
@@ -612,7 +582,7 @@ typename boost::mpl::eval_if<
 	boost::mpl::identity<E const&>
 >::type
 eval_block(blas::vector_expression<E> const& e){
-	return detail::evaluate_block(e,typename E::evaluation_category());
+	return e();//either casts to E const& or returns the copied expression
 }
 ///\brief conditionally evaluates a matrix expression if it is a block expression
 ///
@@ -629,7 +599,7 @@ typename boost::mpl::eval_if<
 	boost::mpl::identity<E const&>
 >::type
 eval_block(blas::matrix_expression<E> const& e){
-	return detail::evaluate_block(e,typename E::evaluation_category());
+	return e();//either casts to E const& or returns the copied expression
 }
 
 }}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/shark.git



More information about the debian-science-commits mailing list