2 // Copyright (c) 2000-2002
3 // Joerg Walter, Mathias Koch
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // The authors gratefully acknowledge the support of
10 // GeNeSys mbH & Co. KG in producing this work.
13 #if defined(__GNUC__) && (__GNUC__ >= 9)
14 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
19 template <class V, int N>
20 void test_blas_1<V, N>::test()
28 initialize_vector(v1);
29 n = ublas::blas_1::asum(v1);
30 std::cout << "asum (v1) = " << n << std::endl;
33 initialize_vector(v1);
34 n = ublas::blas_1::amax(v1);
35 std::cout << "amax (v1) = " << n << std::endl;
38 initialize_vector(v1);
39 n = ublas::blas_1::nrm2(v1);
40 std::cout << "nrm2 (v1) = " << n << std::endl;
45 initialize_vector(v1);
46 initialize_vector(v2);
47 t = ublas::blas_1::dot(v1, v2);
48 std::cout << "dot (v1, v2) = " << t << std::endl;
49 t = ublas::blas_1::dot(ublas::conj(v1), v2);
50 std::cout << "dot (conj (v1), v2) = " << t << std::endl;
53 initialize_vector(v2);
54 ublas::blas_1::copy(v1, v2);
55 std::cout << "copy (v1, v2) = " << v1 << std::endl;
58 initialize_vector(v1);
59 initialize_vector(v2);
60 ublas::blas_1::swap(v1, v2);
61 std::cout << "swap (v1, v2) = " << v1 << " " << v2 << std::endl;
66 initialize_vector(v1);
67 ublas::blas_1::scal(v1, value_type(1));
68 std::cout << "scal (v1, 1) = " << v1 << std::endl;
71 initialize_vector(v1);
72 initialize_vector(v2);
73 ublas::blas_1::axpy(v1, value_type(1), v2);
74 std::cout << "axpy (v1, 1, v2) = " << v1 << std::endl;
77 initialize_vector(v1);
78 initialize_vector(v2);
79 ublas::blas_1::rot(value_type(1), v1, value_type(1), v2);
80 std::cout << "rot (1, v1, 1, v2) = " << v1 << " " << v2 << std::endl;
85 template struct test_blas_1<ublas::vector<mp_test_type>, 3>;
89 template struct test_blas_1<ublas::vector<double>, 3>;
92 #ifdef USE_STD_COMPLEX
94 template struct test_blas_1<ublas::vector<std::complex<mp_test_type> >, 3>;
98 template struct test_blas_1<ublas::vector<std::complex<double> >, 3>;