Ticket #7297: num_columns_rows.patch

File num_columns_rows.patch, 3.2 KB (added by Marco Guazzone <marco.guazzone@…>, 10 years ago)

Patch file file num_columns.hpp and num_rows.hpp

  • boost/numeric/ublas/operation/num_columns.hpp

    diff -Naur /old/boost/numeric/ublas/operation/num_columns.hpp /new/boost/numeric/ublas/operation/num_columns.hpp
    old new  
    11/**
    2  * -*- c++ -*-
    3  *
    42 * \file num_columns.hpp
    53 *
    64 * \brief The \c num_columns operation.
    75 *
    8  * Copyright (c) 2009, Marco Guazzone
     6 * Copyright (c) 2009-2012, Marco Guazzone
    97 *
    108 * Distributed under the Boost Software License, Version 1.0. (See
    119 * accompanying file LICENSE_1_0.txt or copy at
     
    2018
    2119
    2220#include <boost/numeric/ublas/detail/config.hpp>
     21#include <boost/numeric/ublas/expression_types.hpp>
     22#include <boost/numeric/ublas/traits.hpp>
    2323
    2424
    2525namespace boost { namespace numeric { namespace ublas {
    2626
    27     /**
    28      * \brief Return the number of columns.
    29      * \tparam MatrixExprT A type which models the matrix expression concept.
    30      * \param m A matrix expression.
    31      * \return The number of columns.
    32      */
    33     template <typename MatrixExprT>
    34     BOOST_UBLAS_INLINE
    35     typename MatrixExprT::size_type num_columns(MatrixExprT const& m)
    36     {
    37         return m.size2();
    38     }
     27/**
     28 * \brief Return the number of columns.
     29 * \tparam MatrixExprT A type which models the matrix expression concept.
     30 * \param m A matrix expression.
     31 * \return The number of columns.
     32 */
     33template <typename MatrixExprT>
     34BOOST_UBLAS_INLINE
     35typename matrix_traits<MatrixExprT>::size_type num_columns(matrix_expression<MatrixExprT> const& me)
     36{
     37        return me().size2();
     38}
    3939
    4040}}} // Namespace boost::numeric::ublas
    4141
  • boost/numeric/ublas/operation/num_rows.hpp

    diff -Naur /old/boost/numeric/ublas/operation/num_rows.hpp /new/boost/numeric/ublas/operation/num_rows.hpp
    old new  
    11/**
    2  * -*- c++ -*-
    3  *
    42 * \file num_rows.hpp
    53 *
    64 * \brief The \c num_rows operation.
    75 *
    8  * Copyright (c) 2009, Marco Guazzone
     6 * Copyright (c) 2009-2012, Marco Guazzone
    97 *
    108 * Distributed under the Boost Software License, Version 1.0. (See
    119 * accompanying file LICENSE_1_0.txt or copy at
     
    1917
    2018
    2119#include <boost/numeric/ublas/detail/config.hpp>
     20#include <boost/numeric/ublas/expression_types.hpp>
     21#include <boost/numeric/ublas/traits.hpp>
    2222
    2323
    2424namespace boost { namespace numeric { namespace ublas {
    2525
    26     /**
    27      * \brief Return the number of rows.
    28      * \tparam MatrixExprT A type which models the matrix expression concept.
    29      * \param m A matrix expression.
    30      * \return The number of rows.
    31      */
    32     template <typename MatrixExprT>
    33     BOOST_UBLAS_INLINE
    34     typename MatrixExprT::size_type num_rows(MatrixExprT const& m)
    35     {
    36         return m.size1();
    37     }
     26/**
     27 * \brief Return the number of rows.
     28 * \tparam MatrixExprT A type which models the matrix expression concept.
     29 * \param m A matrix expression.
     30 * \return The number of rows.
     31 */
     32template <typename MatrixExprT>
     33BOOST_UBLAS_INLINE
     34typename matrix_traits<MatrixExprT>::size_type num_rows(matrix_expression<MatrixExprT> const& me)
     35{
     36        return me().size1();
     37}
    3838
    3939}}} // Namespace boost::numeric::ublas
    4040