Opened 12 years ago
Last modified 4 years ago
#4549 new Bugs
vector/matrix_assign do not work for integral types
Reported by: | Owned by: | Gunter | |
---|---|---|---|
Milestone: | To Be Determined | Component: | uBLAS |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: | jonathan.jones@… |
Description
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:
- In detail/vector_assign.hpp and detail/matrix_assign.hpp, the check in function
detail::equals
should use<=
instead of<
.
- In detail/config.hpp, macro
BOOST_UBLAS_TYPE_CHECK_MIN
should get zero for integral types.
Attachments (3)
Change History (6)
by , 12 years ago
Attachment: | vector_matrix_assign-allow_integral_types.patch added |
---|
by , 12 years ago
Attachment: | test_ticket4549.cpp added |
---|
Test case: test copy-construction/-assignement of an integral vector and an integral matrix. The test fails to run if the proposed patch is not applied.
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
It seems that this patch has been never added to the repo. I cannot see it in current svn trunk.
Since I've realized that one of the involved files is changed (i.e., boost/numeric/ublas/detail/config.hpp
), I add a new patch to fit actual changes.
The test file that I've already attached is still OK.
by , 10 years ago
Attachment: | vector_matrix_assign-allow_integral_types-20120827.patch added |
---|
Patch file changed to fit actual (Boost 1.51) changes.
comment:3 by , 4 years ago
When I ran the attached test case , it works for integral vector but not integral matrix for Boost 1.65.1 . Please let me know if we have fix for integral matrix ?
Thanks
Possible solution.