1 /** 2 * -*- c++ -*- 3 * 4 * \file num_rows.hpp 5 * 6 * \brief The \c num_rows operation. 7 * 8 * Copyright (c) 2009-2012, Marco Guazzone 9 * 10 * Distributed under the Boost Software License, Version 1.0. (See 11 * accompanying file LICENSE_1_0.txt or copy at 12 * http://www.boost.org/LICENSE_1_0.txt) 13 * 14 * \author Marco Guazzone, marco.guazzone@gmail.com 15 */ 16 17 #ifndef BOOST_NUMERIC_UBLAS_OPERATION_NUM_ROWS_HPP 18 #define BOOST_NUMERIC_UBLAS_OPERATION_NUM_ROWS_HPP 19 20 21 #include <boost/numeric/ublas/detail/config.hpp> 22 #include <boost/numeric/ublas/expression_types.hpp> 23 #include <boost/numeric/ublas/traits.hpp> 24 25 26 namespace boost { namespace numeric { namespace ublas { 27 28 /** 29 * \brief Return the number of rows. 30 * \tparam MatrixExprT A type which models the matrix expression concept. 31 * \param m A matrix expression. 32 * \return The number of rows. 33 */ 34 template <typename MatrixExprT> 35 BOOST_UBLAS_INLINE num_rows(matrix_expression<MatrixExprT> const & me)36 typename matrix_traits<MatrixExprT>::size_type num_rows(matrix_expression<MatrixExprT> const& me) 37 { 38 return me().size1(); 39 } 40 41 }}} // Namespace boost::numeric::ublas 42 43 44 #endif // BOOST_NUMERIC_UBLAS_OPERATION_NUM_ROWS_HPP 45