mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-22 03:42:19 +00:00
boost/numeric/ublas/operation: num_rows.hpp, num_columns.hpp - use matrix_traits, see #7297
[SVN r80269]
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
|
||||
#include <boost/numeric/ublas/detail/config.hpp>
|
||||
#include <boost/numeric/ublas/expression_types.hpp>
|
||||
#include <boost/numeric/ublas/traits.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace numeric { namespace ublas {
|
||||
@@ -32,9 +34,9 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
*/
|
||||
template <typename MatrixExprT>
|
||||
BOOST_UBLAS_INLINE
|
||||
typename MatrixExprT::size_type num_columns(MatrixExprT const& m)
|
||||
typename matrix_traits<MatrixExprT>::size_type num_columns(matrix_expression<MatrixExprT> const& me)
|
||||
{
|
||||
return m.size2();
|
||||
return me().size2();
|
||||
}
|
||||
|
||||
}}} // Namespace boost::numeric::ublas
|
||||
|
||||
@@ -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 <boost/numeric/ublas/detail/config.hpp>
|
||||
#include <boost/numeric/ublas/expression_types.hpp>
|
||||
#include <boost/numeric/ublas/traits.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace numeric { namespace ublas {
|
||||
@@ -31,9 +33,9 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
*/
|
||||
template <typename MatrixExprT>
|
||||
BOOST_UBLAS_INLINE
|
||||
typename MatrixExprT::size_type num_rows(MatrixExprT const& m)
|
||||
typename matrix_traits<MatrixExprT>::size_type num_rows(matrix_expression<MatrixExprT> const& me)
|
||||
{
|
||||
return m.size1();
|
||||
return me().size1();
|
||||
}
|
||||
|
||||
}}} // Namespace boost::numeric::ublas
|
||||
|
||||
Reference in New Issue
Block a user