Skip to content

Commit

Permalink
libboost-numeric-ublas: Patch downstream/
Browse files Browse the repository at this point in the history
With -DNDEBUG BOOST_UBLAS_INLINE actually expands to `inline` causing
instances of the following code to be a syntax error:

 BOOST_UBLAS_INLINE
 template<class size_type, class layout_type>

This bug has already been reported upstream at
boostorg/ublas#82. It has been fixed in the
`develop` branch but not released yet.
  • Loading branch information
francoisk committed Jul 23, 2024
1 parent 175dce6 commit 3611224
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ namespace detail {
* @param[in] w stride vector of length p
* @returns relative memory location depending on \c i and \c w
*/
BOOST_UBLAS_INLINE
template<class size_type, class layout_type>
BOOST_UBLAS_INLINE
auto access(std::vector<size_type> const& i, basic_strides<size_type,layout_type> const& w)
{
const auto p = i.size();
Expand All @@ -231,8 +231,8 @@ auto access(std::vector<size_type> const& i, basic_strides<size_type,layout_type
* @param[in] sum the current relative memory index
* @returns relative memory location depending on \c i and \c w
*/
BOOST_UBLAS_INLINE
template<std::size_t r, class layout_type, class ... size_types>
BOOST_UBLAS_INLINE
auto access(std::size_t sum, basic_strides<std::size_t, layout_type> const& w, std::size_t i, size_types ... is)
{
sum+=i*w[r];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ class tensor:
*
* @param other tensor with a different layout to be copied.
*/
BOOST_UBLAS_INLINE
template<class other_layout>
BOOST_UBLAS_INLINE
tensor (const tensor<value_type, other_layout> &other)
: tensor_expression_type<self_type> ()
, extents_ (other.extents())
Expand All @@ -351,8 +351,8 @@ class tensor:
*
* @param expr tensor expression
*/
BOOST_UBLAS_INLINE
template<class derived_type>
BOOST_UBLAS_INLINE
tensor (const tensor_expression_type<derived_type> &expr)
: tensor_expression_type<self_type> ()
, extents_ ( detail::retrieve_extents(expr) )
Expand All @@ -373,8 +373,8 @@ class tensor:
*
* @param expr matrix expression
*/
BOOST_UBLAS_INLINE
template<class derived_type>
BOOST_UBLAS_INLINE
tensor (const matrix_expression_type<derived_type> &expr)
: tensor( matrix_type ( expr ) )
{
Expand All @@ -389,8 +389,8 @@ class tensor:
*
* @param expr vector expression
*/
BOOST_UBLAS_INLINE
template<class derived_type>
BOOST_UBLAS_INLINE
tensor (const vector_expression_type<derived_type> &expr)
: tensor( vector_type ( expr ) )
{
Expand All @@ -404,8 +404,8 @@ class tensor:
*
* @param expr expression that is evaluated.
*/
BOOST_UBLAS_INLINE
template<class derived_type>
BOOST_UBLAS_INLINE
tensor &operator = (const tensor_expression_type<derived_type> &expr)
{
detail::eval(*this, expr);
Expand Down Expand Up @@ -532,8 +532,8 @@ class tensor:
* @param i zero-based index where 0 <= i < this->size() if sizeof...(is) == 0, else 0<= i < this->size(0)
* @param is zero-based indices where 0 <= is[r] < this->size(r) where 0 < r < this->rank()
*/
BOOST_UBLAS_INLINE
template<class ... size_types>
BOOST_UBLAS_INLINE
reference at (size_type i, size_types ... is) {
if constexpr (sizeof...(is) == 0)
return this->data_[i];
Expand Down Expand Up @@ -579,8 +579,8 @@ class tensor:
* @param i placeholder
* @param is zero-based indices where 0 <= is[r] < this->size(r) where 0 < r < this->rank()
*/
BOOST_UBLAS_INLINE
template<std::size_t I, class ... index_types>
BOOST_UBLAS_INLINE
decltype(auto) operator() (index::index_type<I> p, index_types ... ps) const
{
constexpr auto N = sizeof...(ps)+1;
Expand Down

0 comments on commit 3611224

Please sign in to comment.