[Boost-bugs] [Boost C++ Libraries] #4549: vector/matrix_assign do not work for integral types

Subject: [Boost-bugs] [Boost C++ Libraries] #4549: vector/matrix_assign do not work for integral types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-17 09:10:08


#4549: vector/matrix_assign do not work for integral types
-------------------------------------------------------+--------------------
 Reporter: Marco Guazzone <marco.guazzone@…> | Owner: guwi17
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: uBLAS
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------------------------+--------------------
 I have found a possible problem in `vector_assign` and `matrix_assign`
 functions when vector and matrix values have integral type.

 For instance, when you try to assign two integral vectors (e.g.,
 `ublas::vector<int>`), you'll end up with the following runtime assertion:

 {{{
 Check failed in file
 boost-trunk/boost/numeric/ublas/detail/vector_assign.hpp
 at line 370:
 detail::expression_type_check (v, cv)
 terminate called after throwing an instance of
 'boost::numeric::ublas::external_logic'
  what(): external logic or bad condition of inputs
 Aborted (core dumped)
 }}}

 Similar exception will be thrown for integral matrices.

 I have identified two possible issues:
 1. In ''detail/vector_assign.hpp'' and ''detail/matrix_assign.hpp'', the
 check in function `detail::equals` should use `<=` instead of `<`.

 2. In ''detail/config.hpp'', macro `BOOST_UBLAS_TYPE_CHECK_MIN` should get
 zero for integral types.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4549>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC