diff --git a/include/boost/numeric/ublas/matrix_sparse.hpp b/include/boost/numeric/ublas/matrix_sparse.hpp index 9324108e..b395a529 100644 --- a/include/boost/numeric/ublas/matrix_sparse.hpp +++ b/include/boost/numeric/ublas/matrix_sparse.hpp @@ -1359,7 +1359,7 @@ namespace boost { namespace numeric { namespace ublas { #endif typedef const matrix_reference const_closure_type; typedef matrix_reference closure_type; - typedef mapped_vector vector_temporary_type; + typedef mapped_vector vector_temporary_type; typedef self_type matrix_temporary_type; typedef typename A::value_type::second_type vector_data_value_type; typedef sparse_tag storage_category; @@ -1530,7 +1530,7 @@ namespace boost { namespace numeric { namespace ublas { template // Container assignment without temporary BOOST_UBLAS_INLINE mapped_vector_of_mapped_vector &operator = (const matrix_container &m) { - resize (m ().size1 (), m ().size2 ()); + resize (m ().size1 (), m ().size2 (), false); assign (m); return *this; } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 27461270..edff9af6 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -31,12 +31,20 @@ UBLAS_TESTSET_SPARSE ?= # USE_RANGE USE_SLICE # Too complex for regression testing USE_UNBOUNDED_ARRAY USE_MAP_ARRAY USE_STD_MAP - USE_MAPPED_VECTOR USE_COMPRESSED_VECTOR USE_COORDINATE_VECTOR - USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX USE_COORDINATE_MATRIX + USE_MAPPED_VECTOR USE_COMPRESSED_VECTOR + USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX ; # Generalize VofV still failing # USE_GENERALIZED_VECTOR_OF_VECTOR +UBLAS_TESTSET_SPARSE_COO = [ modules.peek : UBLAS_TESTSET_SPARSE_COO ] ; +UBLAS_TESTSET_SPARSE_COO ?= + USE_DOUBLE USE_STD_COMPLEX + USE_UNBOUNDED_ARRAY + USE_COORDINATE_VECTOR + USE_COORDINATE_MATRIX + ; + # Project settings project @@ -69,6 +77,20 @@ test-suite numeric/uBLAS test33.cpp : : : $(UBLAS_TESTSET_SPARSE) + $(UBLAS_TESTSET_SPARSE_COO) + ] + [ run test3.cpp + test31.cpp + test32.cpp + test33.cpp + : : : + USE_FLOAT + USE_DOUBLE + USE_STD_COMPLEX + USE_STD_MAP + USE_MAPPED_VECTOR_OF_MAPPED_VECTOR + : test3_mvov + : ] [ run test4.cpp test42.cpp @@ -136,6 +158,25 @@ test-suite numeric/uBLAS ] [ run test_triangular.cpp ] - [ run test_inplace_solve.cpp - ] + [ run test_inplace_solve.cpp + : + : + : $(UBLAS_TESTSET) + : test_inplace_solve_basic + : + ] + [ run test_inplace_solve.cpp + : + : + : $(UBLAS_TESTSET_SPARSE) $(UBLAS_TESTSET_SPARSE_COO) + : test_inplace_solve_sparse + : + ] + [ run test_inplace_solve.cpp + : + : + : USE_MAPPED_VECTOR_OF_MAPPED_VECTOR + : test_inplace_solve_mvov + : + ] ; diff --git a/test/test32.cpp b/test/test32.cpp index 2ffc5021..eaf49297 100644 --- a/test/test32.cpp +++ b/test/test32.cpp @@ -321,4 +321,34 @@ void test_matrix_vector () { #endif #endif #endif + +#ifdef USE_MAPPED_VECTOR_OF_MAPPED_VECTOR +#ifdef USE_STD_MAP +#ifdef USE_FLOAT + std::cout << "float mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix_vector >, + ublas::mapped_vector_of_mapped_vector, 3 > () (); +#endif + +#ifdef USE_DOUBLE + std::cout << "double mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix_vector >, + ublas::mapped_vector_of_mapped_vector, 3 > () (); +#endif + +#ifdef USE_STD_COMPLEX +#ifdef USE_FLOAT + std::cout << "std::complex mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix_vector, std::map > >, + ublas::mapped_vector_of_mapped_vector >, 3 > () (); +#endif + +#ifdef USE_DOUBLE + std::cout << "std::complex mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix_vector, std::map > >, + ublas::mapped_vector_of_mapped_vector >, 3 > () (); +#endif +#endif +#endif +#endif } diff --git a/test/test33.cpp b/test/test33.cpp index bf7a3d28..260d8b9a 100644 --- a/test/test33.cpp +++ b/test/test33.cpp @@ -344,4 +344,28 @@ void test_matrix () { #endif #endif #endif + +#ifdef USE_MAPPED_VECTOR_OF_MAPPED_VECTOR +#ifdef USE_FLOAT + std::cout << "float mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix, 3 > () (); +#endif + +#ifdef USE_DOUBLE + std::cout << "double mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix, 3 > () (); +#endif + +#ifdef USE_STD_COMPLEX +#ifdef USE_FLOAT + std::cout << "std::complex mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix >, 3 > () (); +#endif + +#ifdef USE_DOUBLE + std::cout << "std::complex mapped_vector_of_mapped_vector" << std::endl; + test_my_matrix >, 3 > () (); +#endif +#endif +#endif } diff --git a/test/test_inplace_solve.cpp b/test/test_inplace_solve.cpp index f9fcbaa2..0ff8bf9d 100644 --- a/test/test_inplace_solve.cpp +++ b/test/test_inplace_solve.cpp @@ -79,7 +79,6 @@ BOOST_UBLAS_TEST_DEF ( test_inplace_solve ) } int main() { - const int n=10; // typedefs are needed as macros do not work with "," in template arguments typedef ublas::compressed_matrix commat_doub_rowmaj; @@ -95,16 +94,30 @@ int main() { BOOST_UBLAS_TEST_BEGIN(); - BOOST_UBLAS_TEST_DO( test_inplace_solve ); - BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#ifdef USE_MATRIX BOOST_UBLAS_TEST_DO( test_inplace_solve ); BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#endif + +#ifdef USE_COMPRESSED_MATRIX + BOOST_UBLAS_TEST_DO( test_inplace_solve ); + BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#endif + +#ifdef USE_MAPPED_MATRIX BOOST_UBLAS_TEST_DO( test_inplace_solve ); BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#endif + +#ifdef USE_COORDINATE_MATRIX BOOST_UBLAS_TEST_DO( test_inplace_solve ); BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#endif + +#ifdef USE_MAPPED_VECTOR_OF_MAPPED_VECTOR BOOST_UBLAS_TEST_DO( test_inplace_solve ); BOOST_UBLAS_TEST_DO( test_inplace_solve ); +#endif BOOST_UBLAS_TEST_END(); }