I've found the found the reason of that error: dense matrix could be resized by preserving its contents, but spare matrix must be resized without preserving its contents. So the resize test, should be modified, as in this patch (pending of commit to git):
diff --git a/test/test_matrix_vector.cpp b/test/test_matrix_vector.cpp
index a95763e..955f8dc 100644
--- a/test/test_matrix_vector.cpp
+++ b/test/test_matrix_vector.cpp
@@ -68,7 +68,7 @@ bool test_matrix_row_facade() {
pass &= (matrix.size2() == num_cols);
typename Matrix::size_type new_num_rows = 6;
- rows.resize(new_num_rows);
+ rows.resize(new_num_rows, false);
pass &= (matrix.size1() == new_num_rows);
pass &= (rows.size() == new_num_rows);
pass &= (matrix.size2() == num_cols);
@@ -222,7 +222,7 @@ bool test_matrix_column_facade() {
pass &= (matrix.size1() == num_rows);
typename Matrix::size_type new_num_cols = 6;
- columns.resize(new_num_cols);
+ columns.resize(new_num_cols, false);
pass &= (matrix.size2() == new_num_cols);
pass &= (columns.size() == new_num_cols);
pass &= (matrix.size1() == num_rows);
OTOH, there are other issues:
[Debug>> Testing mapped_matrix...
[Debug>> test_matrix_row_facade: resize
[Debug>> test_matrix_row_facade: operator()
[Debug>> test_matrix_row_facade: operator[]
[Debug>> test_matrix_row_facade: operator[] const
[Debug>> test_matrix_row_facade: const iterator
[Debug>> test_matrix_row_facade: iterator
[Debug>> test_matrix_row_facade: reverse iterator
[Debug>> test_matrix_row_facade: const reverse iterator
[Debug>> test_matrix_row_facade: resize
[Debug>> test_matrix_row_facade: operator()
[Debug>> test_matrix_row_facade: operator[]
[Debug>> test_matrix_row_facade: operator[] const
[Debug>> test_matrix_row_facade: const iterator
[Debug>> test_matrix_row_facade: iterator
[Debug>> test_matrix_row_facade: reverse iterator
[Debug>> test_matrix_row_facade: const reverse iterator
[Debug>> test_matrix_row_facade: resize
[Debug>> test_matrix_row_facade: operator()
Check failed in file ../include/boost/numeric/ublas/detail/vector_assign.hpp at line 370:
detail::expression_type_check (v, cv)
[Error (test_matrix_vector.cpp:main:471)>> external logic or bad condition of inputs
This error happens in the 3rd type <long>, why does the tests pass in <double> and <float>?