From c3f2da14666b8a3579987aa31b14099ea460585d Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Mon, 27 Aug 2012 23:29:31 +0000 Subject: [PATCH] boost/numeric/ublas/operation: num_rows.hpp, num_columns.hpp - use matrix_traits, see #7297 [SVN r80269] --- include/boost/numeric/ublas/operation/num_columns.hpp | 6 ++++-- include/boost/numeric/ublas/operation/num_rows.hpp | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/boost/numeric/ublas/operation/num_columns.hpp b/include/boost/numeric/ublas/operation/num_columns.hpp index 30fcc7b6..ee48eea6 100644 --- a/include/boost/numeric/ublas/operation/num_columns.hpp +++ b/include/boost/numeric/ublas/operation/num_columns.hpp @@ -20,6 +20,8 @@ #include +#include +#include namespace boost { namespace numeric { namespace ublas { @@ -32,9 +34,9 @@ namespace boost { namespace numeric { namespace ublas { */ template BOOST_UBLAS_INLINE - typename MatrixExprT::size_type num_columns(MatrixExprT const& m) + typename matrix_traits::size_type num_columns(matrix_expression const& me) { - return m.size2(); + return me().size2(); } }}} // Namespace boost::numeric::ublas diff --git a/include/boost/numeric/ublas/operation/num_rows.hpp b/include/boost/numeric/ublas/operation/num_rows.hpp index 856256ff..246aed3c 100644 --- a/include/boost/numeric/ublas/operation/num_rows.hpp +++ b/include/boost/numeric/ublas/operation/num_rows.hpp @@ -5,7 +5,7 @@ * * \brief The \c num_rows operation. * - * Copyright (c) 2009, Marco Guazzone + * Copyright (c) 2009-2012, Marco Guazzone * * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at @@ -19,6 +19,8 @@ #include +#include +#include namespace boost { namespace numeric { namespace ublas { @@ -31,9 +33,9 @@ namespace boost { namespace numeric { namespace ublas { */ template BOOST_UBLAS_INLINE - typename MatrixExprT::size_type num_rows(MatrixExprT const& m) + typename matrix_traits::size_type num_rows(matrix_expression const& me) { - return m.size1(); + return me().size1(); } }}} // Namespace boost::numeric::ublas