Ticket #4399: size-allow_expr_and_break_back_comp.patch
File size-allow_expr_and_break_back_comp.patch, 32.1 KB (added by , 12 years ago) |
---|
-
boost/numeric/ublas/operation/size.hpp
old new 5 5 * 6 6 * \brief The \c size operation. 7 7 * 8 * Copyright (c) 2009 , Marco Guazzone8 * Copyright (c) 2009-2010, Marco Guazzone 9 9 * 10 10 * Distributed under the Boost Software License, Version 1.0. (See 11 11 * accompanying file LICENSE_1_0.txt or copy at … … 22 22 #include <boost/numeric/ublas/expression_types.hpp> 23 23 #include <boost/numeric/ublas/fwd.hpp> 24 24 #include <boost/numeric/ublas/tags.hpp> 25 #include <boost/numeric/ublas/traits.hpp> 25 26 #include <cstddef> 26 27 27 28 28 29 namespace boost { namespace numeric { namespace ublas { 29 30 31 //@{ Declarations 32 33 /** 34 * \brief Return the number of columns. 35 * \tparam VectorExprT A type which models the matrix expression concept. 36 * \param m A matrix expression. 37 * \return The number of columns. 38 */ 39 template <typename VectorExprT> 40 typename vector_traits<VectorExprT>::size_type size(vector_expression<VectorExprT> const& ve); 41 42 /** 43 * \brief Return the size of the given dimension for the given expression. 44 * \tparam Dim The dimension number (starting from 1). 45 * \tparam VectorExprT An expression type. 46 * \param e An expression. 47 * \return The number of columns. 48 * \return The size associated to the dimension \a Dim. 49 */ 50 template <std::size_t Dim, typename VectorExprT> 51 typename vector_traits<VectorExprT>::size_type size(vector_expression<VectorExprT> const& ve); 52 53 /** 54 * \brief Return the size of the given dimension for the given expression. 55 * \tparam Dim The dimension number (starting from 1). 56 * \tparam MatrixExprT An expression type. 57 * \param e An expression. 58 * \return The number of columns. 59 * \return The size associated to the dimension \a Dim. 60 */ 61 template <std::size_t Dim, typename MatrixExprT> 62 typename matrix_traits<MatrixExprT>::size_type size(matrix_expression<MatrixExprT> const& me); 63 64 /** 65 * \brief Return the size of the given dimension tag for the given expression. 66 * \tparam TagT The dimension tag type (e.g., tag::major). 67 * \tparam MatrixExprT An expression type. 68 * \param e An expression. 69 * \return The size associated to the dimension tag \a TagT. 70 */ 71 template <typename TagT, typename MatrixExprT> 72 typename matrix_traits<MatrixExprT>::size_type size_by_tag(matrix_expression<MatrixExprT> const& me); 73 //typename matrix_traits<MatrixExprT>::size_type size(matrix_expression<MatrixExprT> const& me); //FIXME: don't work 74 75 //@} Declarations 76 77 78 //@{ Definitions 79 30 80 namespace detail { 31 81 82 /** 83 * \brief Auxiliary class for computing the size of the given dimension for 84 * a container of the given category. 85 * \tparam Dim The dimension number (starting from 1). 86 * \tparam CategoryT The category type (e.g., vector_tag). 87 */ 88 template <std::size_t Dim, typename CategoryT> 89 struct size_by_dim_impl; 90 91 92 /** 93 * \brief Auxiliary class for computing the size of the given dimension for 94 * a container of the given category and with the given orientation. 95 * \tparam Dim The dimension number (starting from 1). 96 * \tparam CategoryT The category type (e.g., vector_tag). 97 * \tparam OrientationT The orientation category type (e.g., row_major_tag). 98 */ 99 template <typename TagT, typename CategoryT, typename OrientationT> 100 struct size_by_tag_impl; 101 102 103 /// \brief Specialization of \c size_by_dim_impl for computing the size of a 104 /// vector 105 template <> 106 struct size_by_dim_impl<1, vector_tag> 107 { 32 108 /** 33 * \brief Auxiliary class for computing the size of the given dimension for 34 * a container of the given category.. 35 * \tparam Dim The dimension number (starting from 1). 36 * \tparam CategoryT The category type (e.g., vector_tag). 109 * \brief Compute the size of the given vector. 110 * \tparam ExprT A vector expression type. 111 * \pre ExprT must be a model of VectorExpression. 37 112 */ 38 template <size_t Dim, typename CategoryT> 39 struct size_by_dim_impl; 113 template <typename ExprT> 114 BOOST_UBLAS_INLINE 115 static typename vector_traits<ExprT>::size_type apply(vector_expression<ExprT> const& ve) 116 { 117 return ve().size(); 118 } 119 }; 40 120 41 121 42 /// \brief Specialization of \c size_by_dim_impl for computing the size of a 43 /// vector 44 template <> 45 struct size_by_dim_impl<1, vector_tag> 46 { 47 /** 48 * \brief Compute the size of the given vector. 49 * \tparam ExprT A vector expression type. 50 * \pre ExprT must be a model of VectorExpression. 51 */ 52 template <typename ExprT> 53 BOOST_UBLAS_INLINE 54 static typename ExprT::size_type apply(ExprT const& e) 55 { 56 return e.size(); 57 } 58 }; 59 60 61 /// \brief Specialization of \c size_by_dim_impl for computing the number of 62 /// rows of a matrix 63 template <> 64 struct size_by_dim_impl<1, matrix_tag> 65 { 66 /** 67 * \brief Compute the number of rows of the given matrix. 68 * \tparam ExprT A matrix expression type. 69 * \pre ExprT must be a model of MatrixExpression. 70 */ 71 template <typename ExprT> 72 BOOST_UBLAS_INLINE 73 static typename ExprT::size_type apply(ExprT const& e) 74 { 75 return e.size1(); 76 } 77 }; 78 79 80 /// \brief Specialization of \c size_by_dim_impl for computing the number of 81 /// columns of a matrix 82 template <> 83 struct size_by_dim_impl<2, matrix_tag> 122 /// \brief Specialization of \c size_by_dim_impl for computing the number of 123 /// rows of a matrix 124 template <> 125 struct size_by_dim_impl<1, matrix_tag> 126 { 127 /** 128 * \brief Compute the number of rows of the given matrix. 129 * \tparam ExprT A matrix expression type. 130 * \pre ExprT must be a model of MatrixExpression. 131 */ 132 template <typename ExprT> 133 BOOST_UBLAS_INLINE 134 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 84 135 { 85 /** 86 * \brief Compute the number of columns of the given matrix. 87 * \tparam ExprT A matrix expression type. 88 * \pre ExprT must be a model of MatrixExpression. 89 */ 90 template <typename ExprT> 91 BOOST_UBLAS_INLINE 92 static typename ExprT::size_type apply(ExprT const& e) 93 { 94 return e.size2(); 95 } 96 }; 136 return me().size1(); 137 } 138 }; 97 139 98 140 141 /// \brief Specialization of \c size_by_dim_impl for computing the number of 142 /// columns of a matrix 143 template <> 144 struct size_by_dim_impl<2, matrix_tag> 145 { 99 146 /** 100 * \brief Auxiliary class for computing the size of the given dimension for 101 * a container of the given category and with the given orientation.. 102 * \tparam Dim The dimension number (starting from 1). 103 * \tparam CategoryT The category type (e.g., vector_tag). 104 * \tparam OrientationT The orientation category type (e.g., row_major_tag). 147 * \brief Compute the number of columns of the given matrix. 148 * \tparam ExprT A matrix expression type. 149 * \pre ExprT must be a model of MatrixExpression. 105 150 */ 106 template <typename TagT, typename CategoryT, typename OrientationT> 107 struct size_by_tag_impl; 151 template <typename ExprT> 152 BOOST_UBLAS_INLINE 153 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 154 { 155 return me().size2(); 156 } 157 }; 108 158 109 159 110 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 111 /// major dimension of a row-major oriented matrix. 112 template <> 113 struct size_by_tag_impl<tag::major, matrix_tag, row_major_tag> 160 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 161 /// major dimension of a row-major oriented matrix. 162 template <> 163 struct size_by_tag_impl<tag::major, matrix_tag, row_major_tag> 164 { 165 /** 166 * \brief Compute the number of rows of the given matrix. 167 * \tparam ExprT A matrix expression type. 168 * \pre ExprT must be a model of MatrixExpression. 169 */ 170 template <typename ExprT> 171 BOOST_UBLAS_INLINE 172 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 114 173 { 115 /**116 * \brief Compute the number of rows of the given matrix.117 * \tparam ExprT A matrix expression type.118 * \pre ExprT must be a model of MatrixExpression. 119 */ 120 template <typename ExprT>121 BOOST_UBLAS_INLINE122 static typename ExprT::size_type apply(ExprT const& e)123 {124 return e.size1();125 }126 };127 128 129 /// \brief Specialization of \c size_by_tag_impl for computing the size of the130 /// minor dimension of a row-major oriented matrix.131 template <>132 st ruct size_by_tag_impl<tag::minor, matrix_tag, row_major_tag>174 return me().size1(); 175 } 176 }; 177 178 179 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 180 /// minor dimension of a row-major oriented matrix. 181 template <> 182 struct size_by_tag_impl<tag::minor, matrix_tag, row_major_tag> 183 { 184 /** 185 * \brief Compute the number of columns of the given matrix. 186 * \tparam ExprT A matrix expression type. 187 * \pre ExprT must be a model of MatrixExpression. 188 */ 189 template <typename ExprT> 190 BOOST_UBLAS_INLINE 191 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 133 192 { 134 /**135 * \brief Compute the number of columns of the given matrix.136 * \tparam ExprT A matrix expression type.137 * \pre ExprT must be a model of MatrixExpression. 138 */ 139 template <typename ExprT>140 BOOST_UBLAS_INLINE141 static typename ExprT::size_type apply(ExprT const& e)142 {143 return e.size2();144 }145 };146 147 148 /// \brief Specialization of \c size_by_tag_impl for computing the size of the149 /// leading dimension of a row-major oriented matrix.150 template <>151 st ruct size_by_tag_impl<tag::leading, matrix_tag, row_major_tag>193 return me().size2(); 194 } 195 }; 196 197 198 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 199 /// leading dimension of a row-major oriented matrix. 200 template <> 201 struct size_by_tag_impl<tag::leading, matrix_tag, row_major_tag> 202 { 203 /** 204 * \brief Compute the number of columns of the given matrix. 205 * \tparam ExprT A matrix expression type. 206 * \pre ExprT must be a model of MatrixExpression. 207 */ 208 template <typename ExprT> 209 BOOST_UBLAS_INLINE 210 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 152 211 { 153 /**154 * \brief Compute the number of columns of the given matrix.155 * \tparam ExprT A matrix expression type.156 * \pre ExprT must be a model of MatrixExpression. 157 */ 158 template <typename ExprT>159 BOOST_UBLAS_INLINE160 static typename ExprT::size_type apply(ExprT const& e)161 {162 return e.size2();163 }164 };165 166 167 /// \brief Specialization of \c size_by_tag_impl for computing the size of the168 /// major dimension of a column-major oriented matrix.169 template <>170 st ruct size_by_tag_impl<tag::major, matrix_tag, column_major_tag>212 return me().size2(); 213 } 214 }; 215 216 217 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 218 /// major dimension of a column-major oriented matrix. 219 template <> 220 struct size_by_tag_impl<tag::major, matrix_tag, column_major_tag> 221 { 222 /** 223 * \brief Compute the number of columns of the given matrix. 224 * \tparam ExprT A matrix expression type. 225 * \pre ExprT must be a model of MatrixExpression. 226 */ 227 template <typename ExprT> 228 BOOST_UBLAS_INLINE 229 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 171 230 { 172 /**173 * \brief Compute the number of columns of the given matrix.174 * \tparam ExprT A matrix expression type.175 * \pre ExprT must be a model of MatrixExpression. 176 */ 177 template <typename ExprT>178 BOOST_UBLAS_INLINE179 static typename ExprT::size_type apply(ExprT const& e)180 {181 return e.size2();182 }183 };184 185 186 /// \brief Specialization of \c size_by_tag_impl for computing the size of the187 /// minor dimension of a column-major oriented matrix.188 template <>189 st ruct size_by_tag_impl<tag::minor, matrix_tag, column_major_tag>231 return me().size2(); 232 } 233 }; 234 235 236 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 237 /// minor dimension of a column-major oriented matrix. 238 template <> 239 struct size_by_tag_impl<tag::minor, matrix_tag, column_major_tag> 240 { 241 /** 242 * \brief Compute the number of rows of the given matrix. 243 * \tparam ExprT A matrix expression type. 244 * \pre ExprT must be a model of MatrixExpression. 245 */ 246 template <typename ExprT> 247 BOOST_UBLAS_INLINE 248 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 190 249 { 191 /**192 * \brief Compute the number of rows of the given matrix.193 * \tparam ExprT A matrix expression type.194 * \pre ExprT must be a model of MatrixExpression. 195 */ 196 template <typename ExprT>197 BOOST_UBLAS_INLINE198 static typename ExprT::size_type apply(ExprT const& e)199 {200 return e.size1();201 }202 };203 204 205 /// \brief Specialization of \c size_by_tag_impl for computing the size of the206 /// leading dimension of a column-major oriented matrix.207 template <>208 st ruct size_by_tag_impl<tag::leading, matrix_tag, column_major_tag>250 return me().size1(); 251 } 252 }; 253 254 255 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 256 /// leading dimension of a column-major oriented matrix. 257 template <> 258 struct size_by_tag_impl<tag::leading, matrix_tag, column_major_tag> 259 { 260 /** 261 * \brief Compute the number of rows of the given matrix. 262 * \tparam ExprT A matrix expression type. 263 * \pre ExprT must be a model of MatrixExpression. 264 */ 265 template <typename ExprT> 266 BOOST_UBLAS_INLINE 267 static typename matrix_traits<ExprT>::size_type apply(matrix_expression<ExprT> const& me) 209 268 { 210 /**211 * \brief Compute the number of rows of the given matrix.212 * \tparam ExprT A matrix expression type.213 * \pre ExprT must be a model of MatrixExpression. 214 */ 215 template <typename ExprT>216 BOOST_UBLAS_INLINE217 static typename ExprT::size_type apply(ExprT const& e)218 {219 return e.size1();220 }221 269 return me().size1(); 270 } 271 }; 272 273 274 /// \brief Specialization of \c size_by_tag_impl for computing the size of the 275 /// given dimension of a unknown oriented expression. 276 template <typename TagT, typename CategoryT> 277 struct size_by_tag_impl<TagT, CategoryT, unknown_orientation_tag>: size_by_tag_impl<TagT, CategoryT, row_major_tag> 278 { 279 // Empty 280 }; 222 281 223 282 } // Namespace detail 224 283 225 284 226 /**227 * \brief Return the number of columns.228 * \tparam MatrixExprT A type which models the matrix expression concept.229 * \param m A matrix expression.230 * \return The number of columns.231 */232 285 template <typename VectorExprT> 233 286 BOOST_UBLAS_INLINE 234 typename VectorExprT::size_type size(VectorExprT const& v)287 typename vector_traits<VectorExprT>::size_type size(vector_expression<VectorExprT> const& ve) 235 288 { 236 return v .size();289 return ve().size(); 237 290 } 238 291 239 292 240 /** 241 * \brief Return the size of the given dimension for the given expression. 242 * \tparam Dim The dimension number (starting from 1). 243 * \tparam ExprT An expression type. 244 * \param e An expression. 245 * \return The number of columns. 246 * \return The size associated to the dimension \a Dim. 247 */ 248 template <std::size_t Dim, typename ExprT> 293 template <std::size_t Dim, typename VectorExprT> 249 294 BOOST_UBLAS_INLINE 250 typename ExprT::size_type size(ExprT const&e)295 typename vector_traits<VectorExprT>::size_type size(vector_expression<VectorExprT> const& ve) 251 296 { 252 return detail::size_by_dim_impl<Dim, typename ExprT::type_category>::apply(e);297 return detail::size_by_dim_impl<Dim, vector_tag>::template apply(ve); 253 298 } 254 299 255 300 256 /** 257 * \brief Return the size of the given dimension tag for the given expression. 258 * \tparam TagT The dimension tag type (e.g., tag::major). 259 * \tparam ExprT An expression type. 260 * \param e An expression. 261 * \return The size associated to the dimension tag \a TagT. 262 */ 263 template <typename TagT, typename ExprT> 301 template <std::size_t Dim, typename MatrixExprT> 264 302 BOOST_UBLAS_INLINE 265 typename ExprT::size_type size(ExprT const&e)303 typename matrix_traits<MatrixExprT>::size_type size(matrix_expression<MatrixExprT> const& me) 266 304 { 267 return detail::size_by_ tag_impl<TagT, typename ExprT::type_category, typename ExprT::orientation_category>::apply(e);305 return detail::size_by_dim_impl<Dim, matrix_tag>::template apply(me); 268 306 } 269 307 308 309 //[FIXME]: don't work 310 ///** 311 // * \brief Return the size of the given dimension tag for the given expression. 312 // * \tparam TagT The dimension tag type (e.g., tag::major). 313 // * \tparam MatrixExprT An expression type. 314 // * \param e An expression. 315 // * \return The size associated to the dimension tag \a TagT. 316 // */ 317 //template <typename TagT, typename MatrixExprT> 318 //BOOST_UBLAS_INLINE 319 //typename matrix_traits<MatrixExprT>::size_type size(matrix_expression<MatrixExprT> const& me, TagT tag=TagT()) 320 //{ 321 // return detail::size_by_tag_impl<TagT, matrix_tag, typename matrix_traits<MatrixExprT>::orientation_category>::template apply(me); 322 //} 323 //[/FIXME] 324 325 326 template <typename TagT, typename MatrixExprT> 327 BOOST_UBLAS_INLINE 328 typename matrix_traits<MatrixExprT>::size_type size_by_tag(matrix_expression<MatrixExprT> const& me) 329 { 330 return detail::size_by_tag_impl<TagT, matrix_tag, typename matrix_traits<MatrixExprT>::orientation_category>::template apply(me); 331 } 332 333 //@} Definitions 334 270 335 }}} // Namespace boost::numeric::ublas 271 336 272 337 -
libs/numeric/ublas/test/size.cpp
old new 1 /** -*- c++ -*- \file size.hpp \brief Test the \c size operation. */ 1 /** 2 * \file size.cpp 3 * 4 * \brief Test the \c size operation. 5 * 6 * Copyright (c) 2010, Marco Guazzone 7 * 8 * Distributed under the Boost Software License, Version 1.0. (See 9 * accompwhiching file LICENSE_1_0.txt or copy at 10 * http://www.boost.org/LICENSE_1_0.txt) 11 * 12 * \author Marco Guazzone, marco.guazzone@gmail.com 13 */ 2 14 3 15 #include <boost/numeric/ublas/fwd.hpp> 4 16 #include <boost/numeric/ublas/matrix.hpp> … … 127 139 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(A) == A.size2()) ); 128 140 129 141 // size<major>(A) 130 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size1() ); 131 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size1()) ); 142 //BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size1() ); 143 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size1()) ); 144 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size1() ); 145 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(A) == A.size1()) ); 132 146 133 147 // size<minor>(A) 134 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size2() ); 135 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size2()) ); 148 //BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size2() ); 149 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size2()) ); 150 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size2() ); 151 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(A) == A.size2()) ); 136 152 137 153 // size<leading>(A) 138 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size2() ); 139 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A) == A.size2()) ); 154 //BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size2() ); 155 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A) == A.size2()) ); 156 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size2() ); 157 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(A) == A.size2()) ); 140 158 } 141 159 142 160 … … 165 183 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(A) == A.size2()) ); 166 184 167 185 // size<major>(A) 168 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size2() ); 169 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size2()) ); 186 //BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size2() ); 187 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size2()) ); 188 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size2() ); 189 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(A) == A.size2()) ); 170 190 171 191 // size<minor>(A) 172 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size1() ); 173 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size1()) ); 192 //BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size1() ); 193 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size1()) ); 194 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size1() ); 195 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(A) == A.size1()) ); 174 196 175 197 // size<leading>(A) 176 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size1() ); 177 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A) == A.size1()) ); 198 //BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size1() ); 199 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A) == A.size1()) ); 200 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size1() ); 201 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(A) == A.size1()) ); 178 202 } 179 203 180 204 … … 203 227 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(boost::numeric::ublas::trans(A)) == A.size1()) ); 204 228 205 229 // size<major>(A') [A is row-major => A' column-major, and viceversa] 206 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); 207 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A)) == A.size1()) ); 230 //BOOST_UBLAS_DEBUG_TRACE( "size<major>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); 231 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A)) == A.size1()) ); 232 BOOST_UBLAS_DEBUG_TRACE( "size<major>(A') = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); 233 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A)) == A.size1()) ); 208 234 209 235 // size<minor>(A') [A is row-major => A' column-major, and viceversa] 210 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 211 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A)) == A.size2()) ); 236 //BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 237 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A)) == A.size2()) ); 238 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A') = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 239 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A)) == A.size2()) ); 212 240 213 241 // size<leading>(A') [A row-major => A' column-major, and viceversa] 214 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 215 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A)) == A.size2()) ); 242 //BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 243 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A)) == A.size2()) ); 244 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A') = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); 245 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A)) == A.size2()) ); 216 246 } 217 247 218 248 … … 242 272 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 243 273 244 274 // size<major>(reference(A)) 245 BOOST_UBLAS_DEBUG_TRACE( "size<major>(reference(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); 246 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A)) == matrix_reference_type(A).size1()) ); 275 //BOOST_UBLAS_DEBUG_TRACE( "size<major>(reference(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); 276 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A)) == matrix_reference_type(A).size1()) ); 277 BOOST_UBLAS_DEBUG_TRACE( "size<major>(reference(A) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); 278 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::major>(matrix_reference_type(A)) == matrix_reference_type(A).size1()) ); 247 279 248 280 // size<minor>(reference(A)) 249 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 250 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 281 //BOOST_UBLAS_DEBUG_TRACE( "size<minor>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 282 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 283 BOOST_UBLAS_DEBUG_TRACE( "size<minor>(reference(A)) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 284 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::minor>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 251 285 252 286 // size<leading>(reference(A)) 253 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 254 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 287 //BOOST_UBLAS_DEBUG_TRACE( "size<leading>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 288 //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 289 BOOST_UBLAS_DEBUG_TRACE( "size<leading>(reference(A)) = " << (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); 290 BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size_by_tag<boost::numeric::ublas::tag::leading>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); 255 291 } 256 292 257 293