|
Boost-Commit : |
From: danmarsden_at_[hidden]
Date: 2007-10-27 18:16:36
Author: danmarsden
Date: 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
New Revision: 40515
URL: http://svn.boost.org/trac/boost/changeset/40515
Log:
fixing performance tests, mainly result of issues, and arity issues with unfused typed
Text files modified:
trunk/libs/fusion/example/performance/accumulate.cpp | 23 ++++++++++++++---------
trunk/libs/fusion/example/performance/functional.cpp | 15 +--------------
trunk/libs/fusion/example/performance/inner_product.cpp | 22 ++++++++++++++--------
trunk/libs/fusion/example/performance/inner_product2.cpp | 34 +++++++++++++++++++++-------------
trunk/libs/fusion/example/performance/sequence_efficiency.cpp | 12 ++++++++----
5 files changed, 58 insertions(+), 48 deletions(-)
Modified: trunk/libs/fusion/example/performance/accumulate.cpp
==============================================================================
--- trunk/libs/fusion/example/performance/accumulate.cpp (original)
+++ trunk/libs/fusion/example/performance/accumulate.cpp 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
@@ -15,6 +15,8 @@
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/adapted/array.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
#include <algorithm>
#include <numeric>
#include <functional>
@@ -75,14 +77,15 @@
return result / iter;
}
-
struct poly_add
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_add(Lhs,Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
@@ -93,11 +96,13 @@
struct poly_mult
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_mult(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
Modified: trunk/libs/fusion/example/performance/functional.cpp
==============================================================================
--- trunk/libs/fusion/example/performance/functional.cpp (original)
+++ trunk/libs/fusion/example/performance/functional.cpp 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
@@ -13,8 +13,8 @@
#include <boost/fusion/functional/adapter/unfused_generic.hpp>
#include <boost/fusion/functional/adapter/unfused_rvalue_args.hpp>
#include <boost/fusion/functional/adapter/fused_function_object.hpp>
-#include <boost/fusion/functional/adapter/unfused_typed.hpp>
+#include <boost/utility/result_of.hpp>
#include <boost/config.hpp>
#include <boost/timer.hpp>
#include <algorithm>
@@ -265,12 +265,6 @@
total += res;
}
{
- typedef boost::fusion::vector<int,int,int,int> s;
- boost::fusion::unfused_typed<F,s> f;
- std::cout << "unfused_typed<F,s> " << call_unfused(f,res) << std::endl;
- total += res;
- }
- {
boost::fusion::unfused_rvalue_args<F> f;
std::cout << "unfused_rvalue_args<F> " << call_unfused(f,res) << std::endl;
total += res;
@@ -296,13 +290,6 @@
std::cout << "without random access " << call_fused(f,res) << std::endl;
total += res;
}
- std::cout << std::endl << "Loopback:" << std::endl;
- {
- typedef boost::fusion::vector<int,int,int,int> s;
- boost::fusion::unfused_typed< boost::fusion::fused_function_object<U>, s > f;
- std::cout << "unfused_typed<fused_function_object<U>,s > " << call_unfused(f,res) << std::endl;
- total += res;
- }
{
boost::fusion::unfused_rvalue_args< boost::fusion::fused_function_object<U> > f;
std::cout << "unfused_rvalue_args<fused_function_object<U> > " << call_unfused(f,res) << std::endl;
Modified: trunk/libs/fusion/example/performance/inner_product.cpp
==============================================================================
--- trunk/libs/fusion/example/performance/inner_product.cpp (original)
+++ trunk/libs/fusion/example/performance/inner_product.cpp 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
@@ -16,6 +16,8 @@
#include <boost/fusion/adapted/array.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
#include <algorithm>
#include <numeric>
#include <functional>
@@ -37,11 +39,13 @@
{
struct poly_add
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_add(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
@@ -52,11 +56,13 @@
struct poly_mult
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_mult(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
Modified: trunk/libs/fusion/example/performance/inner_product2.cpp
==============================================================================
--- trunk/libs/fusion/example/performance/inner_product2.cpp (original)
+++ trunk/libs/fusion/example/performance/inner_product2.cpp 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
@@ -16,6 +16,8 @@
#include <boost/fusion/adapted/array.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
#include <algorithm>
#include <numeric>
#include <functional>
@@ -37,11 +39,13 @@
{
struct poly_add
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_add(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
@@ -52,11 +56,13 @@
struct poly_mult
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_mult(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
@@ -110,14 +116,16 @@
struct poly_combine
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Rhs type;
- };
+ struct result<poly_combine(Lhs, Rhs)>
+ : boost::remove_reference<Rhs>
+ {};
template<typename Lhs, typename Rhs>
- typename result<Lhs,Rhs>::type
+ typename result<poly_combine(Lhs,Rhs)>::type
operator()(const Lhs& lhs, const Rhs& rhs) const
{
return rhs + boost::fusion::at_c<0>(lhs) * boost::fusion::at_c<1>(lhs);
Modified: trunk/libs/fusion/example/performance/sequence_efficiency.cpp
==============================================================================
--- trunk/libs/fusion/example/performance/sequence_efficiency.cpp (original)
+++ trunk/libs/fusion/example/performance/sequence_efficiency.cpp 2007-10-27 18:16:35 EDT (Sat, 27 Oct 2007)
@@ -13,6 +13,8 @@
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/container/list.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
#include <boost/lexical_cast.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/enum.hpp>
@@ -59,11 +61,13 @@
{
struct poly_add
{
+ template<typename Sig>
+ struct result;
+
template<typename Lhs, typename Rhs>
- struct result
- {
- typedef Lhs type;
- };
+ struct result<poly_add(Lhs, Rhs)>
+ : boost::remove_reference<Lhs>
+ {};
template<typename Lhs, typename Rhs>
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk