|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80403 - in trunk: boost/numeric/ublas libs/numeric/ublas/test
From: guwi17_at_[hidden]
Date: 2012-09-04 19:30:59
Author: guwi17
Date: 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
New Revision: 80403
URL: http://svn.boost.org/trac/boost/changeset/80403
Log:
boost/numeric/ublas/matrix_sparse.hpp : fix mapped_vector_of_mapped_vector
libs/numeric/ublas/test/test_inplace_solve.cpp : make test set configurable, see #4024
libs/numeric/ublas/test/test32.cpp, libs/numeric/ublas/test/test33.cpp : add mapped_vector_of_mapped_vector
libs/numeric/ublas/test/Jamfile.v2 : see #4024 - split some tests to separate "good" and "bad" matrix types
Text files modified:
trunk/boost/numeric/ublas/matrix_sparse.hpp | 4 +-
trunk/libs/numeric/ublas/test/Jamfile.v2 | 49 ++++++++++++++++++++++++++++++++++++---
trunk/libs/numeric/ublas/test/test32.cpp | 30 ++++++++++++++++++++++++
trunk/libs/numeric/ublas/test/test33.cpp | 24 +++++++++++++++++++
trunk/libs/numeric/ublas/test/test_inplace_solve.cpp | 19 +++++++++++++--
5 files changed, 117 insertions(+), 9 deletions(-)
Modified: trunk/boost/numeric/ublas/matrix_sparse.hpp
==============================================================================
--- trunk/boost/numeric/ublas/matrix_sparse.hpp (original)
+++ trunk/boost/numeric/ublas/matrix_sparse.hpp 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
@@ -1359,7 +1359,7 @@
#endif
typedef const matrix_reference<const self_type> const_closure_type;
typedef matrix_reference<self_type> closure_type;
- typedef mapped_vector<T, typename A::value_type> vector_temporary_type;
+ typedef mapped_vector<T> 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 @@
template<class C> // Container assignment without temporary
BOOST_UBLAS_INLINE
mapped_vector_of_mapped_vector &operator = (const matrix_container<C> &m) {
- resize (m ().size1 (), m ().size2 ());
+ resize (m ().size1 (), m ().size2 (), false);
assign (m);
return *this;
}
Modified: trunk/libs/numeric/ublas/test/Jamfile.v2
==============================================================================
--- trunk/libs/numeric/ublas/test/Jamfile.v2 (original)
+++ trunk/libs/numeric/ublas/test/Jamfile.v2 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
@@ -31,12 +31,20 @@
# 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 @@
test33.cpp
: : :
<define>$(UBLAS_TESTSET_SPARSE)
+ <define>$(UBLAS_TESTSET_SPARSE_COO)
+ ]
+ [ run test3.cpp
+ test31.cpp
+ test32.cpp
+ test33.cpp
+ : : :
+ <define>USE_FLOAT
+ <define>USE_DOUBLE
+ <define>USE_STD_COMPLEX
+ <define>USE_STD_MAP
+ <define>USE_MAPPED_VECTOR_OF_MAPPED_VECTOR
+ : test3_mvov
+ :
]
[ run test4.cpp
test42.cpp
@@ -136,6 +158,25 @@
]
[ run test_triangular.cpp
]
- [ run test_inplace_solve.cpp
- ]
+ [ run test_inplace_solve.cpp
+ :
+ :
+ : <define>$(UBLAS_TESTSET)
+ : test_inplace_solve_basic
+ :
+ ]
+ [ run test_inplace_solve.cpp
+ :
+ :
+ : <define>$(UBLAS_TESTSET_SPARSE) <define>$(UBLAS_TESTSET_SPARSE_COO)
+ : test_inplace_solve_sparse
+ :
+ ]
+ [ run test_inplace_solve.cpp
+ :
+ :
+ : <define>USE_MAPPED_VECTOR_OF_MAPPED_VECTOR
+ : test_inplace_solve_mvov
+ :
+ ]
;
Modified: trunk/libs/numeric/ublas/test/test32.cpp
==============================================================================
--- trunk/libs/numeric/ublas/test/test32.cpp (original)
+++ trunk/libs/numeric/ublas/test/test32.cpp 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
@@ -321,4 +321,34 @@
#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<float, std::map<std::size_t, float> >,
+ ublas::mapped_vector_of_mapped_vector<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >,
+ ublas::mapped_vector_of_mapped_vector<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float> mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >,
+ ublas::mapped_vector_of_mapped_vector<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double> mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >,
+ ublas::mapped_vector_of_mapped_vector<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+#endif
}
Modified: trunk/libs/numeric/ublas/test/test33.cpp
==============================================================================
--- trunk/libs/numeric/ublas/test/test33.cpp (original)
+++ trunk/libs/numeric/ublas/test/test33.cpp 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
@@ -344,4 +344,28 @@
#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<ublas::mapped_vector_of_mapped_vector<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix<ublas::mapped_vector_of_mapped_vector<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float> mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double> mapped_vector_of_mapped_vector" << std::endl;
+ test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
}
Modified: trunk/libs/numeric/ublas/test/test_inplace_solve.cpp
==============================================================================
--- trunk/libs/numeric/ublas/test/test_inplace_solve.cpp (original)
+++ trunk/libs/numeric/ublas/test/test_inplace_solve.cpp 2012-09-04 19:30:58 EDT (Tue, 04 Sep 2012)
@@ -79,7 +79,6 @@
}
int main() {
- const int n=10;
// typedefs are needed as macros do not work with "," in template arguments
typedef ublas::compressed_matrix<double, ublas::row_major> commat_doub_rowmaj;
@@ -95,16 +94,30 @@
BOOST_UBLAS_TEST_BEGIN();
- BOOST_UBLAS_TEST_DO( test_inplace_solve<commat_doub_rowmaj> );
- BOOST_UBLAS_TEST_DO( test_inplace_solve<commat_doub_colmaj> );
+#ifdef USE_MATRIX
BOOST_UBLAS_TEST_DO( test_inplace_solve<mat_doub_rowmaj> );
BOOST_UBLAS_TEST_DO( test_inplace_solve<mat_doub_colmaj> );
+#endif
+
+#ifdef USE_COMPRESSED_MATRIX
+ BOOST_UBLAS_TEST_DO( test_inplace_solve<commat_doub_rowmaj> );
+ BOOST_UBLAS_TEST_DO( test_inplace_solve<commat_doub_colmaj> );
+#endif
+
+#ifdef USE_MAPPED_MATRIX
BOOST_UBLAS_TEST_DO( test_inplace_solve<mapmat_doub_rowmaj> );
BOOST_UBLAS_TEST_DO( test_inplace_solve<mapmat_doub_colmaj> );
+#endif
+
+#ifdef USE_COORDINATE_MATRIX
BOOST_UBLAS_TEST_DO( test_inplace_solve<cormat_doub_rowmaj> );
BOOST_UBLAS_TEST_DO( test_inplace_solve<cormat_doub_colmaj> );
+#endif
+
+#ifdef USE_MAPPED_VECTOR_OF_MAPPED_VECTOR
BOOST_UBLAS_TEST_DO( test_inplace_solve<mvmv_doub_rowmaj> );
BOOST_UBLAS_TEST_DO( test_inplace_solve<mvmv_doub_colmaj> );
+#endif
BOOST_UBLAS_TEST_END();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk