Opened 10 years ago

Closed 10 years ago

#7296 closed Bugs (fixed)

Bug-fix and improvements to test utility functions

Reported by: Marco Guazzone <marco.guazzone@…> Owned by: Gunter
Milestone: Boost 1.52.0 Component: uBLAS
Version: Boost Release Branch Severity: Problem
Keywords: Cc:

Description

Three years ago I introduced in libs/numeric/ublas/test/utils a small set of utility functions for testing purpose.

Now, I corrected some bugs and added new and hopefully useful functions.

Furthermore, I fixed the license part.

I attach a patch file along with the whole include file.

I tested it against the following tests:

begin_end
num_columns
num_rows
size
test_complex_norms

and all works.

I had to skip the following tests since they fail (not for the new version of utils.hpp):

test_assignment
test_coordinate_matrix_sort
test_inplace_solve

Could you add it?

Attachments (13)

utils.patch (10.1 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Patch file for utils.hpp
utils.hpp (8.6 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The new (i.e., already patched) utils.hpp
utils-new.patch (12.5 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
New patch file for utils.hpp
utils.2.hpp (11.0 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The new (i.e., already patched by utils-new.patch) utils.hpp
utils-201208280915.patch (12.5 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Patch file for utils.hpp to be applied against the version you currently find in boost trunk
utils_UBLA_UBLAS-201208280915.patch (1.2 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Patch file for utils.hpp to be applied against the version of utils.hpp patched with utils-new.patch (i.e., the one named utils.2.hpp)
utils.3.hpp (11.0 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The new (i.e., already patched by utils-201208280915.patch) utils.hpp file.
utils-fix_complex-201208281922.patch (7.9 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Patch file for utils.hpp to make it works with complex numbers. To be applied to the version of utils.hpp in the current boost trunk.
utils.4.hpp (14.3 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The new utils.hpp file that you should obtain after applying the utils-fix_complex-201208281922.patch patch.
test_ticket7296.cpp (8.1 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Test case for utils.hpp. It also shows that now utils.hpp works with complex value types.
utils-201208301042.patch (19.0 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
Patch file for utils.hpp to be applied against utils.4.hpp
utils.5.hpp (17.7 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The new patched utils.hpp (i.e., the one resulting after applying patch utils-201208301042.patch)
test_ticket7296.2.cpp (10.9 KB ) - added by Marco Guazzone <marco.guazzone@…> 10 years ago.
The updated test_ticket7296.cpp for the new version of utils.hpp named utils.5.hpp

Download all attachments as: .zip

Change History (29)

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.patch added

Patch file for utils.hpp

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.hpp added

The new (i.e., already patched) utils.hpp

comment:1 by Marco Guazzone <marco.guazzone@…>, 10 years ago

The previously attached patch contained simpler macros but some output messages was less informative (for the user). Now, with the new attached patch utils-new.patch, those output messages are again informative.

Sorry for the inconvenience.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils-new.patch added

New patch file for utils.hpp

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.2.hpp added

The new (i.e., already patched by utils-new.patch) utils.hpp

comment:2 by Gunter, 10 years ago

(In [80267]) boost/numeric/ublas/triangular.hpp - applied patch, see #4024 libs/numeric/ublas/test/test_inplace_solve.cpp - fixed includes

libs/numeric/ublas/test/utils.hpp - applied patch (after s/BOOST_UBLA_TEST/BOOST_UBLAS_TEST/g), see #7296

comment:3 by Marco Guazzone <marco.guazzone@…>, 10 years ago

The previous patch file utils-new.patch contained bad macro names: BOOST_UBLA_TEST_CHECK_EQ and BOOST_UBLA_TEST_CHECK_EQUAL. Specifically, UBLA_ should be UBLAS_. The new attached patch fix this.

I attach two patches:

  • utils-201208280915.patch is the patch file to be used if applied against the original (unpatched) utils.hpp (i.e., the one you find in the actual boost trunk).
  • utils-201208280915.patch is the patch file to be used if applied against the patched utils.hpp (i.e., the ones named utils.2.hpp in the above attachments).

As before, I also attach the new (patched) version of utils.hpp.

Again, sorry for this inconvenience, and thanks to guwi17 for pointing it out.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils-201208280915.patch added

Patch file for utils.hpp to be applied against the version you currently find in boost trunk

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Patch file for utils.hpp to be applied against the version of utils.hpp patched with utils-new.patch (i.e., the one named utils.2.hpp)

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.3.hpp added

The new (i.e., already patched by utils-201208280915.patch) utils.hpp file.

comment:4 by Marco Guazzone <marco.guazzone@…>, 10 years ago

In the last my comment, read the second utils-201208280915.patch as utils_UBLA_UBLAS-201208280915.patch.

comment:5 by Marco Guazzone <marco.guazzone@…>, 10 years ago

To date, some macros in utils.hpp fail when the value type has a complex type.

I've tried to fix it and to test the fix I have created a test-suite for the macros contained in utils.hpp.

I'm going to upload the patch file together with the test suite.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Patch file for utils.hpp to make it works with complex numbers. To be applied to the version of utils.hpp in the current boost trunk.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.4.hpp added

The new utils.hpp file that you should obtain after applying the utils-fix_complex-201208281922.patch patch.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: test_ticket7296.cpp added

Test case for utils.hpp. It also shows that now utils.hpp works with complex value types.

comment:6 by Marco Guazzone <marco.guazzone@…>, 10 years ago

I've tried to make some macro more robust to complex expressions by using (when needed) macro expansion inside parenthesis. Furthermore,

  • I fixed a bug: I forgot to add an increment of the variable used to count test failures
  • I added two more macros for performing relative closeness comparison in case of vectors and matrices
  • I replaced the use of unsigned long with std::size_t (I think it's better)
  • I enhanced the doc

As usual, I add the new patch file (wrt utils.4.hpp) together with the whole new utils.hpp file and the updated test-case.

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils-201208301042.patch added

Patch file for utils.hpp to be applied against utils.4.hpp

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: utils.5.hpp added

The new patched utils.hpp (i.e., the one resulting after applying patch utils-201208301042.patch)

by Marco Guazzone <marco.guazzone@…>, 10 years ago

Attachment: test_ticket7296.2.cpp added

The updated test_ticket7296.cpp for the new version of utils.hpp named utils.5.hpp

comment:7 by Gunter, 10 years ago

(In [80483]) boost/numeric/ublas/traits.hpp, libs/numeric/ublas/test/test_assignment.cpp, libs/numeric/ublas/test/begin_end.cpp: see #7296, fix test issues with unsigned integer types

comment:8 by Gunter, 10 years ago

(In [80485])

  • libs/numeric/ublas/test/utils.hpp : see #7296, improved macros
  • libs/numeric/ublas/test/Jamfile.v2 : add new test for utils.hpp

comment:9 by Gunter, 10 years ago

(In [80507])

  • libs/numeric/ublas/tests/utils.hpp: see #7296 - replace func by FUNCTION if compiled with MSVC

comment:10 by Gunter, 10 years ago

Milestone: To Be DeterminedBoost 1.52.0
Status: newassigned

comment:11 by Gunter, 10 years ago

(In [80563])

  • libs/numeric/ublas/test/test_ticket7296.cpp: see #7296 - add missing test

comment:12 by Gunter, 10 years ago

Resolution: fixed
Status: assignedclosed

comment:13 by Gunter, 10 years ago

Resolution: fixed
Status: closedreopened
Version: Boost 1.52.0Boost Release Branch

comment:14 by Gunter, 10 years ago

(In [80624])

  • libs/numeric/ublas/test/utils.hpp: switch to boost::math::isnan, see #7296

comment:15 by Gunter, 10 years ago

(In [80644])

  • libs/numeric/ublas/test/test_triangular.cpp: switch to boost::timer and enable all tests, see #7296
  • libs/numeric/ublas/test/Jamfile.v2: add required lib boost_timer

comment:16 by Gunter, 10 years ago

Resolution: fixed
Status: reopenedclosed

(In [80645]) merged [80483],[80487],[80586],[80591],[80592],[80599],[80600],[80624],[80625],[80643],[80644] into release:

  • fix #7296 (hopefully ;-)
  • see #7363 (must wait for a full test cycle before closing this task)
Note: See TracTickets for help on using tickets.