diff --git a/test1/test11.cpp b/test1/test11.cpp index e589a7f2..a4ed5228 100644 --- a/test1/test11.cpp +++ b/test1/test11.cpp @@ -50,6 +50,17 @@ struct test_my_vector { v1.swap (v2); std::cout << "v1.swap (v2) = " << v1 << " " << v2 << std::endl; +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + // Project range and slice + initialize_vector (v1); + initialize_vector (v2); + project (v1, ublas::range(0,1)) = project (v2, ublas::range(0,1)); + project (v1, ublas::range(0,1)) = project (v2, ublas::slice(0,1,1)); + project (v1, ublas::slice(2,-1,2)) = project (v2, ublas::slice(0,1,2)); + project (v1, ublas::slice(2,-1,2)) = project (v2, ublas::range(0,2)); + std::cout << "v1 = range/slice " << v1 << std::endl; +#endif + // Unary vector operations resulting in a vector initialize_vector (v1); v2 = - v1; diff --git a/test1/test13.cpp b/test1/test13.cpp index 8950f207..83ac7296 100644 --- a/test1/test13.cpp +++ b/test1/test13.cpp @@ -47,6 +47,17 @@ struct test_my_matrix { m1.swap (m2); std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + // Project range and slice + initialize_matrix (m1); + initialize_matrix (m2); + project (m1, ublas::range(0,1),ublas::range(0,1)) = project (m2, ublas::range(0,1),ublas::range(0,1)); + project (m1, ublas::range(0,1),ublas::range(0,1)) = project (m2, ublas::slice(0,1,1),ublas::slice(0,1,1)); + project (m1, ublas::slice(2,-1,2),ublas::slice(2,-1,2)) = project (m2, ublas::slice(0,1,2),ublas::slice(0,1,2)); + project (m1, ublas::slice(2,-1,2),ublas::slice(2,-1,2)) = project (m2, ublas::range(0,2),ublas::range(0,2)); + std::cout << "m1 = range/slice " << m1 << std::endl; +#endif + // Unary matrix operations resulting in a matrix initialize_matrix (m1); m2 = - m1; diff --git a/test2/test21.cpp b/test2/test21.cpp index 20bf9987..007f03d4 100644 --- a/test2/test21.cpp +++ b/test2/test21.cpp @@ -18,8 +18,6 @@ #include #include -#include -#include #include #include diff --git a/test3/test31.cpp b/test3/test31.cpp index 62c6cfb0..ac8fa2f4 100644 --- a/test3/test31.cpp +++ b/test3/test31.cpp @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #include "test3.hpp" @@ -49,6 +47,17 @@ struct test_my_vector { v1.swap (v2); std::cout << "v1.swap (v2) = " << v1 << " " << v2 << std::endl; +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + // Project range and slice + initialize_vector (v1); + initialize_vector (v2); + project (v1, ublas::range(0,1)) = project (v2, ublas::range(0,1)); + project (v1, ublas::range(0,1)) = project (v2, ublas::slice(0,1,1)); + project (v1, ublas::slice(2,-1,2)) = project (v2, ublas::slice(0,1,2)); + project (v1, ublas::slice(2,-1,2)) = project (v2, ublas::range(0,2)); + std::cout << "v1 = range/slice " << v1 << std::endl; +#endif + // Unary vector operations resulting in a vector initialize_vector (v1); v2 = - v1; @@ -194,23 +203,23 @@ void test_vector () { #ifdef USE_COMPRESSED_VECTOR #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float compressed" << std::endl; test_my_vector, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double compressed" << std::endl; test_my_vector, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed" << std::endl; test_my_vector >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed" << std::endl; test_my_vector >, 3 > () (); #endif #endif @@ -218,23 +227,23 @@ void test_vector () { #ifdef USE_COORDINATE_VECTOR #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float coordinate" << std::endl; test_my_vector, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double coordinate" << std::endl; test_my_vector, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate" << std::endl; test_my_vector >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate" << std::endl; test_my_vector >, 3 > () (); #endif #endif diff --git a/test3/test32.cpp b/test3/test32.cpp index dbe38ac5..d667f104 100644 --- a/test3/test32.cpp +++ b/test3/test32.cpp @@ -153,26 +153,26 @@ void test_matrix_vector () { #ifdef USE_SPARSE_VECTOR_OF_SPARSE_VECTOR #ifdef USE_MAP_ARRAY #ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; + std::cout << "float, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix_vector >, ublas::sparse_vector_of_sparse_vector > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; + std::cout << "double, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix_vector >, ublas::sparse_vector_of_sparse_vector > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix_vector, ublas::map_array > >, ublas::sparse_vector_of_sparse_vector, ublas::row_major, ublas::map_array > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex,sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix_vector, ublas::map_array > >, ublas::sparse_vector_of_sparse_vector, ublas::row_major, ublas::map_array > > >, 3 > () (); #endif @@ -181,26 +181,26 @@ void test_matrix_vector () { #ifdef USE_STD_MAP #ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; + std::cout << "float, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix_vector >, ublas::sparse_vector_of_sparse_vector > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; + std::cout << "double, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix_vector >, ublas::sparse_vector_of_sparse_vector > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix_vector, std::map > >, ublas::sparse_vector_of_sparse_vector, ublas::row_major, std::map > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix_vector, std::map > >, ublas::sparse_vector_of_sparse_vector, ublas::row_major, std::map > > >, 3 > () (); #endif @@ -211,7 +211,7 @@ void test_matrix_vector () { #ifdef USE_GENERALIZED_VECTOR_OF_VECTOR #ifdef USE_MAP_ARRAY #ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; + std::cout << "float, generalized_vector_of_vector map_array" << std::endl; test_my_matrix_vector >, ublas::generalized_vector_of_vector > > >, 3 > () (); test_my_matrix_vector >, @@ -219,7 +219,7 @@ void test_matrix_vector () { #endif #ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; + std::cout << "double, generalized_vector_of_vector map_array" << std::endl; test_my_matrix_vector >, ublas::generalized_vector_of_vector > > >, 3 > () (); test_my_matrix_vector >, @@ -228,7 +228,7 @@ void test_matrix_vector () { #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector map_array" << std::endl; test_my_matrix_vector, ublas::map_array > >, ublas::generalized_vector_of_vector, ublas::row_major, ublas::vector, ublas::map_array > > > >, 3 > () (); test_my_matrix_vector, ublas::map_array > >, @@ -236,7 +236,7 @@ void test_matrix_vector () { #endif #ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector map_array" << std::endl; test_my_matrix_vector, ublas::map_array > >, ublas::generalized_vector_of_vector, ublas::row_major, ublas::vector, ublas::map_array > > > >, 3 > () (); test_my_matrix_vector, ublas::map_array > >, @@ -247,7 +247,7 @@ void test_matrix_vector () { #ifdef USE_STD_MAP #ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; + std::cout << "float, generalized_vector_of_vector std::map" << std::endl; test_my_matrix_vector >, ublas::generalized_vector_of_vector > > >, 3 > () (); test_my_matrix_vector >, @@ -255,7 +255,7 @@ void test_matrix_vector () { #endif #ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; + std::cout << "double, generalized_vector_of_vector std::map" << std::endl; test_my_matrix_vector >, ublas::generalized_vector_of_vector > > >, 3 > () (); test_my_matrix_vector >, @@ -264,7 +264,7 @@ void test_matrix_vector () { #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector std::map" << std::endl; test_my_matrix_vector, std::map > >, ublas::generalized_vector_of_vector, ublas::row_major, ublas::vector, std::map > > > >, 3 > () (); test_my_matrix_vector, std::map > >, @@ -272,7 +272,7 @@ void test_matrix_vector () { #endif #ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector std::map" << std::endl; test_my_matrix_vector, std::map > >, ublas::generalized_vector_of_vector, ublas::row_major, ublas::vector, std::map > > > >, 3 > () (); test_my_matrix_vector, std::map > >, @@ -284,26 +284,26 @@ void test_matrix_vector () { #ifdef USE_COMPRESSED_MATRIX #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float compressed" << std::endl; test_my_matrix_vector, ublas::compressed_matrix, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double compressed" << std::endl; test_my_matrix_vector, ublas::compressed_matrix, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed" << std::endl; test_my_matrix_vector >, ublas::compressed_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed" << std::endl; test_my_matrix_vector >, ublas::compressed_matrix >, 3 > () (); #endif @@ -312,26 +312,26 @@ void test_matrix_vector () { #ifdef USE_COORDINATE_MATRIX #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float coordinate" << std::endl; test_my_matrix_vector, ublas::coordinate_matrix, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double coordinate" << std::endl; test_my_matrix_vector, ublas::coordinate_matrix, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate" << std::endl; test_my_matrix_vector >, ublas::coordinate_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate" << std::endl; test_my_matrix_vector >, ublas::coordinate_matrix >, 3 > () (); #endif diff --git a/test3/test33.cpp b/test3/test33.cpp index 99c2575d..5f1b00a3 100644 --- a/test3/test33.cpp +++ b/test3/test33.cpp @@ -48,6 +48,17 @@ struct test_my_matrix { m1.swap (m2); std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + // Project range and slice + initialize_matrix (m1); + initialize_matrix (m2); + project (m1, ublas::range(0,1),ublas::range(0,1)) = project (m2, ublas::range(0,1),ublas::range(0,1)); + project (m1, ublas::range(0,1),ublas::range(0,1)) = project (m2, ublas::slice(0,1,1),ublas::slice(0,1,1)); + project (m1, ublas::slice(2,-1,2),ublas::slice(2,-1,2)) = project (m2, ublas::slice(0,1,2),ublas::slice(0,1,2)); + project (m1, ublas::slice(2,-1,2),ublas::slice(2,-1,2)) = project (m2, ublas::range(0,2),ublas::range(0,2)); + std::cout << "m1 = range/slice " << m1 << std::endl; +#endif + // Unary matrix operations resulting in a matrix initialize_matrix (m1); m2 = - m1; @@ -139,23 +150,23 @@ void test_matrix () { #ifdef USE_SPARSE_MATRIX #ifdef USE_MAP_ARRAY #ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; + std::cout << "float, sparse_matrix map_array" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; + std::cout << "double, sparse_matrix map_array" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, sparse_matrix map_array" << std::endl; test_my_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, sparse_matrix map_array" << std::endl; test_my_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); #endif #endif @@ -163,23 +174,23 @@ void test_matrix () { #ifdef USE_STD_MAP #ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; + std::cout << "float, sparse_matrix std::map" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; + std::cout << "double, sparse_matrix std::map" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_matrix std::map" << std::endl; test_my_matrix, ublas::row_major, std::map > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_matrix std::map" << std::endl; test_my_matrix, ublas::row_major, std::map > >, 3 > () (); #endif #endif @@ -189,23 +200,23 @@ void test_matrix () { #ifdef USE_SPARSE_VECTOR_OF_SPARSE_VECTOR #ifdef USE_MAP_ARRAY #ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; + std::cout << "float, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; + std::cout << "double, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector map_array" << std::endl; test_my_matrix, ublas::row_major, ublas::map_array > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vectormap_array" << std::endl; test_my_matrix, ublas::row_major, ublas::map_array > > >, 3 > () (); #endif #endif @@ -213,23 +224,23 @@ void test_matrix () { #ifdef USE_STD_MAP #ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; + std::cout << "float, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; + std::cout << "double, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix, ublas::row_major, std::map > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, sparse_vector_of_sparse_vector std::map" << std::endl; test_my_matrix, ublas::row_major, std::map > > >, 3 > () (); #endif #endif @@ -239,26 +250,26 @@ void test_matrix () { #ifdef USE_GENERALIZED_VECTOR_OF_VECTOR #ifdef USE_MAP_ARRAY #ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; + std::cout << "float,generalized_vector_of_vector map_array" << std::endl; test_my_matrix > > >, 3 > () (); test_my_matrix >, ublas::map_array > > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; + std::cout << "double, generalized_vector_of_vector map_array" << std::endl; test_my_matrix > > >, 3 > () (); test_my_matrix >, ublas::map_array > > > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector map_array" << std::endl; test_my_matrix, ublas::row_major, ublas::vector, ublas::map_array > > > >, 3 > () (); test_my_matrix, ublas::row_major, ublas::sparse_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector map_array" << std::endl; test_my_matrix, ublas::row_major, ublas::vector, ublas::map_array > > > >, 3 > () (); test_my_matrix, ublas::row_major, ublas::sparse_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); #endif @@ -267,26 +278,26 @@ void test_matrix () { #ifdef USE_STD_MAP #ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; + std::cout << "float, generalized_vector_of_vector std::map" << std::endl; test_my_matrix > > >, 3 > () (); test_my_matrix >, std::map > > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; + std::cout << "double, generalized_vector_of_vector std::map" << std::endl; test_my_matrix > > >, 3 > () (); test_my_matrix >, std::map > > > >, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector std::map" << std::endl; test_my_matrix, ublas::row_major, ublas::vector, std::map > > > >, 3 > () (); test_my_matrix, ublas::row_major, ublas::sparse_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; + std::cout << "std::complex, generalized_vector_of_vector std::map" << std::endl; test_my_matrix, ublas::row_major, ublas::vector, std::map > > > >, 3 > () (); test_my_matrix, ublas::row_major, ublas::sparse_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); #endif @@ -296,23 +307,23 @@ void test_matrix () { #ifdef USE_COMPRESSED_MATRIX #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float compressed_matrix" << std::endl; test_my_matrix, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double compressed_matrix" << std::endl; test_my_matrix, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed_matrix" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex compressed_matrix" << std::endl; test_my_matrix >, 3 > () (); #endif #endif @@ -320,23 +331,23 @@ void test_matrix () { #ifdef USE_COORDINATE_MATRIX #ifdef USE_FLOAT - std::cout << "float" << std::endl; + std::cout << "float coordinate_matrix" << std::endl; test_my_matrix, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "double" << std::endl; + std::cout << "double coordinate_matrix" << std::endl; test_my_matrix, 3 > () (); #endif #ifdef USE_STD_COMPLEX #ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate_matrix" << std::endl; test_my_matrix >, 3 > () (); #endif #ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; + std::cout << "std::complex coordinate_matrix" << std::endl; test_my_matrix >, 3 > () (); #endif #endif