Unified test operator() and operator(int)

svn path=/trunk/boost/libs/numeric/ublas/; revision=28740
This commit is contained in:
Michael Stevens 2005-05-08 16:50:14 +00:00
parent b72a4345a0
commit 2da4e44a37
3 changed files with 3 additions and 54 deletions

View File

@ -126,8 +126,7 @@ struct test_my_matrix {
test_with (ms1, ms2, ms3);
#endif
}
}
void operator () (int) const {
#ifdef USE_ADAPTOR
{
#ifdef USE_BANDED
@ -183,26 +182,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
@ -211,26 +206,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
@ -239,26 +230,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
@ -269,26 +256,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
@ -297,26 +280,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
@ -325,26 +304,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif

View File

@ -121,8 +121,7 @@ struct test_my_matrix {
test_with (ms1, ms2, ms3);
#endif
}
}
void operator () (int) const {
#ifdef USE_ADAPTOR
{
M m1 (N, N), m2 (N, N), m3 (N, N);
@ -155,26 +154,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
@ -183,26 +178,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
@ -211,26 +202,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif

View File

@ -121,8 +121,7 @@ struct test_my_matrix {
test_with (ms1, ms2, ms3);
#endif
}
}
void operator () (int) const {
#ifdef USE_ADAPTOR
{
M m1 (N, N), m2 (N, N), m3 (N, N);
@ -155,26 +154,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
@ -183,26 +178,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
@ -211,26 +202,22 @@ void test_matrix () {
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif