diff --git a/include/boost/numeric/ublas/banded.hpp b/banded.hpp similarity index 100% rename from include/boost/numeric/ublas/banded.hpp rename to banded.hpp diff --git a/bench1/Jamfile.v2 b/bench1/Jamfile.v2 deleted file mode 100644 index 77b11c77..00000000 --- a/bench1/Jamfile.v2 +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2004 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# bench1 - measure the abstraction penalty of dense matrix and vector operations. - -exe bench1 - : bench1.cpp bench11.cpp bench12.cpp bench13.cpp - ; diff --git a/bench1/bench1.cpp b/bench1/bench1.cpp deleted file mode 100644 index 87478e13..00000000 --- a/bench1/bench1.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench1.hpp" - -void header (std::string text) { - std::cout << text << std::endl; -} - -template -struct peak_c_plus { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (0); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s += T (0); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct peak_c_multiplies { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s *= T (1); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -void peak::operator () (int runs) { - header ("peak"); - - header ("plus"); - peak_c_plus () (runs); - - header ("multiplies"); - peak_c_multiplies () (runs); -} - - -template -void do_bench (std::string type_string, int scale) -{ - header (type_string); - peak () (1000000 * scale); - - header (type_string + ", 3"); - bench_1 () (1000000 * scale); - bench_2 () (300000 * scale); - bench_3 () (100000 * scale); - - header (type_string + ", 10"); - bench_1 () (300000 * scale); - bench_2 () (30000 * scale); - bench_3 () (3000 * scale); - - header (type_string + ", 30"); - bench_1 () (100000 * scale); - bench_2 () (3000 * scale); - bench_3 () (100 * scale); - - header (type_string + ", 100"); - bench_1 () (30000 * scale); - bench_2 () (300 * scale); - bench_3 () (3 * scale); -} - -int main (int argc, char *argv []) { - - int scale = 1; - if (argc > 1) - scale = std::atoi (argv [1]); - -#ifdef USE_FLOAT - do_bench ("FLOAT", scale); -#endif - -#ifdef USE_DOUBLE - do_bench ("DOUBLE", scale); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - do_bench > ("COMPLEX", scale); -#endif - -#ifdef USE_DOUBLE - do_bench > ("COMPLEX", scale); -#endif -#endif - - return 0; -} diff --git a/bench1/bench1.hpp b/bench1/bench1.hpp deleted file mode 100644 index 08376c9b..00000000 --- a/bench1/bench1.hpp +++ /dev/null @@ -1,156 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef BENCH1_H -#define BENCH1_H - -#include -#include -#include - -#include -#include - -#include - - -namespace ublas = boost::numeric::ublas; - -void header (std::string text); - -template -struct footer { - void operator () (int multiplies, int plus, int runs, double elapsed) { - std::cout << "elapsed: " << elapsed << " s, " - << (multiplies * ublas::type_traits::multiplies_complexity + - plus * ublas::type_traits::plus_complexity) * runs / - (1024 * 1024 * elapsed) << " Mflops" << std::endl; - } -}; - -template -struct c_vector_traits { - typedef T type [N]; -}; -template -struct c_matrix_traits { - typedef T type [N] [M]; -}; - -template -struct initialize_c_vector { - void operator () (typename c_vector_traits::type &v) { - for (int i = 0; i < N; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_vector (V &v) { - int size = v.size (); - for (int i = 0; i < size; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; -} - -template -struct initialize_c_matrix { - void operator () (typename c_matrix_traits::type &m) { - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - m [i] [j] = std::rand () * 1.f; -// m [i] [j] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_matrix (M &m) { - int size1 = m.size1 (); - int size2 = m.size2 (); - for (int i = 0; i < size1; ++ i) - for (int j = 0; j < size2; ++ j) - m (i, j) = std::rand () * 1.f; -// m (i, j) = 0.f; -} - -template -BOOST_UBLAS_INLINE -void sink_scalar (const T &s) { - static T g_s = s; -} - -template -struct sink_c_vector { - void operator () (const typename c_vector_traits::type &v) { - static typename c_vector_traits::type g_v; - for (int i = 0; i < N; ++ i) - g_v [i] = v [i]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_vector (const V &v) { - static V g_v (v); -} - -template -struct sink_c_matrix { - void operator () (const typename c_matrix_traits::type &m) { - static typename c_matrix_traits::type g_m; - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - g_m [i] [j] = m [i] [j]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_matrix (const M &m) { - static M g_m (m); -} - -template -struct peak { - void operator () (int runs); -}; - -template -struct bench_1 { - void operator () (int runs); -}; - -template -struct bench_2 { - void operator () (int runs); -}; - -template -struct bench_3 { - void operator () (int runs); -}; - -struct safe_tag {}; -struct fast_tag {}; - -//#define USE_FLOAT -#define USE_DOUBLE -// #define USE_STD_COMPLEX - -#define USE_C_ARRAY -// #define USE_BOUNDED_ARRAY -#define USE_UNBOUNDED_ARRAY -// #define USE_STD_VALARRAY -//#define USE_STD_VECTOR - -#endif - - diff --git a/bench1/bench11.cpp b/bench1/bench11.cpp deleted file mode 100644 index 633d8272..00000000 --- a/bench1/bench11.cpp +++ /dev/null @@ -1,285 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench1.hpp" - -template -struct bench_c_inner_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - for (int j = 0; j < N; ++ j) { - s += v1 [j] * v2 [j]; - } -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = ublas::inner_prod (v1, v2); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = (v1 * v2).sum (); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_vector_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2, v3; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v3 [j] = - (v1 [j] + v2 [j]); - } -// sink_c_vector () (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static V v1 (N), v2 (N), v3 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3 = - (v1 + v2); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static V v1 (N), v2 (N), v3 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3.assign (- (v1 + v2)); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N), v3 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3 = - (v1 + v2); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n) -template -void bench_1::operator () (int runs) { - header ("bench_1"); - - header ("inner_prod"); - - header ("C array"); - bench_c_inner_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_vector"); - bench_my_inner_prod, N> () (runs); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_STD_VALARRAY - header ("vector"); - bench_my_inner_prod >, N> () (); -#endif - -#ifdef USE_STD_VECTOR - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_inner_prod, N> () (runs); -#endif - - header ("vector + vector"); - - header ("C array"); - bench_c_vector_add () (runs); - -#ifdef USE_C_ARRAY - header ("c_vector safe"); - bench_my_vector_add, N> () (runs, safe_tag ()); - - header ("c_vector fast"); - bench_my_vector_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_vector_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_DOUBLE -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif -#endif diff --git a/bench1/bench12.cpp b/bench1/bench12.cpp deleted file mode 100644 index 50c57d73..00000000 --- a/bench1/bench12.cpp +++ /dev/null @@ -1,487 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench1.hpp" - -template -struct bench_c_outer_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [j] [k] = - v1 [j] * v2 [k]; - } - } -// sink_c_matrix () (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N); - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m = - ublas::outer_prod (v1, v2); -// sink_matrix (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N); - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m.assign (- ublas::outer_prod (v1, v2)); -// sink_matrix (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [N * j + k] = - v1 [j] * v2 [k]; - } - } -// sink_vector (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_vector_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_matrix () (m); - initialize_c_vector () (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v2 [j] = 0; - for (int k = 0; k < N; ++ k) { - v2 [j] += m [j] [k] * v1 [k]; - } - } -// sink_c_vector () (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N); - static V v1 (N), v2 (N); - initialize_matrix (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v2 = ublas::prod (m, v1); -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N); - static V v1 (N), v2 (N); - initialize_matrix (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v2.assign (ublas::prod (m, v1)); -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m [std::slice (N * j, N, 1)]); - v2 [j] = (row * v1).sum (); - } -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = - (m1 [j] [k] + m2 [j] [k]); - } - } -// sink_c_matrix () (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3.assign (- (m1 + m2)); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_vector (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 2) -template -void bench_2::operator () (int runs) { - header ("bench_2"); - - header ("outer_prod"); - - header ("C array"); - bench_c_outer_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix, c_vector safe"); - bench_my_outer_prod, - ublas::c_vector, N> () (runs, safe_tag ()); - - header ("c_matrix, c_vector fast"); - bench_my_outer_prod, - ublas::c_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_outer_prod, std::valarray, N> () (runs); -#endif - - header ("prod (matrix, vector)"); - - header ("C array"); - bench_c_matrix_vector_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix, c_vector safe"); - bench_my_matrix_vector_prod, - ublas::c_vector, N> () (runs, safe_tag ()); - - header ("c_matrix, c_vector fast"); - bench_my_matrix_vector_prod, - ublas::c_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_vector_prod, std::valarray, N> () (runs); -#endif - - header ("matrix + matrix"); - - header ("C array"); - bench_c_matrix_add () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix safe"); - bench_my_matrix_add, N> () (runs, safe_tag ()); - - header ("c_matrix fast"); - bench_my_matrix_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_DOUBLE -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif -#endif diff --git a/bench1/bench13.cpp b/bench1/bench13.cpp deleted file mode 100644 index fadb0b67..00000000 --- a/bench1/bench13.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench1.hpp" - -template -struct bench_c_matrix_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = 0; - for (int l = 0; l < N; ++ l) { - m3 [j] [k] += m1 [j] [l] * m2 [l] [k]; - } - } - } -// sink_c_matrix () (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = ublas::prod (m1, m2); -// sink_matrix (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3.assign (ublas::prod (m1, m2)); -// sink_matrix (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m1 [std::slice (N * j, N, 1)]); - for (int k = 0; k < N; ++ k) { - std::valarray column (m2 [std::slice (k, N, N)]); - m3 [N * j + k] = (row * column).sum (); - } - } -// sink_vector (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 3) -template -void bench_3::operator () (int runs) { - header ("bench_3"); - - header ("prod (matrix, matrix)"); - - header ("C array"); - bench_c_matrix_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix safe"); - bench_my_matrix_prod, N> () (runs, safe_tag ()); - - header ("c_matrix fast"); - bench_my_matrix_prod, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_prod, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_DOUBLE -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif -#endif diff --git a/bench2/Jamfile.v2 b/bench2/Jamfile.v2 deleted file mode 100644 index 4eb80159..00000000 --- a/bench2/Jamfile.v2 +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2004 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# bench2 - measurs the performance of sparse matrix and vector operations. - -exe bench2 - : bench2.cpp bench21.cpp bench22.cpp bench23.cpp - ; diff --git a/bench2/bench2.cpp b/bench2/bench2.cpp deleted file mode 100644 index 43ba152f..00000000 --- a/bench2/bench2.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench2.hpp" - -void header (std::string text) { - std::cout << text << std::endl; -} - -template -struct peak_c_plus { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (0); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s += T (0); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct peak_c_multiplies { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s *= T (1); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -void peak::operator () (int runs) { - header ("peak"); - - header ("plus"); - peak_c_plus () (runs); - - header ("multiplies"); - peak_c_multiplies () (runs); -} - - -template -void do_bench (std::string type_string, int scale) -{ - header (type_string); - peak () (1000000 * scale); - - header (type_string + ", 3"); - bench_1 () (1000000 * scale); - bench_2 () (300000 * scale); - bench_3 () (100000 * scale); - - header (type_string + ", 10"); - bench_1 () (300000 * scale); - bench_2 () (30000 * scale); - bench_3 () (3000 * scale); - - header (type_string + ", 30"); - bench_1 () (100000 * scale); - bench_2 () (3000 * scale); - bench_3 () (100 * scale); - - header (type_string + ", 100"); - bench_1 () (30000 * scale); - bench_2 () (300 * scale); - bench_3 () (3 * scale); -} - -int main (int argc, char *argv []) { - - int scale = 1; - if (argc > 1) - scale = std::atoi (argv [1]); - -#ifdef USE_FLOAT - do_bench ("FLOAT", scale); -#endif - -#ifdef USE_DOUBLE - do_bench ("DOUBLE", scale); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - do_bench > ("COMPLEX", scale); -#endif - -#ifdef USE_DOUBLE - do_bench > ("COMPLEX", scale); -#endif -#endif - - return 0; -} diff --git a/bench2/bench2.hpp b/bench2/bench2.hpp deleted file mode 100644 index 713fec5f..00000000 --- a/bench2/bench2.hpp +++ /dev/null @@ -1,178 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef BENCH2_H -#define BENCH2_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace ublas = boost::numeric::ublas; - -void header (std::string text); - -template -struct footer { - void operator () (int multiplies, int plus, int runs, double elapsed) { - std::cout << "elapsed: " << elapsed << " s, " - << (multiplies * ublas::type_traits::multiplies_complexity + - plus * ublas::type_traits::plus_complexity) * runs / - (1024 * 1024 * elapsed) << " Mflops" << std::endl; - } -}; - -template -struct c_vector_traits { - typedef T type [N]; -}; -template -struct c_matrix_traits { - typedef T type [N] [M]; -}; - -template -struct initialize_c_vector { - void operator () (typename c_vector_traits::type &v) { - for (int i = 0; i < N; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_vector (V &v) { - int size = v.size (); - for (int i = 0; i < size; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; -} - -template -struct initialize_c_matrix { - void operator () (typename c_matrix_traits::type &m) { - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - m [i] [j] = std::rand () * 1.f; -// m [i] [j] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_matrix (M &m, ublas::row_major_tag) { - int size1 = m.size1 (); - int size2 = m.size2 (); - for (int i = 0; i < size1; ++ i) - for (int j = 0; j < size2; ++ j) - m (i, j) = std::rand () * 1.f; -// m (i, j) = 0.f; -} -template -BOOST_UBLAS_INLINE -void initialize_matrix (M &m, ublas::column_major_tag) { - int size1 = m.size1 (); - int size2 = m.size2 (); - for (int j = 0; j < size2; ++ j) - for (int i = 0; i < size1; ++ i) - m (i, j) = std::rand () * 1.f; -// m (i, j) = 0.f; -} -template -BOOST_UBLAS_INLINE -void initialize_matrix (M &m) { - typedef typename M::orientation_category orientation_category; - initialize_matrix (m, orientation_category ()); -} - -template -BOOST_UBLAS_INLINE -void sink_scalar (const T &s) { - static T g_s = s; -} - -template -struct sink_c_vector { - void operator () (const typename c_vector_traits::type &v) { - static typename c_vector_traits::type g_v; - for (int i = 0; i < N; ++ i) - g_v [i] = v [i]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_vector (const V &v) { - static V g_v (v); -} - -template -struct sink_c_matrix { - void operator () (const typename c_matrix_traits::type &m) { - static typename c_matrix_traits::type g_m; - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - g_m [i] [j] = m [i] [j]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_matrix (const M &m) { - static M g_m (m); -} - -template -struct peak { - void operator () (int runs); -}; - -template -struct bench_1 { - void operator () (int runs); -}; - -template -struct bench_2 { - void operator () (int runs); -}; - -template -struct bench_3 { - void operator () (int runs); -}; - -struct safe_tag {}; -struct fast_tag {}; - -// #define USE_FLOAT -#define USE_DOUBLE -// #define USE_STD_COMPLEX - -#define USE_MAP_ARRAY -// #define USE_STD_MAP -// #define USE_STD_VALARRAY - -#define USE_MAPPED_VECTOR -#define USE_COMPRESSED_VECTOR -#define USE_COORDINATE_VECTOR - -#define USE_MAPPED_MATRIX -// #define USE_SPARSE_VECTOR_OF_SPARSE_VECTOR -#define USE_COMPRESSED_MATRIX -#define USE_COORDINATE_MATRIX - -#endif diff --git a/bench2/bench21.cpp b/bench2/bench21.cpp deleted file mode 100644 index 2cf33326..00000000 --- a/bench2/bench21.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench2.hpp" - -template -struct bench_c_inner_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - for (int j = 0; j < N; ++ j) { - s += v1 [j] * v2 [j]; - } -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N, N), v2 (N, N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = ublas::inner_prod (v1, v2); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = (v1 * v2).sum (); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_vector_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2, v3; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v3 [j] = - (v1 [j] + v2 [j]); - } -// sink_c_vector () (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static V v1 (N, N), v2 (N, N), v3 (N, N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3 = - (v1 + v2); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static V v1 (N, N), v2 (N, N), v3 (N, N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3.assign (- (v1 + v2)); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N), v3 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3 = - (v1 + v2); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n) -template -void bench_1::operator () (int runs) { - header ("bench_1"); - - header ("inner_prod"); - - header ("C array"); - bench_c_inner_prod () (runs); - -#ifdef USE_MAPPED_VECTOR -#ifdef USE_MAP_ARRAY - header ("mapped_vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_STD_MAP - header ("mapped_vector"); - bench_my_inner_prod >, N> () (runs); -#endif -#endif - -#ifdef USE_COMPRESSED_VECTOR - header ("compressed_vector"); - bench_my_inner_prod, N> () (runs); -#endif - -#ifdef USE_COORDINATE_VECTOR - header ("coordinate_vector"); - bench_my_inner_prod, N> () (runs); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_inner_prod, N> () (runs); -#endif - - header ("vector + vector"); - - header ("C array"); - bench_c_vector_add () (runs); - -#ifdef USE_MAPPED_VECTOR -#ifdef USE_MAP_ARRAY - header ("mapped_vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("maped_vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_MAP - header ("mapped_vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("mapped_vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COMPRESSED_VECTOR -#ifdef USE_MAP_ARRAY - header ("compressed_vector safe"); - bench_my_vector_add, N> () (runs, safe_tag ()); - - header ("compressed_vector fast"); - bench_my_vector_add, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COORDINATE_VECTOR -#ifdef USE_MAP_ARRAY - header ("coordinate_vector safe"); - bench_my_vector_add, N> () (runs, safe_tag ()); - - header ("coordinate_vector fast"); - bench_my_vector_add, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_vector_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_DOUBLE -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif -#endif diff --git a/bench2/bench22.cpp b/bench2/bench22.cpp deleted file mode 100644 index ce054786..00000000 --- a/bench2/bench22.cpp +++ /dev/null @@ -1,465 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench2.hpp" - -template -struct bench_c_outer_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [j] [k] = - v1 [j] * v2 [k]; - } - } -// sink_c_matrix () (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N, N * N); - static V v1 (N, N), v2 (N, N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m = - ublas::outer_prod (v1, v2); -// sink_matrix (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N, N * N); - static V v1 (N, N), v2 (N, N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m.assign (- ublas::outer_prod (v1, v2)); -// sink_matrix (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [N * j + k] = - v1 [j] * v2 [k]; - } - } -// sink_vector (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_vector_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_matrix () (m); - initialize_c_vector () (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v2 [j] = 0; - for (int k = 0; k < N; ++ k) { - v2 [j] += m [j] [k] * v1 [k]; - } - } -// sink_c_vector () (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N, N * N); - static V v1 (N, N), v2 (N, N); - initialize_matrix (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v2 = ublas::prod (m, v1); -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N, N * N); - static V v1 (N, N), v2 (N, N); - initialize_matrix (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v2.assign (ublas::prod (m, v1)); -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m [std::slice (N * j, N, 1)]); - v2 [j] = (row * v1).sum (); - } -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = - (m1 [j] [k] + m2 [j] [k]); - } - } -// sink_c_matrix () (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m1 (N, N, N * N), m2 (N, N, N * N), m3 (N, N, N * N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m1 (N, N, N * N), m2 (N, N, N * N), m3 (N, N, N * N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3.assign (- (m1 + m2)); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_vector (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 2) -template -void bench_2::operator () (int runs) { - header ("bench_2"); - - header ("outer_prod"); - - header ("C array"); - bench_c_outer_prod () (runs); - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY - header ("sparse_matrix, sparse_vector safe"); - bench_my_outer_prod >, - ublas::sparse_vector >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_vector fast"); - bench_my_outer_prod >, - ublas::sparse_vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_MAP - header ("sparse_matrix, sparse_vector safe"); - bench_my_outer_prod >, - ublas::sparse_vector >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_vector fast"); - bench_my_outer_prod >, - ublas::sparse_vector >, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX - header ("compressed_matrix, compressed_vector safe"); - bench_my_outer_prod, - ublas::compressed_vector, N> () (runs, safe_tag ()); - - header ("compressed_matrix, compressed_vector fast"); - bench_my_outer_prod, - ublas::compressed_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_COORDINATE_MATRIX - header ("coordinate_matrix, coordinate_vector safe"); - bench_my_outer_prod, - ublas::coordinate_vector, N> () (runs, safe_tag ()); - - header ("coordinate_matrix, coordinate_vector fast"); - bench_my_outer_prod, - ublas::coordinate_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_outer_prod, std::valarray, N> () (runs); -#endif - - header ("prod (matrix, vector)"); - - header ("C array"); - bench_c_matrix_vector_prod () (runs); - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY - header ("sparse_matrix, sparse_vector safe"); - bench_my_matrix_vector_prod >, - ublas::sparse_vector >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_vector fast"); - bench_my_matrix_vector_prod >, - ublas::sparse_vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_MAP - header ("sparse_matrix, sparse_vector safe"); - bench_my_matrix_vector_prod >, - ublas::sparse_vector >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_vector fast"); - bench_my_matrix_vector_prod >, - ublas::sparse_vector >, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX - header ("compressed_matrix, compressed_vector safe"); - bench_my_matrix_vector_prod, - ublas::compressed_vector, N> () (runs, safe_tag ()); - - header ("compressed_matrix, compressed_vector fast"); - bench_my_matrix_vector_prod, - ublas::compressed_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_COORDINATE_MATRIX - header ("coordinate_matrix, coordinate_vector safe"); - bench_my_matrix_vector_prod, - ublas::coordinate_vector, N> () (runs, safe_tag ()); - - header ("coordinate_matrix, coordinate_vector fast"); - bench_my_matrix_vector_prod, - ublas::coordinate_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_vector_prod, std::valarray, N> () (runs); -#endif - - header ("matrix + matrix"); - - header ("C array"); - bench_c_matrix_add () (runs); - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY - header ("sparse_matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("sparse_matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_MAP - header ("sparse_matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("sparse_matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX - header ("compressed_matrix safe"); - bench_my_matrix_add, N> () (runs, safe_tag ()); - - header ("compressed_matrix fast"); - bench_my_matrix_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_COORDINATE_MATRIX - header ("coordinate_matrix safe"); - bench_my_matrix_add, N> () (runs, safe_tag ()); - - header ("coordinate_matrix fast"); - bench_my_matrix_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_DOUBLE -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif -#endif diff --git a/bench2/bench23.cpp b/bench2/bench23.cpp deleted file mode 100644 index bb363f53..00000000 --- a/bench2/bench23.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench2.hpp" - -template -struct bench_c_matrix_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = 0; - for (int l = 0; l < N; ++ l) { - m3 [j] [k] += m1 [j] [l] * m2 [l] [k]; - } - } - } -// sink_c_matrix () (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_prod { - typedef typename M1::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M1 m1 (N, N, N * N), m3 (N, N, N * N); - static M2 m2 (N, N, N * N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = ublas::prod (m1, m2); -// sink_matrix (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M1 m1 (N, N, N * N), m3 (N, N, N * N); - static M2 m2 (N, N, N * N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3.assign (ublas::prod (m1, m2)); -// sink_matrix (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m1 [std::slice (N * j, N, 1)]); - for (int k = 0; k < N; ++ k) { - std::valarray column (m2 [std::slice (k, N, N)]); - m3 [N * j + k] = (row * column).sum (); - } - } -// sink_vector (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 3) -template -void bench_3::operator () (int runs) { - header ("bench_3"); - - header ("prod (matrix, matrix)"); - - header ("C array"); - bench_c_matrix_prod () (runs); - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY - header ("sparse_matrix, sparse_matrix safe"); - bench_my_matrix_prod >, - ublas::sparse_matrix >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_matrix fast"); - bench_my_matrix_prod >, - ublas::sparse_matrix >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_MAP - header ("sparse_matrix, sparse_matrix safe"); - bench_my_matrix_prod >, - ublas::sparse_matrix >, N> () (runs, safe_tag ()); - - header ("sparse_matrix, sparse_matrix fast"); - bench_my_matrix_prod >, - ublas::sparse_matrix >, N> () (runs, fast_tag ()); -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX - header ("compressed_matrix, compressed_matrix safe"); - bench_my_matrix_prod, - ublas::compressed_matrix, N> () (runs, safe_tag ()); - - header ("compressed_matrix, compressed_matrix fast"); - bench_my_matrix_prod, - ublas::compressed_matrix, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_COORDINATE_MATRIX - header ("coordinate_matrix, coordinate_matrix safe"); - bench_my_matrix_prod, - ublas::coordinate_matrix, N> () (runs, safe_tag ()); - - header ("coordinate_matrix, coordinate_matrix fast"); - bench_my_matrix_prod, - ublas::coordinate_matrix, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_prod, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_DOUBLE -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif -#endif diff --git a/bench3/Jamfile.v2 b/bench3/Jamfile.v2 deleted file mode 100644 index 7ce9c9b8..00000000 --- a/bench3/Jamfile.v2 +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2004 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# bench3 - measure the performance of vector and matrix proxy's operations. - -exe bench3 - : bench3.cpp bench31.cpp bench32.cpp bench33.cpp - ; diff --git a/bench3/bench3.cpp b/bench3/bench3.cpp deleted file mode 100644 index 390d226c..00000000 --- a/bench3/bench3.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench3.hpp" - -void header (std::string text) { - std::cout << text << std::endl; -} - -template -struct peak_c_plus { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (0); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s += T (0); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct peak_c_multiplies { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s *= T (1); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -void peak::operator () (int runs) { - header ("peak"); - - header ("plus"); - peak_c_plus () (runs); - - header ("multiplies"); - peak_c_multiplies () (runs); -} - - -template -void do_bench (std::string type_string, int scale) -{ - header (type_string); - peak () (1000000 * scale); - - header (type_string + ", 3"); - bench_1 () (1000000 * scale); - bench_2 () (300000 * scale); - bench_3 () (100000 * scale); - - header (type_string + ", 10"); - bench_1 () (300000 * scale); - bench_2 () (30000 * scale); - bench_3 () (3000 * scale); - - header (type_string + ", 30"); - bench_1 () (100000 * scale); - bench_2 () (3000 * scale); - bench_3 () (100 * scale); - - header (type_string + ", 100"); - bench_1 () (30000 * scale); - bench_2 () (300 * scale); - bench_3 () (3 * scale); -} - -int main (int argc, char *argv []) { - - int scale = 1; - if (argc > 1) - scale = std::atoi (argv [1]); - -#ifdef USE_FLOAT - do_bench ("FLOAT", scale); -#endif - -#ifdef USE_DOUBLE - do_bench ("DOUBLE", scale); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - do_bench > ("COMPLEX", scale); -#endif - -#ifdef USE_DOUBLE - do_bench > ("COMPLEX", scale); -#endif -#endif - - return 0; -} diff --git a/bench3/bench3.hpp b/bench3/bench3.hpp deleted file mode 100644 index 4959348a..00000000 --- a/bench3/bench3.hpp +++ /dev/null @@ -1,155 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef BENCH3_H -#define BENCH3_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace ublas = boost::numeric::ublas; - -void header (std::string text); - -template -struct footer { - void operator () (int multiplies, int plus, int runs, double elapsed) { - std::cout << "elapsed: " << elapsed << " s, " - << (multiplies * ublas::type_traits::multiplies_complexity + - plus * ublas::type_traits::plus_complexity) * runs / - (1024 * 1024 * elapsed) << " Mflops" << std::endl; - } -}; - -template -struct c_vector_traits { - typedef T type [N]; -}; -template -struct c_matrix_traits { - typedef T type [N] [M]; -}; - -template -struct initialize_c_vector { - void operator () (typename c_vector_traits::type &v) { - for (int i = 0; i < N; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_vector (V &v) { - int size = v.size (); - for (int i = 0; i < size; ++ i) - v [i] = std::rand () * 1.f; -// v [i] = 0.f; -} - -template -struct initialize_c_matrix { - void operator () (typename c_matrix_traits::type &m) { - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - m [i] [j] = std::rand () * 1.f; -// m [i] [j] = 0.f; - } -}; -template -BOOST_UBLAS_INLINE -void initialize_matrix (M &m) { - int size1 = m.size1 (); - int size2 = m.size2 (); - for (int i = 0; i < size1; ++ i) - for (int j = 0; j < size2; ++ j) - m (i, j) = std::rand () * 1.f; -// m (i, j) = 0.f; -} - -template -BOOST_UBLAS_INLINE -void sink_scalar (const T &s) { - static T g_s = s; -} - -template -struct sink_c_vector { - void operator () (const typename c_vector_traits::type &v) { - static typename c_vector_traits::type g_v; - for (int i = 0; i < N; ++ i) - g_v [i] = v [i]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_vector (const V &v) { - static V g_v (v); -} - -template -struct sink_c_matrix { - void operator () (const typename c_matrix_traits::type &m) { - static typename c_matrix_traits::type g_m; - for (int i = 0; i < N; ++ i) - for (int j = 0; j < M; ++ j) - g_m [i] [j] = m [i] [j]; - } -}; -template -BOOST_UBLAS_INLINE -void sink_matrix (const M &m) { - static M g_m (m); -} - -template -struct peak { - void operator () (int runs); -}; - -template -struct bench_1 { - void operator () (int runs); -}; - -template -struct bench_2 { - void operator () (int runs); -}; - -template -struct bench_3 { - void operator () (int runs); -}; - -struct safe_tag {}; -struct fast_tag {}; - -// #define USE_FLOAT -#define USE_DOUBLE -// #define USE_STD_COMPLEX - -#define USE_C_ARRAY -// #define USE_BOUNDED_ARRAY -#define USE_UNBOUNDED_ARRAY -// #define USE_STD_VALARRAY -#define USE_STD_VECTOR - -#endif diff --git a/bench3/bench31.cpp b/bench3/bench31.cpp deleted file mode 100644 index 66ca7802..00000000 --- a/bench3/bench31.cpp +++ /dev/null @@ -1,294 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench3.hpp" - -template -struct bench_c_inner_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - for (int j = 0; j < N; ++ j) { - s += v1 [j] * v2 [j]; - } -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)); - initialize_vector (vr1); - initialize_vector (vr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = ublas::inner_prod (vr1, vr2); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_inner_prod { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - static value_type s (0); - s = (v1 * v2).sum (); -// sink_scalar (s); - } - footer () (N, N - 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_vector_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_vector_traits::type v1, v2, v3; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v3 [j] = - (v1 [j] + v2 [j]); - } -// sink_c_vector () (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static V v1 (N), v2 (N), v3 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)), - vr3 (v2, ublas::range (0, N)); - initialize_vector (vr1); - initialize_vector (vr2); - initialize_vector (vr3); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - vr3 = - (vr1 + vr2); -// sink_vector (vr3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static V v1 (N), v2 (N), v3 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)), - vr3 (v2, ublas::range (0, N)); - initialize_vector (vr1); - initialize_vector (vr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - vr3.assign (- (vr1 + vr2)); -// sink_vector (vr3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_vector_add { - typedef typename V::value_type value_type; - - void operator () (int runs) const { - try { - static V v1 (N), v2 (N), v3 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - v3 = - (v1 + v2); -// sink_vector (v3); - } - footer () (0, 2 * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n) -template -void bench_1::operator () (int runs) { - header ("bench_1"); - - header ("inner_prod"); - - header ("C array"); - bench_c_inner_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_vector"); - bench_my_inner_prod, N> () (runs); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_STD_VALARRAY - header ("vector"); - bench_my_inner_prod >, N> () (); -#endif - -#ifdef USE_STD_VECTOR - header ("vector"); - bench_my_inner_prod >, N> () (runs); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_inner_prod, N> () (runs); -#endif - - header ("vector + vector"); - - header ("C array"); - bench_c_vector_add () (runs); - -#ifdef USE_C_ARRAY - header ("c_vector safe"); - bench_my_vector_add, N> () (runs, safe_tag ()); - - header ("c_vector fast"); - bench_my_vector_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("vector safe"); - bench_my_vector_add >, N> () (runs, safe_tag ()); - - header ("vector fast"); - bench_my_vector_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_vector_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_DOUBLE -template struct bench_1; -template struct bench_1; -template struct bench_1; -template struct bench_1; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif -#endif diff --git a/bench3/bench32.cpp b/bench3/bench32.cpp deleted file mode 100644 index 4c1b2bc3..00000000 --- a/bench3/bench32.cpp +++ /dev/null @@ -1,499 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench3.hpp" - -template -struct bench_c_outer_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_vector () (v1); - initialize_c_vector () (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [j] [k] = - v1 [j] * v2 [k]; - } - } -// sink_c_matrix () (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N); - ublas::matrix_range mr (m, ublas::range (0, N), ublas::range (0, N)); - static V v1 (N), v2 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)); - initialize_vector (vr1); - initialize_vector (vr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - mr = - ublas::outer_prod (vr1, vr2); -// sink_matrix (mr); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N); - ublas::matrix_range mr (m, ublas::range (0, N), ublas::range (0, N)); - static V v1 (N), v2 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)); - initialize_vector (vr1); - initialize_vector (vr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - mr.assign (- ublas::outer_prod (vr1, vr2)); -// sink_matrix (mr); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_outer_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (v1); - initialize_vector (v2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m [N * j + k] = - v1 [j] * v2 [k]; - } - } -// sink_vector (m); - } - footer () (N * N, N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_vector_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m; - static typename c_vector_traits::type v1, v2; - initialize_c_matrix () (m); - initialize_c_vector () (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - v2 [j] = 0; - for (int k = 0; k < N; ++ k) { - v2 [j] += m [j] [k] * v1 [k]; - } - } -// sink_c_vector () (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m (N, N); - ublas::matrix_range mr (m, ublas::range (0, N), ublas::range (0, N)); - static V v1 (N), v2 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)); - initialize_matrix (mr); - initialize_vector (vr1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - vr2 = ublas::prod (mr, vr1); -// sink_vector (vr2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m (N, N); - ublas::matrix_range mr (m, ublas::range (0, N), ublas::range (0, N)); - static V v1 (N), v2 (N); - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)); - initialize_matrix (mr); - initialize_vector (vr1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - vr2.assign (ublas::prod (mr, vr1)); -// sink_vector (vr2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_vector_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m (N * N); - static V v1 (N), v2 (N); - initialize_vector (m); - initialize_vector (v1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m [std::slice (N * j, N, 1)]); - v2 [j] = (row * v1).sum (); - } -// sink_vector (v2); - } - footer () (N * N, N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -struct bench_c_matrix_add { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = - (m1 [j] [k] + m2 [j] [k]); - } - } -// sink_c_matrix () (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - initialize_matrix (m1); - initialize_matrix (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3.assign (- (m1 + m2)); -// sink_matrix (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_add { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - m3 = - (m1 + m2); -// sink_vector (m3); - } - footer () (0, 2 * N * N, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 2) -template -void bench_2::operator () (int runs) { - header ("bench_2"); - - header ("outer_prod"); - - header ("C array"); - bench_c_outer_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix, c_vector safe"); - bench_my_outer_prod, - ublas::c_vector, N> () (runs, safe_tag ()); - - header ("c_matrix, c_vector fast"); - bench_my_outer_prod, - ublas::c_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix, vector safe"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_outer_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_outer_prod, std::valarray, N> () (runs); -#endif - - header ("prod (matrix, vector)"); - - header ("C array"); - bench_c_matrix_vector_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix, c_vector safe"); - bench_my_matrix_vector_prod, - ublas::c_vector, N> () (runs, safe_tag ()); - - header ("c_matrix, c_vector fast"); - bench_my_matrix_vector_prod, - ublas::c_vector, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix, vector safe"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, safe_tag ()); - - header ("matrix, vector fast"); - bench_my_matrix_vector_prod >, - ublas::vector >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_vector_prod, std::valarray, N> () (runs); -#endif - - header ("matrix + matrix"); - - header ("C array"); - bench_c_matrix_add () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix safe"); - bench_my_matrix_add, N> () (runs, safe_tag ()); - - header ("c_matrix fast"); - bench_my_matrix_add, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix safe"); - bench_my_matrix_add >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_add >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_add, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_DOUBLE -template struct bench_2; -template struct bench_2; -template struct bench_2; -template struct bench_2; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif -#endif diff --git a/bench3/bench33.cpp b/bench3/bench33.cpp deleted file mode 100644 index 9b8e1070..00000000 --- a/bench3/bench33.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "bench3.hpp" - -template -struct bench_c_matrix_prod { - typedef T value_type; - - void operator () (int runs) const { - try { - static typename c_matrix_traits::type m1, m2, m3; - initialize_c_matrix () (m1); - initialize_c_matrix () (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - for (int k = 0; k < N; ++ k) { - m3 [j] [k] = 0; - for (int l = 0; l < N; ++ l) { - m3 [j] [k] += m1 [j] [l] * m2 [l] [k]; - } - } - } -// sink_c_matrix () (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_my_matrix_prod { - typedef typename M::value_type value_type; - - void operator () (int runs, safe_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - initialize_matrix (mr1); - initialize_matrix (mr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - mr3 = ublas::prod (mr1, mr2); -// sink_matrix (mr3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } - void operator () (int runs, fast_tag) const { - try { - static M m1 (N, N), m2 (N, N), m3 (N, N); - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - initialize_matrix (mr1); - initialize_matrix (mr2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - mr3.assign (ublas::prod (mr1, mr2)); -// sink_matrix (mr3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct bench_cpp_matrix_prod { - typedef typename M::value_type value_type; - - void operator () (int runs) const { - try { - static M m1 (N * N), m2 (N * N), m3 (N * N); - initialize_vector (m1); - initialize_vector (m2); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - for (int j = 0; j < N; ++ j) { - std::valarray row (m1 [std::slice (N * j, N, 1)]); - for (int k = 0; k < N; ++ k) { - std::valarray column (m2 [std::slice (k, N, N)]); - m3 [N * j + k] = (row * column).sum (); - } - } -// sink_vector (m3); - } - footer () (N * N * N, N * N * (N - 1), runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -// Benchmark O (n ^ 3) -template -void bench_3::operator () (int runs) { - header ("bench_3"); - - header ("prod (matrix, matrix)"); - - header ("C array"); - bench_c_matrix_prod () (runs); - -#ifdef USE_C_ARRAY - header ("c_matrix safe"); - bench_my_matrix_prod, N> () (runs, safe_tag ()); - - header ("c_matrix fast"); - bench_my_matrix_prod, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_BOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_UNBOUNDED_ARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VECTOR - header ("matrix safe"); - bench_my_matrix_prod >, N> () (runs, safe_tag ()); - - header ("matrix fast"); - bench_my_matrix_prod >, N> () (runs, fast_tag ()); -#endif - -#ifdef USE_STD_VALARRAY - header ("std::valarray"); - bench_cpp_matrix_prod, N> () (runs); -#endif -} - -#ifdef USE_FLOAT -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_DOUBLE -template struct bench_3; -template struct bench_3; -template struct bench_3; -template struct bench_3; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif -#endif diff --git a/bench4/Jamfile.v2 b/bench4/Jamfile.v2 deleted file mode 100644 index 94a9f070..00000000 --- a/bench4/Jamfile.v2 +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2004 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# bench4 measurs the abstraction penalty of dense matrix and vector -# operations with boost::numeric::interval(s). - -exe bench4 - : bench4.cpp bench41.cpp bench42.cpp bench43.cpp - : BOOST_UBLAS_USE_INTERVAL - ; diff --git a/bench4/bench4.cpp b/bench4/bench4.cpp deleted file mode 100644 index 6d460eb1..00000000 --- a/bench4/bench4.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include "../bench1/bench1.hpp" - -void header (std::string text) { - std::cout << text << std::endl; -} - -template -struct peak_c_plus { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (0); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s += T (0); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; -template -struct peak_c_multiplies { - typedef T value_type; - - void operator () (int runs) const { - try { - static T s (1); - boost::timer t; - for (int i = 0; i < runs; ++ i) { - s *= T (1); -// sink_scalar (s); - } - footer () (0, 1, runs, t.elapsed ()); - } - catch (std::exception &e) { - std::cout << e.what () << std::endl; - } - } -}; - -template -void peak::operator () (int runs) { - header ("peak"); - - header ("plus"); - peak_c_plus () (runs); - - header ("multiplies"); - peak_c_multiplies () (runs); -} - -template struct peak >; -template struct peak >; - -#ifdef USE_BOOST_COMPLEX - -template struct peak > >; -template struct peak > >; - -#endif - - - -template -void do_bench (std::string type_string, int scale) -{ - header (type_string); - peak () (1000000 * scale); - - header (type_string + ", 3"); - bench_1 () (1000000 * scale); - bench_2 () (300000 * scale); - bench_3 () (100000 * scale); - - header (type_string + ", 10"); - bench_1 () (300000 * scale); - bench_2 () (30000 * scale); - bench_3 () (3000 * scale); - - header (type_string + ", 30"); - bench_1 () (100000 * scale); - bench_2 () (3000 * scale); - bench_3 () (100 * scale); - - header (type_string + ", 100"); - bench_1 () (30000 * scale); - bench_2 () (300 * scale); - bench_3 () (3 * scale); -} - -int main (int argc, char *argv []) { - - int scale = 1; - if (argc > 1) - scale = std::atoi (argv [1]); - -#ifdef USE_FLOAT - do_bench > ("boost::numeric::interval", scale); -#endif - -#ifdef USE_DOUBLE - do_bench > ("boost::numeric::interval", scale); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - do_bench > > ("boost::numeric::interval>", scale); -#endif - -#ifdef USE_DOUBLE - do_bench > > ("boost::numeric::interval>", scale); -#endif -#endif - - return 0; -} diff --git a/bench4/bench41.cpp b/bench4/bench41.cpp deleted file mode 100644 index 2ef2d696..00000000 --- a/bench4/bench41.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include "../bench1/bench11.cpp" - - -#ifdef USE_FLOAT -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_1, 3>; -template struct bench_1, 10>; -template struct bench_1, 30>; -template struct bench_1, 100>; -#endif - -#ifdef USE_BOOST_COMPLEX -#ifdef USE_FLOAT -template struct bench_1 >, 3>; -template struct bench_1 >, 10>; -template struct bench_1 >, 30>; -template struct bench_1 >, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_1 >, 3>; -template struct bench_1 >, 10>; -template struct bench_1 >, 30>; -template struct bench_1 >, 100>; -#endif -#endif diff --git a/bench4/bench42.cpp b/bench4/bench42.cpp deleted file mode 100644 index 55f9060b..00000000 --- a/bench4/bench42.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include "../bench1/bench12.cpp" - - -#ifdef USE_FLOAT -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_2, 3>; -template struct bench_2, 10>; -template struct bench_2, 30>; -template struct bench_2, 100>; -#endif - -#ifdef USE_BOOST_COMPLEX -#ifdef USE_FLOAT -template struct bench_2 >, 3>; -template struct bench_2 >, 10>; -template struct bench_2 >, 30>; -template struct bench_2 >, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_2 >, 3>; -template struct bench_2 >, 10>; -template struct bench_2 >, 30>; -template struct bench_2 >, 100>; -#endif -#endif diff --git a/bench4/bench43.cpp b/bench4/bench43.cpp deleted file mode 100644 index c39655a4..00000000 --- a/bench4/bench43.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include "../bench1/bench13.cpp" - - -#ifdef USE_FLOAT -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_3, 3>; -template struct bench_3, 10>; -template struct bench_3, 30>; -template struct bench_3, 100>; -#endif - -#ifdef USE_BOOST_COMPLEX -#ifdef USE_FLOAT -template struct bench_3 >, 3>; -template struct bench_3 >, 10>; -template struct bench_3 >, 30>; -template struct bench_3 >, 100>; -#endif - -#ifdef USE_DOUBLE -template struct bench_3 >, 3>; -template struct bench_3 >, 10>; -template struct bench_3 >, 30>; -template struct bench_3 >, 100>; -#endif -#endif diff --git a/include/boost/numeric/ublas/blas.hpp b/blas.hpp similarity index 100% rename from include/boost/numeric/ublas/blas.hpp rename to blas.hpp diff --git a/include/boost/numeric/ublas/detail/concepts.hpp b/detail/concepts.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/concepts.hpp rename to detail/concepts.hpp diff --git a/include/boost/numeric/ublas/detail/config.hpp b/detail/config.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/config.hpp rename to detail/config.hpp diff --git a/include/boost/numeric/ublas/detail/definitions.hpp b/detail/definitions.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/definitions.hpp rename to detail/definitions.hpp diff --git a/include/boost/numeric/ublas/detail/documentation.hpp b/detail/documentation.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/documentation.hpp rename to detail/documentation.hpp diff --git a/include/boost/numeric/ublas/detail/duff.hpp b/detail/duff.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/duff.hpp rename to detail/duff.hpp diff --git a/include/boost/numeric/ublas/detail/iterator.hpp b/detail/iterator.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/iterator.hpp rename to detail/iterator.hpp diff --git a/include/boost/numeric/ublas/detail/matrix_assign.hpp b/detail/matrix_assign.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/matrix_assign.hpp rename to detail/matrix_assign.hpp diff --git a/include/boost/numeric/ublas/detail/raw.hpp b/detail/raw.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/raw.hpp rename to detail/raw.hpp diff --git a/include/boost/numeric/ublas/detail/returntype_deduction.hpp b/detail/returntype_deduction.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/returntype_deduction.hpp rename to detail/returntype_deduction.hpp diff --git a/include/boost/numeric/ublas/detail/temporary.hpp b/detail/temporary.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/temporary.hpp rename to detail/temporary.hpp diff --git a/include/boost/numeric/ublas/detail/vector_assign.hpp b/detail/vector_assign.hpp similarity index 100% rename from include/boost/numeric/ublas/detail/vector_assign.hpp rename to detail/vector_assign.hpp diff --git a/doc/Release_notes.txt b/doc/Release_notes.txt deleted file mode 100644 index 621ef4b1..00000000 --- a/doc/Release_notes.txt +++ /dev/null @@ -1,16 +0,0 @@ -UBLAS -~~~~~ - -Copyright (c) 2000-2004 Joerg Walter, Mathias Koch - -Distributed under the Boost Software License, Version 1.0. (See -accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) - -1.35.0 - Updated all files to BSL v1 with permission of the authors. - -PRE 1.34.0 - FIX size_type and difference_type can be non defaults and uBLAS - expressions use the correct types. - \ No newline at end of file diff --git a/doc/banded.htm b/doc/banded.htm deleted file mode 100644 index a9bb1aaf..00000000 --- a/doc/banded.htm +++ /dev/null @@ -1,580 +0,0 @@ - - - - - - - - - -Banded Matrix - - -

Banded Matrix

-
-

Banded Matrix

-

Description

-

The templated class banded_matrix<T, F, A> is -the base container adaptor for banded matrices. For a (m x -n)-dimensional banded matrix with l lower and -u upper diagonals and 0 <= i < m, 0 -<= j < n holds bi, j = -0, if i > j + l or i < j - u. The -storage of banded matrices is packed.

-

Example

-
-#include <boost/numeric/ublas/banded.hpp>
-#include <boost/numeric/ublas/io.hpp>
-
-int main () {
-    using namespace boost::numeric::ublas;
-    banded_matrix<double> m (3, 3, 1, 1);
-    for (signed i = 0; i < signed (m.size1 ()); ++ i)
-        for (signed j = std::max (i - 1, 0); j < std::min (i + 2, signed (m.size2 ())); ++ j)
-            m (i, j) = 3 * i + j;
-    std::cout << m << std::endl;
-}
-
-

Definition

-

Defined in the header banded.hpp.

-

Template parameters

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionDefault
TThe type of object stored in the matrix.
FFunctor describing the storage organization. [1]row_major
AThe type of the adapted array. [2]unbounded_array<T>
-

Model of

-

Matrix .

-

Type requirements

-

None, except for those imposed by the requirements of Matrix .

-

Public base classes

-

matrix_container<banded_matrix<T, F, A> ->

-

Members

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
banded_matrix ()Allocates an uninitialized banded_matrix that -holds zero rows of zero elements.
banded_matrix (size_type size1, size_type size2, -size_type lower = 0, size_type upper = 0)Allocates an uninitialized banded_matrix that -holds (lower + 1 + upper) diagonals around the main -diagonal of a matrix with size1 rows of -size2 elements.
banded_matrix (const banded_matrix &m)The copy constructor.
template<class AE>
-banded_matrix (const matrix_expression<AE> -&ae)
The extended copy constructor.
void resize (size_type size1, size_type size2, size_type -lower = 0, size_type upper = 0, bool preserve = true)Reallocates a banded_matrix to hold (lower + -1 + upper) diagonals around the main diagonal of a matrix -with size1 rows of size2 elements. The -existing elements of the banded_matrix are preseved -when specified.
size_type size1 () constReturns the number of rows.
size_type size2 () constReturns the number of columns.
size_type lower () constReturns the number of diagonals below the main diagonal.
size_type upper () constReturns the number of diagonals above the main diagonal.
const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
banded_matrix &operator = (const banded_matrix -&m)The assignment operator.
banded_matrix &assign_temporary (banded_matrix -&m)Assigns a temporary. May change the banded matrix -m .
template<class AE>
-banded_matrix &operator = (const matrix_expression<AE> -&ae)
The extended assignment operator.
template<class AE>
-banded_matrix &assign (const matrix_expression<AE> -&ae)
Assigns a matrix expression to the banded matrix. Left and -right hand side of the assignment should be independent.
template<class AE>
-banded_matrix &operator += (const matrix_expression<AE> -&ae)
A computed assignment operator. Adds the matrix expression to -the banded matrix.
template<class AE>
-banded_matrix &plus_assign (const matrix_expression<AE> -&ae)
Adds a matrix expression to the banded matrix. Left and right -hand side of the assignment should be independent.
template<class AE>
-banded_matrix &operator -= (const matrix_expression<AE> -&ae)
A computed assignment operator. Subtracts the matrix expression -from the banded matrix.
template<class AE>
-banded_matrix &minus_assign (const matrix_expression<AE> -&ae)
Subtracts a matrix expression from the banded matrix. Left and -right hand side of the assignment should be independent.
template<class AT>
-banded_matrix &operator *= (const AT &at)
A computed assignment operator. Multiplies the banded matrix -with a scalar.
template<class AT>
-banded_matrix &operator /= (const AT &at)
A computed assignment operator. Divides the banded matrix -through a scalar.
void swap (banded_matrix &m)Swaps the contents of the banded matrices.
void insert (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row.
void erase (size_type i, size_type j)Erases the value at the j-th elemenst of the -i-th row.
void clear ()Clears the matrix.
const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the banded_matrix.
const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the banded_matrix.
iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the banded_matrix.
iterator1 end1 ()Returns a iterator1 pointing to the end of the -banded_matrix.
const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the banded_matrix.
const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the banded_matrix.
iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the banded_matrix.
iterator2 end2 ()Returns a iterator2 pointing to the end of the -banded_matrix.
const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed banded_matrix.
const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed banded_matrix.
reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed banded_matrix.
reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed banded_matrix.
const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed banded_matrix.
const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed banded_matrix.
reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed banded_matrix.
reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed banded_matrix.
-

Notes

-

[1] Supported -parameters for the storage organization are row_major -and column_major.

-

[2] Supported -parameters for the adapted array are -unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

-

Banded Adaptor

-

Description

-

The templated class banded_adaptor<M> is a -banded matrix adaptor for other matrices.

-

Example

-
-#include <boost/numeric/ublas/banded.hpp>
-#include <boost/numeric/ublas/io.hpp>
-
-int main () {
-    using namespace boost::numeric::ublas;
-    matrix<double> m (3, 3);
-    banded_adaptor<matrix<double> > ba (m, 1, 1);
-    for (signed i = 0; i < signed (ba.size1 ()); ++ i)
-        for (signed j = std::max (i - 1, 0); j < std::min (i + 2, signed (ba.size2 ())); ++ j)
-            ba (i, j) = 3 * i + j;
-    std::cout << ba << std::endl;
-}
-
-

Definition

-

Defined in the header banded.hpp.

-

Template parameters

- - - - - - - - - - - - - -
ParameterDescriptionDefault
MThe type of the adapted matrix.
-

Model of

-

Matrix Expression -.

-

Type requirements

-

None, except for those imposed by the requirements of Matrix Expression .

-

Public base classes

-

matrix_expression<banded_adaptor<M> ->

-

Members

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
banded_adaptor (matrix_type &data, size_type lower = -0, size_type upper = 0)Constructs a banded_adaptor that holds -(lower + 1 + upper) diagonals around the main diagonal -of a matrix.
banded_adaptor (const banded_adaptor &m)The copy constructor.
template<class AE>
-banded_adaptor (const matrix_expression<AE> -&ae)
The extended copy constructor.
size_type size1 () constReturns the number of rows.
size_type size2 () constReturns the number of columns.
size_type lower () constReturns the number of diagonals below the main diagonal.
size_type upper () constReturns the number of diagonals above the main diagonal.
const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
banded_adaptor &operator = (const banded_adaptor -&m)The assignment operator.
banded_adaptor &assign_temporary (banded_adaptor -&m)Assigns a temporary. May change the banded adaptor -m .
template<class AE>
-banded_adaptor &operator = (const matrix_expression<AE> -&ae)
The extended assignment operator.
template<class AE>
-banded_adaptor &assign (const matrix_expression<AE> -&ae)
Assigns a matrix expression to the banded adaptor. Left and -right hand side of the assignment should be independent.
template<class AE>
-banded_adaptor &operator += (const matrix_expression<AE> -&ae)
A computed assignment operator. Adds the matrix expression to -the banded adaptor.
template<class AE>
-banded_adaptor &plus_assign (const matrix_expression<AE> -&ae)
Adds a matrix expression to the banded adaptor. Left and right -hand side of the assignment should be independent.
template<class AE>
-banded_adaptor &operator -= (const matrix_expression<AE> -&ae)
A computed assignment operator. Subtracts the matrix expression -from the banded adaptor.
template<class AE>
-banded_adaptor &minus_assign (const matrix_expression<AE> -&ae)
Subtracts a matrix expression from the banded adaptor. Left and -right hand side of the assignment should be independent.
template<class AT>
-banded_adaptor &operator *= (const AT &at)
A computed assignment operator. Multiplies the banded adaptor -with a scalar.
template<class AT>
-banded_adaptor &operator /= (const AT &at)
A computed assignment operator. Divides the banded adaptor -through a scalar.
void swap (banded_adaptor &m)Swaps the contents of the banded adaptors.
const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the banded_adaptor.
const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the banded_adaptor.
iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the banded_adaptor.
iterator1 end1 ()Returns a iterator1 pointing to the end of the -banded_adaptor.
const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the banded_adaptor.
const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the banded_adaptor.
iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the banded_adaptor.
iterator2 end2 ()Returns a iterator2 pointing to the end of the -banded_adaptor.
const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed banded_adaptor.
const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed banded_adaptor.
reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed banded_adaptor.
reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed banded_adaptor.
const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed banded_adaptor.
const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed banded_adaptor.
reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed banded_adaptor.
reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed banded_adaptor.
-
-

Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt). -

- - - diff --git a/doc/blas.htm b/doc/blas.htm deleted file mode 100644 index 843f26f1..00000000 --- a/doc/blas.htm +++ /dev/null @@ -1,453 +0,0 @@ - - - - - BLAS - - - - - - - - - - - - -

Level 3 BLAS

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Functions

template<class M1, class T, class M2, class M3> M1 & boost::numeric::ublas::blas_3::tmm (M1 &m1, const T &t, const M2 &m2, const M3 &m3)
 triangular matrix multiplication

template<class M1, class T, class M2, class C> M1 & boost::numeric::ublas::blas_3::tsm (M1 &m1, const T &t, const M2 &m2, C)
 triangular solve m2 * x = t * m1 in place, m2 is a triangular matrix

template<class M1, class T1, class T2, class M2, class M3> M1 & boost::numeric::ublas::blas_3::gmm (M1 &m1, const T1 &t1, const T2 &t2, const M2 &m2, const M3 &m3)
 general matrix multiplication

template<class M1, class T1, class T2, class M2> M1 & boost::numeric::ublas::blas_3::srk (M1 &m1, const T1 &t1, const T2 &t2, const M2 &m2)
 symmetric rank k update: m1 = t * m1 + t2 * (m2 * m2T)

template<class M1, class T1, class T2, class M2> M1 & boost::numeric::ublas::blas_3::hrk (M1 &m1, const T1 &t1, const T2 &t2, const M2 &m2)
 hermitian rank k update: m1 = t * m1 + t2 * (m2 * m2H)

template<class M1, class T1, class T2, class M2, class M3> M1 & boost::numeric::ublas::blas_3::sr2k (M1 &m1, const T1 &t1, const T2 &t2, const M2 &m2, const M3 &m3)
 generalized symmetric rank k update: m1 = t1 * m1 + t2 * (m2 * m3T) + t2 * (m3 * m2T)

template<class M1, class T1, class T2, class M2, class M3> M1 & boost::numeric::ublas::blas_3::hr2k (M1 &m1, const T1 &t1, const T2 &t2, const M2 &m2, const M3 &m3)
 generalized hermitian rank k update: m1 = t1 * m1 + t2 * (m2 * m3H) + (m3 * (t2 * m2)H)

template<class M, class E1, class E2> BOOST_UBLAS_INLINE M & boost::numeric::ublas::axpy_prod (const matrix_expression< E1 > &e1, const matrix_expression< E2 > &e2, M &m, bool init=true)
 computes M += A X or M = A X in an optimized fashion.

template<class M, class E1, class E2> BOOST_UBLAS_INLINE M & boost::numeric::ublas::opb_prod (const matrix_expression< E1 > &e1, const matrix_expression< E2 > &e2, M &m, bool init=true)
 computes M += A X or M = A X in an optimized fashion.

- -
- -

Function Documentation

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& tmm M1 &  m1,
const T &  t,
const M2 &  m2,
const M3 &  m3
-
- - - - - -
-   - -

triangular matrix multiplication

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& tsm M1 &  m1,
const T &  t,
const M2 &  m2,
-
- - - - - -
-   - - -

-triangular solve m2 * x = t * m1 in place, m2 is a triangular matrix -

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& gmm M1 &  m1,
const T1 &  t1,
const T2 &  t2,
const M2 &  m2,
const M3 &  m3
-
- - - - - -
-   - - -

-general matrix multiplication -

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& srk M1 &  m1,
const T1 &  t1,
const T2 &  t2,
const M2 &  m2
-
- - - - - -
-   - - -

-symmetric rank k update: m1 = t * m1 + t2 * (m2 * m2T) -

-
Todo:
use opb_prod()
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& hrk M1 &  m1,
const T1 &  t1,
const T2 &  t2,
const M2 &  m2
-
- - - - - -
-   - - -

-hermitian rank k update: m1 = t * m1 + t2 * (m2 * m2H) -

-
Todo:
use opb_prod()
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& sr2k M1 &  m1,
const T1 &  t1,
const T2 &  t2,
const M2 &  m2,
const M3 &  m3
-
- - - - - -
-   - - -

-generalized symmetric rank k update: m1 = t1 * m1 + t2 * (m2 * m3T) + t2 * (m3 * m2T) -

-
Todo:
use opb_prod()
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M1& hr2k M1 &  m1,
const T1 &  t1,
const T2 &  t2,
const M2 &  m2,
const M3 &  m3
-
- - - - - -
-   - - -

-generalized hermitian rank k update: m1 = t1 * m1 + t2 * (m2 * m3H) + (m3 * (t2 * m2)H) -

-
Todo:
use opb_prod()
-
- - - -
-

Copyright (©) 2000-2004 Michael Stevens, Mathias Koch, -Joerg Walter, Gunter Winkler
-Use, modification and distribution are subject to the -Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt -or copy at -http://www.boost.org/LICENSE_1_0.txt). -

- - - diff --git a/doc/bounded_array.htm b/doc/bounded_array.htm deleted file mode 100644 index a793bdfb..00000000 --- a/doc/bounded_array.htm +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - -Bounded Array; - - -

Bounded Array Storage

-
-

Bounded Array

-

Description

-

The templated class bounded_array<T, N, ALLOC> implements a bounded storage array. The bounded array is similar to a C++ array type in that its maximum size is bounded by N and is allocated on the stack instead of the heap. Similarly a bounded_array requires no secondary storage and ALLOC is only used to specify size_type and difference_type. -

-

When resized bounded_array never reallocated the storage. It is therefore always efficient to resize a bounded_array but the size bound N must not be exceeded.

-

Example

-
-#include <boost/numeric/ublas/storage.hpp>
-
-int main () {
-    using namespace boost::numeric::ublas;
-    bounded_array<double, 3> a (3);
-    for (unsigned i = 0; i < a.size (); ++ i) {
-        a [i] = i;
-        std::cout << a [i] << std::endl;
-    }
-}
-
-

Definition

-

Defined in the header storage.hpp.

-

Template parameters

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionDefault
TThe type of object stored in the array.
NThe allocation size of the array.
ALLOCAn STL Allocatorstd::allocator
-

Model of

-

Storage

-

Type requirements

-

None, except for those imposed by the requirements of Storage.

-

Public base classes

-

None.

-

Members

-
    -
  • The description does not describe what the member actually does, this can be looked up -in the corresponding concept documentation, but instead contains a remark on the implementation of the -member inside this model of the concept.
  • -
  • Typography: -
      -
    • Members that are not part of the implemented concepts are in blue.
    • -
    -
  • -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberWhere definedDescription
value_typeContainer
pointerContainerDefined as value_type*
const_pointerContainerDefined as const value_type*
referenceContainerDefined as value_type&
const_referenceContainerDefined as const value_type&
size_typeContainerDefined as Alloc::size_type
difference_typeContainerDefined as Alloc::difference_type
iteratorContainerDefined as pointer
const_iteratorContainerDefined as const_pointer
revere_iteratorContainerDefined as std::reverse_iterator<iterator>
const_revere_iteratorContainerDefined as std::reverse_iterator<const_iterator>
bounded_array ()StorageCreates an unbounded_array that holds zero elements.
bounded_array (size_type size)StorageCreates a uninitialized bounded_array that holds size elements. All the elements are default constructed.
bounded_array (size_type size, const T& init)StorageCreates an initialized bounded_array that holds size elements. All the elements are constructed from the init value.
bounded_array (const bounded_array &c)ContainerThe copy constructor.
~bounded_array ()ContainerDeallocates the bounded_array itself.
void resize (size_type size)Storage -Reallocates a bounded_array to hold size elements.
void resize (size_type size, const T& t)Storage -Reallocates a bounded_array to hold size elements.
size_type size () constContainerReturns the size of the bounded_array.
const_reference operator [] (size_type i) constContainerReturns a const reference of the i -th element.
reference operator [] (size_type i)ContainerReturns a reference of the i-th element.
bounded_array &operator = (const bounded_array &a)ContainerThe assignment operator.
bounded_array &assign_temporary (bounded_array &a)Assigns a temporary. May change the array a.
void swap (bounded_array &a)ContainerSwaps the contents of the arrays.
const_iterator begin () constContainerReturns a const_iterator pointing to the beginning of the bounded_array.
const_iterator end () constContainerReturns a const_iterator pointing to the end of the bounded_array.
iterator begin ()ContainerReturns a iterator pointing to the beginning of the bounded_array.
iterator end ()ContainerReturns a iterator pointing to the end of the bounded_array.
const_reverse_iterator rbegin () constReversible ContainerReturns a const_reverse_iterator pointing to the beginning of the reversed bounded_array.
const_reverse_iterator rend () constReversible ContainerReturns a const_reverse_iterator pointing to the end of the reversed bounded_array.
reverse_iterator rbegin ()Reversible ContainerReturns a reverse_iterator pointing to the beginning of the reversed bounded_array.
reverse_iterator rend ()Reversible ContainerReturns a reverse_iterator pointing to the end of the reversed bounded_array.
-
-

- Copyright (©) 2000-2004 Michael Stevens, Mathias Koch, - Joerg Walter, Gunter Winkler
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - - diff --git a/doc/container_concept.htm b/doc/container_concept.htm deleted file mode 100644 index 4d2d33ca..00000000 --- a/doc/container_concept.htm +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - - -Container Concepts - - -

Container Concepts

-
-

Vector

-

Description

-

A Vector describes common aspects of dense, packed and sparse -vectors.

-

Refinement of

-

DefaultConstructible, -Vector Expression -[1].

-

Associated types

-

In addition to the types defined by Vector Expression

- - - - - - - - - - - - - -
Public basevector_container<V>V must be derived from this public base type.
Storage arrayV::array_type -Dense Vector ONLY. The type of underlying storage array used to store the elements. The array_type must model the -Storage concept.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - -
VA type that is a model of Vector
vObjects of type V
n, iObjects of a type convertible to size_type
tObject of a type convertible to value_type
pObject of a type convertible to bool
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in DefaultConstructible, -Vector Expression the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Sizing constructorV v (n) V
Insertv.insert_element (i, t)v is mutable.void
Erasev.erase_element (i)v is mutable.void
Clearv.clear ()v is mutable.void
Resizev.resize (n)
-v.resize (n, p)
v is mutable.void
Storagev.data()v is mutable and Dense.array_type& if v is mutable, const array_type& otherwise
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Vector Expression .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Sizing constructorV v (n)n >= 0Allocates a vector ofn elements.v.size () == n.
Element access [2]v[n]0<n>v.size()returns the n-th element in v 
Insertv.insert_element (i, t)0 <= i < v.size ().Inserts an element at v (i) with value t. -The storage requirement of the Vector may be increased.v (i) is equal to t.
Erasev.erase_element (i)0 <= i < v.size ()Destroys the element as v (i) and replaces it with the default -value_type (). -The storage requirement of the Vector may be decreased.v (i) is equal to value_type ().
Clearv.clear () Equivalent to
-for (i = 0; i < v.size (); ++ i)
v.erase_element (i);
 
Resizev.resize (n) -
v.resize (n, p)
 Reallocates the vector so that it can hold n -elements.
-Erases or appends elements in order to bring the vector to the prescribed size. Appended elements copies of value_type(). -
-When p == false then existing elements are not preserved and elements will not appended as normal. Instead the vector is in the same state as that after an equivalent sizing constructor.
v.size () == n.
Storagev.data()Returns a reference to the underlying dense storage. 
-

Complexity guarantees

-

The run-time complexity of the sizing constructor is linear in -the vector's size.

-

The run-time complexity of insert_element and erase_element is specific for the -Vector model and it depends on increases/decreases in storage requirements.

-

The run-time complexity of resize is linear in the vector's -size.

-

Invariants

-

Models

-
    -
  • vector, bounded_vector, c_vector
  • -
  • unit_vector, zero_vector, scalar_vector
  • -
  • mapped_vector;, compressed_vector, coordinate_vector
  • -
-

Notes

-

[1] -As a user you need not care about Vector being a refinement of the VectorExpression. Being a refinement of the VectorExpression is only important for the template-expression engine but not the user.

-

[2] -The operator[] is added purely for convenience -and compatibility with the std::vector. In uBLAS however, -generally operator() is used for indexing because this can be -used for both vectors and matrices.

-

Matrix

-

Description

-

A Matrix describes common aspects of dense, packed and sparse -matrices.

-

Refinement of

-

DefaultConstructible, -Matrix Expression -[1] -.

-

Associated types

-

In addition to the types defined by Matrix Expression

- - - - - - - - - - - - - -
Public basematrix_container<M>M must be derived from this public base type.
Storage arrayM::array_typeDense Matrix ONLY. The type of underlying storage array used to store the elements. The array_type must model -the Storage concept.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - -
MA type that is a model of Matrix
mObjects of type M
n1, n2, i, jObjects of a type convertible to size_type
tObject of a type convertible to value_type
pObject of a type convertible to bool
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Matrix Expression the -following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Sizing constructorM m (n1, n2) M
Insertm.insert_element (i, j, t)m is mutable.void
Erasem.erase_element (i, j)m is mutable.void
Clearm.clear ()m is mutable.void
Resizem.resize (n1, n2)
-m.resize (n1, n2, p)
m is mutable.void
Storagem.data()m is mutable and Dense.array_type& if m is mutable, const array_type& otherwise
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Matrix Expression .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Sizing constructorM m (n1, n2)n1 >= 0 and n2 >= 0Allocates a matrix of n1 rows and n2 -columns.m.size1 () == n1 and m.size2 () == -n2.
Insertm.insert_element (i, j, t)0 <= i < m.size1 (),
-0 <= j < m.size2 ().
Inserts an element at m (i, j) with value t. -The storage requirement of the Matrix may be increased.m (i, j) is equal to t.
Erasem.erase_element (i, j)0 <= i < m.size1 ()and
-0 <= j < m.size2
Destroys the element as m (i, j) and replaces it with the default -value_type (). -The storage requirement of the Matrix may be decreased.m (i, j) is equal to value_type ().
Clearm.clear () Equivalent to
-for (i = 0; i < m.size1 (); ++ i)
for (j = 0; j < m.size2 (); ++ j)
-    m.erase_element (i, j);
 
Resizem.resize (n1, n2) -
-m.resize (n1, n2, p) -
 Reallocate the matrix so that it can hold n1 rows -and n2 columns.
-Erases or appends elements in order to bring the matrix to the -prescribed size. Appended elements are value_type() -copies.
-When p == false then existing elements are not preserved and elements will not appended as normal. Instead the matrix is in the same state as that after an equivalent sizing constructor.
m.size1 () == n1 and m.size2 () == n2.
Storagem.data()Returns a reference to the underlying dense storage. 
-

Complexity guarantees

-

The run-time complexity of the sizing constructor is quadratic -in the matrix's size.

-

The run-time complexity of insert_element and erase_element is specific for the -Matrix model and it depends on increases/decreases in storage requirements.

-

The run-time complexity of resize is quadratic in the matrix's -size.

-

Invariants

-

Models

-
    -
  • matrix, bounded_matrix, c_matrix
  • -
  • identity_matrix , zero_matrix , scalar_matrix
  • -
  • triangular_matrix , symmetric_matrix , banded_matrix
  • -
  • mapped_matrix , compressed_matrix , coordinate_matrix
  • -
-

Notes

-

[1] -As a user you need not care about Matrix being a refinement of the MatrixExpression. Being a refinement of the MatrixExpression is only important for the template-expression engine but not the user.

-
-

Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - - diff --git a/doc/doxygen.css b/doc/doxygen.css deleted file mode 100644 index 6dbaf573..00000000 --- a/doc/doxygen.css +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright 2000-2004 Michael Stevens, Mathias Koch, - * Joerg Walter, Gunter Winkler. - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt - * or copy at http://www.boost.org/LICENSE_1_0.txt). - */ - - -H1 { - text-align: center; - font-family: Geneva, Arial, Helvetica, sans-serif; -} -H2 { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #eeeeff; - border: 1px solid #B0B0B0; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 120%; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; - padding: 2px; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D - padding: 2px; -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; - padding: 2px; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; - border: 1px double #9295C2; -} -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #1A419D} -A.codeRef { font-weight: normal; color: #1A419D} -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 6px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #F4F4FB; font-weight: bold; } -TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } -TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; - font-family: Geneva, Arial, Helvetica, sans-serif; -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #eeeeff; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} -.mdRow { - padding: 8px 10px; -} -.mdescLeft { - font-size: smaller; - font-style: italic; - background-color: #FAFAFA; - padding-left: 8px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - font-size: smaller; - font-style: italic; - background-color: #FAFAFA; - padding-left: 4px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; - padding-bottom: 0px; - padding-right: 8px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -.memItemRight { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 13px; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #eeeeff; -} -TD.tiny { font-size: 75%; -} -a { - color: #252E78; -} -a:visited { - color: #3D2185; -} diff --git a/doc/expression_concept.htm b/doc/expression_concept.htm deleted file mode 100644 index f1b1cb3a..00000000 --- a/doc/expression_concept.htm +++ /dev/null @@ -1,1074 +0,0 @@ - - - - - - - - -Expression Concepts - - -

Expression Concepts

-
-

Scalar Expression

-

Description

-

A Scalar Expression is an expression convertible to a scalar -type.

-

Refinement of

-

Default Constructible.

-

Associated types

- - - - - - - - - - - - - -
Public basescaler_expression<S>S must be derived from this public base type.
Value typevalue_typeThe type of the scalar expression.
-

Notation

- - - - - - - -
SA type that is a model of Scalar Expression
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Evaluationoperator value_type () const value_type
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Evaluationoperator value_type () const   Evaluates the scalar expression. 
-

Complexity guarantees

-

The run-time complexity of the evaluation is specific for the -evaluated scalar expression.

-

Invariants

-

Models

-
    -
  • vector_scalar_unary
  • -
  • vector_scalar_binary
  • -
-

Vector Expression

-

Description

-

A Vector Expression is an expression evaluatable to a vector. -Vector Expression provides an Indexed Bidirectional -Iterator or an Indexed Random Access -Iterator .

-

Refinement of

-

Default Constructible.

-

Associated types

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Public basevector_expression<V>V must be derived from this public base type.
Value typevalue_type -The element type of the vector expression. -
Reference typereference -The return type when accessing an element of a vector expression. -
-Convertable to avalue_type. -
Const reference typeconst_reference -The return type when accessing an element of a constant vector expression. -
-Convertable to avalue_type. -
Size typesize_type -The index type of the vector expression. Am unsigned integral type used to represent size and index values. -
-Can represent any nonnegative value of difference_type. -
Distance typedifference_type -A signed integral type used to represent the distance between two of the vector expression's iterators. -
Const iterator typeconst_iteratorA type of iterator that may be used to examine a vector -expression's elements.
Iterator typeiteratorA type of iterator that may be used to modify a vector -expression's elements.
Const reverse iterator typeconst_reverse_iteratorA Reverse Iterator adaptor whose base iterator type is the -vector expression's const iterator type.
Reverse iterator typereverse_iteratorA Reverse Iterator adaptor whose base iterator type is the -vector expression's iterator type.
-

Notation

- - - - - - - - - - - - - - - - - - - -
VA type that is a model of Vector Expression
v, v1, v2Object of type V
iObject of a type convertible to size_type
tObject of a type convertible to value_type
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Beginning of rangev.begin () const_iterator
v.begin ()v is mutable.iterator
End of rangev.end () const_iterator
v.end ()v is mutable.iterator
Sizev.size () size_type
Swapv1.swap (v2)v1 and v2 are mutable.void
Beginning of reverse rangev.rbegin () const_reverse_iterator
v.rbegin ()v is mutable.reverse_iterator
End of reverse rangev.rend () const_reverse_iterator
v.rend ()v is mutable.reverse_iterator
Element accessv (i)i is convertible to size_type.Convertible to value_type.
Assignmentv2 = v1v2 is mutable and v1 is convertible -to V.V &
v2.assign (v1)v2 is mutable and v1 is convertible -to V.V &
Computed assignmentv2 += v1v2 is mutable and v1 is convertible -to V.V &
v2.plus_assign (v1)v2 is mutable and v1 is convertible -to V.V &
v2 -= v1v2 is mutable and v1 is convertible -to V.V &
v2.minus_assign (v1)v2 is mutable and v1 is convertible -to V.V &
v *= tv is mutable and t is convertible to -value_type.V &
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Beginning of rangev.begin () Returns an iterator pointing to the first element in the vector -expression.v.begin () is either dereferenceable or -past-the-end. It is past-the-end if and only if v.size () == -0.
End of rangev.end () Returns an iterator pointing one past the last element in the -vector expression.v.end () is past-the-end.
Sizev.size () Returns the size of the vector expression, that is, its number -of elements.v.size () >= 0
Swapv1.swap (v2) Equivalent to swap (v1, v2). 
Beginning of reverse rangev.rbegin () Equivalent to reverse_iterator (v.end ()).v.rbegin () is either dereferenceable or -past-the-end. It is past-the-end if and only if v.size () == -0.
End of reverse rangev.rend () Equivalent to reverse_iterator (v.begin ()).v.rend () is past-the-end.
Element accessv (i)0 <= i < v.size ()Returns the i-th element of the vector -expression. 
Assignmentv2 = v1v1.size () == v2.size ()Assigns every element of the evaluated vector expression -v1 to the corresponding element of v2 -. 
v2.assign (v1)v1.size () == v2.size ()Assigns every element of v1 to the corresponding -element of v2. 
Computed assignmentv2 += v1v1.size () == v2.size ()Adds every element of the evaluated vector expression -v1 to the corresponding element of -v2. 
v2.plus_assign (v1)v1.size () == v2.size ()Adds every element of v1 to the corresponding -element of v2. 
v2 -= v1v1.size () == v2.size ()Subtracts every element of the evaluated vector expression -v1 from the corresponding element of v2 -. 
v2.minus_assign (v1)v1.size () == v2.size ()Subtracts every element of v1 from the -corresponding element of v2. 
v *= t Multiplies every element of v with t -. 
-

Complexity guarantees

-

The run-time complexity of begin () and end -() is specific for the evaluated vector expression, -typically amortized constant time.

-

The run-time complexity of size () is constant -time.

-

The run-time complexity of swap () is specific for -the evaluated vector expression, typically constant time.

-

The run-time complexity of rbegin () and rend -() is specific for the evaluated vector expression, -typically amortized constant time.

-

The run-time complexity of the element access is specific for -the evaluated vector expression, typically amortized constant time -for the dense and logarithmic for the sparse case.

-

The run-time complexity of the arithmetic operations is specific -for the evaluated vector expressions, typically linear in the size -of the expressions.

-

Invariants

- - - - - - - - - - - - - - - - - - - -
Valid rangeFor any vector expression v, [v.begin (), -v.end ()) is a valid range.
CompletenessAn algorithm that iterates through the range [v.begin (), -v.end ()) will pass through every element of v -.
Valid reverse range[v.rbegin (), v.rend ()) is a valid range.
Equivalence of rangesThe distance from v.begin () to v.end -() is the same as the distance from v.rbegin () -to v.rend ().
-

Models

-
    -
  • vector_range;
  • -
  • vector_slice
  • -
  • matrix_row
  • -
  • matrix_column
  • -
  • matrix_vector_range
  • -
  • matrix_vector_slice
  • -
  • vector_unary
  • -
  • vector_binary
  • -
  • vector_binary_scalar1
  • -
  • vector_binary_scalar2
  • -
  • matrix_vector_unary1
  • -
  • matrix_vector_unary2
  • -
  • matrix_vector_binary1
  • -
  • matrix_vector_binary2
  • -
- -

Matrix Expression

-

Description

-

A Matrix Expression is an expression evaluatable to a matrix. -Matrix Expression provides an Indexed -Bidirectional Column/Row Iterator or an Indexed Random -Access Column/Row Iterator .

-

Refinement of

-

Default Constructible.

- -

Associated types

-
immutable types
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Public basematrix_expression<M>M must be derived from this public base type.
Value typevalue_type -The element type of the matrix expression. -
Const reference typeconst_reference -The return type when accessing an element of a constant matrix expression. -
-Convertable to a value_type. -
Size typesize_type -The index type of the matrix expression. Am unsigned integral type used to represent size and index values. -
-Can represent any nonnegative value of difference_type. -
Distance typedifference_type -A signed integral type used to represent the distance between two of the matrix expression's iterators. -
Const iterator typesconst_iterator1A type of column iterator that may be used to examine a matrix -expression's elements.
const_iterator2A type of row iterator that may be used to examine a matrix -expression's elements.
Const reverse iterator typesconst_reverse_iterator1A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const column iterator type.
const_reverse_iterator2A Reverse Iterator adaptor whose base iterator type is the -matrix expression's const row iterator type.
- -
mutable types
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Reference typereference -The return type when accessing an element of a matrix expression. -
-Convertable to a value_type. -
Iterator typesiterator1A type of column iterator that may be used to modify a matrix -expression's elements.
iterator2A type of row iterator that may be used to modify a matrix -expression's elements.
Reverse iterator typesreverse_iterator1A Reverse Iterator adaptor whose base iterator type is the -matrix expression's column iterator type.
reverse_iterator2A Reverse Iterator adaptor whose base iterator type is the -matrix expression's row iterator type.
- - -

Notation

- - - - - - - - - - - - - - - - - - - -
MA type that is a model of Matrix Expression
m, m1, m2Object of type M
i, jObjects of a type convertible to size_type
tObject of a type convertible to value_type
-

Definitions

-

Valid expressions

-

In addition to the expressions defined in Default Constructible -the following expressions must be valid.

- -
immutable expressions
- - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Sizem.size1 () size_type
m.size2 () size_type
- -
possibly mutable expressions
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Beginning of rangem.begin1 () const_iterator1
m.begin2 () const_iterator2
m.begin1 ()m is mutable. iterator1
m.begin2 ()m is mutable.iterator2
End of rangem.end1 () const_iterator1
m.end2 () const_iterator2
m.end1 ()m is mutable. iterator1
m.end2 ()m is mutable.iterator2
Swapm1.swap (m2)m1 and m2 are mutable. void
Beginning of reverse rangem.rbegin1 () const_reverse_iterator1
m.rbegin2 () const_reverse_iterator2
m.rbegin1 ()m is mutable. reverse_iterator1
m.rbegin2 ()m is mutable.reverse_iterator2
End of reverse rangem.rend1 () const_reverse_iterator1
m.rend2 () const_reverse_iterator2
m.rend1 ()m is mutable.reverse_iterator1
m.rend2 ()m is mutable.reverse_iterator2
Element accessm (i, j)i and j are convertible to -size_type .Convertible to value_type.
Assignmentm2 = m1m2 is mutable and m1 is convertible -to M.M &
m2.assign (m1)m2 is mutable and m1 is convertible -to M.M &
Computed assignmentm2 += m1m2 is mutable and m1 is convertible -to M.M &
m2.plus_assign (m1)m2 is mutable and m1 is convertible -to M.M &
m2 -= m1m2 is mutable and m1 is convertible -to M.M &
m2.minus_assign (m1)m2 is mutable and m1 is convertible -to M.M &
m *= tm is mutable and t is convertible to -value_type.M &
-

Expression semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Beginning of rangem.begin1 () Returns an iterator pointing to the first element in the first -column of a matrix expression.m.begin1 () is either dereferenceable or -past-the-end. It is past-the-end if and only if m.size1 () == -0.
m.begin2 () Returns an iterator pointing to the first element in the first -row of a matrix expression.m.begin2 () is either dereferenceable or -past-the-end. It is past-the-end if and only if m.size2 () == -0.
End of rangem.end1 () Returns an iterator pointing one past the last element in the -matrix expression.m.end1 () is past-the-end.
m.end2 () Returns an iterator pointing one past the last element in the -matrix expression.m.end2 () is past-the-end.
Sizem.size1 () Returns the number of rows of the matrix expression.m.size1 () >= 0
m.size2 () Returns the number of columns of the matrix expression.m.size2 () >= 0
Swapm1.swap (m2) Equivalent to swap (m1, m2). 
Beginning of reverse rangem.rbegin1 () Equivalent to reverse_iterator1 (m.end1 ()).m.rbegin1 () is either dereferenceable or -past-the-end. It is past-the-end if and only if m.size1 () == -0.
m.rbegin2 () Equivalent to reverse_iterator2 (m.end2 ()).m.rbegin2 () is either dereferenceable or -past-the-end. It is past-the-end if and only if m.size2 () == -0.
End of reverse rangem.rend1 () Equivalent to reverse_iterator1 (m.begin1 -()).m.rend1 () is past-the-end.
m.rend2 () Equivalent to reverse_iterator2 (m.begin2 -()).m.rend2 () is past-the-end.
Element accessm (i, j)0 <= i < m.size1 () and 0 <= j < -m.size2 ()Returns the j-th element of the i-th -row of the matrix expression. 
Assignmentm2 = m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Assigns every element of the evaluated matrix expression -m1 to the corresponding element of m2 -. 
m2.assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Assigns every element of m1 to the corresponding -element of m2. 
Computed assignmentm2 += m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Adds every element of the evaluated matrix expression -m1 to the corresponding element of -m2. 
m2.plus_assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Adds every element of m1 to the corresponding -element of m2. 
m2 -= m1m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Subtracts every element of the evaluated matrix expression -m1 from the corresponding element of m2 -. 
m2.minus_assign (m1)m1.size1 () == m2.size1 () and
-m1.size2 () == m2.size2 ()
Subtracts every element of m1 from the -corresponding element of m2. 
m *= t Multiplies every element of m with t -. 
-

Complexity guarantees

-

The run-time complexity of begin1 (), begin2 -() , end1 () and end2 () is -specific for the evaluated matrix expression.

-

The run-time complexity of size1 () and size2 -() is constant time.

-

The run-time complexity of swap () is specific for -the evaluated matrix expression, typically constant time.

-

The run-time complexity of rbegin1 (), -rbegin2 () , rend1 () and rend2 -() is specific for the evaluated matrix expression.

-

The run-time complexity of the element access is specific for -the evaluated matrix expression, typically amortized constant time -for the dense and logarithmic for the sparse case.

-

The run-time complexity of the arithmetic operations is specific -for the evaluated matrix expressions, typically quadratic in the -size of the proxies.

-

Invariants

- - - - - - - - - - - - - - - - - - - -
Valid rangeFor any matrix expression m, [m.begin1 (), -m.end1 ()) and [m.begin2 (), m.end2 ()) are -valid ranges.
CompletenessAn algorithm that iterates through the range [m.begin1 -(), m.end1 ()) will pass through every row of m -, an algorithm that iterates through the range [m.begin2 (), -m.end2 ()) will pass through every column of m -.
Valid reverse range[m.rbegin1 (), m.rend1 ()) and [m.rbegin2 -(), m.rend2 ()) are valid ranges.
Equivalence of rangesThe distance from m.begin1 () to m.end1 -() is the same as the distance from m.rbegin1 -() to m.rend1 () and the distance from -m.begin2 () to m.end2 () is the same as -the distance from m.rbegin2 () to m.rend2 -().
-

Models

-
    -
  • matrix_range
  • -
  • matrix_slice;
  • -
  • triangular_adaptor
  • -
  • symmetric_adaptor
  • -
  • banded_adaptor
  • -
  • vector_matrix_binary
  • -
  • matrix_unary1
  • -
  • matrix_unary2
  • -
  • matrix_binary
  • -
  • matrix_binary_scalar1
  • -
  • matrix_binary_scalar2
  • -
  • matrix_matrix_binary
  • -
-
-

Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - - diff --git a/doc/hermitian.htm b/doc/hermitian.htm deleted file mode 100644 index 3c659a4f..00000000 --- a/doc/hermitian.htm +++ /dev/null @@ -1,597 +0,0 @@ - - - - - - - - - -Hermitian Matrix - - -

Hermitian Matrix

-
-

Hermitian Matrix

-

Description

-

The templated class hermitian_matrix<T, F1, F2, -A> is the base container adaptor for hermitian matrices. -For a (n x n )-dimensional hermitian matrix and 0 -<= i < n, 0 <= j < n holds -hi, j = hj, -i-. The storage of hermitian -matrices is packed.

-

Example

-
-#include <boost/numeric/ublas/hermitian.hpp>
-#include <boost/numeric/ublas/io.hpp>
-
-int main () {
-    using namespace boost::numeric::ublas;
-    hermitian_matrix<std::complex<double>, lower> ml (3, 3);
-    for (unsigned i = 0; i < ml.size1 (); ++ i) {
-        for (unsigned j = 0; j < i; ++ j)
-            ml (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
-        ml (i, i) = std::complex<double> (4 * i, 0);
-    }
-    std::cout << ml << std::endl;
-    hermitian_matrix<std::complex<double>, upper> mu (3, 3);
-    for (unsigned i = 0; i < mu.size1 (); ++ i) {
-        mu (i, i) = std::complex<double> (4 * i, 0);
-        for (unsigned j = i + 1; j < mu.size2 (); ++ j)
-            mu (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
-    }
-    std::cout << mu << std::endl;
-}
-
-

Definition

-

Defined in the header hermitian.hpp.

-

Template parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterDescriptionDefault
TThe type of object stored in the matrix.
F1Functor describing the type of the hermitian matrix. [1]lower
F2Functor describing the storage organization. [2]row_major
AThe type of the adapted array. [3]unbounded_array<T>
-

Model of

-

Matrix .

-

Type requirements

-

None, except for those imposed by the requirements of Matrix .

-

Public base classes

-

matrix_container<hermitian_matrix<T, F1, F2, A> ->

-

Members

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
hermitian_matrix ()Allocates an uninitialized hermitian_matrix that -holds zero rows of zero elements.
hermitian_matrix (size_type size)Allocates an uninitialized hermitian_matrix that -holds size rows of size elements.
hermitian_matrix (const hermitian_matrix -&m)The copy constructor.
template<class AE>
-hermitian_matrix (const matrix_expression<AE> -&ae)
The extended copy constructor.
void resize (size_type size, bool preserve = -true)Reallocates a hermitian_matrix to hold -size rows of size elements. The existing -elements of the hermitian_matrix are preseved when -specified.
size_type size1 () constReturns the number of rows.
size_type size2 () constReturns the number of columns.
const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
hermitian_matrix &operator = (const hermitian_matrix -&m)The assignment operator.
hermitian_matrix &assign_temporary (hermitian_matrix -&m)Assigns a temporary. May change the hermitian matrix -m .
template<class AE>
-hermitian_matrix &operator = (const matrix_expression<AE> -&ae)
The extended assignment operator.
template<class AE>
-hermitian_matrix &assign (const matrix_expression<AE> -&ae)
Assigns a matrix expression to the hermitian matrix. Left and -right hand side of the assignment should be independent.
template<class AE>
-hermitian_matrix &operator += (const -matrix_expression<AE> &ae)
A computed assignment operator. Adds the matrix expression to -the hermitian matrix.
template<class AE>
-hermitian_matrix &plus_assign (const -matrix_expression<AE> &ae)
Adds a matrix expression to the hermitian matrix. Left and -right hand side of the assignment should be independent.
template<class AE>
-hermitian_matrix &operator -= (const -matrix_expression<AE> &ae)
A computed assignment operator. Subtracts the matrix expression -from the hermitian matrix.
template<class AE>
-hermitian_matrix &minus_assign (const -matrix_expression<AE> &ae)
Subtracts a matrix expression from the hermitian matrix. Left -and right hand side of the assignment should be independent.
template<class AT>
-hermitian_matrix &operator *= (const AT &at)
A computed assignment operator. Multiplies the hermitian matrix -with a scalar.
template<class AT>
-hermitian_matrix &operator /= (const AT &at)
A computed assignment operator. Divides the hermitian matrix -through a scalar.
void swap (hermitian_matrix &m)Swaps the contents of the hermitian matrices.
void insert (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row.
void erase (size_type i, size_type j)Erases the value at the j-th elemenst of the -i-th row.
void clear ()Clears the matrix.
const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the hermitian_matrix.
const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the hermitian_matrix.
iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the hermitian_matrix.
iterator1 end1 ()Returns a iterator1 pointing to the end of the -hermitian_matrix.
const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the hermitian_matrix.
const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the hermitian_matrix.
iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the hermitian_matrix.
iterator2 end2 ()Returns a iterator2 pointing to the end of the -hermitian_matrix.
const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed hermitian_matrix.
const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed hermitian_matrix.
reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed hermitian_matrix.
reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed hermitian_matrix.
const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed hermitian_matrix.
const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed hermitian_matrix.
reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed hermitian_matrix.
reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed hermitian_matrix.
-

Notes

-

[1] -Supported parameters for the type of the hermitian matrix are -lower and upper.

-

[2] -Supported parameters for the storage organization are -row_major and column_major.

-

[3] -Supported parameters for the adapted array are -unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

-

Hermitian Adaptor

-

Description

-

The templated class hermitian_adaptor<M, F> -is a hermitian matrix adaptor for other matrices.

-

Example

-
-#include <boost/numeric/ublas/hermitian.hpp>
-#include <boost/numeric/ublas/io.hpp>
-
-int main () {
-    using namespace boost::numeric::ublas;
-    matrix<std::complex<double> > m (3, 3);
-    hermitian_adaptor<matrix<std::complex<double> >, lower> hal (m);
-    for (unsigned i = 0; i < hal.size1 (); ++ i) {
-        for (unsigned j = 0; j < i; ++ j)
-            hal (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
-        hal (i, i) = std::complex<double> (4 * i, 0);
-    }
-    std::cout << hal << std::endl;
-    hermitian_adaptor<matrix<std::complex<double> >, upper> hau (m);
-    for (unsigned i = 0; i < hau.size1 (); ++ i) {
-        hau (i, i) = std::complex<double> (4 * i, 0);
-        for (unsigned j = i + 1; j < hau.size2 (); ++ j)
-            hau (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
-    }
-    std::cout << hau << std::endl;
-}
-
-

Definition

-

Defined in the header hermitian.hpp.

-

Template parameters

- - - - - - - - - - - - - - - - - - -
ParameterDescriptionDefault
MThe type of the adapted matrix.
FFunctor describing the type of the hermitian adaptor. [1]lower
-

Model of

-

Matrix Expression -.

-

Type requirements

-

None, except for those imposed by the requirements of Matrix Expression .

-

Public base classes

-

matrix_expression<hermitian_adaptor<M, F> ->

-

Members

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
hermitian_adaptor (matrix_type &data)Constructs a hermitian_adaptor of a matrix.
hermitian_adaptor (const hermitian_adaptor -&m)The copy constructor.
template<class AE>
-hermitian_adaptor (const matrix_expression<AE> -&ae)
The extended copy constructor.
size_type size1 () constReturns the number of rows.
size_type size2 () constReturns the number of columns.
const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
hermitian_adaptor &operator = (const -hermitian_adaptor &m)The assignment operator.
hermitian_adaptor &assign_temporary -(hermitian_adaptor &m)Assigns a temporary. May change the hermitian adaptor -m.
template<class AE>
-hermitian_adaptor &operator = (const -matrix_expression<AE> &ae)
The extended assignment operator.
template<class AE>
-hermitian_adaptor &assign (const matrix_expression<AE> -&ae)
Assigns a matrix expression to the hermitian adaptor. Left and -right hand side of the assignment should be independent.
template<class AE>
-hermitian_adaptor &operator += (const -matrix_expression<AE> &ae)
A computed assignment operator. Adds the matrix expression to -the hermitian adaptor.
template<class AE>
-hermitian_adaptor &plus_assign (const -matrix_expression<AE> &ae)
Adds a matrix expression to the hermitian adaptor. Left and -right hand side of the assignment should be independent.
template<class AE>
-hermitian_adaptor &operator -= (const -matrix_expression<AE> &ae)
A computed assignment operator. Subtracts the matrix expression -from the hermitian adaptor.
template<class AE>
-hermitian_adaptor &minus_assign (const -matrix_expression<AE> &ae)
Subtracts a matrix expression from the hermitian adaptor. Left -and right hand side of the assignment should be independent.
template<class AT>
-hermitian_adaptor &operator *= (const AT &at)
A computed assignment operator. Multiplies the hermitian -adaptor with a scalar.
template<class AT>
-hermitian_adaptor &operator /= (const AT &at)
A computed assignment operator. Divides the hermitian adaptor -through a scalar.
void swap (hermitian_adaptor &m)Swaps the contents of the hermitian adaptors.
const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the hermitian_adaptor.
const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the hermitian_adaptor.
iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the hermitian_adaptor.
iterator1 end1 ()Returns a iterator1 pointing to the end of the -hermitian_adaptor.
const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the hermitian_adaptor.
const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the hermitian_adaptor.
iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the hermitian_adaptor.
iterator2 end2 ()Returns a iterator2 pointing to the end of the -hermitian_adaptor.
const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed hermitian_adaptor.
const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed hermitian_adaptor.
reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed hermitian_adaptor.
reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed hermitian_adaptor.
const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed hermitian_adaptor.
const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed hermitian_adaptor.
reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed hermitian_adaptor.
reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed hermitian_adaptor.
-

Notes

-

[1] -Supported parameters for the type of the hermitian adaptor are -lower and upper.

-
-

Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - - diff --git a/doc/index.htm b/doc/index.htm deleted file mode 100644 index 49b72877..00000000 --- a/doc/index.htm +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - - - - -Boost Basic Linear Algebra - - -

logo Basic Linear Algebra

-
- -

uBLAS is a C++ template class library that provides BLAS level 1, 2, 3 -functionality for dense, packed and sparse matrices. The design and implementation unify mathematical notation via -operator overloading and efficient code generation via expression templates.

- -

Functionality

- -

uBLAS provides templated C++ classes for dense, unit and sparse vectors, dense, identity, triangular, banded, -symmetric, hermitian and sparse matrices. Views into vectors and matrices can be constructed via ranges or slices and -adaptor classes. The library covers the usual basic linear algebra operations on vectors and matrices: reductions like -different norms, addition and subtraction of vectors and matrices and multiplication with a scalar, inner and outer -products of vectors, matrix vector and matrix matrix products and triangular solver. The glue between containers, views -and expression templated operations is a mostly STL conforming iterator -interface.

-

Please consult the release notes for details on the latest changes.

- -

Documentation

- - - -

Supported Platforms

- -

The current version of uBLAS expects a modern (ISO standard compliant) compiler. Compilers targeted and tested with -this release are:

- -
    -
  • GCC 3.2.3, 3.3.x, 3.4.x, 4.0.x
  • - -
  • MSVC 7.1, 8.0
  • - -
  • ICC 8.0, 8.1
  • - -
  • Visual age 6
  • - -
  • Codewarrior 9.4, 9.5
  • -
- -

The version of uBLAS in Boost 1.32.0 (and earlier) support many older compilers. If you are using such a compiler -please use this version of uBLAS. Compilers known to accept this older library are:

- -
    -
  • MSVC 6.0 with STLPort-4.5.3, 7.0, 7.1
  • - -
  • GCC 2.95.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x
  • - -
  • ICC 7.0, 7.1 8.0
  • - -
  • Comeau 4.2.x
  • - -
  • Codewarrior 8.3
  • -
- -

For possible problems please consider to consult the Boost regression tests.

- -

Known limitations:

- -
    -
  • The implementation assumes a linear memory address model.
  • - -
  • Tuning was focussed on dense matrices.
  • -
- -

Further Information

- -

Project Location and Download

- -

The latest stable release of uBLAS is part of the Boost libraries.

- -

Documentation and Discussion

- -

Visit the Effective -uBLAS wiki for up to date information and contributions.

- -

There is also an active uBLAS mailing list where uBLAS specific user and -development questions are answered.

- -

uBLAS and Boost Project

- -

There is also an active uBLAS mailing list where uBLAS specific from the -latest uBLAS project code. You can view the Boost -CVS archive directly. You will find the library here. Documentation and test -programs reside here.

- -

Authors and Credits

- -

uBLAS initially was written by Joerg Walter and Mathias Koch. We would like to thank all, which supported and -contributed to the development of this library: David Abrahams, Ed Brey, Fernando Cacciola, Juan Jose Gomez Cadenas, -Beman Dawes, Matt Davies, Bob Fletcher, Kresimir Fresl, Joachim Kessel, Patrick Kowalzick, Toon Knapen, Hendrik Kueck, -John Maddock, Jens Maurer, Alexei Novakov, Gary Powell, Joachim Pyras, Peter Schmitteckert, Jeremy Siek, Markus Steffl, -Michael Stevens, Benedikt Weber, Martin Weiser, Gunter Winkler, Marc Zimmermann and the members of Boost

- -

Frequently Asked Questions

- -

Q: I'm running the uBLAS dense vector and matrix benchmarks. Why do I see a significant performance difference -between the native C and library implementations?
-A: uBLAS distinguishes debug mode (size and type conformance checks enabled, expression templates disabled) and release -mode (size and type conformance checks disabled, expression templates enabled). Please check, if the preprocessor -symbol NDEBUG of cassert is defined. NDEBUG enables release mode, which in turn -uses expression templates. You can optionally define BOOST_UBLAS_NDEBUG to disable all bounds, structure -and similar checks of uBLAS.

- -

Q: I've written some uBLAS tests, which try to incorrectly assign different matrix types or overrun vector and -matrix dimensions. Why don't I get a compile time or runtime diagnostic?
-A: uBLAS distinguishes debug mode (size and type conformance checks enabled, expression templates disabled) and release -mode (size and type conformance checks disabled, expression templates enabled). Please check, if the preprocessor -symbol NDEBUG of cassert is defined. NDEBUG disables debug mode, which is needed -to get size and type conformance checks.

- -

Q: I've written some uBLAS benchmarks to measure the performance of matrix chain multiplications like prod (A, -prod (B, C)) and see a significant performance penalty due to the use of expression templates. How can I disable -expression templates?
-A: You do not need to disable expression templates. Please try reintroducing temporaries using either prod -(A, matrix_type (prod (B, C))) or prod (A, -prod<matrix_type > (B, C)).

- -
- -

Copyright (©) 2000-2009 Joerg Walter, Mathias Koch, Gunter Winkler
-Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file -LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt -).

- - - diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index 35f0862f..00000000 --- a/doc/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -index.html not found - - -

Please update your bookmarks to point to index.htm. You will be redirected in a second.

-

- Copyright (©) 2000-2004 Michael Stevens, Mathias Koch, - Joerg Walter, Gunter Winkler
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - diff --git a/doc/iterator_concept.htm b/doc/iterator_concept.htm deleted file mode 100644 index 0657df74..00000000 --- a/doc/iterator_concept.htm +++ /dev/null @@ -1,1168 +0,0 @@ - - - - - - - - - -Iterator Concepts - - -

Iterator Concepts

-
-

An Iterator is a restricted pointer-like object pointing into a -vector or matrix container.

-

Indexed Bidirectional Iterator

-

Description

-

An Indexed Bidirectional Iterator is an iterator of a container -that can be dereferenced, incremented, decremented and carries -index information.

-

Refinement of

-

Assignable, Equality Comparable, Default Constructible.

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Bidirectional Iterator
Container typeThe type of the container a Indexed Bidirectional Iterator -points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Bidirectional Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
cObject of type C
-

Definitions

-

A Indexed Bidirectional Iterator may be mutable, meaning -that the values referred to by objects of that type may be -modified, or constant , meaning that they may not. If an -iterator type is mutable, this implies that its value type is a -model of Assignable; the converse, though, is not necessarily -true.

-

A Indexed Bidirectional Iterator may have a singular -value, meaning that the results of most operations, including -comparison for equality, are undefined. The only operation that is -guaranteed to be supported is assigning a nonsingular iterator to a -singular iterator.

-

A Indexed Bidirectional Iterator may have a -dereferenceable value, meaning that dereferencing it yields -a well-defined value. Dereferenceable iterators are always -nonsingular, but the converse is not true.

-

An Indexed Bidirectional Iterator is past-the-end if it -points beyond the last element of a container. Past-the-end values -are nonsingular and nondereferenceable.

-

Valid expressions

-

In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Default constructorI it  
Dereference*it Convertible to T.
Dereference assignment*it = tI is mutable. 
Member accessit->mT is a type for which t.m is -defined. 
Preincrement++ it I &
Postincrementit ++ I
Predecrement-- it I &
Postdecrementit -- I
Indexit.index () C::size_type
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Default constructorI it  it is singular.
Dereference*itit is dereferenceable.  
Dereference assignment*it = tSame as for *it. *it is a copy of t.
Member accessit->mit is dereferenceable.Equivalent to (*it).m 
Preincrement++ itit is dereferenceable.it is modified to point to the next element.it is dereferenceable or past-the-end. -
-&it == &++ it
.
-If it1 == it2,
-then ++ it1 == ++ it2.
Postincrementit ++Same as for ++ it.Equivalent to
-{
- I itt = it;
- ++ it;
- return itt;
-}
it is dereferenceable or past-the-end.
Predecrement-- itit is dereferenceable or past-the-end.
-There exists a dereferenceable iterator itt such that -it == ++ itt.
it is modified to point to the previous -element.it is dereferenceable.
-&it = &-- it.
-If it1 == it2,
-then -- it1 == -- it2.
-If it2 is dereferenceable and it1 == -++it2,
-then --it1 == it2.
Postdecrementit --Same as for -- it.Equivalent to
-{
- I itt = it;
- -- it;
- return itt;
-}
it is dereferenceable. 
Indexit.index ()it is dereferenceable.it.index () >= 0
-and
-it.index () < it ().size ()
If it1 == it2,
-then it1.index () == it2.index ().
-If it1 == it2,
-then it1.index () < (++ it2).index -().
-If it1 == it2,
-then it1.index () > (-- it2).index -().
-

Complexity guarantees

-

The complexity of operations on indexed bidirectional iterators -is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Identityit1 == it2 if and only if &*it1 == -&*it2.
Symmetry of increment and decrementIf it is dereferenceable, then ++ it; ---it; is a null operation. Similarly, -- it; ++ -it; is a null operation.
Relation between iterator index and container element -operatorIf it is dereferenceable, *it == it () -(it.index ()).
-

Models

-
    -
  • sparse_vector::iterator
  • -
-

Indexed Random Access Iterator

-

Description

-

An Indexed Random Access Iterator is an iterator of a container -that can be dereferenced, moved forward, moved backward and carries -index information.

-

Refinement of

-

LessThanComparable, Indexed Bidirectional -Iterator .

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Random Access Iterator
Container typeThe type of the container a Indexed Random Access Iterator -points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Random Access Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
nObject of type C::difference_type
-

Definitions

-

An Indexed Random Access Iterator it1 is -reachable from an Indexed Random Access Iterator -it2 if, after applying operator ++ to -it2 a finite number of times, it1 == -it2.

-

Valid expressions

-

In addition to the expressions defined for Indexed Bidirectional -Iterator , the following expressions must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Forward motionit += n I &
Iterator additionit + n I
Backward motioni -= n I &
Iterator subtractionit - n I 
Differenceit1 - it2 C::difference_type
Element operatorit [n] Convertible to T.
Element assignmentit [n] = tI is mutableConvertible to T.
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Iterator .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Forward motionit += nIncluding it itself, there must be n -dereferenceable or past-the-end iterators following or preceding -it, depending on whether n is positive or -negative.If n > 0, equivalent to executing ++ -it n times. If n < 0, -equivalent to executing -- it n times. If -n == 0, this is a null operation.it is dereferenceable or past-the-end.
Iterator additionit + nSame as for i += n.Equivalent to
-{
- I itt = it;
- return itt += n;
-}
Result is dereferenceable or past-the-end.
Backward motionit -= nIncluding it itself, there must be n -dereferenceable or past-the-end iterators preceding or following -it, depending on whether n is positive or -negative.Equivalent to it += (-n).it is dereferenceable or past-the-end.
Iterator subtractionit - nSame as for i -= n.Equivalent to
-{
- I itt = it;
- return itt -= n;
-}
Result is dereferenceable or past-the-end.
Differenceit1 - it2Either it1 is reachable from it2 or -it2 is reachable from it1, or both.Returns a number n such that it1 == it2 + -n 
Element operatorit [n]it + n exists and is dereferenceable.Equivalent to *(it + n) 
Element assignmenti[n] = tSame as for it [n].Equivalent to *(it + n) = t 
-

Complexity guarantees

-

The complexity of operations on indexed random access iterators -is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Symmetry of addition and subtractionIf it + n is well-defined, then it += n; it --= n; and (it + n) - n are null operations. -Similarly, if it - n is well-defined, then it -= -n; it += n; and (it - n) + n are null -operations.
Relation between distance and additionIf it1 - it2 is well-defined, then it1 == -it2 + (it1 - it2).
Reachability and distanceIf it1 is reachable from it2, then -it1 - it2 >= 0.
-

Models

-
    -
  • vector::iterator
  • -
-

Indexed Bidirectional Column/Row Iterator

-

Description

-

An Indexed Bidirectional Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.

-

Refinement of

-

Assignable, Equality Comparable, Default Constructible.

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Bidirectional Column/Row Iterator
Container typeThe type of the container a Indexed Bidirectional Column/Row -Iterator points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I1A type that is a model of Indexed Bidirectional Column/Row -Iterator
I2A type that is a model of Indexed Bidirectional Row/Column -Iterator
TThe value type of I1 and I2
CThe container type of I1 and I2
it1, it1t, it11, -it12Objects of type I1
it2, it2tObjects of type I2
tObject of type T
cObject of type C
-

Definitions

-

Valid expressions

-

In addition to the expressions defined for Assignable, Equality -Comparable and Default Constructible, the following expressions -must be valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Default constructorI1 it  
Dereference*it Convertible to T.
Dereference assignment*it = tI1 is mutable. 
Member accessit->mT is a type for which t.m is -defined. 
Preincrement++ it I1 &
Postincrementit ++ I1
Predecrement-- it I1 &
Postdecrementit -- I1
Row Indexit.index1 () C::size_type
Column Indexit.index2 () C::size_type
Row/Column Beginit.begin () I2
Row/Column Endit.end () I2
Reverse Row/Column Beginit.rbegin () reverse_iterator<I2>
Reverse Row/Column Endit.rend () reverse_iterator<I2>
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Assignable, Equality Comparable and -Default Constructible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Default constructorI1 it  it is singular.
Dereference*itit is dereferenceable.  
Dereference assignment*it = tSame as for *it. *it is a copy of t.
Member accessit->mit is dereferenceable.Equivalent to (*it).m 
Preincrement++ itit is dereferenceable.it is modified to point to the next element of -the column/row, i.e. for column iterators holds
-it.index1 () < (++ it).index1 () and
-it.index2 () == (++ it).index2 (),
-for row iterators holds
-it.index1 () == (++ it).index1 () and
-it.index2 () < (++ it).index2 ().
it is dereferenceable or past-the-end. -
-&it == &++ it
.
-If it1 == it2,
-then ++ it1 == ++ it2.
Postincrementit ++Same as for ++ it.Equivalent to
-{
- I1 itt = it;
- ++ it;
- return itt;
-}
it is dereferenceable or past-the-end.
Predecrement-- itit is dereferenceable or past-the-end.
-There exists a dereferenceable iterator itt such that -it == ++ itt.
it is modified to point to the previous  -element of the column/row, i.e. for column iterators holds
-it.index1 () > (-- it).index1 () and
-it.index2 () == (-- it).index2 (),
-for row iterators holds
-it.index1 () == (-- it).index1 () and
-it.index2 () > (-- it).index2 ().
it is dereferenceable.
-&it = &-- it.
-If it1 == it2,
-then -- it1 == -- it2.
Postdecrementit --Same as for -- it.Equivalent to
-{
- I1 itt = it;
- -- it;
- return itt;
-}
it is dereferenceable. 
Row Indexit.index1 ()If it is a Row iterator then it must be dereferenceable.it.index1 () >= 0 and
-it.index1 () < it () .size1 ()
If it1 == it2,
-then it1.index1 () == 12.index1 ().
-If it1, it2 are Row Iterators with it1 == it2,
-then it1.index1 () < (++ it2).index1 ().
-and it1.index1 () > (-- it2).index1 ().
Column Indexit.index2 ()If it is a Column iterator then it must be dereferenceable.it.index2 () >= 0 and
-it.index2 () < it () .size2 ()
If it1 == it2,
-then it1.index2 () == it2.index2 () -.
-If it1, it2 are Column Iterators with it1 == i12,
-then it1.index2 () < (++ it2).index2 ().
-end it1.index2 () > (-- it2).index2 ().
Row/Column Beginit.begin ()it is dereferenceable.If it is a Column Iterator,
-then it2 = it.begin () is a Row Iterator
-with it2.index1 () == it.index1 (). -

If it is a Row Iterator,
-then it2 = it.begin () is a Column Iterator
-with it2.index2 () == it.index2 ().

-
 
Row/Column Endit.end ()it is dereferenceable.If it is a Column Iterator,
-then it2 = it.end () is a Row Iterator
-with it2.index1 () == it.index1 (). -

If it is a Row Iterator,
-then it2 = it.end () is a Column Iterator
-with it2.index2 () == it.index2 ().

-
 
Reverse Row/Column Beginit.rbegin ()it is dereferenceable.Equivalent to reverse_iterator<I2> (it.end -()). 
Reverse Row/Column Endit.rend ()it is dereferenceable.Equivalent to reverse_iterator<I2> (it.begin -()). 
-

Complexity guarantees

-

The complexity of operations on indexed bidirectional column/row -iterators is guaranteed to be logarithmic depending on the size of -the container. The complexity of one iterator (depending on the -storage layout) can be lifted to be amortized constant time. The -complexity of the other iterator (depending on the storage layout -and the container) can be lifted to be amortized constant time for -the first row/first column respectively.

-

Invariants

- - - - - - - - - - - - - - - - - - - - - - - -
Identityit1 == it2 if and only if &*it1 == -&*it2.
Symmetry of increment and decrementIf it is dereferenceable, then ++ it; ---it; is a null operation. Similarly, -- it; ++ -it; is a null operation.
Relation between iterator index and container element -operatorIf it is dereferenceable, *it == it () -(it.index1 (), it.index2 ())
Relation between iterator column/row begin and iterator -indexIf it is a Column Iterator -and it2 = it.begin () then it2.index2 () < -it2t.index2 () for all it2t with it2t () -== it2 () and it2t ().index1 () == it2 ().index1 -(). -

If it is a Row Iterator and -it2 = it.begin () then it2.index1 () < -it2t.index1 () for all it2t with it2t () -== it2 () and it2t ().index2 () == it2 ().index2 -().

-
Relation between iterator column/row end and iterator -indexIf it is a Column Iterator -and it2 = it.end () then it2.index2 () > -it2t.index2 () for all it2t with it2t () -== it2 () and it2t ().index1 () == it2 ().index1 -(). -

If it is a Row Iterator and -it2 = it.end () then it2.index1 () > -it2t.index1 () for all it2t with it2t () -== it2 () and it2t ().index2 () == it2 ().index2 -().

-
-

Models

-
    -
  • sparse_matrix::iterator1
  • -
  • sparse_matrix::iterator2
  • -
-

Indexed Random Access Column/Row Iterator

-

Description

-

An Indexed Random Access Column/Row Iterator is an iterator of a -container that can be dereferenced, incremented, decremented and -carries index information.

-

Refinement of

-

Indexed -Bidirectional Column/Row Iterator .

-

Associated types

- - - - - - - - - - - -
Value typeThe type of the value obtained by dereferencing a Indexed -Random Access Column/Row Iterator
Container typeThe type of the container a Indexed Random Access Column/Row -Iterator points into.
-

Notation

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
IA type that is a model of Indexed Random Access Column/Row -Iterator
TThe value type of I
CThe container type of I
it, itt, it1, it2Objects of type I
tObject of type T
cObject of type C
-

Definitions

-

Valid expressions

-

In addition to the expressions defined for Indexed Bidirectional -Column/Row Iterator , the following expressions must be -valid.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Forward motionit += n I &
Iterator additionit + n I
Backward motioni -= n I &
Iterator subtractionit - n I 
Differenceit1 - it2 C::difference_type
Element operatorit [n] Convertible to T.
Element assignmentit [n] = tI is mutableConvertible to T.
-

Expression Semantics

-

Semantics of an expression is defined only where it differs -from, or is not defined in, Indexed Bidirectional -Column/Row Iterator .

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionPreconditionSemanticsPostcondition
Forward motionit += nIncluding it itself, there must be n -dereferenceable or past-the-end iterators following or preceding -it, depending on whether n is positive or -negative.If n > 0, equivalent to executing ++ -it n times. If n < 0, -equivalent to executing -- it n times. If -n == 0, this is a null operation.it is dereferenceable or past-the-end.
Iterator additionit + nSame as for i += n.Equivalent to
-{
- I itt = it;
- return itt += n;
-}
Result is dereferenceable or past-the-end.
Backward motionit -= nIncluding it itself, there must be n -dereferenceable or past-the-end iterators preceding or following -it, depending on whether n is positive or -negative.Equivalent to it += (-n).it is dereferenceable or past-the-end.
Iterator subtractionit - nSame as for i -= n.Equivalent to
-{
- I itt = it;
- return itt -= n;
-}
Result is dereferenceable or past-the-end.
Differenceit1 - it2Either it1 is reachable from it2 or -it2 is reachable from it1, or both.Returns a number n such that it1 == it2 + -n 
Element operatorit [n]it + n exists and is dereferenceable.Equivalent to *(it + n) 
Element assignmenti[n] = tSame as for it [n].Equivalent to *(it + n) = t 
-

Complexity guarantees

-

The complexity of operations on indexed random access Column/Row -iterators is guaranteed to be amortized constant time.

-

Invariants

- - - - - - - - - - - - - - - -
Symmetry of addition and subtractionIf it + n is well-defined, then it += n; it --= n; and (it + n) - n are null operations. -Similarly, if it - n is well-defined, then it -= -n; it += n; and (it - n) + n are null -operations.
Relation between distance and additionIf it1 - it2 is well-defined, then it1 == -it2 + (it1 - it2).
Reachability and distanceIf it1 is reachable from it2, then -it1 - it2 >= 0.
-

Models

-
    -
  • matrix::iterator1
  • -
  • matrix::iterator2
  • -
-
-

Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
- Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

- - - diff --git a/doc/js/jquery-1.3.2.min.js b/doc/js/jquery-1.3.2.min.js deleted file mode 100644 index b1ae21d8..00000000 --- a/doc/js/jquery-1.3.2.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/doc/js/jquery.toc-gw.js b/doc/js/jquery.toc-gw.js deleted file mode 100644 index d48dd4be..00000000 --- a/doc/js/jquery.toc-gw.js +++ /dev/null @@ -1,166 +0,0 @@ -/*! - * jQuery TOC Plugin v1.1.x based on - * samaxesJS JavaScript Library - * http://code.google.com/p/samaxesjs/ - * - * Copyright (c) 2008 samaxes.com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * 2009-10-04, guwi17: modified and extended to meet uBLAS' needs - */ - -(function($) { - /* - * The TOC plugin dynamically builds a table of contents from the headings in - * a document and prepends legal-style section numbers to each of the headings. - */ - $.fn.toc = function(options) { - var opts = $.extend({}, $.fn.toc.defaults, options); - - return this.each(function() { - var toc = $(this).append('
    ').children('ul'); - var headers = {h1: 0, h2: 0, h3: 0, h4: 0, h5: 0, h6: 0}; - var index = 0; - var indexes = { - h1: (opts.exclude.match('h1') == null && $('h1').length > 0) ? ++index : 0, - h2: (opts.exclude.match('h2') == null && $('h2').length > 0) ? ++index : 0, - h3: (opts.exclude.match('h3') == null && $('h3').length > 0) ? ++index : 0, - h4: (opts.exclude.match('h4') == null && $('h4').length > 0) ? ++index : 0, - h5: (opts.exclude.match('h5') == null && $('h5').length > 0) ? ++index : 0, - h6: (opts.exclude.match('h6') == null && $('h6').length > 0) ? ++index : 0 - }; - - $(':header').not(opts.exclude).each(function() { - var linkId = ""; - if ($(this).is('h6')) { - checkContainer(headers.h6, toc); - updateNumeration(headers, 'h6'); - $(this).text(addNumeration(headers, 'h6', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h6, linkId, $(this).text(), headers); - } else if ($(this).is('h5')) { - checkContainer(headers.h5, toc); - updateNumeration(headers, 'h5'); - $(this).text(addNumeration(headers, 'h5', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h5, linkId, $(this).text(), headers); - } else if ($(this).is('h4')) { - checkContainer(headers.h4, toc); - updateNumeration(headers, 'h4'); - $(this).text(addNumeration(headers, 'h4', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h4, linkId, $(this).text(), headers); - } else if ($(this).is('h3')) { - checkContainer(headers.h3, toc); - updateNumeration(headers, 'h3'); - $(this).text(addNumeration(headers, 'h3', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h3, linkId, $(this).text(), headers); - } else if ($(this).is('h2')) { - checkContainer(headers.h2, toc); - updateNumeration(headers, 'h2'); - $(this).text(addNumeration(headers, 'h2', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h2, linkId, $(this).text(), headers); - } else if ($(this).is('h1')) { - updateNumeration(headers, 'h1'); - $(this).text(addNumeration(headers, 'h1', $(this).text())); - linkId = fixAnchor($(this)); - appendToTOC(toc, indexes.h1, linkId, $(this).text(), headers); - } - }); - }); - }; - - /* - * Checks if the last node is an 'ul' element. - * If not, a new one is created. - */ - function checkContainer(header, toc) { - if (header == 0 && !toc.find(':last').is('ul')) { - toc.find('li:last').append('
      '); - } - }; - - /* - * Updates headers numeration. - */ - function updateNumeration(headers, header) { - $.each(headers, function(i, val) { - if (i == header) { - ++headers[i]; - } else if (i > header) { - headers[i] = 0; - } - }); - }; - - /* - * Prepends the numeration to a heading. - */ - function addNumeration(headers, header, text) { - var numeration = ''; - - $.each(headers, function(i, val) { - if (i <= header && headers[i] > 0) { - numeration += headers[i] + '.'; - } - }); - - return removeFinalDot(numeration) + ' ' + text; - }; - - function removeFinalDot(text) { - return (text||"").replace(/\.$/g, "" ) - } - - function fixAnchor(element) { - // use existing id by default - var linkId = element.attr('id'); - // next, look for an anchor and use its id or name - if ( !linkId ) { - element.find('> a:first').each( function() { - linkId = $(this).attr('id') || $(this).attr('name'); - }); - } - // next, use the text content as last resort - if ( !linkId ) { - linkId = (element.text()||"unknown").replace(/[^a-zA-Z0-9]/g,""); - } - - element.attr('id',linkId); - return linkId; - } - - /* - * Appends a new node to the TOC. - */ - function appendToTOC(toc, index, id, text, headers) { - var parent = toc; - - for (var i = 1; i < index; i++) { - if (parent.find('> li:last > ul').length == 0) { - parent = parent.append('
      • '); - } - parent = parent.find('> li:last > ul'); - } - if (id) { - parent.append('
      • ' + text + '
      • '); - } else { - parent.append('
      • ' + text + '
      • '); - } - }; - - $.fn.toc.defaults = {exclude: 'h1, h5, h6'} -})(jQuery); diff --git a/doc/matrix.htm b/doc/matrix.htm deleted file mode 100644 index 0c909c79..00000000 --- a/doc/matrix.htm +++ /dev/null @@ -1,768 +0,0 @@ - - - - - - - - - -Matrix - - -

        Matrix

        -
        -

        Matrix

        -

        Description

        -

        The templated class matrix<T, F, A> is the -base container adaptor for dense matrices. For a (m x -n)-dimensional matrix and 0 <= i < m, 0 -<= j < n every element mi, -j is mapped to the (i x n + j)-th element of -the container for row major orientation or the (i + j x -m)-th element of the container for column major -orientation.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.
        FFunctor describing the storage organization. [1]row_major
        AThe type of the Storage array. [2]unbounded_array<T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<matrix<T, F, A> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix ()Allocates an uninitialized matrix that holds zero -rows of zero elements.
        matrix (size_type size1, size_type size2)Allocates an uninitialized matrix that holds -size1 rows of size2 elements.
        matrix (const matrix &m)The copy constructor.
        template<class AE>
        -matrix (const matrix_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size1, size_type size2, bool -preserve = true)Reallocates a matrix to hold size1 -rows of size2 elements. The existing elements of the -matrix are preseved when specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const array_type& data () const
        array_type& data ()
        const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        matrix &operator = (const matrix &m)The assignment operator.
        matrix &assign_temporary (matrix &m)Assigns a temporary. May change the matrix m.
        template<class AE>
        -matrix &operator = (const matrix_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the matrix. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix &operator += (const matrix_expression<AE> -&ae)
        A computed assignment operator. Adds the matrix expression to -the matrix.
        template<class AE>
        -matrix &plus_assign (const matrix_expression<AE> -&ae)
        Adds a matrix expression to the matrix. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix &operator -= (const matrix_expression<AE> -&ae)
        A computed assignment operator. Subtracts the matrix expression -from the matrix.
        template<class AE>
        -matrix &minus_assign (const matrix_expression<AE> -&ae)
        Subtracts a matrix expression from the matrix. Left and right -hand side of the assignment should be independent.
        template<class AT>
        -matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the matrix with a -scalar.
        template<class AT>
        -matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the matrix through a -scalar.
        void swap (matrix &m)Swaps the contents of the matrices.
        void insert_element (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row.
        void erase_element (size_type i, size_type j)Erases the value at the j-th element of the -i-th row.
        void clear ()Clears the matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed matrix.
        -

        Notes

        -

        [1] Supported parameters -for the storage organization are row_major and -column_major.

        -

        [2] Common parameters -for the storage array are unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

        -

        Identity Matrix

        -

        Description

        -

        The templated class identity_matrix<T, ALLOC> -represents identity matrices. For a (m x n)-dimensional -identity matrix and 0 <= i < m, 0 <= j < -n holds idi, j = 0, if -i <> j, and idi, i= -1.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    identity_matrix<double> m (3);
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Matrix .

        -

        Public base classes

        -

        matrix_container<identity_matrix<T> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        identity_matrix ()Constructs an identity_matrix that holds zero rows -of zero elements.
        identity_matrix (size_type size)Constructs an identity_matrix that holds -size rows of size elements.
        identity_matrix (const identity_matrix -&m)The copy constructor.
        void resize (size_type size, bool preserve = -true)Resizes a identity_matrix to hold -size rows of size elements. Therefore the -existing elements of the itendity_matrix are always -preseved.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        identity_matrix &operator = (const identity_matrix -&m)The assignment operator.
        identity_matrix &assign_temporary (identity_matrix -&m)Assigns a temporary. May change the identity matrix -m .
        void swap (identity_matrix &m)Swaps the contents of the identity matrices.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the identity_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the identity_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the identity_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the identity_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed identity_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed identity_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed identity_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed identity_matrix.
        -

        Zero Matrix

        -

        Description

        -

        The templated class zero_matrix<T, ALLOC> represents -zero matrices. For a (m x n)-dimensional zero matrix and -0 <= i < m, 0 <= j < n holds -zi, j = 0.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    zero_matrix<double> m (3, 3);
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Matrix .

        -

        Public base classes

        -

        matrix_container<zero_matrix<T> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        zero_matrix ()Constructs a zero_matrix that holds zero rows of -zero elements.
        zero_matrix (size_type size1, size_type -size2)Constructs a zero_matrix that holds -size1 rows of size2 elements.
        zero_matrix (const zero_matrix &m)The copy constructor.
        void resize (size_type size1, size_type size2, bool -preserve = true)Resizes a zero_matrix to hold size1 -rows of size2 elements. Therefore the existing -elements of the zero_matrix are always preseved.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        zero_matrix &operator = (const zero_matrix -&m)The assignment operator.
        zero_matrix &assign_temporary (zero_matrix -&m)Assigns a temporary. May change the zero matrix m -.
        void swap (zero_matrix &m)Swaps the contents of the zero matrices.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the zero_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the zero_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the zero_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the zero_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed zero_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed zero_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed zero_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed zero_matrix.
        -

        Scalar Matrix

        -

        Description

        -

        The templated class scalar_matrix<T, ALLOC> -represents scalar matrices. For a (m x n)-dimensional -scalar matrix and 0 <= i < m, 0 <= j < -n holds zi, j = s.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    scalar_matrix<double> m (3, 3);
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Matrix .

        -

        Public base classes

        -

        matrix_container<scalar_matrix<T> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        scalar_matrix ()Constructs a scalar_matrix that holds scalar rows -of zero elements.
        scalar_matrix (size_type size1, size_type size2, const -value_type &value)Constructs a scalar_matrix that holds -size1 rows of size2 elements each of the -specified value.
        scalar_matrix (const scalar_matrix &m)The copy constructor.
        void resize (size_type size1, size_type size2, bool -preserve = true)Resizes a scalar_matrix to hold size1 -rows of size2 elements. Therefore the existing -elements of the scalar_matrix are always -preseved.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        scalar_matrix &operator = (const scalar_matrix -&m)The assignment operator.
        scalar_matrix &assign_temporary (scalar_matrix -&m)Assigns a temporary. May change the scalar matrix -m .
        void swap (scalar_matrix &m)Swaps the contents of the scalar matrices.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the scalar_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the scalar_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the scalar_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the scalar_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed scalar_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed scalar_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed scalar_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed scalar_matrix.
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/matrix_expression.htm b/doc/matrix_expression.htm deleted file mode 100644 index 3960dec6..00000000 --- a/doc/matrix_expression.htm +++ /dev/null @@ -1,1428 +0,0 @@ - - - - - - - - - -Matrix Expressions - - -

        Matrix Expressions

        -
        -

        Matrix Expression

        -

        Description

        -

        The templated class matrix_expression<E> -is required to be a public base of all classes which model the Matrix Expression concept.

        -

        Definition

        -

        Defined in the header expression_types.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the matrix expression. 
        -

        Model of

        -

        None. Not a Matrix Expression! -

        -

        Type requirements

        -

        None.

        -

        Public base classes

        -

        None.

        -

        Members

        - - - - - - - - - - - - - - - -
        MemberDescription
        const expression_type &operator () () -constReturns a const reference of the expression.
        expression_type &operator () ()Returns a reference of the expression.
        -

        Notes

        -

        The operator[], row, column, range, slice and project functions have been removed. Use the free functions defined in matrix proxy instead.

        -

        Matrix Container

        -

        Description

        -

        The templated class matrix_container<C> -is required to be a public base of all classes which model the Matrix concept. -This includes the class matrix itself.

        -

        Definition

        -

        Defined in the header expression_types.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the matrix expression. 
        -

        Model of

        -

        None. Not a Matrix Expression OR Matrix! -

        -

        Type requirements

        -

        None.

        -

        Public base classes

        -

        matrix_expression<C>

        -

        Members

        - - - - - - - - - - - - - - - -
        MemberDescription
        const container_type &operator () () -constReturns a const reference of the container.
        container_type &operator () ()Returns a reference of the container.
        -

        Matrix References

        -

        Reference

        -

        Description

        -

        The templated class matrix_reference<E> -contains a reference to a matrix expression.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the matrix expression. 
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_reference<E> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_reference (expression_type &e)Constructs a constant reference of the expression.
        void resize (size_type size1, size2)Resizes the expression to hold at most size1 rows -of size2 elements.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the expression.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the expression.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed expression.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed expression.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed expression.
        -

        Matrix Operations

        -

        Unary Operation Description

        -

        Description

        -

        The templated classes matrix_unary1<E, F> and -matrix_unary2<E, F> describe unary matrix -operations.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the matrix expression. 
        FThe type of the operation. 
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_unary1<E, F> > -and matrix_expression<matrix_unary2<E, F> -> resp.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_unary1 (const expression_type &e)Constructs a description of the expression.
        matrix_unary2 (const expression_type &e)Constructs a description of the expression.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        -

        Unary Operations

        -

        Prototypes

        -
        -template<class E, class F>
        -    struct matrix_unary1_traits {
        -        typedef matrix_unary1<typename E::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (- m) [i] [j] = - m [i] [j]
        -    template<class E>
        -     typename matrix_unary1_traits<E, scalar_negate<typename E::value_type> >::result_type
        -    operator - (const matrix_expression<E> &e);
        -
        -    // (conj m) [i] [j] = conj (m [i] [j])
        -    template<class E>
        -     typename matrix_unary1_traits<E, scalar_conj<typename E::value_type> >::result_type
        -    conj (const matrix_expression<E> &e);
        -
        -    // (real m) [i] [j] = real (m [i] [j])
        -    template<class E>
        -     typename matrix_unary1_traits<E, scalar_real<typename E::value_type> >::result_type
        -    real (const matrix_expression<E> &e);
        -
        -    // (imag m) [i] [j] = imag (m [i] [j])
        -    template<class E>
        -     typename matrix_unary1_traits<E, scalar_imag<typename E::value_type> >::result_type
        -    imag (const matrix_expression<E> &e);
        -
        -    template<class E, class F>
        -    struct matrix_unary2_traits {
        -        typedef matrix_unary2<typename E::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (trans m) [i] [j] = m [j] [i]
        -    template<class E>
        -     typename matrix_unary2_traits<E, scalar_identity<typename E::value_type> >::result_type
        -    trans (const matrix_expression<E> &e);
        -
        -    // (herm m) [i] [j] = conj (m [j] [i])
        -    template<class E>
        -     typename matrix_unary2_traits<E, scalar_conj<typename E::value_type> >::result_type
        -    herm (const matrix_expression<E> &e);
        -
        -

        Description

        -

        operator - computes the additive inverse of a -matrix expression. conj computes the complex conjugate -of a matrix expression. real and imag -compute the real and imaginary parts of a matrix expression. -trans computes the transpose of a matrix expression. -herm computes the hermitian, i.e. the complex -conjugate of the transpose of a matrix expression.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Quadratic depending from the size of the matrix expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<std::complex<double> > m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
        -
        -    std::cout << - m << std::endl;
        -    std::cout << conj (m) << std::endl;
        -    std::cout << real (m) << std::endl;
        -    std::cout << imag (m) << std::endl;
        -    std::cout << trans (m) << std::endl;
        -    std::cout << herm (m) << std::endl;
        -}
        -
        -

        Binary Operation Description

        -

        Description

        -

        The templated class matrix_binary<E1, E2, F> -describes a binary matrix operation.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1The type of the first matrix expression.
        E2The type of the second matrix expression.
        FThe type of the operation.
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_binary<E1, E2, F> ->.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_binary (const expression1_type &e1, const -expression2_type &e2)Constructs a description of the expression.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        -

        Binary Operations

        -

        Prototypes

        -
        -template<class E1, class E2, class F>
        -    struct matrix_binary_traits {
        -        typedef matrix_binary<typename E1::const_closure_type,
        -                               typename E2::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (m1 + m2) [i] [j] = m1 [i] [j] + m2 [i] [j]
        -    template<class E1, class E2>
        -    typename matrix_binary_traits<E1, E2, scalar_plus<typename E1::value_type,
        -                                                       typename E2::value_type> >::result_type
        -    operator + (const matrix_expression<E1> &e1,
        -                 const matrix_expression<E2> &e2);
        -
        -    // (m1 - m2) [i] [j] = m1 [i] [j] - m2 [i] [j]
        -    template<class E1, class E2>
        -    typename matrix_binary_traits<E1, E2, scalar_minus<typename E1::value_type,
        -                                                        typename E2::value_type> >::result_type
        -    operator - (const matrix_expression<E1> &e1,
        -                 const matrix_expression<E2> &e2);
        -
        -

        Description

        -

        operator + computes the sum of two matrix -expressions. operator - computes the difference of two -matrix expressions.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size1 () == e2 ().size1 ()
        • -
        • e1 ().size2 () == e2 ().size2 ()
        • -
        -

        Complexity

        -

        Quadratic depending from the size of the matrix expressions.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m1 (3, 3), m2 (3, 3);
        -    for (unsigned i = 0; i < std::min (m1.size1 (), m2.size1 ()); ++ i)
        -        for (unsigned j = 0; j < std::min (m1.size2 (), m2.size2 ()); ++ j)
        -            m1 (i, j) = m2 (i, j) = 3 * i + j;
        -
        -    std::cout << m1 + m2 << std::endl;
        -    std::cout << m1 - m2 << std::endl;
        -}
        -
        -

        Scalar Matrix Operation Description

        -

        Description

        -

        The templated classes matrix_binary_scalar1<E1, E2, -F> and matrix_binary_scalar2<E1, E2, -F> describe binary operations between a scalar and a -matrix.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1/E2The type of the scalar expression.
        E2/E1The type of the matrix expression.
        FThe type of the operation.
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_binary_scalar1<E1, E2, -F> > and -matrix_expression<matrix_binary_scalar2<E1, E2, F> -> resp.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_binary_scalar1 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        matrix_binary_scalar1 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        -

        Scalar Matrix Operations

        -

        Prototypes

        -
        -template<class T1, class E2, class F>
        -    struct matrix_binary_scalar1_traits {
        -        typedef matrix_binary_scalar1<scalar_const_reference<T1>,
        -                                      typename E2::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (t * m) [i] [j] = t * m [i] [j]
        -    template<class T1, class E2>
        -    typename matrix_binary_scalar1_traits<T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type
        -    operator * (const T1 &e1,
        -                 const matrix_expression<E2> &e2);
        -
        -    template<class E1, class T2, class F>
        -    struct matrix_binary_scalar2_traits {
        -        typedef matrix_binary_scalar2<typename E1::const_closure_type,
        -                                      scalar_const_reference<T2>, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (m * t) [i] [j] = m [i] [j] * t
        -    template<class E1, class T2>
        -    typename matrix_binary_scalar2_traits<E1, T2, scalar_multiplies<typename E1::value_type, T2> >::result_type
        -    operator * (const matrix_expression<E1> &e1,
        -                 const T2 &e2);
        -
        -    // (m / t) [i] [j] = m [i] [j] / t
        -    template<class E1, class T2>
        -    typename matrix_binary_scalar2_traits<E1, T2, scalar_divides<typename E1::value_type, T2> >::result_type
        -    operator / (const matrix_expression<E1> &e1,
        -                 const T2 &e2);
        -
        -

        Description

        -

        operator * computes the product of a scalar and a -matrix expression. operator / multiplies the matrix -with the reciprocal of the scalar.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Quadratic depending from the size of the matrix expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -
        -    std::cout << 2.0 * m << std::endl;
        -    std::cout << m * 2.0 << std::endl;
        -}
        -
        -

        Matrix Vector Operations

        -

        Binary Operation Description

        -

        Description

        -

        The templated classes matrix_vector_binary1<E1, E2, -F> and matrix_vector_binary2<E1, E2, -F> describe binary matrix vector operations.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1The type of the matrix or vector expression.
        E2The type of the vector or matrix expression.
        FThe type of the operation.
        -

        Model of

        -

        Vector Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<matrix_vector_binary1<E1, E2, -F> > and -vector_expression<matrix_vector_binary2<E1, E2, F> -> resp.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_vector_binary1 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        matrix_vector_binary2 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        size_type size () constReturns the size of the expression.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the expression.
        const_iterator end () constReturns a const_iterator pointing to the end of -the expression.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed expression.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed expression.
        -

        Binary Operations

        -

        Prototypes

        -
        -template<class T1, class E1, class T2, class E2>
        -    struct matrix_vector_binary1_traits {
        -        typedef row_major_tag dispatch_category;
        -        typedef typename promote_traits<T1, T2>::promote_type promote_type;
        -        typedef matrix_vector_binary1<typename E1::const_closure_type,
        -                                       typename E2::const_closure_type,
        -                                       matrix_vector_prod1<T1, T2, promote_type> > expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    template<class E1, class E2>
        -    typename matrix_vector_binary1_traits<typename E1::value_type, E1,
        -                                           typename E2::value_type, E2>::result_type
        -    prod (const matrix_expression<E1> &e1,
        -           const vector_expression<E2> &e2,
        -          row_major_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_vector_binary1_traits<typename E1::value_type, E1,
        -                                           typename E2::value_type, E2>::result_type
        -    prod (const matrix_expression<E1> &e1,
        -           const vector_expression<E2> &e2);
        -
        -    template<class E1, class E2>
        -    typename matrix_vector_binary1_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                           typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const matrix_expression<E1> &e1,
        -                const vector_expression<E2> &e2,
        -               row_major_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_vector_binary1_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                           typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const matrix_expression<E1> &e1,
        -                const vector_expression<E2> &e2);
        -
        -    template<class V, class E1, class E2>
        -    V
        -    prod (const matrix_expression<E1> &e1,
        -          const vector_expression<E2> &e2);
        -
        -    template<class V, class E1, class E2>
        -    V
        -    prec_prod (const matrix_expression<E1> &e1,
        -               const vector_expression<E2> &e2);
        -
        -    template<class T1, class E1, class T2, class E2>
        -    struct matrix_vector_binary2_traits {
        -        typedef column_major_tag dispatch_category;
        -        typedef typename promote_traits<T1, T2>::promote_type promote_type;
        -        typedef matrix_vector_binary2<typename E1::const_closure_type,
        -                                       typename E2::const_closure_type,
        -                                       matrix_vector_prod2<T1, T2, promote_type> > expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    template<class E1, class E2>
        -    typename matrix_vector_binary2_traits<typename E1::value_type, E1,
        -                                           typename E2::value_type, E2>::result_type
        -    prod (const vector_expression<E1> &e1,
        -           const matrix_expression<E2> &e2,
        -          column_major_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_vector_binary2_traits<typename E1::value_type, E1,
        -                                           typename E2::value_type, E2>::result_type
        -    prod (const vector_expression<E1> &e1,
        -           const matrix_expression<E2> &e2);
        -
        -    template<class E1, class E2>
        -    typename matrix_vector_binary2_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                           typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const vector_expression<E1> &e1,
        -                const matrix_expression<E2> &e2,
        -               column_major_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_vector_binary2_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                           typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const vector_expression<E1> &e1,
        -                const matrix_expression<E2> &e2);
        -
        -    template<class V, class E1, class E2>
        -    V
        -    prod (const vector_expression<E1> &e1,
        -          const matrix_expression<E2> &e2);
        -
        -    template<class V, class E1, class E2>
        -    V
        -    prec_prod (const vector_expression<E1> &e1,
        -               const matrix_expression<E2> &e2);
        -
        -

        Description

        -

        prod computes the product of the matrix and the -vector expression. prec_prod computes the double -precision product of the matrix and the vector expression.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size2 () == e2 ().size ()
        • -
        • e1 ().size () == e2 ().size1 ()
        • -
        -

        Complexity

        -

        Quadratic depending from the size of the matrix expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    vector<double> v (3);
        -    for (unsigned i = 0; i < std::min (m.size1 (), v.size ()); ++ i) {
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -        v (i) = i;
        -    }
        -
        -    std::cout << prod (m, v) << std::endl;
        -    std::cout << prod (v, m) << std::endl;
        -}
        -
        -

        Triangular Solver

        -

        Prototypes

        -
        -template<class E1, class E2>
        -    struct matrix_vector_solve_traits {
        -        typedef typename promote_traits<typename E1::value_type, typename E2::value_type>::promote_type promote_type;
        -        typedef vector<promote_type> result_type;
        -    };
        -
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                         E2 &e2,
        -                        lower_tag,
        -                        vector_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                         E2 &e2,
        -                        upper_tag,
        -                        vector_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                         E2 &e2,
        -                        unit_lower_tag,
        -                        vector_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                         E2 &e2,
        -                        unit_upper_tag,
        -                        vector_tag);
        -
        -    template<class E1, class E2, class C>
        -    typename matrix_vector_solve_traits<E1, E2>::result_type
        -    solve (const matrix_expression<E1> &e1,
        -            const vector_expression<E2> &e2,
        -           C);
        -
        -    template<class E1, class E2>
        -    void inplace_solve (E1 &e1,
        -                        const matrix_expression<E2> &e2,
        -                         vector_tag,
        -                         lower_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (E1 &e1,
        -                        const matrix_expression<E2> &e2,
        -                         vector_tag,
        -                         upper_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (E1 &e1,
        -                        const matrix_expression<E2> &e2,
        -                         vector_tag,
        -                         unit_lower_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (E1 &e1,
        -                        const matrix_expression<E2> &e2,
        -                         vector_tag,
        -                         unit_upper_tag);
        -
        -    template<class E1, class E2, class C>
        -    typename matrix_vector_solve_traits<E1, E2>::result_type
        -    solve (const vector_expression<E1> &e1,
        -            const matrix_expression<E2> &e2,
        -           C);
        -
        -

        Description

        -

        solve solves a linear equation for lower or upper -(unit) triangular matrices.

        -

        Definition

        -

        Defined in the header triangular.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size1 () == e1 ().size2 ()
        • -
        • e1 ().size2 () == e2 ().size ()
        • -
        • e1 ().size () == e2 ().size1 ()
        • -
        • e2 ().size1 () == e2 ().size2 ()
        • -
        -

        Complexity

        -

        Quadratic depending from the size of the matrix expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/triangular.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    vector<double> v (3);
        -    for (unsigned i = 0; i < std::min (m.size1 (), v.size ()); ++ i) {
        -        for (unsigned j = 0; j <= i; ++ j)
        -            m (i, j) = 3 * i + j + 1;
        -        v (i) = i;
        -    }
        -
        -    std::cout << solve (m, v, lower_tag ()) << std::endl;
        -    std::cout << solve (v, m, lower_tag ()) << std::endl;
        -}
        -
        -

        Matrix Matrix Operations

        -

        Binary Operation Description

        -

        Description

        -

        The templated class matrix_matrix_binary<E1, E2, -F> describes a binary matrix operation.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1The type of the first matrix expression.
        E2The type of the second matrix expression.
        FThe type of the operation.
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_matrix_binary<E1, E2, F> -> .

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_matrix_binary (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        -

        Binary Operations

        -

        Prototypes

        -
        -template<class T1, class E1, class T2, class E2>
        -    struct matrix_matrix_binary_traits {
        -        typedef unknown_orientation_tag dispatch_category;
        -        typedef typename promote_traits<T1, T2>::promote_type promote_type;
        -        typedef matrix_matrix_binary<typename E1::const_closure_type,
        -                                     typename E2::const_closure_type,
        -                                     matrix_matrix_prod<T1, T2, promote_type> > expression_type;
        -        typedef expression_type result_type;
        -    };
        -
        -    template<class E1, class E2>
        -    typename matrix_matrix_binary_traits<typename E1::value_type, E1,
        -                                         typename E2::value_type, E2>::result_type
        -    prod (const matrix_expression<E1> &e1,
        -          const matrix_expression<E2> &e2,
        -          unknown_orientation_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_matrix_binary_traits<typename E1::value_type, E1,
        -                                         typename E2::value_type, E2>::result_type
        -    prod (const matrix_expression<E1> &e1,
        -          const matrix_expression<E2> &e2);
        -
        -    template<class E1, class E2>
        -    typename matrix_matrix_binary_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                         typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const matrix_expression<E1> &e1,
        -               const matrix_expression<E2> &e2,
        -               unknown_orientation_tag);
        -
        -    // Dispatcher
        -    template<class E1, class E2>
        -    typename matrix_matrix_binary_traits<typename type_traits<typename E1::value_type>::precision_type, E1,
        -                                         typename type_traits<typename E2::value_type>::precision_type, E2>::result_type
        -    prec_prod (const matrix_expression<E1> &e1,
        -               const matrix_expression<E2> &e2);
        -
        -    template<class M, class E1, class E2>
        -    M
        -    prod (const matrix_expression<E1> &e1,
        -          const matrix_expression<E2> &e2);
        -
        -    template<class M, class E1, class E2>
        -    M
        -    prec_prod (const matrix_expression<E1> &e1,
        -               const matrix_expression<E2> &e2);
        -
        -

        Description

        -

        prod computes the product of the matrix -expressions. prec_prod computes the double precision -product of the matrix expressions.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size2 () == e2 ().size1 ()
        • -
        -

        Complexity

        -

        Cubic depending from the size of the matrix expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m1 (3, 3), m2 (3, 3);
        -    for (unsigned i = 0; i < std::min (m1.size1 (), m2.size1 ()); ++ i)
        -        for (unsigned j = 0; j < std::min (m1.size2 (), m2.size2 ()); ++ j)
        -            m1 (i, j) = m2 (i, j) = 3 * i + j;
        -
        -    std::cout << prod (m1, m2) << std::endl;
        -}
        -
        -

        Triangular Solvers

        -

        Prototypes

        -
        -template<class E1, class E2>
        -    struct matrix_matrix_solve_traits {
        -        typedef typename promote_traits<typename E1::value_type, typename E2::value_type>::promote_type promote_type;
        -        typedef matrix<promote_type> result_type;
        -    };
        -
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                        E2 &e2,
        -                        lower_tag,
        -                        matrix_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                        E2 &e2,
        -                        upper_tag,
        -                        matrix_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                        E2 &e2,
        -                        unit_lower_tag,
        -                        matrix_tag);
        -    template<class E1, class E2>
        -    void inplace_solve (const matrix_expression<E1> &e1,
        -                        E2 &e2,
        -                        unit_upper_tag,
        -                        matrix_tag);
        -
        -    template<class E1, class E2, class C>
        -    typename matrix_matrix_solve_traits<E1, E2>::result_type
        -    solve (const matrix_expression<E1> &e1,
        -           const matrix_expression<E2> &e2,
        -           C);
        -
        -

        Description

        -

        solve solves a linear equation for lower or upper -(unit) triangular matrices.

        -

        Definition

        -

        Defined in the header triangular.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size1 () == e1 ().size2 ()
        • -
        • e1 ().size2 () == e2 ().size1 ()
        • -
        -

        Complexity

        -

        Cubic depending from the size of the matrix expressions.

        -

        Examples

        -
        -#include <boost/numeric/ublas/triangular.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m1 (3, 3), m2 (3, 3);
        -    for (unsigned i = 0; i < std::min (m1.size1 (), m2.size1 ()); ++ i)
        -        for (unsigned j = 0; j <= i; ++ j)
        -            m1 (i, j) = m2 (i, j) = 3 * i + j + 1;
        -
        -    std::cout << solve (m1, m2, lower_tag ()) << std::endl;
        -}
        -
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/matrix_proxy.htm b/doc/matrix_proxy.htm deleted file mode 100644 index 56e774d9..00000000 --- a/doc/matrix_proxy.htm +++ /dev/null @@ -1,1428 +0,0 @@ - - - - - - - - - -Matrix Proxies - - -

        Matrix Proxies

        -
        -

        Matrix Row

        -

        Description

        -

        The templated class matrix_row<M> allows -addressing a row of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i) {
        -        matrix_row<matrix<double> > mr (m, i);
        -        for (unsigned j = 0; j < mr.size (); ++ j)
        -            mr (j) = 3 * i + j;
        -        std::cout << mr << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified row falls outside that of the row index range -of the matrix, then the matrix_row is not a well -formed Vector Expression. That is, access to an element which is -outside of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<matrix_row<M> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_row (matrix_type &data, size_type -i)Constructs a sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        matrix_row &operator = (const matrix_row -&mr)The assignment operator.
        matrix_row &assign_temporary (matrix_row -&mr)Assigns a temporary. May change the matrix row mr -.
        template<class AE>
        -matrix_row &operator = (const vector_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -matrix_row &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_row &operator += (const vector_expression<AE> -&ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -matrix_row &plus_assign (const vector_expression<AE> -&ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_row &operator -= (const vector_expression<AE> -&ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -matrix_row &minus_assign (const vector_expression<AE> -&ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_row &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -matrix_row &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (matrix_row &mr)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the matrix_row.
        const_iterator end () constReturns a const_iterator pointing to the end of -the matrix_row.
        iterator begin ()Returns a iterator pointing to the beginning of -the matrix_row.
        iterator end ()Returns a iterator pointing to the end of the -matrix_row.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed matrix_row.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed matrix_row.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed matrix_row.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed matrix_row.
        -

        Projections

        -

        Description

        -

        The free row functions support the construction of -matrix rows.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_row<M> row (M &data, std::size_t i);
        -    template<class M>
        -    const matrix_row<const M> row (const M &data, std::size_t i);
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Linear depending from the size of the row.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i) {
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            row (m, i) (j) = 3 * i + j;
        -        std::cout << row (m, i) << std::endl;
        -    }
        -}
        -
        -

        Matrix Column

        -

        Description

        -

        The templated class matrix_column<M> allows -addressing a column of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned j = 0; j < m.size2 (); ++ j) {
        -        matrix_column<matrix<double> > mc (m, j);
        -        for (unsigned i = 0; i < mc.size (); ++ i)
        -            mc (i) = 3 * i + j;
        -        std::cout << mc << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified column falls outside that of the column index -range of the matrix, then the matrix_column is not a -well formed Vector Expression. That is, access to an element which -is outside of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<matrix_column<M> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_column (matrix_type &data, size_type -j)Constructs a sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        matrix_column &operator = (const matrix_column -&mc)The assignment operator.
        matrix_column &assign_temporary (matrix_column -&mc)Assigns a temporary. May change the matrix column -mc .
        template<class AE>
        -matrix_column &operator = (const vector_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -matrix_column &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_column &operator += (const vector_expression<AE> -&ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -matrix_column &plus_assign (const vector_expression<AE> -&ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_column &operator -= (const vector_expression<AE> -&ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -matrix_column &minus_assign (const vector_expression<AE> -&ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_column &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -matrix_column &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (matrix_column &mc)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the matrix_column.
        const_iterator end () constReturns a const_iterator pointing to the end of -the matrix_column.
        iterator begin ()Returns a iterator pointing to the beginning of -the matrix_column.
        iterator end ()Returns a iterator pointing to the end of the -matrix_column.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed matrix_column.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed matrix_column.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed matrix_column.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed matrix_column.
        -

        Projections

        -

        Description

        -

        The free column functions support the construction -of matrix columns.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_column<M> column (M &data, std::size_t j);
        -    template<class M>
        -    const matrix_column<const M> column (const M &data, std::size_t j);
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Linear depending from the size of the column.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned j = 0; j < m.size2 (); ++ j) {
        -        for (unsigned i = 0; i < m.size1 (); ++ i)
        -            column (m, j) (i) = 3 * i + j;
        -        std::cout << column (m, j) << std::endl;
        -    }
        -}
        -
        -

        Vector Range

        -

        Description

        -

        The templated class matrix_vector_range<M> -allows addressing a sub vector of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -
        -    matrix_vector_range<matrix<double> > mvr (m, range (0, 3), range (0, 3));
        -    std::cout << mvr << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified ranges fall outside that of the index range of -the matrix, then the matrix_vector_range is not a well -formed Vector Expression. That is, access to an element which is -outside of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<matrix_vector_range<M> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_vector_range (matrix_type &data,
        -const range &r1, const range &r2)
        Constructs a sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        matrix_vector_range &operator = (const -matrix_vector_range &mvr)The assignment operator.
        matrix_vector_range &assign_temporary -(matrix_vector_range &mvr)Assigns a temporary. May change the matrix vector range -mvr.
        template<class AE>
        -matrix_vector_range &operator = (const -vector_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -matrix_vector_range &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_vector_range &operator += (const -vector_expression<AE> &ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -matrix_vector_range &plus_assign (const -vector_expression<AE> &ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_vector_range &operator -= (const -vector_expression<AE> &ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -matrix_vector_range &minus_assign (const -vector_expression<AE> &ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_vector_range &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -matrix_vector_range &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (matrix_vector_range &mvr)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the matrix_vector_range.
        const_iterator end () constReturns a const_iterator pointing to the end of -the matrix_vector_range.
        iterator begin ()Returns a iterator pointing to the beginning of -the matrix_vector_range.
        iterator end ()Returns a iterator pointing to the end of the -matrix_vector_range.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the matrix_vector_range.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed matrix_vector_range.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed matrix_vector_range.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed matrix_vector_range.
        -

        Vector Slice

        -

        Description

        -

        The templated class matrix_vector_slice<M> -allows addressing a sliced sub vector of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -
        -    matrix_vector_slice<matrix<double> > mvs (m, slice (0, 1, 3), slice (0, 1, 3));
        -    std::cout << mvs << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified slices fall outside that of the index range of -the matrix, then the matrix_vector_slice is not a well -formed Vector Expression. That is, access to an element which is -outside of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<matrix_vector_slice<M> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_vector_slice (matrix_type &data,
        -const slice &s1, const slice &s2)
        Constructs a sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        matrix_vector_slice &operator = (const -matrix_vector_slice &mvs)The assignment operator.
        matrix_vector_slice &assign_temporary -(matrix_vector_slice &mvs)Assigns a temporary. May change the matrix vector slice -vs.
        template<class AE>
        -matrix_vector_slice &operator = (const -vector_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -matrix_vector_slice &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_vector_slice &operator += (const -vector_expression<AE> &ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -matrix_vector_slice &plus_assign (const -vector_expression<AE> &ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_vector_slice &operator -= (const -vector_expression<AE> &ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -matrix_vector_slice &minus_assign (const -vector_expression<AE> &ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_vector_slice &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -matrix_vector_slice &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (matrix_vector_slice &mvs)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the matrix_vector_slice.
        const_iterator end () constReturns a const_iterator pointing to the end of -the matrix_vector_slice.
        iterator begin ()Returns a iterator pointing to the beginning of -the matrix_vector_slice.
        iterator end ()Returns a iterator pointing to the end of the -matrix_vector_slice.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed matrix_vector_slice.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed matrix_vector_slice.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed matrix_vector_slice.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed matrix_vector_slice.
        -

        Matrix Range

        -

        Description

        -

        The templated class matrix_range<M> allows -addressing a sub matrix of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    matrix_range<matrix<double> > mr (m, range (0, 3), range (0, 3));
        -    for (unsigned i = 0; i < mr.size1 (); ++ i)
        -        for (unsigned j = 0; j < mr.size2 (); ++ j)
        -            mr (i, j) = 3 * i + j;
        -    std::cout << mr << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Matrix Expression -.

        -

        If the specified ranges fall outside that of the index range of -the matrix, then the matrix_range is not a well formed -Matrix Expression. That is, access to an element which is outside -of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_range<M> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_range (matrix_type &data,
        -const range &r1, const range &r2)
        Constructs a sub matrix.
        size_type start1 () constReturns the index of the first row.
        size_type size1 () constReturns the number of rows.
        size_type start2 () constReturns the index of the first column.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        matrix_range &operator = (const matrix_range -&mr)The assignment operator.
        matrix_range &assign_temporary (matrix_range -&mr)Assigns a temporary. May change the matrix range -mr .
        template<class AE>
        -matrix_range &operator = (const matrix_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -matrix_range &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the sub matrix. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_range &operator += (const matrix_expression<AE> -&ae)
        A computed assignment operator. Adds the matrix expression to -the sub matrix.
        template<class AE>
        -matrix_range &plus_assign (const matrix_expression<AE> -&ae)
        Adds a matrix expression to the sub matrix. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_range &operator -= (const matrix_expression<AE> -&ae)
        A computed assignment operator. Subtracts the matrix expression -from the sub matrix.
        template<class AE>
        -matrix_range &minus_assign (const matrix_expression<AE> -&ae)
        Subtracts a matrix expression from the sub matrix. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_range &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub matrix with -a scalar.
        template<class AT>
        -matrix_range &operator /= (const AT &at)
        A computed assignment operator. Divides the sub matrix through -a scalar.
        void swap (matrix_range &mr)Swaps the contents of the sub matrices.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the matrix_range.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the matrix_range.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the matrix_range.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -matrix_range.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the matrix_range.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the matrix_range.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the matrix_range.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -matrix_range.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed matrix_range.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed matrix_range.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed matrix_range.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed matrix_range.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed matrix_range.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed matrix_range.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed matrix_range.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -reversed the matrix_range.
        -

        Simple Projections

        -

        Description

        -

        The free subrange functions support the construction -of matrix ranges.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_range<M> subrange (M &data,
        -       M::size_type start1, M::size_type stop1, M::size_type start2, M::size_type, stop2);
        -    template<class M>
        -    const matrix_range<const M> subrange (const M &data,
        -       M::size_type start1, M::size_type stop1, M::size_type start2, M::size_type, stop2);
        -
        -

        Generic Projections

        -

        Description

        -

        The free project functions support the construction -of matrix ranges. Existing matrix_range's can be composed with further ranges. The resulting ranges are computed using this existing ranges' compose function.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_range<M> project (M &data, const range &r1, const range &r2);
        -    template<class M>
        -    const matrix_range<const M> project (const M &data, const range &r1, const range &r2);
        -    template<class M>
        -    matrix_range<M> project (matrix_range<M> &data, const range &r1, const range &r2);
        -    template<class M>
        -    const matrix_range<M> project (const matrix_range<M> &data, const range &r1, const range &r2);
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Quadratic depending from the size of the ranges.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            project (m, range (0, 3), range (0, 3)) (i, j) = 3 * i + j;
        -    std::cout << project (m, range (0, 3), range (0, 3)) << std::endl;
        -}
        -
        -

        Matrix Slice

        -

        Description

        -

        The templated class matrix_slice<M> allows -addressing a sliced sub matrix of a matrix.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    matrix_slice<matrix<double> > ms (m, slice (0, 1, 3), slice (0, 1, 3));
        -    for (unsigned i = 0; i < ms.size1 (); ++ i)
        -        for (unsigned j = 0; j < ms.size2 (); ++ j)
        -            ms (i, j) = 3 * i + j;
        -    std::cout << ms << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of matrix referenced.
        -

        Model of

        -

        Matrix Expression -.

        -

        If the specified slices fall outside that of the index range of -the matrix, then the matrix_slice is not a well formed -Matrix Expression. That is, access to an element which is outside -of the matrix is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<matrix_slice<M> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        matrix_slice (matrix_type &data,
        -const slice &s1, const slice &s2)
        Constructs a sub matrix.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        matrix_slice &operator = (const matrix_slice -&ms)The assignment operator.
        matrix_slice &assign_temporary (matrix_slice -&ms)Assigns a temporary. May change the matrix slice -ms .
        template<class AE>
        -matrix_slice &operator = (const matrix_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -matrix_slice &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the sub matrix. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -matrix_slice &operator += (const matrix_expression<AE> -&ae)
        A computed assignment operator. Adds the matrix expression to -the sub matrix.
        template<class AE>
        -matrix_slice &plus_assign (const matrix_expression<AE> -&ae)
        Adds a matrix expression to the sub matrix. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -matrix_slice &operator -= (const matrix_expression<AE> -&ae)
        A computed assignment operator. Subtracts the matrix expression -from the sub matrix.
        template<class AE>
        -matrix_slice &minus_assign (const matrix_expression<AE> -&ae)
        Subtracts a matrix expression from the sub matrix. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -matrix_slice &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub matrix with -a scalar.
        template<class AT>
        -matrix_slice &operator /= (const AT &at)
        A computed assignment operator. Multiplies the sub matrix -through a scalar.
        void swap (matrix_slice &ms)Swaps the contents of the sub matrices.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the matrix_slice.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the matrix_slice.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the matrix_slice.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -matrix_slice.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the matrix_slice.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the matrix_slice.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the matrix_slice.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -matrix_slice.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed matrix_slice.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed matrix_slice.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed matrix_slice.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed matrix_slice.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed matrix_slice.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed matrix_slice.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed matrix_slice.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed matrix_slice.
        -

        Simple Projections

        -

        Description

        -

        The free subslice functions support the construction -of matrix slices.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_slice<M> subslice (M &data,
        -       M::size_type start1, M::difference_type stride1, M::size_type size1,
        -       M::size_type start2, M::difference_type stride2, M::size_type size2);
        -    template<class M>
        -    const matrix_slice<const M> subslice (const M &data,
        -       M::size_type start1, M::difference_type stride1, M::size_type size1,
        -       M::size_type start2, M::difference_type stride2, M::size_type size2);
        -
        -

        Generic Projections

        -

        Description

        -

        The free project functions support the construction -of matrix slices. Existing matrix_slice's can be composed with further ranges or slices. The resulting slices are computed using this existing slices' compose function.

        -

        Prototypes

        -
        
        -    template<class M>
        -    matrix_slice<M> project (M &data, const slice &s1, const slice &s2);
        -    template<class M>
        -    const matrix_slice<const M> project (const M &data, const slice &s1, const slice &s2);
        -    template<class M>
        -    matrix_slice<M> project (matrix_slice<M> &data, const range &r1, const range &r2);
        -    template<class M>
        -    const matrix_slice<M> project (const matrix_slice<M> &data, const range &r1, const range &r2);
        -    template<class M>
        -    matrix_slice<M> project (matrix_slice<M> &data, const slice &s1, const slice &s2);
        -    template<class M>
        -    const matrix_slice<M> project (const matrix_slice<M> &data, const slice &s1, const slice &s2);
        -
        -

        Definition

        -

        Defined in the header matrix_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Quadratic depending from the size of the slices.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/matrix_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            project (m, slice (0, 1, 3), slice (0, 1, 3)) (i, j) = 3 * i + j;
        -    std::cout << project (m, slice (0, 1, 3), slice (0, 1, 3)) << std::endl;
        -}
        -
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/matrix_sparse.htm b/doc/matrix_sparse.htm deleted file mode 100644 index e08781ea..00000000 --- a/doc/matrix_sparse.htm +++ /dev/null @@ -1,983 +0,0 @@ - - - - - - - - - -Sparse Matrix - - -

        Sparse Matricies

        -
        -

        Mapped Matrix

        -

        Description

        -

        The templated class mapped_matrix<T, F, A> is -the base container adaptor for sparse matricies using element maps. -For a (m xn)-dimensional sparse matrix and 0 <= i < m, -0 <= j < n the non-zero elements -mi, j are mapped via (i x n + -j) for row major orientation or via (i + j x m) for -column major orientation to consecutive elements of the associative -container, i.e. for elements k = -mi1 -,j1and k + 1 = -mi2 -,j2of the container holds -i1 < -i2 or (i1 -= i2 and -j1 < -j2) with row major orientation or -j1 < -j2 or (j1 -= j2 and -i1 < -i2) with column major -orientation.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    mapped_matrix<double> m (3, 3, 3 * 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the mapped matrix.
        FFunctor describing the storage organization. [1]row_major
        AThe type of the adapted array. [2]map_std<std::size_t, T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<mapped_matrix<T, F, A> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        mapped_matrix ()Allocates a mapped_matrix that holds at most zero -rows of zero elements.
        mapped_matrix (size_type size1, size_type2, size_type non_zeros = 0)Allocates a mapped_matrix that holds at most -size1 rows of size2 elements.
        mapped_matrix (const mapped_matrix &m)The copy constructor.
        template<class AE>
        -mapped_matrix (size_type non_zeros, const -matrix_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size1, size_type size2, bool preserve = true)Reallocates a mapped_matrix to hold at most -size1 rows of size2 elements. The -existing elements of the mapped_matrix are preseved -when specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        mapped_matrix &operator = (const mapped_matrix -&m)The assignment operator.
        mapped_matrix &assign_temporary (mapped_matrix -&m)Assigns a temporary. May change the mapped matrix -m .
        template<class AE>
        -mapped_matrix &operator = (const matrix_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -mapped_matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the mapped matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -mapped_matrix &operator += (const matrix_expression<AE> -&ae)
        A computed assignment operator. Adds the matrix expression to -the mapped matrix.
        template<class AE>
        -mapped_matrix &plus_assign (const matrix_expression<AE> -&ae)
        Adds a matrix expression to the mapped matrix. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -mapped_matrix &operator -= (const matrix_expression<AE> -&ae)
        A computed assignment operator. Subtracts the matrix expression -from the mapped matrix.
        template<class AE>
        -mapped_matrix &minus_assign (const matrix_expression<AE> -&ae)
        Subtracts a matrix expression from the mapped matrix. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -mapped_matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the mapped matrix -with a scalar.
        template<class AT>
        -mapped_matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the mapped matrix -through a scalar.
        void swap (mapped_matrix &m)Swaps the contents of the mapped matrices.
        true_refrence insert_element (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row. Duplicates elements are not allowed.
        void erase_element (size_type i, size_type j)Erases the value at the j-th element of the -i-th row.
        void clear ()Clears the mapped matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the mapped_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the mapped_matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the mapped_matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -mapped_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the mapped_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the mapped_matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the mapped_matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -mapped_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed mapped_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed mapped_matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed mapped_matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed mapped_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed mapped_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed mapped_matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed mapped_matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed mapped_matrix.
        -

        Notes

        -

        [1] Supported -parameters for the storage organization are row_major -and column_major.

        -

        [2] Supported -parameters for the adapted array are -map_array<std::size_t, T> and -map_std<std::size_t, T>. The latter is -equivalent to std::map<std::size_t, T>.

        -

        Compressed Matrix

        -

        Description

        -

        The templated class compressed_matrix<T, F, IB, IA, -TA> is the base container adaptor for compressed -matrices. For a (m x n )-dimensional compressed matrix and -0 <= i < m, 0 <= j < n the non-zero -elements mi, j are mapped via (i x -n + j) for row major orientation or via (i + j x m) -for column major orientation to consecutive elements of the index -and value containers, i.e. for elements k = -mi1 -,j1and k + 1 = -mi2 -,j2of the container holds -i1 < -i2 or (i1 -= i2 and -j1 < -j2) with row major orientation or -j1 < -j2 or (j1 -= j2 and -i1 < -i2) with column major -orientation.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    compressed_matrix<double> m (3, 3, 3 * 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the compressed matrix.
        FFunctor describing the storage organization. [1]row_major
        IBThe index base of the compressed vector. [2]0
        IAThe type of the adapted array for indices. [3]unbounded_array<std::size_t>
        TAThe type of the adapted array for values. [3]unbounded_array<T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<compressed_matrix<T, F, IB, IA, -TA> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        compressed_matrix ()Allocates a compressed_matrix that holds at most -zero rows of zero elements.
        compressed_matrix (size_type size1, size_type2, size_type non_zeros = 0)Allocates a compressed_matrix that holds at most -size1 rows of size2 elements.
        compressed_matrix (const compressed_matrix -&m)The copy constructor.
        template<class AE>
        -compressed_matrix (size_type non_zeros, const -matrix_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size1, size_type size2, bool preserve = true)Reallocates a compressed_matrix to hold at most -size1 rows of size2 elements. The -existing elements of the compressed_matrix are -preseved when specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        compressed_matrix &operator = (const -compressed_matrix &m)The assignment operator.
        compressed_matrix &assign_temporary -(compressed_matrix &m)Assigns a temporary. May change the compressed matrix -m.
        template<class AE>
        -compressed_matrix &operator = (const -matrix_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -compressed_matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the compressed matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -compressed_matrix &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the compressed matrix.
        template<class AE>
        -compressed_matrix &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the compressed matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -compressed_matrix &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the compressed matrix.
        template<class AE>
        -compressed_matrix &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the compressed matrix. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -compressed_matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the compressed -matrix with a scalar.
        template<class AT>
        -compressed_matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the compressed matrix -through a scalar.
        void swap (compressed_matrix &m)Swaps the contents of the compressed matrices.
        true_reference insert_element (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row. Duplicates elements are not allowed.
        void erase_element (size_type i, size_type j)Erases the value at the j-th element of the -i-th row.
        void clear ()Clears the compressed matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the compressed_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the compressed_matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the compressed_matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -compressed_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the compressed_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the compressed_matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the compressed_matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -compressed_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed compressed_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed compressed_matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed compressed_matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed compressed_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed compressed_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed compressed_matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed compressed_matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed compressed_matrix.
        -

        Notes

        -

        [1] -Supported parameters for the storage organization are -row_major and column_major.

        -

        [2] -Supported parameters for the index base are 0 and -1 at least.

        -

        [3] -Supported parameters for the adapted array are -unbounded_array<> , -bounded_array<> and -std::vector<> .

        -

        Coordinate Matrix

        -

        Description

        -

        The templated class coordinate_matrix<T, F, IB, IA, -TA> is the base container adaptor for compressed -matrices. For a (m x n )-dimensional sorted coordinate -matrix and 0 <= i < m, 0 <= j < n the -non-zero elements mi, j are mapped via -(i x n + j) for row major orientation or via (i + j x -m) for column major orientation to consecutive elements of the -index and value containers, i.e. for elements k = -mi1 -,j1and k + 1 = -mi2 -,j2of the container holds -i1 < -i2 or (i1 -= i2 and -j1 < -j2) with row major orientation or -j1 < -j2 or (j1 -= j2 and -i1 < -i2) with column major -orientation.

        -

        Example

        -
        -#include <boost/numeric/ublas/matrix_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    coordinate_matrix<double> m (3, 3, 3 * 3);
        -    for (unsigned i = 0; i < m.size1 (); ++ i)
        -        for (unsigned j = 0; j < m.size2 (); ++ j)
        -            m (i, j) = 3 * i + j;
        -    std::cout << m << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header matrix_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the coordinate matrix.
        FFunctor describing the storage organization. [1]row_major
        IBThe index base of the coordinate vector. [2]0
        IAThe type of the adapted array for indices. [3]unbounded_array<std::size_t>
        TAThe type of the adapted array for values. [3]unbounded_array<T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<coordinate_matrix<T, F, IB, IA, -TA> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        coordinate_matrix ()Allocates a coordinate_matrix that holds at most -zero rows of zero elements.
        coordinate_matrix (size_type size1, size_type2, size_type non_zeros = 0)Allocates a coordinate_matrix that holds at most -size1 rows of size2 elements.
        coordinate_matrix (const coordinate_matrix -&m)The copy constructor.
        template<class AE>
        -coordinate_matrix (size_type non_zeros, const -matrix_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size1, size_type size2, bool preserve = true)Reallocates a coordinate_matrix to hold at most -size1 rows of size2 elements. The -existing elements of the coordinate_matrix are -preseved when specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        coordinate_matrix &operator = (const -coordinate_matrix &m)The assignment operator.
        coordinate_matrix &assign_temporary -(coordinate_matrix &m)Assigns a temporary. May change the coordinate matrix -m.
        template<class AE>
        -coordinate_matrix &operator = (const -matrix_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -coordinate_matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the coordinate matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -coordinate_matrix &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the coordinate matrix.
        template<class AE>
        -coordinate_matrix &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the coordinate matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -coordinate_matrix &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the coordinate matrix.
        template<class AE>
        -coordinate_matrix &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the coordinate matrix. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -coordinate_matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the coordinate -matrix with a scalar.
        template<class AT>
        -coordinate_matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the coordinate matrix -through a scalar.
        void swap (coordinate_matrix &m)Swaps the contents of the coordinate matrices.
        true_reference insert_element (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row. Duplicates elements are not allowed.
        void append_element (size_type i, size_type j, const_reference t)Appends the value t at the j-th element of the i-th row. -Duplicate elements can be appended to a coordinate_matrix. They are merged into a single -arithmetically summed element by the sort function.
        void erase_element (size_type i, size_type j)Erases the value at the j-th element of the -i-th row.
        void clear ()Clears the coordinate matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the coordinate_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the coordinate_matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the coordinate_matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -coordinate_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the coordinate_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the coordinate_matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the coordinate_matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -coordinate_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed coordinate_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed coordinate_matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed coordinate_matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed coordinate_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed coordinate_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed coordinate_matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed coordinate_matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed coordinate_matrix.
        -

        Notes

        -

        [1] -Supported parameters for the storage organization are -row_major and column_major.

        -

        [2] -Supported parameters for the index base are 0 and -1 at least.

        -

        [3] -Supported parameters for the adapted array are -unbounded_array<> , -bounded_array<> and -std::vector<> .

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/operations_overview.htm b/doc/operations_overview.htm deleted file mode 100644 index ecb7ace1..00000000 --- a/doc/operations_overview.htm +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - -uBLAS operations overview - - -

        Overview of Matrix and Vector Operations

        -
        - -
        -
        Contents:
        -
        Basic Linear Algebra
        -
        Advanced Functions
        -
        Submatrices, Subvectors
        -
        Speed Improvements
        -
        - -

        Definitions

        - - - - - - - - - - - - - - -
        A, B, C are matrices
        u, v, ware vectors
        i, j, kare integer values
        t, t1, t2are scalar values
        r, r1, r2are ranges, e.g. range(0, 3)
        s, s1, s2are slices, e.g. slice(0, 1, 3)
        - -

        Basic Linear Algebra

        - -

        standard operations: addition, subtraction, multiplication by a -scalar

        - -
        
        -C = A + B; C = A - B; C = -A;
        -w = u + v; w = u - v; w = -u;
        -C = t * A; C = A * t; C = A / t;
        -w = t * u; w = u * t; w = u / t;
        -
        - -

        computed assignements

        - -
        
        -C += A; C -= A; 
        -w += u; w -= u; 
        -C *= t; C /= t; 
        -w *= t; w /= t;
        -
        - -

        inner, outer and other products

        - -
        
        -t = inner_prod(u, v);
        -C = outer_prod(u, v);
        -w = prod(A, u); w = prod(u, A); w = prec_prod(A, u); w = prec_prod(u, A);
        -C = prod(A, B); C = prec_prod(A, B);
        -w = element_prod(u, v); w = element_div(u, v);
        -C = element_prod(A, B); C = element_div(A, B);
        -
        - -

        transformations

        - -
        
        -w = conj(u); w = real(u); w = imag(u);
        -C = trans(A); C = conj(A); C = herm(A); C = real(A); C = imag(A);
        -
        - -

        Advanced functions

        - -

        norms

        - -
        
        -t = norm_inf(v); i = index_norm_inf(v);
        -t = norm_1(v);   t = norm_2(v); 
        -t = norm_inf(A); i = index_norm_inf(A);
        -t = norm_1(A);   t = norm_frobenius(A); 
        -
        - -

        products

        - -
        
        -axpy_prod(A, u, w, true);  // w = A * u
        -axpy_prod(A, u, w, false); // w += A * u
        -axpy_prod(u, A, w, true);  // w = trans(A) * u
        -axpy_prod(u, A, w, false); // w += trans(A) * u
        -axpy_prod(A, B, C, true);  // C = A * B
        -axpy_prod(A, B, C, false); // C += A * B
        -
        -

        Note: The last argument (bool init) of -axpy_prod is optional. Currently it defaults to -true, but this may change in the future. Set the -init to true is equivalent to call -w.clear() before axpy_prod. Up to now -there are some specialisation for compressed matrices that give a -large speed up compared to prod.

        -
        
        -w = block_prod<matrix_type, 64> (A, u); // w = A * u
        -w = block_prod<matrix_type, 64> (u, A); // w = trans(A) * u
        -C = block_prod<matrix_type, 64> (A, B); // w = A * B
        -
        -

        Note: The blocksize can be any integer. However, the -total speed depends very strong on the combination of blocksize, -CPU and compiler. The function block_prod is designed -for large dense matrices.

        -

        rank-k updates

        -
        
        -opb_prod(A, B, C, true);  // C = A * B
        -opb_prod(A, B, C, false); // C += A * B
        -
        -

        Note: The last argument (bool init) of -opb_prod is optional. Currently it defaults to -true, but this may change in the future. This function -may give a speedup if A has less columns than rows, -because the product is computed as a sum of outer products.

        - -

        Submatrices, Subvectors

        -

        Accessing submatrices and subvectors via proxies using project functions:

        -
        
        -w = project(u, r);         // the subvector of u specifed by the index range r
        -w = project(u, s);         // the subvector of u specifed by the index slice s
        -C = project(A, r1, r2);    // the submatrix of A specified by the two index ranges r1 and r2
        -C = project(A, s1, s2);    // the submatrix of A specified by the two index slices s1 and s2
        -w = row(A, i); w = column(A, j);    // a row or column of matrix as a vector
        -
        -

        Assigning to submatrices and subvectors via proxies using project functions:

        -
        
        -project(u, r) = w;         // assign the subvector of u specifed by the index range r
        -project(u, s) = w;         // assign the subvector of u specifed by the index slice s
        -project(A, r1, r2) = C;    // assign the submatrix of A specified by the two index ranges r1 and r2
        -project(A, s1, s2) = C;    // assign the submatrix of A specified by the two index slices s1 and s2
        -row(A, i) = w; column(A, j) = w;    // a row or column of matrix as a vector
        -
        -

        Note: A range r = range(start, stop) -contains all indices i with start <= i < -stop. A slice is something more general. The slice -s = slice(start, stride, size) contains the indices -start, start+stride, ..., start+(size-1)*stride. The -stride can be 0 or negative! If start >= stop for a range -or size == 0 for a slice then it contains no elements.

        -

        Sub-ranges and sub-slices of vectors and matrices can be created directly with the subrange and sublice functions:

        -
        
        -w = subrange(u, 0, 2);         // the 2 element subvector of u
        -w = subslice(u, 0, 1, 2);      // the 2 element subvector of u
        -C = subrange(A, 0,2, 0,3);     // the 2x3 element submatrix of A
        -C = subslice(A, 0,1,2, 0,1,3); // the 2x3 element submatrix of A
        -subrange(u, 0, 2) = w;         // assign the 2 element subvector of u
        -subslice(u, 0, 1, 2) = w;      // assign the 2 element subvector of u
        -subrange(A, 0,2, 0,3) = C;     // assign the 2x3 element submatrix of A
        -subrange(A, 0,1,2, 0,1,3) = C; // assigne the 2x3 element submatrix of A
        -
        -

        There are to more ways to access some matrix elements as a -vector:

        -
        matrix_vector_range<matrix_type> (A, r1, r2);
        -matrix_vector_slice<matrix_type> (A, s1, s2);
        -
        -

        Note: These matrix proxies take a sequence of elements -of a matrix and allow you to access these as a vector. In -particular matrix_vector_slice can do this in a very -general way. matrix_vector_range is less useful as the -elements must lie along a diagonal.

        -

        Example: To access the first two elements of a sub -column of a matrix we access the row with a slice with stride 1 and -the column with a slice with stride 0 thus:
        -matrix_vector_slice<matrix_type> (A, slice(0,1,2), -slice(0,0,2)); -

        - -

        Speed improvements

        -

        Matrix / Vector assignment

        -

        If you know for sure that the left hand expression and the right -hand expression have no common storage, then assignment has -no aliasing. A more efficient assignment can be specified -in this case:

        -
        noalias(C) = prod(A, B);
        -
        -

        This avoids the creation of a temporary matrix that is required in a normal assignment. -'noalias' assignment requires that the left and right hand side be size conformant.

        - -

        Sparse element access

        -

        The matrix element access function A(i1,i2) or the equivalent vector -element access functions (v(i) or v[i]) usually create 'sparse element proxies' -when applied to a sparse matrix or vector. These proxies allow access to elements -without having to worry about nasty C++ issues where references are invalidated.

        -

        These 'sparse element proxies' can be implemented more efficiently when applied to const -objects. -Sadly in C++ there is no way to distinguish between an element access on the left and right hand side of -an assignment. Most often elements on the right hand side will not be changed and therefore it would -be better to use the const proxies. We can do this by making the matrix or vector -const before accessing it's elements. For example:

        -
        value = const_cast<const VEC>(v)[i];   // VEC is the type of V
        -
        -

        If more then one element needs to be accessed const_iterator's should be used -in preference to iterator's for the same reason. For the more daring 'sparse element proxies' -can be completely turned off in uBLAS by defining the configuration macro BOOST_UBLAS_NO_ELEMENT_PROXIES. -

        - - -

        Controlling the complexity of nested products

        - -

        What is the complexity (the number of add and multiply operations) required to compute the following? -

        -
        - R = prod(A, prod(B,C)); 
        -
        -

        Firstly the complexity depends on matrix size. Also since prod is transitive (not commutative) -the bracket order affects the complexity. -

        -

        uBLAS evaluates expressions without matrix or vector temporaries and honours -the bracketing structure. However avoiding temporaries for nested product unnecessarly increases the complexity. -Conversly by explictly using temporary matrices the complexity of a nested product can be reduced. -

        -

        uBLAS provides 3 alternative syntaxes for this purpose: -

        -
        - temp_type T = prod(B,C); R = prod(A,T);   // Preferable if T is preallocated
        -
        -
        - prod(A, temp_type(prod(B,C));
        -
        -
        - prod(A, prod<temp_type>(B,C));
        -
        -

        The 'temp_type' is important. Given A,B,C are all of the same type. Say -matrix<float>, the choice is easy. However if the value_type is mixed (int with float or double) -or the matrix type is mixed (sparse with symmetric) the best solution is not so obvious. It is up to you! It -depends on numerical properties of A and the result of the prod(B,C). -

        - -
        -

        Copyright (©) 2000-2007 Joerg Walter, Mathias Koch, Gunter -Winkler, Michael Stevens
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/options.htm b/doc/options.htm deleted file mode 100644 index 299f6b60..00000000 --- a/doc/options.htm +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - -Boost Basic Linear Algebra - Configuration Options - - -

        logoBoost Basic Linear Algebra - Configuration Options

        -
        - - - -

        NDEBUG

        - -

        Make sure you define NDEBUG The only way uBLAS -knows you want a release configuration is to check if you have defined -NDEBUG. If you don't it assumes you want a debug configuration and -adds a lot of very useful runtime check. However these are very slow! -

        - - -

        BOOST_UBLAS_MOVE_SEMANTICS

        - -

        The patch and description was provided by Nasos Iliopoulos.

        - -

        An immediate effect of this option is the elimination of the need -for noalias in types vector<T> and matrix<T>, -when assigned to the same type. This option doesn't have an effect on -bounded and c types. Although it is rare, not all compilers support copy -elision (that allows for move semantics), so a test must be performed to -make sure that there is a benefit when it is enabled. A small -demonstration and test can be found in -test_move_semantics.cpp

        - -

        -In the test -example two tests are defined, one for vectors and one for -matrices. The aim of this example is to print the pointers of the -storage of each of the containers, before and after the assignment to -a temporary object. When move semantics are enabled, the -vector<T> and matrix<T> storage is moved -from the temporary and no copy is performed. -

        - -

        -If move semantics are supported by your compiler you will get an output like the following: -

        -
        -matrix<double> --------------------------------------------------------------------
        -Temporary pointer r: 0x94790c0
        -Pointer (must be equal to temp. pointer if move semantics are enabled) : 0x94790c0
        -
        - -

        Notes:

        -
          -
        • It should be no surprise to see matrices and vectors been passed -by VALUE, the compiler takes care and either moves (if the underlying -code does not modify the object), or copies (if the underlying code -modifies the object). -
        • -
        • There might be some space for some improvements (like clearing the -data, before swaping) -
        • -
        • Move semantics don't eliminate temporaries. They rather move their -storage around so no copies are performed. -
        • -
        • MSVC does no implement Named Return Value Optimization in debug -mode. So if you build in debug with this compiler you might get different behaviour than a release build. -
        • -
        • Enabling move semantics is done via #define BOOST_UBLAS_MOVE_SEMANTICS. -
        • -
        • There is plenty of room for optimizations when c++0x standard is -out, taking advantage of rvalue references. (I have a sweet vector -implementation using that). -
        • -
        • If you enable move semantics and your compiler does not support -them, the operation will just be as passing by const reference. -
        • -
        - -

        Interesting links

        - - -

        BOOST_UBLAS_CHECK_ENABLE

        - -

        When BOOST_UBLAS_CHECK_ENABLE is defined then all index and -parameter checks are enabled. This is enabled in debug mode and -disabled in release mode. -

        - -

        BOOST_UBLAS_TYPE_CHECK

        - -

        When BOOST_UBLAS_TYPE_CHECK is enabled then all possibly expensive -structure checks are enabled. If this is not desireable then use -#define BOOST_UBLAS_TYPE_CHECK 0 before including any uBLAS -header. The define BOOST_UBLAS_TYPE_CHECK_EPSILON can be used to -control the acceptable tolerance, see -detail/matrix_assign.hpp for implementation details of this -check. -

        - -

        BOOST_UBLAS_USE_LONG_DOUBLE

        - -

        Enable uBLAS expressions that involve containers of 'long double'

        - -

        BOOST_UBLAS_USE_INTERVAL

        - -

        Enable uBLAS expressions that involve containers of 'boost::numeric::interval' types

        - -

        Configuring uBLAS with Macros

        - -

        Many macro's appear in ublas/config.hpp and elsewhere. Hopefully in the future some of these will disappear! -They fall into 4 groups: -

        -
          -
        • Automatically set by 'boost/numeric/ublas/config.hpp' based on -NDEBUG. Makes the distinction between debug (safe) and release (fast) -mode. Similar to STLport -
            -
          • Release mode (NDEBUG defined) -
              -
            • BOOST_UBLAS_INLINE Compiler dependant definition to control -function inlining.
            • BOOST_UBLAS_USE_FAST_SAME
            -
          • Debug mode -
              -
            • BOOST_UBLAS_CHECK_ENABLE Enable checking of indexs, iterators -and parameters. Prevents out of bound access etc.
            • -BOOST_UBLAS_TYPE_CHECK Enable additional checks for the results of -expressions using non dense types. Picks up runtime error such as the -assignment of a numerically non-symmetric matrix to -symmertic_matrix. Use #define BOOST_UBLAS_TYPE_CHECK 0 to -disable expensive numeric type checks. (Note: "structure check" -would be a much better name.)
            • -BOOST_UBLAS_TYPE_CHECK_EPSILON default: sqrt(epsilon), controls how -large the difference between the expected result and the computed -result may become. Increase this value if you are going to use near -singular or badly scaled matrices. Please, refer to -detail/matrix_assign.hpp for implementation of these type -checks.
          -
        • -
        • Automatically set by 'boost/numeric/ublas/config.hpp' based on -compiler and boost/config.hpp macro's. Augments the compiler -deficiency workarounds already supplied by boost/config.hpp -
            -
          • BOOST_UBLAS_NO_NESTED_CLASS_RELATION A particularly nasty -problem with VC7.1 Requires that uBLAS and the user use begin(it) -rather then it.begin()
          • BOOST_UBLAS_NO_SMART_PROXIES -Disable the automatic propagation of 'constantness' to -proxies. Smart proxies automatically determine if the underling -container they reference is constant or not. They adjust there -definition of iterators and container access to reflect this -constantness.
          -
        • -
        • For use by uBLAS authors to test implementation methods. Preset -in config.hpp -
            -
          • BOOST_UBLAS_USE_INVARIANT_HOISTING
          • -BOOST_UBLAS_USE_INDEXING
          • BOOST_UBLAS_USE_INDEXED_ITERATOR -
          • BOOST_UBLAS_NON_CONFORMANT_PROXIES Gappy containers may -be non-conformant, that is contain elements at different -indices. Assigning between proxies (vector ranges for example) of -these containers is difficult as the LHS may need insert new -elements. This is slow.
          • BOOST_UBLAS_USE_DUFF_DEVICE -Near useless on all platforms (see GCC's -funroll-loops) - -
          -
        • -
        • User options. Can be predefined by user before including any -uBLAS headers. They may also be automatically defined for some -compilers to work around compile bugs. -
            -
          • BOOST_UBLAS_USE_LONG_DOUBLE Enable uBLAS expressions that -involve containers of 'long double'
          • -BOOST_UBLAS_USE_INTERVAL Enable uBLAS expressions that involve -containers of 'boost::numeric::interval' types
          • -BOOST_UBLAS_SIMPLE_ET_DEBUG In order to simplify debugging is is -possible to simplify expression templateso they are restricted to a -single operation - -
          • BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS enable automatic -conversion from proxy class to matrix expression
          • -BOOST_UBLAS_NO_ELEMENT_PROXIES Disables the use of element proxies -for gappy types.
          • The Gappy types (sparse, coordinate, -compressed) store non-zero elements in their own containers. When new -non-zero elements are assigned they must rearrange these -containers. This invalidates references, iterators or pointers to -these elements. This can happen at some surprising times such as the -expression "a [1] = a [0] = 1;". Element proxies guarantee all such -expressions will work as expected. However they bring their own -restrictions and efficiency problems. For example as of Boost 1.30.0 -they prevent the assignment of elements between different types. -
          • -
          • BOOST_UBLAS_REFERENCE_CONST_MEMBER Enable to allow refernces -to be returned to fixed (zero or one) elements of triangular or banded -matrices - -
          • BOOST_UBLAS_NO_EXCEPTIONS Disable the use exceptions of -uBLAS internal checks and error conditions. BOOST_NO_EXCEPTIONS has -same effect. -
          • -
          • BOOST_UBLAS_SINGULAR_CHECK Check the for singularity in triangular solve() functions
          • -
          -
        • -
        - -
        - -
        -

        - - -Last modified: Wed Sep 16 23:16:45 CEST 2009 - -

        -
        - - - diff --git a/doc/overview.htm b/doc/overview.htm deleted file mode 100644 index 60fce76c..00000000 --- a/doc/overview.htm +++ /dev/null @@ -1,965 +0,0 @@ - - - - - - - - - - -uBLAS Overview - - -

        logouBLAS Overview

        -
        -

        Rationale

        -

        It would be nice if every kind of numeric software could -be written in C++ without loss of efficiency, but unless something -can be found that achieves this without compromising the C++ type -system it may be preferable to rely on Fortran, assembler or -architecture-specific extensions (Bjarne Stroustrup).

        -

        This C++ library is directed towards scientific computing on the -level of basic linear algebra constructions with matrices and -vectors and their corresponding abstract operations. The primary -design goals were:

        -
          -
        • mathematical notation
        • -
        • efficiency
        • -
        • functionality
        • -
        • compatibility
        • -
        -

        Another intention was to evaluate, if the abstraction penalty -resulting from the use of such matrix and vector classes is -acceptable.

        -

        Resources

        -

        The development of this library was guided by a couple of -similar efforts:

        -
          -
        • BLAS by -Jack Dongarra et al.
        • -
        • Blitz++ by Todd -Veldhuizen
        • -
        • POOMA by Scott -Haney et al.
        • -
        • MTL by Jeremy -Siek et al.
        • -
        -

        BLAS seems to be the most widely used library for basic linear -algebra constructions, so it could be called a de-facto standard. -Its interface is procedural, the individual functions are somewhat -abstracted from simple linear algebra operations. Due to the fact -that is has been implemented using Fortran and its optimizations, -it also seems to be one of the fastest libraries available. As we -decided to design and implement our library in an object-oriented -way, the technical approaches are distinct. However anyone should -be able to express BLAS abstractions in terms of our library -operators and to compare the efficiency of the implementations.

        -

        Blitz++ is an impressive library implemented in C++. Its main -design seems to be oriented towards multidimensional arrays and -their associated operators including tensors. The author of Blitz++ -states, that the library achieves performance on par or better than -corresponding Fortran code due to his implementation technique -using expression templates and template metaprograms. However we -see some reasons, to develop an own design and implementation -approach. We do not know whether anybody tries to implement -traditional linear algebra and other numerical algorithms using -Blitz++. We also presume that even today Blitz++ needs the most -advanced C++ compiler technology due to its implementation idioms. -On the other hand, Blitz++ convinced us, that the use of expression -templates is mandatory to reduce the abstraction penalty to an -acceptable limit.

        -

        POOMA's design goals seem to parallel Blitz++'s in many parts . -It extends Blitz++'s concepts with classes from the domains of -partial differential equations and theoretical physics. The -implementation supports even parallel architectures.

        -

        MTL is another approach supporting basic linear algebra -operations in C++. Its design mainly seems to be influenced by BLAS -and the C++ Standard Template Library. We share the insight that a -linear algebra library has to provide functionality comparable to -BLAS. On the other hand we think, that the concepts of the C++ -standard library have not yet been proven to support numerical -computations as needed. As another difference MTL currently does -not seem to use expression templates. This may result in one of two -consequences: a possible loss of expressiveness or a possible loss -of performance.

        -

        Concepts

        -

        Mathematical Notation

        -

        The usage of mathematical notation may ease the development of -scientific algorithms. So a C++ library implementing basic linear -algebra concepts carefully should overload selected C++ operators -on matrix and vector classes.

        -

        We decided to use operator overloading for the following -primitives:

        - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DescriptionOperator
        Indexing of vectors and matricesvector::operator(size_t i);
        -matrix::operator(size_t i, size_t j);
        Assignment of vectors and matricesvector::operator = (const vector_expression &);
        -vector::operator += (const vector_expression &);
        -vector::operator -= (const vector_expression &);
        -vector::operator *= (const scalar_expression &);
        -matrix::operator = (const matrix_expression &);
        -matrix::operator += (const matrix_expression &);
        -matrix::operator -= (const matrix_expression &);
        -matrix::operator *= (const scalar_expression &);
        Unary operations on vectors and matricesvector_expression operator - (const vector_expression -&);
        -matrix_expression operator - (const matrix_expression -&);
        Binary operations on vectors and matricesvector_expression operator + (const vector_expression -&, const vector_expression &);
        -vector_expression operator - (const vector_expression &, const -vector_expression &);
        -matrix_expression operator + (const matrix_expression &, const -matrix_expression &);
        -matrix_expression operator - (const matrix_expression &, const -matrix_expression &);
        Multiplication of vectors and matrices with a scalarvector_expression operator * (const scalar_expression -&, const vector_expression &);
        -vector_expression operator * (const vector_expression &, const -scalar_expression &);
        -matrix_expression operator * (const scalar_expression &, const -matrix_expression &);
        -matrix_expression operator * (const matrix_expression &, const -scalar_expression &);
        -

        We decided to use no operator overloading for the following -other primitives:

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DescriptionFunction
        Left multiplication of vectors with a matrixvector_expression -prod<vector_type > (const -matrix_expression &, const vector_expression &);
        -vector_expression prod (const matrix_expression &, const -vector_expression &);
        Right multiplication of vectors with a matrixvector_expression -prod<vector_type > (const -vector_expression &, const matrix_expression &);
        -vector_expression prod (const vector_expression &, const -matrix_expression &);
        Multiplication of matricesmatrix_expression -prod<matrix_type > (const -matrix_expression &, const matrix_expression &);
        -matrix_expression prod (const matrix_expression &, const -matrix_expression &);
        Inner product of vectorsscalar_expression inner_prod (const vector_expression -&, const vector_expression &);
        Outer product of vectorsmatrix_expression outer_prod (const vector_expression -&, const vector_expression &);
        Transpose of a matrixmatrix_expression trans (const matrix_expression -&);
        -

        Efficiency

        -

        To achieve the goal of efficiency for numerical computing, one -has to overcome two difficulties in formulating abstractions with -C++, namely temporaries and virtual function calls. Expression -templates solve these problems, but tend to slow down compilation -times.

        -

        Eliminating Temporaries

        -

        Abstract formulas on vectors and matrices normally compose a -couple of unary and binary operations. The conventional way of -evaluating such a formula is first to evaluate every leaf operation -of a composition into a temporary and next to evaluate the -composite resulting in another temporary. This method is expensive -in terms of time especially for small and space especially for -large vectors and matrices. The approach to solve this problem is -to use lazy evaluation as known from modern functional programming -languages. The principle of this approach is to evaluate a complex -expression element wise and to assign it directly to the -target.

        -

        Two interesting and dangerous facts result:

        -

        Aliases

        -

        One may get serious side effects using element wise -evaluation on vectors or matrices. Consider the matrix vector -product x = A x. Evaluation of -A1x and assignment to -x1 changes the right hand side, so -that the evaluation of A2x -returns a wrong result. In this case there are aliases of the elements -xn on both the left and right hand side of the assignment.

        -

        Our solution for this problem is to -evaluate the right hand side of an assignment into a temporary and -then to assign this temporary to the left hand side. To allow -further optimizations, we provide a corresponding member function -for every assignment operator and also a - noalias syntax. -By using this syntax a programmer can confirm, that the left and right hand sides of an -assignment are independent, so that element wise evaluation and -direct assignment to the target is safe.

        -

        Complexity

        -

        The computational complexity may be unexpectedly large under certain -cirumstances. Consider the chained matrix vector product A (B -x). Conventional evaluation of A (B x) is quadratic. -Deferred evaluation of B xi is linear. -As every element B xi is needed -linearly depending of the size, a completely deferred evaluation of -the chained matrix vector product A (B x) is cubic. In -such cases one needs to reintroduce temporaries in the -expression.

        -

        Eliminating Virtual Function Calls

        -

        Lazy expression evaluation normally leads to the definition of a -class hierarchy of terms. This results in the usage of dynamic -polymorphism to access single elements of vectors and matrices, -which is also known to be expensive in terms of time. A solution -was found a couple of years ago independently by David Vandervoorde -and Todd Veldhuizen and is commonly called expression templates. -Expression templates contain lazy evaluation and replace dynamic -polymorphism with static, i.e. compile time polymorphism. -Expression templates heavily depend on the famous Barton-Nackman -trick, also coined 'curiously defined recursive templates' by Jim -Coplien.

        -

        Expression templates form the base of our implementation.

        -

        Compilation times

        -

        It is also a well known fact, that expression templates -challenge currently available compilers. We were able to -significantly reduce the amount of needed expression templates -using the Barton-Nackman trick consequently.

        -

        We also decided to support a dual conventional implementation -(i.e. not using expression templates) with extensive bounds and -type checking of vector and matrix operations to support the -development cycle. Switching from debug mode to release mode is -controlled by the NDEBUG preprocessor symbol of -<cassert>.

        - -

        Functionality

        - -

        Every C++ library supporting linear algebra will be measured -against the long-standing Fortran package BLAS. We now describe how -BLAS calls may be mapped onto our classes.

        - -

        The page Overview of Matrix and Vector Operations -gives a short summary of the most used operations on vectors and -matrices.

        - -

        Blas Level 1

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BLAS CallMapped Library ExpressionMathematical DescriptionComment
        sasum OR dasumnorm_1 (x)sum |xi|Computes the l1 (sum) norm of a real vector.
        scasum OR dzasumreal (sum (v)) + imag (sum (v))sum re(xi) + sum im(xi)Computes the sum of elements of a complex vector.
        _nrm2norm_2 (x)sqrt (sum -|xi|2 )Computes the l2 (euclidean) norm of a vector.
        i_amaxnorm_inf (x)
        -index_norm_inf (x)
        max |xi|Computes the linf (maximum) norm of a vector.
        -BLAS computes the index of the first element having this -value.
        _dot
        -_dotu
        -_dotc
        inner_prod (x, y)or
        -inner_prod (conj (x), y)
        xT y or
        -xH y
        Computes the inner product of two vectors.
        -BLAS implements certain loop unrollment.
        dsdot
        -sdsdot
        a + prec_inner_prod (x, y)a + xT yComputes the inner product in double precision.
        _copyx = y
        -y.assign (x)
        x <- yCopies one vector to another.
        -BLAS implements certain loop unrollment.
        _swapswap (x, y)x <-> ySwaps two vectors.
        -BLAS implements certain loop unrollment.
        _scal
        -csscal
        -zdscal
        x *= ax <- a xScales a vector.
        -BLAS implements certain loop unrollment.
        _axpyy += a * xy <- a x + yAdds a scaled vector.
        -BLAS implements certain loop unrollment.
        _rot
        -_rotm
        -csrot
        -zdrot
        t.assign (a * x + b * y),
        -y.assign (- b * x + a * y),
        -x.assign (t)
        (x, y) <- (a x + b y, -b x + a y)Applies a plane rotation.
        _rotg
        -_rotmg
         (a, b) <-
        -  (? a / sqrt (a
        2 + -b2),
        -    ? b / sqrt (a
        2 + -b2)) or
        -(1, 0) <- (0, 0)
        Constructs a plane rotation.
        -

        Blas Level 2

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BLAS CallMapped Library ExpressionMathematical DescriptionComment
        _t_mvx = prod (A, x) or
        -x = prod (trans (A), x)
        or
        -x = prod (herm (A), x)
        x <- A x or
        -x <- A
        T x or
        -x <- A
        H x
        Computes the product of a matrix with a vector.
        _t_svy = solve (A, x, tag) or
        -inplace_solve (A, x, tag) or
        -y = solve (trans (A), x, tag) or
        -inplace_solve (trans (A), x, tag) or
        -y = solve (herm (A), x, tag)or
        -inplace_solve (herm (A), x, tag)
        y <- A-1 x -or
        -x <- A
        -1 x or
        -y <- -A
        T-1 -x or
        -x <- -A
        T-1 -x or
        -y <- -A
        H-1 -x or
        -x <- -A
        H-1 -x
        Solves a system of linear equations with triangular form, i.e. -A is triangular.
        _g_mv
        -_s_mv
        -_h_mv
        y = a * prod (A, x) + b * y or
        -y = a * prod (trans (A), x) + b * y
        or
        -y = a * prod (herm (A), x) + b * y
        y <- a A x + b y or
        -y <- a A
        T x + b y
        -y <- a A
        H x + b y
        Adds the scaled product of a matrix with a vector.
        _g_r
        -_g_ru
        -_g_rc
        A += a * outer_prod (x, y) or
        -A += a * outer_prod (x, conj (y))
        A <- a x yT + A -or
        -A <- a x y
        H + A
        Performs a rank 1 update.
        _s_r
        -_h_r
        A += a * outer_prod (x, x) or
        -A += a * outer_prod (x, conj (x))
        A <- a x xT + A -or
        -A <- a x x
        H + A
        Performs a symmetric or hermitian rank 1 update.
        _s_r2
        -_h_r2
        A += a * outer_prod (x, y) +
        - a * outer_prod (y, x))
        or
        -A += a * outer_prod (x, conj (y)) +
        - conj (a) * outer_prod (y, conj (x)))
        A <- a x yT + a y -xT + A or
        -A <- a x y
        H + -a- y xH + -A
        Performs a symmetric or hermitian rank 2 update.
        -

        Blas Level 3

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BLAS CallMapped Library ExpressionMathematical DescriptionComment
        _t_mmB = a * prod (A, B) or
        -B = a * prod (trans (A), B) or
        -B = a * prod (A, trans (B)) or
        -B = a * prod (trans (A), trans (B)) or
        -B = a * prod (herm (A), B) or
        -B = a * prod (A, herm (B)) or
        -B = a * prod (herm (A), trans (B)) or
        -B = a * prod (trans (A), herm (B)) or
        -B = a * prod (herm (A), herm (B))
        B <- a op (A) op (B) with
        op (X) = X or
        op (X) = XT or
        op (X) = XH
        Computes the scaled product of two matrices.
        _t_smC = solve (A, B, tag) or
        -inplace_solve (A, B, tag) or
        -C = solve (trans (A), B, tag) or
        -inplace_solve (trans (A), B, tag)
        or
        -C = solve (herm (A), B, tag)
        or
        -inplace_solve (herm (A), B, tag)
        C <- A-1 B -or
        -B <- A
        -1 B or
        -C <- -A
        T-1 -B or
        -B <- A
        -1 B or
        -C <- -A
        H-1 -B or
        -B <- -A
        H-1 -B
        Solves a system of linear equations with triangular form, i.e. -A is triangular.
        _g_mm
        -_s_mm
        -_h_mm
        C = a * prod (A, B) + b * C or
        -C = a * prod (trans (A), B) + b * C or
        -C = a * prod (A, trans (B)) + b * C or
        -C = a * prod (trans (A), trans (B)) + b * C or
        -C = a * prod (herm (A), B) + b * C or
        -C = a * prod (A, herm (B)) + b * C or
        -C = a * prod (herm (A), trans (B)) + b * C or
        -C = a * prod (trans (A), herm (B)) + b * C or
        -C = a * prod (herm (A), herm (B)) + b * C
        C <- a op (A) op (B) + b C with
        op (X) = X or
        op (X) = XT or
        op (X) = XH
        Adds the scaled product of two matrices.
        _s_rk
        -_h_rk
        B = a * prod (A, trans (A)) + b * B or
        -B = a * prod (trans (A), A) + b * B or
        -B = a * prod (A, herm (A)) + b * B or
        -B = a * prod (herm (A), A) + b * B
        B <- a A AT + b B -or
        -B <- a A
        T A + b B or
        -B <- a A AH + b B -or
        -B <- a A
        H A + b B
        Performs a symmetric or hermitian rank k update.
        _s_r2k
        -_h_r2k
        C = a * prod (A, trans (B)) +
        - a * prod (B, trans (A)) + b * C
        or
        -C = a * prod (trans (A), B) +
        - a * prod (trans (B), A) + b * C
        or
        -C = a * prod (A, herm (B)) +
        - conj (a) * prod (B, herm (A)) + b * C
        or
        -C = a * prod (herm (A), B) +
        - conj (a) * prod (herm (B), A) + b * C
        C <- a A BT + a B -AT + b C or
        -C <- a A
        T B + a -BT A + b C or
        -C <- a A B
        H + -a- B AH + -b C or
        -C <- a A
        H B + -a- BH A + -b C
        Performs a symmetric or hermitian rank 2 k -update.
        - -

        Storage Layout

        - -

        uBLAS supports many different storage layouts. The full details can be -found at the Overview of Types. Most types like -vector<double> and matrix<double> are -by default compatible to C arrays, but can also be configured to contain -FORTAN compatible data. -

        - -

        Compatibility

        -

        For compatibility reasons we provide array like indexing for vectors and matrices. For some types (hermitian, sparse etc) this can be expensive for matrices due to the needed temporary proxy objects.

        -

        uBLAS uses STL compatible allocators for the allocation of the storage required for it's containers.

        -

        Benchmark Results

        -

        The following tables contain results of one of our benchmarks. -This benchmark compares a native C implementation ('C array') and -some library based implementations. The safe variants based on the -library assume aliasing, the fast variants do not use temporaries -and are functionally equivalent to the native C implementation. -Besides the generic vector and matrix classes the benchmark -utilizes special classes c_vector and -c_matrix, which are intended to avoid every overhead -through genericity.

        -

        The benchmark program bench1 was compiled with GCC 4.0 and run on an Athlon 64 3000+. Times are scales for reasonable precision by running bench1 100.

        -

        First we comment the results for double vectors and matrices of dimension 3 and 3 x 3, respectively.

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Comment
        inner_prodC array0.61782Some abstraction penalty
        c_vector0.86554
        vector<unbounded_array>1.02467
        vector + vectorC array0.511122Abstraction penalty: factor 2
        c_vector fast1.17489
        vector<unbounded_array> fast1.32433
        c_vector safe2.02283
        vector<unbounded_array> safe6.9582
        outer_prodC array0.59872Some abstraction penalty
        c_matrix, c_vector fast0.88585
        matrix<unbounded_array>, vector<unbounded_array> fast0.90572
        c_matrix, c_vector safe1.66310
        matrix<unbounded_array>, vector<unbounded_array> safe2.95175
        prod (matrix, vector)C array0.64671No significant abstraction penalty
        c_matrix, c_vector fast0.70613
        matrix<unbounded_array>, vector<unbounded_array> fast0.79543
        c_matrix, c_vector safe0.95452
        matrix<unbounded_array>, vector<unbounded_array> safe2.61164
        matrix + matrixC array0.75686No significant abstraction penalty
        c_matrix fast0.99520
        matrix<unbounded_array> fast1.29399
        c_matrix safe1.7303
        matrix<unbounded_array> safe3.14164
        prod (matrix, matrix)C array0.94457No significant abstraction penalty
        c_matrix fast1.17367
        matrix<unbounded_array> fast1.34320
        c_matrix safe1.56275
        matrix<unbounded_array> safe2.06208
        -

        We notice a two fold performance loss for small vectors and matrices: first the general abstraction penalty for using classes, and then a small loss when using the generic vector and matrix classes. The difference w.r.t. alias assumptions is also significant.

        -

        Next we comment the results for double vectors and matrices of -dimension 100 and 100 x 100, respectively.

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        OperationImplementationElapsed [s]MFLOP/sComment
        inner_prodC array0.64889No significant abstraction penalty
        c_vector0.66862
        vector<unbounded_array>0.66862
        vector + vectorC array0.64894No significant abstraction penalty
        c_vector fast0.66867
        vector<unbounded_array> fast0.66867
        c_vector safe1.14501
        vector<unbounded_array> safe1.23465
        outer_prodC array0.501144No significant abstraction penalty
        c_matrix, c_vector fast0.71806
        matrix<unbounded_array>, vector<unbounded_array> fast0.571004
        c_matrix, c_vector safe1.91300
        matrix<unbounded_array>, vector<unbounded_array> safe0.89643
        prod (matrix, vector)C array0.65876No significant abstraction penalty
        c_matrix, c_vector fast0.65876
        matrix<unbounded_array>, vector<unbounded_array> -fast0.66863
        c_matrix, c_vector safe0.66863
        matrix<unbounded_array>, vector<unbounded_array> -safe0.66863
        matrix + matrixC array0.96596No significant abstraction penalty
        c_matrix fast1.21473
        matrix<unbounded_array> fast1.00572
        c_matrix safe2.44235
        matrix<unbounded_array> safe1.30440
        prod (matrix, matrix)C array0.70813No significant abstraction penalty
        c_matrix fast0.73780
        matrix<unbounded_array> fast0.76749
        c_matrix safe0.75759
        matrix<unbounded_array> safe0.76749
        -

        For larger vectors and matrices the general abstraction penalty -for using classes seems to decrease, the small loss when using -generic vector and matrix classes seems to remain. The difference -w.r.t. alias assumptions remains visible, too.

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/products.htm b/doc/products.htm deleted file mode 100644 index 63a396ed..00000000 --- a/doc/products.htm +++ /dev/null @@ -1,319 +0,0 @@ - - - - - Special Products - - - - - - - - - - - -

        Special Products

        -
        - -

        Functions

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        template<class V, class E1, class E2> BOOST_UBLAS_INLINE V & axpy_prod (const matrix_expression< E1 > &e1, const vector_expression< E2 > &e2, V &v, bool init=true)
         computes v += A x or v = A x in an optimized fashion.

        template<class V, class E1, class E2> BOOST_UBLAS_INLINE V & axpy_prod (const vector_expression< E1 > &e1, const matrix_expression< E2 > &e2, V &v, bool init=true)
         computes v += AT x or v = AT x in an optimized fashion.

        template<class M, class E1, class E2> BOOST_UBLAS_INLINE M & axpy_prod (const matrix_expression< E1 > &e1, const matrix_expression< E2 > &e2, M &m, bool init=true)
         computes M += A X or M = A X in an optimized fashion.

        template<class M, class E1, class E2> BOOST_UBLAS_INLINE M & opb_prod (const matrix_expression< E1 > &e1, const matrix_expression< E2 > &e2, M &m, bool init=true)
         computes M += A X or M = A X in an optimized fashion.

        - -
        - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BOOST_UBLAS_INLINE V& axpy_prod const matrix_expression< E1 > &  e1,
        const vector_expression< E2 > &  e2,
        V &  v,
        bool  init = true
        -
        - - - - - -
        -   - - -

        -computes v += A x or v = A x in an optimized fashion. -

        -
        Parameters:
        - - - - - -
        e1 the matrix expression A
        e2 the vector expression x
        v the result vector v
        init a boolean parameter
        -
        -axpy_prod(A, x, v, init) implements the well known axpy-product. Setting init to true is equivalent to call v.clear() before axpy_prod. Currently init defaults to true, but this may change in the future.

        -Up to now there are some specialisation for compressed matrices that give a large speed up compared to prod.

        - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BOOST_UBLAS_INLINE V& axpy_prod const vector_expression< E1 > &  e1,
        const matrix_expression< E2 > &  e2,
        V &  v,
        bool  init = true
        -
        - - - - - -
        -   - - -

        -computes v += AT x or v = AT x in an optimized fashion. -

        -
        Parameters:
        - - - - - -
        e1 the vector expression x
        e2 the matrix expression A
        v the result vector v
        init a boolean parameter
        -
        -axpy_prod(x, A, v, init) implements the well known axpy-product. Setting init to true is equivalent to call v.clear() before axpy_prod. Currently init defaults to true, but this may change in the future.

        -Up to now there are some specialisation for compressed matrices that give a large speed up compared to prod.

        - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BOOST_UBLAS_INLINE M& axpy_prod const matrix_expression< E1 > &  e1,
        const matrix_expression< E2 > &  e2,
        M &  m,
        bool  init = true
        -
        - - - - - -
        -   - - -

        -computes M += A X or M = A X in an optimized fashion. -

        -
        Parameters:
        - - - - - -
        e1 the matrix expression A
        e2 the matrix expression X
        m the result matrix M
        init a boolean parameter
        -
        -axpy_prod(A, X, M, init) implements the well known axpy-product. Setting init to true is equivalent to call M.clear() before axpy_prod. Currently init defaults to true, but this may change in the future.

        -Up to now there are no specialisations.

        - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        BOOST_UBLAS_INLINE M& opb_prod const matrix_expression< E1 > &  e1,
        const matrix_expression< E2 > &  e2,
        M &  m,
        bool  init = true
        -
        - - - - - -
        -   - - -

        -computes M += A X or M = A X in an optimized fashion. -

        -
        Parameters:
        - - - - - -
        e1 the matrix expression A
        e2 the matrix expression X
        m the result matrix M
        init a boolean parameter
        -
        -opb_prod(A, X, M, init) implements the well known axpy-product. Setting init to true is equivalent to call M.clear() before opb_prod. Currently init defaults to true, but this may change in the future.

        -This function may give a speedup if A has less columns than rows, because the product is computed as a sum of outer products.

        - - - -
        -

        Copyright (©) 2000-2004 Michael Stevens, Mathias Koch, -Joerg Walter, Gunter Winkler
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/range.htm b/doc/range.htm deleted file mode 100644 index 5e4224c5..00000000 --- a/doc/range.htm +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - -Range and slice - - -

        Range and Slice Storage

        -
        -

        Range<SizeType,DistanceType>

        -

        Description

        -

        The class range specifies a range of indicies. The range is a sequence of indices -from a start value to stop value. The indices increase by one and exlude the stop value. -range can therefore be used to specify ranges of elements from vectors and matrices.

        -

        Example

        -
        -#include <boost/numeric/ublas/storage.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    range r (0, 3);
        -    for (unsigned i = 0; i < r.size (); ++ i) {
        -        std::cout << r (i) << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header storage.hpp.

        -

        Model of

        -

        Reversible Container.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Reversible -Container.

        -

        Public base classes

        -

        None.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        range (size_type start, size_type stop)Constructs a range of indicies from start to stop (excluded) -.
        size_type start () constReturns the beginning of the range.
        size_type size () constReturns the size of the range.
        const_reference operator [] (size_type i) -constReturns the value start + i of the i --th element.
        range compose (const range &r) constReturns the composite range from start + r.start -() to start + r.start () + r.size ().
        bool operator == (const range &r) constTests two ranges for equality.
        bool operator != (const range &r) constTests two ranges for inequality.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the range.
        const_iterator end () constReturns a const_iterator pointing to the end of -the range.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed range.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed range.
        -

        Preconditions

        -
          -
        • start () <= stop ()
        • -
        - -

        Slice<SizeType,DistanceType>

        -

        Description

        -

        The class slice specifies a 'slice' of indicies. Slices are more general -then ranges, the stride allows the sequence of indicies to increase and decrease by the specified amount between element. -slice can therefore be used to specify slices of element from vectors and matrices.

        -

        Example

        -
        -#include <boost/numeric/ublas/storage.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    slice s (0, 1, 3);
        -    for (unsigned i = 0; i < s.size (); ++ i) {
        -        std::cout << s (i) << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header storage.hpp.

        -

        Model of

        -

        Reversible Container.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Reversible -Container.

        -

        Public base classes

        -

        None.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        slice (size_type start, size_type stride, size_type -size)Constructs a slice start,start+stride,start+2*stride... with -size elements.
        size_type start () constReturns the beginning of the slice.
        size_type stride () constReturns the stride of the slice.
        size_type size () constReturns the size of the slice.
        const_reference operator [] (size_type i) -constReturns the value start + i * stride of the -i-th element.
        slice compose (const range &r) constReturns the composite slice from start + stride * r.start -() to start + stride * (r.start () + r.size ()) -with stride stride.
        slice compose (const slice &s) constReturns the composite slice from start + stride * s.start -() to start + stride * s.stride () * (s.start () + -s.size ()) with stride stride * s.stride () -.
        bool operator == (const slice &s) constTests two slices for equality.
        bool operator != (const slice &s) constTests two slices for inequality.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the slice.
        const_iterator end () constReturns a const_iterator pointing to the end of -the slice.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed slice.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed slice.
        -

        Preconditions

        -
          -
        • None all strides are vaild. However when an index is returned or an iterator is dereferenced its -value must be representable as the size_type.
        • -
        -
        -

        - Copyright (©) 2000-2004 Michael Stevens, Mathias Koch, - Joerg Walter, Gunter Winkler
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/release_notes.htm b/doc/release_notes.htm deleted file mode 100644 index a731a5ac..00000000 --- a/doc/release_notes.htm +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - -Boost Basic Linear Algebra - Release Notes - - -

        logoBoost Basic Linear Algebra - Release Notes

        - - -
        - -

        Release 1.43.0

        - -

        bug fixes

        - -
          -
        • [3968] fixed coordinate_matrix sort problem on MSVC10 -
        • -
        • [3539] - changed computation of norm_inf for complex types to match - mathematical definition.
          - Note: This might cause a performance drop - because now std::abs(z) is called for each vector element. - The old implementation used std::max(std::abs(real(z)),std::abs(imag(z)). - Further norm_inf and norm_1 will now return - the same values for complex vector. -
        • -
        • [3501] Moved free functions in concepts.hpp into anonymous namespace. -
        • -
        - -

        Release 1.41.1

        - -

        new features

        - -
          -
        • Move semantics of vector/matrix container assignments have been -implemented. They can be enabled by setting -BOOST_UBLAS_MOVE_SEMANTICS. More details are on the preprocessor options page. -
        • -
        • Introduce new free functions. See [3449], -the new tests in libs/numeric/ublas/test and the inline documentation of the files in boost/numeric/ublas/operation/. -
        • -
        - -

        bug fixes

        - -
          -
        • [3293] Fix resizing problem in identity_matrix -
        • -
        • [3499] Add DefaultConstructible to concept checks -
        • -
        - -

        Release 1.40.0 and before

        -
          -
        • Release notes were not available in this form.
        • -
        - -
        -

        Copyright (©) 2000-2009 Joerg Walter, Mathias Koch, Gunter Winkler
        - Use, modification and distribution are subject to the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - - diff --git a/doc/samples/Jamfile.v2 b/doc/samples/Jamfile.v2 deleted file mode 100644 index 55a8e6a6..00000000 --- a/doc/samples/Jamfile.v2 +++ /dev/null @@ -1,228 +0,0 @@ -# Copyright Michael Stevens 2004 - -# Use, modification, and distribution is subject to the Boost Software -# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# bring in rules for testing - -# Boost uBLAS library documentation samples - -# Project requirements -project samples - : requirements - borland:"-w-8026 -w-8027 -w-8057 -w-8084 -w-8092" - kylix:"-w-8026 -w-8027 -w-8057 -w-8084 -w-8092" - ; - -exe unbounded_array - : unbounded_array.cpp - ; - -exe bounded_array - : bounded_array.cpp - ; - -exe range - : range.cpp - ; - -exe slice - : slice.cpp - ; - -exe map_array - : map_array.cpp - ; - -exe vector - : vector.cpp - ; - -exe unit_vector - : unit_vector.cpp - ; - -exe zero_vector - : zero_vector.cpp - ; - -exe mapped_vector - : mapped_vector.cpp - ; - -exe compressed_vector - : compressed_vector.cpp - ; - -exe coordinate_vector - : coordinate_vector.cpp - ; - -exe vector_range - : vector_range.cpp - ; - -exe vector_range_project - : vector_range_project.cpp - ; - -exe vector_slice - : vector_slice.cpp - ; - -exe vector_slice_project - : vector_slice_project.cpp - ; - -exe vector_unary - : vector_unary.cpp - ; - -exe vector_binary - : vector_binary.cpp - ; - -exe vector_binary_outer - : vector_binary_outer.cpp - ; - -exe vector_binary_scalar - : vector_binary_scalar.cpp - ; - -exe vector_unary_redux - : vector_unary_redux.cpp - ; - -exe vector_binary_redux - : vector_binary_redux.cpp - ; - -exe matrix - : matrix.cpp - ; - -exe identity_matrix - : identity_matrix.cpp - ; - -exe zero_matrix - : zero_matrix.cpp - ; - -exe mapped_matrix - : mapped_matrix.cpp - ; - -exe compressed_matrix - : compressed_matrix.cpp - ; - -exe coordinate_matrix - : coordinate_matrix.cpp - ; - -exe matrix_row - : matrix_row.cpp - ; - -exe matrix_row_project - : matrix_row_project.cpp - ; - -exe matrix_column - : matrix_column.cpp - ; - -exe matrix_column_project - : matrix_column_project.cpp - ; - -exe matrix_vector_range - : matrix_vector_range.cpp - ; - -exe matrix_vector_slice - : matrix_vector_slice.cpp - ; - -exe matrix_range - : matrix_range.cpp - ; - -exe matrix_range_project - : matrix_range_project.cpp - ; - -exe matrix_slice - : matrix_slice.cpp - ; - -exe matrix_slice_project - : matrix_slice_project.cpp - ; - -exe matrix_unary - : matrix_unary.cpp - ; - -exe matrix_binary - : matrix_binary.cpp - : $(BOOST_ROOT) - ; - -exe matrix_binary_scalar - : matrix_binary_scalar.cpp - ; - -exe matrix_vector_binary - : matrix_vector_binary.cpp - ; - -exe matrix_vector_solve - : matrix_vector_solve.cpp - ; - -exe matrix_matrix_binary - : matrix_matrix_binary.cpp - ; - -exe matrix_matrix_solve - : matrix_matrix_solve.cpp - ; - -exe banded_matrix - : banded_matrix.cpp - ; - -exe banded_adaptor - : banded_adaptor.cpp - ; - -exe hermitian_matrix - : hermitian_matrix.cpp - ; - -exe hermitian_adaptor - : hermitian_adaptor.cpp - ; - -exe symmetric_matrix - : symmetric_matrix.cpp - ; - -exe symmetric_adaptor - : symmetric_adaptor.cpp - ; - -exe triangular_matrix - : triangular_matrix.cpp - ; - -exe triangular_adaptor - : triangular_adaptor.cpp - ; - -exe ex_triangular - : ex_triangular.cpp - ; diff --git a/doc/samples/banded_adaptor.cpp b/doc/samples/banded_adaptor.cpp deleted file mode 100644 index 8aa5a217..00000000 --- a/doc/samples/banded_adaptor.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - banded_adaptor > ba (m, 1, 1); - for (signed i = 0; i < signed (ba.size1 ()); ++ i) - for (signed j = (std::max) (i - 1, 0); j < (std::min) (i + 2, signed (ba.size2 ())); ++ j) - ba (i, j) = 3 * i + j; - std::cout << ba << std::endl; -} - diff --git a/doc/samples/banded_matrix.cpp b/doc/samples/banded_matrix.cpp deleted file mode 100644 index 73746b7a..00000000 --- a/doc/samples/banded_matrix.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - banded_matrix m (3, 3, 1, 1); - for (signed i = 0; i < signed (m.size1 ()); ++ i) - for (signed j = (std::max) (i - 1, 0); j < (std::min) (i + 2, signed (m.size2 ())); ++ j) - m (i, j) = 3 * i + j; - std::cout << m << std::endl; -} - diff --git a/doc/samples/bounded_array.cpp b/doc/samples/bounded_array.cpp deleted file mode 100644 index bc827a31..00000000 --- a/doc/samples/bounded_array.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - bounded_array a (3); - for (unsigned i = 0; i < a.size (); ++ i) { - a [i] = i; - std::cout << a [i] << std::endl; - } -} - diff --git a/doc/samples/compressed_matrix.cpp b/doc/samples/compressed_matrix.cpp deleted file mode 100644 index 997106ea..00000000 --- a/doc/samples/compressed_matrix.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - compressed_matrix m (3, 3, 3 * 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - std::cout << m << std::endl; -} - diff --git a/doc/samples/compressed_vector.cpp b/doc/samples/compressed_vector.cpp deleted file mode 100644 index 33353e49..00000000 --- a/doc/samples/compressed_vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - compressed_vector v (3, 3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - std::cout << v << std::endl; -} - diff --git a/doc/samples/coordinate_matrix.cpp b/doc/samples/coordinate_matrix.cpp deleted file mode 100644 index ee09515d..00000000 --- a/doc/samples/coordinate_matrix.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - coordinate_matrix m (3, 3, 3 * 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - std::cout << m << std::endl; -} - diff --git a/doc/samples/coordinate_vector.cpp b/doc/samples/coordinate_vector.cpp deleted file mode 100644 index 44893fca..00000000 --- a/doc/samples/coordinate_vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - coordinate_vector v (3, 3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - std::cout << v << std::endl; -} - diff --git a/doc/samples/ex_triangular.cpp b/doc/samples/ex_triangular.cpp deleted file mode 100644 index a2a34d96..00000000 --- a/doc/samples/ex_triangular.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright Gunter Winkler 2004 - 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - - -#include - -#include -#include - -#include - -using std::cout; -using std::endl; - - - -namespace ublas = boost::numeric::ublas; - - -int main(int argc, char * argv[] ) { - - ublas::matrix M (3, 3); - for (std::size_t i=0; i < M.data().size(); ++i) { M.data()[i] = 1+i ; } - - std::cout << "full M = " << M << "\n" ; - - ublas::triangular_matrix L; - ublas::triangular_matrix UL; - ublas::triangular_matrix SL; - - L = ublas::triangular_adaptor, ublas::lower> (M); - SL = ublas::triangular_adaptor, ublas::strict_lower> (M); - UL = ublas::triangular_adaptor, ublas::unit_lower> (M); - - std::cout << "lower L = " << L << "\n" - << "strict lower SL = " << SL << "\n" - << "unit lower UL = " << UL << "\n" ; - - ublas::triangular_matrix U; - ublas::triangular_matrix UU; - ublas::triangular_matrix SU; - - U = ublas::triangular_adaptor, ublas::upper> (M); - SU = ublas::triangular_adaptor, ublas::strict_upper> (M); - UU = ublas::triangular_adaptor, ublas::unit_upper> (M); - - std::cout << "upper U = " << U << "\n" - << "strict upper SU = " << SU << "\n" - << "unit upper UU = " << UU << "\n" ; - - std::cout << "M = L + SU ? " << ((norm_inf( M - (L + SU) ) == 0.0)?"ok":"failed") << "\n"; - std::cout << "M = U + SL ? " << ((norm_inf( M - (U + SL) ) == 0.0)?"ok":"failed") << "\n"; - -} - - diff --git a/doc/samples/hermitian_adaptor.cpp b/doc/samples/hermitian_adaptor.cpp deleted file mode 100644 index 889ae4e1..00000000 --- a/doc/samples/hermitian_adaptor.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix > m (3, 3); - hermitian_adaptor >, lower> hal (m); - for (unsigned i = 0; i < hal.size1 (); ++ i) { - for (unsigned j = 0; j < i; ++ j) - hal (i, j) = std::complex (3 * i + j, 3 * i + j); - hal (i, i) = std::complex (4 * i, 0); - } - std::cout << hal << std::endl; - hermitian_adaptor >, upper> hau (m); - for (unsigned i = 0; i < hau.size1 (); ++ i) { - hau (i, i) = std::complex (4 * i, 0); - for (unsigned j = i + 1; j < hau.size2 (); ++ j) - hau (i, j) = std::complex (3 * i + j, 3 * i + j); - } - std::cout << hau << std::endl; -} - diff --git a/doc/samples/hermitian_matrix.cpp b/doc/samples/hermitian_matrix.cpp deleted file mode 100644 index 1a71ad5c..00000000 --- a/doc/samples/hermitian_matrix.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - hermitian_matrix, lower> ml (3, 3); - for (unsigned i = 0; i < ml.size1 (); ++ i) { - for (unsigned j = 0; j < i; ++ j) - ml (i, j) = std::complex (3 * i + j, 3 * i + j); - ml (i, i) = std::complex (4 * i, 0); - } - std::cout << ml << std::endl; - hermitian_matrix, upper> mu (3, 3); - for (unsigned i = 0; i < mu.size1 (); ++ i) { - mu (i, i) = std::complex (4 * i, 0); - for (unsigned j = i + 1; j < mu.size2 (); ++ j) - mu (i, j) = std::complex (3 * i + j, 3 * i + j); - } - std::cout << mu << std::endl; -} - diff --git a/doc/samples/identity_matrix.cpp b/doc/samples/identity_matrix.cpp deleted file mode 100644 index 0e98683e..00000000 --- a/doc/samples/identity_matrix.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - identity_matrix m (3); - std::cout << m << std::endl; -} - diff --git a/doc/samples/map_array.cpp b/doc/samples/map_array.cpp deleted file mode 100644 index 12dc519a..00000000 --- a/doc/samples/map_array.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - map_array a; - a.reserve (3); - for (unsigned i = 0; i < 3; ++ i) { - a [i] = i; - std::cout << a [i] << std::endl; - } -} - diff --git a/doc/samples/mapped_matrix.cpp b/doc/samples/mapped_matrix.cpp deleted file mode 100644 index 92b5ca7b..00000000 --- a/doc/samples/mapped_matrix.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - mapped_matrix m (3, 3, 3 * 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - std::cout << m << std::endl; -} - diff --git a/doc/samples/mapped_vector.cpp b/doc/samples/mapped_vector.cpp deleted file mode 100644 index 73e6d8f2..00000000 --- a/doc/samples/mapped_vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - mapped_vector v (3, 3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - std::cout << v << std::endl; -} - diff --git a/doc/samples/matrix.cpp b/doc/samples/matrix.cpp deleted file mode 100644 index 63d3c7d5..00000000 --- a/doc/samples/matrix.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - std::cout << m << std::endl; -} - diff --git a/doc/samples/matrix_binary.cpp b/doc/samples/matrix_binary.cpp deleted file mode 100644 index 66edf62d..00000000 --- a/doc/samples/matrix_binary.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m1 (3, 3), m2 (3, 3); - for (unsigned i = 0; i < (std::min) (m1.size1 (), m2.size1 ()); ++ i) - for (unsigned j = 0; j < (std::min) (m1.size2 (), m2.size2 ()); ++ j) - m1 (i, j) = m2 (i, j) = 3 * i + j; - - std::cout << m1 + m2 << std::endl; - std::cout << m1 - m2 << std::endl; -} - diff --git a/doc/samples/matrix_binary_scalar.cpp b/doc/samples/matrix_binary_scalar.cpp deleted file mode 100644 index fb3282f7..00000000 --- a/doc/samples/matrix_binary_scalar.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - - std::cout << 2.0 * m << std::endl; - std::cout << m * 2.0 << std::endl; -} - diff --git a/doc/samples/matrix_column.cpp b/doc/samples/matrix_column.cpp deleted file mode 100644 index 9eb0ca4e..00000000 --- a/doc/samples/matrix_column.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned j = 0; j < m.size2 (); ++ j) { - matrix_column > mc (m, j); - for (unsigned i = 0; i < mc.size (); ++ i) - mc (i) = 3 * i + j; - std::cout << mc << std::endl; - } -} - diff --git a/doc/samples/matrix_column_project.cpp b/doc/samples/matrix_column_project.cpp deleted file mode 100644 index d2585c6f..00000000 --- a/doc/samples/matrix_column_project.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned j = 0; j < m.size2 (); ++ j) { - for (unsigned i = 0; i < m.size1 (); ++ i) - column (m, j) (i) = 3 * i + j; - std::cout << column (m, j) << std::endl; - } -} - diff --git a/doc/samples/matrix_matrix_binary.cpp b/doc/samples/matrix_matrix_binary.cpp deleted file mode 100644 index 17e33a64..00000000 --- a/doc/samples/matrix_matrix_binary.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m1 (3, 3), m2 (3, 3); - for (unsigned i = 0; i < (std::min) (m1.size1 (), m2.size1 ()); ++ i) - for (unsigned j = 0; j < (std::min) (m1.size2 (), m2.size2 ()); ++ j) - m1 (i, j) = m2 (i, j) = 3 * i + j; - - std::cout << prod (m1, m2) << std::endl; -} - diff --git a/doc/samples/matrix_matrix_solve.cpp b/doc/samples/matrix_matrix_solve.cpp deleted file mode 100644 index 07d05a34..00000000 --- a/doc/samples/matrix_matrix_solve.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m1 (3, 3), m2 (3, 3); - for (unsigned i = 0; i < (std::min) (m1.size1 (), m2.size1 ()); ++ i) - for (unsigned j = 0; j <= i; ++ j) - m1 (i, j) = m2 (i, j) = 3 * i + j + 1; - - std::cout << solve (m1, m2, lower_tag ()) << std::endl; -} - diff --git a/doc/samples/matrix_range.cpp b/doc/samples/matrix_range.cpp deleted file mode 100644 index 048ab9fc..00000000 --- a/doc/samples/matrix_range.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - matrix_range > mr (m, range (0, 3), range (0, 3)); - for (unsigned i = 0; i < mr.size1 (); ++ i) - for (unsigned j = 0; j < mr.size2 (); ++ j) - mr (i, j) = 3 * i + j; - std::cout << mr << std::endl; -} - diff --git a/doc/samples/matrix_range_project.cpp b/doc/samples/matrix_range_project.cpp deleted file mode 100644 index 3ee095c2..00000000 --- a/doc/samples/matrix_range_project.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - project (m, range (0, 3), range (0, 3)) (i, j) = 3 * i + j; - std::cout << project (m, range (0, 3), range (0, 3)) << std::endl; -} - diff --git a/doc/samples/matrix_row.cpp b/doc/samples/matrix_row.cpp deleted file mode 100644 index 156c1f5e..00000000 --- a/doc/samples/matrix_row.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) { - matrix_row > mr (m, i); - for (unsigned j = 0; j < mr.size (); ++ j) - mr (j) = 3 * i + j; - std::cout << mr << std::endl; - } -} - diff --git a/doc/samples/matrix_row_project.cpp b/doc/samples/matrix_row_project.cpp deleted file mode 100644 index 6cc35698..00000000 --- a/doc/samples/matrix_row_project.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) { - for (unsigned j = 0; j < m.size2 (); ++ j) - row (m, i) (j) = 3 * i + j; - std::cout << row (m, i) << std::endl; - } -} - diff --git a/doc/samples/matrix_slice.cpp b/doc/samples/matrix_slice.cpp deleted file mode 100644 index d3911f69..00000000 --- a/doc/samples/matrix_slice.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - matrix_slice > ms (m, slice (0, 1, 3), slice (0, 1, 3)); - for (unsigned i = 0; i < ms.size1 (); ++ i) - for (unsigned j = 0; j < ms.size2 (); ++ j) - ms (i, j) = 3 * i + j; - std::cout << ms << std::endl; -} - diff --git a/doc/samples/matrix_slice_project.cpp b/doc/samples/matrix_slice_project.cpp deleted file mode 100644 index 0b6150a9..00000000 --- a/doc/samples/matrix_slice_project.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - project (m, slice (0, 1, 3), slice (0, 1, 3)) (i, j) = 3 * i + j; - std::cout << project (m, slice (0, 1, 3), slice (0, 1, 3)) << std::endl; -} - diff --git a/doc/samples/matrix_unary.cpp b/doc/samples/matrix_unary.cpp deleted file mode 100644 index 044b2945..00000000 --- a/doc/samples/matrix_unary.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix > m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = std::complex (3 * i + j, 3 * i + j); - - std::cout << - m << std::endl; - std::cout << conj (m) << std::endl; - std::cout << real (m) << std::endl; - std::cout << imag (m) << std::endl; - std::cout << trans (m) << std::endl; - std::cout << herm (m) << std::endl; -} - diff --git a/doc/samples/matrix_vector_binary.cpp b/doc/samples/matrix_vector_binary.cpp deleted file mode 100644 index a53665bf..00000000 --- a/doc/samples/matrix_vector_binary.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - vector v (3); - for (unsigned i = 0; i < (std::min) (m.size1 (), v.size ()); ++ i) { - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - v (i) = i; - } - - std::cout << prod (m, v) << std::endl; - std::cout << prod (v, m) << std::endl; -} - diff --git a/doc/samples/matrix_vector_range.cpp b/doc/samples/matrix_vector_range.cpp deleted file mode 100644 index 3a4c7e70..00000000 --- a/doc/samples/matrix_vector_range.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - - matrix_vector_range > mvr (m, range (0, 3), range (0, 3)); - std::cout << mvr << std::endl; -} - diff --git a/doc/samples/matrix_vector_slice.cpp b/doc/samples/matrix_vector_slice.cpp deleted file mode 100644 index 335c06cb..00000000 --- a/doc/samples/matrix_vector_slice.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - for (unsigned i = 0; i < m.size1 (); ++ i) - for (unsigned j = 0; j < m.size2 (); ++ j) - m (i, j) = 3 * i + j; - - matrix_vector_slice > mvs (m, slice (0, 1, 3), slice (0, 1, 3)); - std::cout << mvs << std::endl; -} - diff --git a/doc/samples/matrix_vector_solve.cpp b/doc/samples/matrix_vector_solve.cpp deleted file mode 100644 index 819856fe..00000000 --- a/doc/samples/matrix_vector_solve.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - vector v (3); - for (unsigned i = 0; i < (std::min) (m.size1 (), v.size ()); ++ i) { - for (unsigned j = 0; j <= i; ++ j) - m (i, j) = 3 * i + j + 1; - v (i) = i; - } - - std::cout << solve (m, v, lower_tag ()) << std::endl; - std::cout << solve (v, m, lower_tag ()) << std::endl; -} - diff --git a/doc/samples/range.cpp b/doc/samples/range.cpp deleted file mode 100644 index 35526ff8..00000000 --- a/doc/samples/range.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - range r (0, 3); - for (unsigned i = 0; i < r.size (); ++ i) { - std::cout << r (i) << std::endl; - } -} - diff --git a/doc/samples/slice.cpp b/doc/samples/slice.cpp deleted file mode 100644 index 394251e3..00000000 --- a/doc/samples/slice.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - slice s (0, 1, 3); - for (unsigned i = 0; i < s.size (); ++ i) { - std::cout << s (i) << std::endl; - } -} - diff --git a/doc/samples/symmetric_adaptor.cpp b/doc/samples/symmetric_adaptor.cpp deleted file mode 100644 index 4a3f67c4..00000000 --- a/doc/samples/symmetric_adaptor.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - symmetric_adaptor, lower> sal (m); - for (unsigned i = 0; i < sal.size1 (); ++ i) - for (unsigned j = 0; j <= i; ++ j) - sal (i, j) = 3 * i + j; - std::cout << sal << std::endl; - symmetric_adaptor, upper> sau (m); - for (unsigned i = 0; i < sau.size1 (); ++ i) - for (unsigned j = i; j < sau.size2 (); ++ j) - sau (i, j) = 3 * i + j; - std::cout << sau << std::endl; -} - diff --git a/doc/samples/symmetric_matrix.cpp b/doc/samples/symmetric_matrix.cpp deleted file mode 100644 index c9bed51f..00000000 --- a/doc/samples/symmetric_matrix.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - symmetric_matrix ml (3, 3); - for (unsigned i = 0; i < ml.size1 (); ++ i) - for (unsigned j = 0; j <= i; ++ j) - ml (i, j) = 3 * i + j; - std::cout << ml << std::endl; - symmetric_matrix mu (3, 3); - for (unsigned i = 0; i < mu.size1 (); ++ i) - for (unsigned j = i; j < mu.size2 (); ++ j) - mu (i, j) = 3 * i + j; - std::cout << mu << std::endl; -} - diff --git a/doc/samples/triangular_adaptor.cpp b/doc/samples/triangular_adaptor.cpp deleted file mode 100644 index 7f7647ee..00000000 --- a/doc/samples/triangular_adaptor.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - matrix m (3, 3); - triangular_adaptor, lower> tal (m); - for (unsigned i = 0; i < tal.size1 (); ++ i) - for (unsigned j = 0; j <= i; ++ j) - tal (i, j) = 3 * i + j; - std::cout << tal << std::endl; - triangular_adaptor, upper> tau (m); - for (unsigned i = 0; i < tau.size1 (); ++ i) - for (unsigned j = i; j < tau.size2 (); ++ j) - tau (i, j) = 3 * i + j; - std::cout << tau << std::endl; -} - diff --git a/doc/samples/triangular_matrix.cpp b/doc/samples/triangular_matrix.cpp deleted file mode 100644 index 91772335..00000000 --- a/doc/samples/triangular_matrix.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - triangular_matrix ml (3, 3); - for (unsigned i = 0; i < ml.size1 (); ++ i) - for (unsigned j = 0; j <= i; ++ j) - ml (i, j) = 3 * i + j; - std::cout << ml << std::endl; - triangular_matrix mu (3, 3); - for (unsigned i = 0; i < mu.size1 (); ++ i) - for (unsigned j = i; j < mu.size2 (); ++ j) - mu (i, j) = 3 * i + j; - std::cout << mu << std::endl; -} - diff --git a/doc/samples/unbounded_array.cpp b/doc/samples/unbounded_array.cpp deleted file mode 100644 index 2331f576..00000000 --- a/doc/samples/unbounded_array.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - unbounded_array a (3); - for (unsigned i = 0; i < a.size (); ++ i) { - a [i] = i; - std::cout << a [i] << std::endl; - } -} - diff --git a/doc/samples/unit_vector.cpp b/doc/samples/unit_vector.cpp deleted file mode 100644 index 63fc825d..00000000 --- a/doc/samples/unit_vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - for (int i = 0; i < 3; ++ i) { - unit_vector v (3, i); - std::cout << v << std::endl; - } -} - diff --git a/doc/samples/vector.cpp b/doc/samples/vector.cpp deleted file mode 100644 index 1f8310c7..00000000 --- a/doc/samples/vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - std::cout << v << std::endl; -} - diff --git a/doc/samples/vector_binary.cpp b/doc/samples/vector_binary.cpp deleted file mode 100644 index 8b42d065..00000000 --- a/doc/samples/vector_binary.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v1 (3), v2 (3); - for (unsigned i = 0; i < (std::min) (v1.size (), v2.size ()); ++ i) - v1 (i) = v2 (i) = i; - - std::cout << v1 + v2 << std::endl; - std::cout << v1 - v2 << std::endl; -} - diff --git a/doc/samples/vector_binary_outer.cpp b/doc/samples/vector_binary_outer.cpp deleted file mode 100644 index 094a0a9d..00000000 --- a/doc/samples/vector_binary_outer.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v1 (3), v2 (3); - for (unsigned i = 0; i < (std::min) (v1.size (), v2.size ()); ++ i) - v1 (i) = v2 (i) = i; - - std::cout << outer_prod (v1, v2) << std::endl; -} - diff --git a/doc/samples/vector_binary_redux.cpp b/doc/samples/vector_binary_redux.cpp deleted file mode 100644 index abc36412..00000000 --- a/doc/samples/vector_binary_redux.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - vector v1 (3), v2 (3); - for (unsigned i = 0; i < (std::min) (v1.size (), v2.size ()); ++ i) - v1 (i) = v2 (i) = i; - - std::cout << inner_prod (v1, v2) << std::endl; -} - diff --git a/doc/samples/vector_binary_scalar.cpp b/doc/samples/vector_binary_scalar.cpp deleted file mode 100644 index 8f853e54..00000000 --- a/doc/samples/vector_binary_scalar.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - - std::cout << 2.0 * v << std::endl; - std::cout << v * 2.0 << std::endl; -} - diff --git a/doc/samples/vector_range.cpp b/doc/samples/vector_range.cpp deleted file mode 100644 index bf48c231..00000000 --- a/doc/samples/vector_range.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - vector_range > vr (v, range (0, 3)); - for (unsigned i = 0; i < vr.size (); ++ i) - vr (i) = i; - std::cout << vr << std::endl; -} - diff --git a/doc/samples/vector_range_project.cpp b/doc/samples/vector_range_project.cpp deleted file mode 100644 index ebe34816..00000000 --- a/doc/samples/vector_range_project.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - for (int i = 0; i < 3; ++ i) - project (v, range (0, 3)) (i) = i; - std::cout << project (v, range (0, 3)) << std::endl; -} - diff --git a/doc/samples/vector_slice.cpp b/doc/samples/vector_slice.cpp deleted file mode 100644 index 478631b7..00000000 --- a/doc/samples/vector_slice.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - vector_slice > vs (v, slice (0, 1, 3)); - for (unsigned i = 0; i < vs.size (); ++ i) - vs (i) = i; - std::cout << vs << std::endl; -} - diff --git a/doc/samples/vector_slice_project.cpp b/doc/samples/vector_slice_project.cpp deleted file mode 100644 index a8f17945..00000000 --- a/doc/samples/vector_slice_project.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - for (int i = 0; i < 3; ++ i) - project (v, slice (0, 1, 3)) (i) = i; - std::cout << project (v, slice (0, 1, 3)) << std::endl; -} - diff --git a/doc/samples/vector_unary.cpp b/doc/samples/vector_unary.cpp deleted file mode 100644 index 4d9a8b58..00000000 --- a/doc/samples/vector_unary.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - vector > v (3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = std::complex (i, i); - - std::cout << - v << std::endl; - std::cout << conj (v) << std::endl; - std::cout << real (v) << std::endl; - std::cout << imag (v) << std::endl; - std::cout << trans (v) << std::endl; - std::cout << herm (v) << std::endl; -} - diff --git a/doc/samples/vector_unary_redux.cpp b/doc/samples/vector_unary_redux.cpp deleted file mode 100644 index 7de1918b..00000000 --- a/doc/samples/vector_unary_redux.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -int main () { - using namespace boost::numeric::ublas; - vector v (3); - for (unsigned i = 0; i < v.size (); ++ i) - v (i) = i; - - std::cout << sum (v) << std::endl; - std::cout << norm_1 (v) << std::endl; - std::cout << norm_2 (v) << std::endl; - std::cout << norm_inf (v) << std::endl; - std::cout << index_norm_inf (v) << std::endl; -} - diff --git a/doc/samples/zero_matrix.cpp b/doc/samples/zero_matrix.cpp deleted file mode 100644 index fbdd8d67..00000000 --- a/doc/samples/zero_matrix.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - zero_matrix m (3, 3); - std::cout << m << std::endl; -} - diff --git a/doc/samples/zero_vector.cpp b/doc/samples/zero_vector.cpp deleted file mode 100644 index 7a4d77df..00000000 --- a/doc/samples/zero_vector.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include - -int main () { - using namespace boost::numeric::ublas; - zero_vector v (3); - std::cout << v << std::endl; -} - diff --git a/doc/storage_concept.htm b/doc/storage_concept.htm deleted file mode 100644 index 4d52a699..00000000 --- a/doc/storage_concept.htm +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - -Storage concept - - -

        Storage concept

        -
        -

        Storage concept

        -

        Description

        -

        Storage is a variable-size container whose elements are arranged in a strict linear order. -

        Storage extends the STL Container concept with some STL Sequence-like functionality. The main difference with -the Sequence concept however is that the Storage concept does not require default-initialisation of its -elements. -

        Refinement of

        -Random Access Container -and -Default Constructible -

        Associated types

        -No additional types beyond those defined by -Random Access Container -

        Notation

        - - - - - -
        XA type that is model of Storage
        TThe value_type of X
        tAn object of type T
        nobject of type convertible to X::size_type
        -

        Definitions

        -

        Valid expressions

        -In addition to the expressions defined in -Random Access Container, -and -Default Constructible -the following expressions must be valid: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        NameExpressionType requirementsReturn type
        Size constructorX(n)T is DefaultConstructibleX
        Fill constructorX(n,t)X
        Range constructorX(i, j)i and j are Input Iterators whose value type is convertible to T X
        Resizea.resize(n, t)a is mutablevoid
        Resizea.resize(n)a is mutablevoid
        -

        Expression semantics

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        NameExpressionPreconditionSemanticsPostcondition -
        Default-constructorX() -Creates 0 elements. -size()==0
        Size-constructorX(n) -n>=0Creates n elements. Elements are constructed without an initializer. That is -if T is a (possibly cv-qualified) non-POD class type (or array thereof), the object is default -initialized. Otherwise, the object created has indeterminate value. See the sentance -"If new initializer is omitted" in section 5.3.4 paragraph 15 of the ISO C++ standard. -size()==n
        Fill-constructorX(n,t) -n>=0Creates n initialised element with copies of tsize()==n
        Range constructorX(i, j)[i,j) is a valid range.copies the range [i,j) to the storagesize() is equal to the distance from i to j. Each element is a copy of the corresponding element in the range [i,j).
        Resizea.resize(n, t)n <= a.max_size()Modified the container so that it has exactly n elements.
        -The container may be reallocated if its size changes. -Existing element values are preserved, additional elements are copies of t.
        a.size() == n
        Resizea.resize(n)n <= a.max_size()Modified the container so that it has exactly n elements.
        -The container may be reallocated if its size changes. Element values are uninitialised. That is, -each element value may be a previously assigned value or default construced value for T.
        a.size() == n
        -

        Complexity guarantees

        -

        Invariants

        -

        Models

        - -

        Notes

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - - \ No newline at end of file diff --git a/doc/storage_sparse.htm b/doc/storage_sparse.htm deleted file mode 100644 index a16e1097..00000000 --- a/doc/storage_sparse.htm +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - -Sparse Storage - - -

        Sparse Storage

        -
        -

        Default Standard Map

        -

        Description

        -

        The templated class map_std<I, T, ALLOC> provides a -wrapper for the standard library associative container -std::map. The wrapper has one simple purpose. It -allows the definition of a default template parameter (for the -adapted array) when declaring the sparse container types.

        -

        Example

        -
        -#include <boost/numeric/ublas/storage_sparse.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    map_std<int, double> a (3);
        -    for (unsigned i = 0; i < a.size (); ++ i) {
        -        a [i] = i;
        -        std::cout << a [i] << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header storage_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        IThe type of index stored in the array.
        TThe type of object stored in the array.
        ALLOCAn STL Allocatorstd::allocator
        -

        Model of

        -

        Reversible Container.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Reversible -Container.

        -

        Public base classes

        -

        std::map

        -

        Map Array

        -

        Description

        -

        The templated class map_array<I, T, ALLOC> implements a std::map like associative container as a sorted array. It therefore some of the Associative Container interface without having the same semantics as an std::map. -

        At any time the map_array has a capacity up to which new element can be inserted. -If insert would cause the size of the map_array to exceeds its capactity then it is reallocated. Iterators and reference are invalidated. -The capacity can be directly control using the reserve member function. -

        -

        Example

        -
        -#include <boost/numeric/ublas/storage_sparse.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    map_array<int, double> a (3);
        -    for (unsigned i = 0; i < a.size (); ++ i) {
        -        a [i] = i;
        -        std::cout << a [i] << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header storage_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        IThe type of index stored in the array.
        TThe type of object stored in the array.
        ALLOCAn STL Allocatorstd::allocator
        -

        Model of

        -

        Reversible Container.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Reversible -Container.

        -

        Public base classes

        -

        None.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        map_array (ALLOC &a = ALLOC())Allocates a map_array that holds at most zero -elements.
        map_array (const map_array &c)The copy constructor.
        ~map_array ()Deallocates the map_array itself.
        void reserve (size_type capacity) -Changes themap_array capacity. It can hold at mostcapacity elements without reallocation. The capacity can be reduced such that capacity >= size(). The content of themap_array is preserved.
        size_type size () constReturns the size of the map_array.
        size_type size () constReturns the capacity of the map_array.
        data_reference operator [] (index_type i)Returns a reference of the element that is associated with a -particular index. If the map_array does not already -contain such an element, operator[] inserts the -default T ().
        map_array &operator = (const map_array -&a)The assignment operator.
        map_array &assign_temporary (map_array -&a)Assigns a temporary. May change the array a.
        void swap (map_array &a)Swaps the contents of the arrays.
        std::pair insert (const value_type -&p)Inserts p into the array. The second part of the return value is true -if p was inserted and false if was not inserted because it was aleady -present.
        iterator insert (iterator it, const value_type -&p)Inserts p into the array, using it as -a hint to where it will be inserted.
        void erase (iterator it)Erases the value at it.
        void clear ()Clears the array.
        const_iterator find (index_type i) constFinds an element whose index is i.
        iterator find (index_type i)Finds an element whose index is i.
        const_iterator lower_bound (index_type i) -constFinds the first element whose index is not less than -i .
        iterator lower_bound (index_type i)Finds the first element whose index is not less than -i .
        const_iterator upper_bound (index_type i) -constFinds the first element whose index is greater than -i .
        iterator upper_bound (index_type i)Finds the first element whose index is greater than -i .
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the map_array.
        const_iterator end () constReturns a const_iterator pointing to the end of -the map_array.
        iterator begin ()Returns a iterator pointing to the beginning of -the map_array.
        iterator end ()Returns a iterator pointing to the end of the -map_array.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed map_array.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed map_array.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed map_array.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed map_array.
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/symmetric.htm b/doc/symmetric.htm deleted file mode 100644 index 27af0390..00000000 --- a/doc/symmetric.htm +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - - - - -Symmetric Matrix - - -

        Symmetric Matrix

        -
        -

        Symmetric Matrix

        -

        Description

        -

        The templated class symmetric_matrix<T, F1, F2, -A> is the base container adaptor for symmetric matrices. -For a (n x n )-dimensional symmetric matrix and 0 -<= i < n, 0 <= j < n holds -si, j = sj, -i. The storage of symmetric matrices is packed.

        -

        Example

        -
        -#include <boost/numeric/ublas/symmetric.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    symmetric_matrix<double, lower> ml (3, 3);
        -    for (unsigned i = 0; i < ml.size1 (); ++ i)
        -        for (unsigned j = 0; j <= i; ++ j)
        -            ml (i, j) = 3 * i + j;
        -    std::cout << ml << std::endl;
        -    symmetric_matrix<double, upper> mu (3, 3);
        -    for (unsigned i = 0; i < mu.size1 (); ++ i)
        -        for (unsigned j = i; j < mu.size2 (); ++ j)
        -            mu (i, j) = 3 * i + j;
        -    std::cout << mu << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header symmetric.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.
        F1Functor describing the type of the symmetric matrix. [1]lower
        F2Functor describing the storage organization. [2]row_major
        AThe type of the adapted array. [3]unbounded_array<T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<symmetric_matrix<T, F1, F2, A> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        symmetric_matrix (size_type size)Allocates an uninitialized symmetric_matrix that -holds size rows of size elements.
        symmetric_matrix (const symmetric_matrix -&m)The copy constructor.
        template<class AE>
        -symmetric_matrix (const matrix_expression<AE> -&ae)
        The extended copy constructor.
        void resize (size_type size, bool preserve = -true)Reallocates a symmetric_matrix to hold -size rows of size elements. The existing -elements of the symmetric_matrix are preseved when -specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        symmetric_matrix &operator = (const symmetric_matrix -&m)The assignment operator.
        symmetric_matrix &assign_temporary (symmetric_matrix -&m)Assigns a temporary. May change the symmetric matrix -m .
        template<class AE>
        -symmetric_matrix &operator = (const matrix_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -symmetric_matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the symmetric matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -symmetric_matrix &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the symmetric matrix.
        template<class AE>
        -symmetric_matrix &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the symmetric matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -symmetric_matrix &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the symmetric matrix.
        template<class AE>
        -symmetric_matrix &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the symmetric matrix. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -symmetric_matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the symmetric matrix -with a scalar.
        template<class AT>
        -symmetric_matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the symmetric matrix -through a scalar.
        void swap (symmetric_matrix &m)Swaps the contents of the symmetric matrices.
        void insert (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row.
        void erase (size_type i, size_type j)Erases the value at the j-th elemenst of the -i-th row.
        void clear ()Clears the matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the symmetric_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the symmetric_matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the symmetric_matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -symmetric_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the symmetric_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the symmetric_matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the symmetric_matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -symmetric_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed symmetric_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed symmetric_matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed symmetric_matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed symmetric_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed symmetric_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed symmetric_matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed symmetric_matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed symmetric_matrix.
        -

        Notes

        -

        [1] -Supported parameters for the type of the symmetric matrix are -lower and upper.

        -

        [2] -Supported parameters for the storage organization are -row_major and column_major.

        -

        [3] -Supported parameters for the adapted array are -unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

        -

        Symmetric Adaptor

        -

        Description

        -

        The templated class symmetric_adaptor<M, F> -is a symmetric matrix adaptor for other matrices.

        -

        Example

        -
        -#include <boost/numeric/ublas/symmetric.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    symmetric_adaptor<matrix<double>, lower> sal (m);
        -    for (unsigned i = 0; i < sal.size1 (); ++ i)
        -        for (unsigned j = 0; j <= i; ++ j)
        -            sal (i, j) = 3 * i + j;
        -    std::cout << sal << std::endl;
        -    symmetric_adaptor<matrix<double>, upper> sau (m);
        -    for (unsigned i = 0; i < sau.size1 (); ++ i)
        -        for (unsigned j = i; j < sau.size2 (); ++ j)
        -            sau (i, j) = 3 * i + j;
        -    std::cout << sau << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header symmetric.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of the adapted matrix.
        FFunctor describing the type of the symmetric adaptor. [1]lower
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<symmetric_adaptor<M, F> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        symmetric_adaptor ()Constructs a symmetric_adaptor that holds zero -rows of zero elements.
        symmetric_adaptor (matrix_type &data)Constructs a symmetric_adaptor of a matrix.
        symmetric_adaptor (const symmetric_adaptor -&m)The copy constructor.
        template<class AE>
        -symmetric_adaptor (const matrix_expression<AE> -&ae)
        The extended copy constructor.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        symmetric_adaptor &operator = (const -symmetric_adaptor &m)The assignment operator.
        symmetric_adaptor &assign_temporary -(symmetric_adaptor &m)Assigns a temporary. May change the symmetric adaptor -m.
        template<class AE>
        -symmetric_adaptor &operator = (const -matrix_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -symmetric_adaptor &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the symmetric adaptor. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -symmetric_adaptor &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the symmetric adaptor.
        template<class AE>
        -symmetric_adaptor &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the symmetric adaptor. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -symmetric_adaptor &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the symmetric adaptor.
        template<class AE>
        -symmetric_adaptor &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the symmetric adaptor. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -symmetric_adaptor &operator *= (const AT &at)
        A computed assignment operator. Multiplies the symmetric -adaptor with a scalar.
        template<class AT>
        -symmetric_adaptor &operator /= (const AT &at)
        A computed assignment operator. Divides the symmetric adaptor -through a scalar.
        void swap (symmetric_adaptor &m)Swaps the contents of the symmetric adaptors.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the symmetric_adaptor.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the symmetric_adaptor.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the symmetric_adaptor.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -symmetric_adaptor.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the symmetric_adaptor.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the symmetric_adaptor.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the symmetric_adaptor.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -symmetric_adaptor.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed symmetric_adaptor.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed symmetric_adaptor.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed symmetric_adaptor.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed symmetric_adaptor.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed symmetric_adaptor.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed symmetric_adaptor.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed symmetric_adaptor.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed symmetric_adaptor.
        -

        Notes

        -

        [1] -Supported parameters for the type of the symmetric adaptor are -lower and upper.

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/triangular.htm b/doc/triangular.htm deleted file mode 100644 index 5e0a4ddf..00000000 --- a/doc/triangular.htm +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - - - - -Triangular Matrix - - -

        Triangular Matrix

        -
        -

        Triangular Matrix

        -

        Description

        -

        The templated class triangular_matrix<T, F1, F2, -A> is the base container adaptor for triangular matrices. -For a (n x n )-dimensional lower triangular matrix and -0 <= i < n,0 <= j < n holds -ti, j = 0 , if i > -j. If furthermore holds ti, i= 1 -the matrix is called unit lower triangular. For a (n x n -)-dimensional lower triangular matrix and 0 <= i < -n,0 <= j < n holds ti, -j = 0 , if i < j. If furthermore -holds ti, i= 1 the matrix is called -unit lower triangular. The storage of triangular matrices is -packed.

        -

        Example

        -
        -#include <boost/numeric/ublas/triangular.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    triangular_matrix<double, lower> ml (3, 3);
        -    for (unsigned i = 0; i < ml.size1 (); ++ i)
        -        for (unsigned j = 0; j <= i; ++ j)
        -            ml (i, j) = 3 * i + j;
        -    std::cout << ml << std::endl;
        -    triangular_matrix<double, upper> mu (3, 3);
        -    for (unsigned i = 0; i < mu.size1 (); ++ i)
        -        for (unsigned j = i; j < mu.size2 (); ++ j)
        -            mu (i, j) = 3 * i + j;
        -    std::cout << mu << std::endl;
        -}
        -
        -

        Please read the full triangular example for more details.

        - -

        Definition

        -

        Defined in the header triangular.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the matrix.
        F1Functor describing the type of the triangular matrix. [1]lower
        F2Functor describing the storage organization. [2]row_major
        AThe type of the adapted array. [3]unbounded_array<T>
        -

        Model of

        -

        Matrix .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix .

        -

        Public base classes

        -

        matrix_container<triangular_matrix<T, F1, F2, A> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        triangular_matrix ()Allocates an uninitialized triangular_matrix that -holds zero rows of zero elements.
        triangular_matrix (size_type size1, size_type -size2)Allocates an uninitialized triangular_matrix that -holds size1 rows of size2 elements.
        triangular_matrix (const triangular_matrix -&m)The copy constructor.
        template<class AE>
        -triangular_matrix (const matrix_expression<AE> -&ae)
        The extended copy constructor.
        void resize (size_type size1, size_type size2, bool -preserve = true)Reallocates a triangular_matrix to hold -size1 rows of size2 elements. The -existing elements of the triangular_matrix are -preseved when specified.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        triangular_matrix &operator = (const -triangular_matrix &m)The assignment operator.
        triangular_matrix &assign_temporary -(triangular_matrix &m)Assigns a temporary. May change the triangular matrix -m.
        template<class AE>
        -triangular_matrix &operator = (const -matrix_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -triangular_matrix &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the triangular matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -triangular_matrix &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the triangular matrix.
        template<class AE>
        -triangular_matrix &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the triangular matrix. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -triangular_matrix &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the triangular matrix.
        template<class AE>
        -triangular_matrix &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the triangular matrix. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -triangular_matrix &operator *= (const AT &at)
        A computed assignment operator. Multiplies the triangular -matrix with a scalar.
        template<class AT>
        -triangular_matrix &operator /= (const AT &at)
        A computed assignment operator. Divides the triangular matrix -through a scalar.
        void swap (triangular_matrix &m)Swaps the contents of the triangular matrices.
        void insert (size_type i, size_type j, const_reference -t)Inserts the value t at the j-th -element of the i-th row.
        void erase (size_type i, size_type j)Erases the value at the j-th elemenst of the -i-th row.
        void clear ()Clears the matrix.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the triangular_matrix.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the triangular_matrix.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the triangular_matrix.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -triangular_matrix.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the triangular_matrix.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the triangular_matrix.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the triangular_matrix.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -triangular_matrix.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed triangular_matrix.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed triangular_matrix.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed triangular_matrix.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed triangular_matrix.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed triangular_matrix.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed triangular_matrix.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed triangular_matrix.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed triangular_matrix.
        -

        Notes

        -

        [1] -Supported parameters for the type of the triangular matrix are -lower , unit_lower, upper -and unit_upper .

        -

        [2] -Supported parameters for the storage organization are -row_major and column_major.

        -

        [3] -Supported parameters for the adapted array are -unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

        -

        Triangular Adaptor

        -

        Description

        -

        The templated class triangular_adaptor<M, F> -is a triangular matrix adaptor for other matrices.

        -

        Example

        -
        -#include <boost/numeric/ublas/triangular.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    matrix<double> m (3, 3);
        -    triangular_adaptor<matrix<double>, lower> tal (m);
        -    for (unsigned i = 0; i < tal.size1 (); ++ i)
        -        for (unsigned j = 0; j <= i; ++ j)
        -            tal (i, j) = 3 * i + j;
        -    std::cout << tal << std::endl;
        -    triangular_adaptor<matrix<double>, upper> tau (m);
        -    for (unsigned i = 0; i < tau.size1 (); ++ i)
        -        for (unsigned j = i; j < tau.size2 (); ++ j)
        -            tau (i, j) = 3 * i + j;
        -    std::cout << tau << std::endl;
        -}
        -
        -

        Please read the full triangular example for more details.

        - -

        Definition

        -

        Defined in the header triangular.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        MThe type of the adapted matrix.
        FFunctor describing the type of the triangular adaptor. [1]lower
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<triangular_adaptor<M, F> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        triangular_adaptor (matrix_type &data)Constructs a triangular_adaptor of a matrix.
        triangular_adaptor (const triangular_adaptor -&m)The copy constructor.
        template<class AE>
        -triangular_adaptor (const matrix_expression<AE> -&ae)
        The extended copy constructor.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns a const reference of the j --th element in the i-th row.
        reference operator () (size_type i, size_type -j)Returns a reference of the j-th element in the -i-th row.
        triangular_adaptor &operator = (const -triangular_adaptor &m)The assignment operator.
        triangular_adaptor &assign_temporary -(triangular_adaptor &m)Assigns a temporary. May change the triangular adaptor -m.
        template<class AE>
        -triangular_adaptor &operator = (const -matrix_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -triangular_adaptor &assign (const matrix_expression<AE> -&ae)
        Assigns a matrix expression to the triangular adaptor. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -triangular_adaptor &operator += (const -matrix_expression<AE> &ae)
        A computed assignment operator. Adds the matrix expression to -the triangular adaptor.
        template<class AE>
        -triangular_adaptor &plus_assign (const -matrix_expression<AE> &ae)
        Adds a matrix expression to the triangular adaptor. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -triangular_adaptor &operator -= (const -matrix_expression<AE> &ae)
        A computed assignment operator. Subtracts the matrix expression -from the triangular adaptor.
        template<class AE>
        -triangular_adaptor &minus_assign (const -matrix_expression<AE> &ae)
        Subtracts a matrix expression from the triangular adaptor. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -triangular_adaptor &operator *= (const AT &at)
        A computed assignment operator. Multiplies the triangular -adaptor with a scalar.
        template<class AT>
        -triangular_adaptor &operator /= (const AT &at)
        A computed assignment operator. Divides the triangular adaptor -through a scalar.
        void swap (triangular_adaptor &m)Swaps the contents of the triangular adaptors.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the triangular_adaptor.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the triangular_adaptor.
        iterator1 begin1 ()Returns a iterator1 pointing to the beginning of -the triangular_adaptor.
        iterator1 end1 ()Returns a iterator1 pointing to the end of the -triangular_adaptor.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the triangular_adaptor.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the triangular_adaptor.
        iterator2 begin2 ()Returns a iterator2 pointing to the beginning of -the triangular_adaptor.
        iterator2 end2 ()Returns a iterator2 pointing to the end of the -triangular_adaptor.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed triangular_adaptor.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed triangular_adaptor.
        reverse_iterator1 rbegin1 ()Returns a reverse_iterator1 pointing to the -beginning of the reversed triangular_adaptor.
        reverse_iterator1 rend1 ()Returns a reverse_iterator1 pointing to the end of -the reversed triangular_adaptor.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed triangular_adaptor.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed triangular_adaptor.
        reverse_iterator2 rbegin2 ()Returns a reverse_iterator2 pointing to the -beginning of the reversed triangular_adaptor.
        reverse_iterator2 rend2 ()Returns a reverse_iterator2 pointing to the end of -the reversed triangular_adaptor.
        -

        Notes

        -

        [1] -Supported parameters for the type of the triangular adaptor are -lower , unit_lower, upper -and unit_upper .

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/types_overview.htm b/doc/types_overview.htm deleted file mode 100644 index b68a7ce0..00000000 --- a/doc/types_overview.htm +++ /dev/null @@ -1,580 +0,0 @@ - - - - - - - - - -Types Overview - - -

        Overview of Matrix- and Vector-Types

        -
        - -
        -
        Contents:
        -
        Vectors
        -
        Vector Proxies
        -
        Matrices
        -
        Matrix Proxies
        -
        Special Storage Layouts
        -
        - - -

        Notation

        - - - - - - - - - - - - - - - - - - - -
        Tis the data type. For general linear algebra operations this will be a real type e.g. double, ...
        Fis the orientation type (functor), either -row_major or column_major
        A, IA, TA is an array storage type, e.g. std::vector, -bounded_array, unbounded_array, ...
        TRIis a triangular functor: lower, -unit_lower, strict_lower, upper, unit_upper, -strict_upper
        M, Nare unsigned integer sizes -(std::size_t)
        IBis an index base -(std::size_t)
        VECis any vector type
        MAT is any matrix type
        [...]denote optional arguments - for more details -look at the section "storage layout".
        - -

        Vectors

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DefinitionDescription
        vector<T [, A]>
           v(size);
        a dense vector of values of type T of variable -size. A storage type A can be specified -which defaults to unbounded_array. -Elements are constructed by A, which need not initialise their value.
        bounded_vector<T, N>
           v;
        a dense vector of values of type T of variable size but with maximum -N. The default constructor creates v -with size N. -Elements are constructed by the storage type bounded_array, which need not initialise their value.
        c_vector<T, M>
           v(size);
        a dense vector of values of type T with the given size. -The data is stored as an ordinary C++ array T -data_[M]
        zero_vector<T>
           v(size);
        the zero vector of type T with the given -size.
        unit_vector<T>
           v(size, index);
        the unit vector of type T with the given size. The -vector is zero other then a single specified element. -
        index should be less than size.
        mapped_vector<T [, S]>
           v(size);
        a sparse vector of values of type T of variable -size. The sparse storage type S can be std::map<size_t, -T> or map_array<size_t, T>.
        compressed_vector<T [,IB, IA, TA]>
           v(size);
        a sparse vector of values of type T of variable -size. The non zero values are stored as two seperate arrays - an -index array and a value array. The index array is always sorted and -there is at most one entry for each index.
        coordinate_vector<T [,IB, IA, TA]>
           v(size);
        a sparse vector of values of type T of variable -size. The non zero values are stored as two seperate arrays - an -index array and a value array. The arrays may be out of order with -multiple entries for each vector element. If there are multiple -values for the same index the sum of these values is the real -value.
        -

        Note: the default types are defined in -boost/numeric/ublas/fwd.hpp.

        - -

        Vector Proxies

        - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DefinitionDescription
        vector_range<VEC>
           vr(v, range);
        a vector referencing a continuous subvector of elements of -vector v containing all elements specified by -range.
        vector_slice<VEC>
           vs(v, slice);
        a vector referencing a non continuous subvector of elements of -vector v containing all elements specified by -slice.
        matrix_row<MAT>
           vr(m, index);
        a vector referencing the index-th row of matrix -m
        matrix_column<MAT>
           vc(m, index);
        a vector referencing the index-th column of matrix -m
        - -

        Matrices

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DefinitionDescription
        matrix<T [, F, A]>
           m(size1, size2);
        a dense matrix of values of type T of variable -size. A storage type A can be specified -which defaults to unbounded_array. -The orientation functor F defaults to -row_major. -Elements are constructed by A, which need not initialise their value.
        bounded_matrix<T, M, N [, F]>
           m;
        a dense matrix of type T with variable size with maximum M-by-N. The orientation functor F -defaults to row_major. The default constructor creates -m with size M-by-N. -Elements are constructed by the storage type bounded_array, which need not initialise their value.
        c_matrix<T, M, N>
           m(size1, size2);
        a dense matrix of values of type T with the given size. -The data is stored as an ordinary C++ array T -data_[N][M]
        vector_of_vector<T [, F, A]>
           m(size1, -size2);
        a dense matrix of values of type T with the given size. -The data is stored as a vector of vectors. The orientation -F defaults to row_major. The storage -type S defaults to -unbounded_array<unbounded_array<T> >
        zero_matrix<T>
           m(size1, size2);
        a zero matrix of type T with the given size.
        identity_matrix<T>
           m(size1, size2);
        an identity matrix of type T with the given size. -The values are v(i,j) = (i==j)?T(1):T().
        scalar_matrix<T>
           m(size1, size2, -value);
        a matrix of type T with the given size that has the -value value everywhere.
        triangular_matrix<T [, TRI, F, A]>
           -m(size);
        a triangular matrix of values of type T of -variable size. Only the nonzero elements are stored in the given -order F. ("triangular packed storage") The triangular -type F defaults to lower, the orientation -type F defaults to row_major.
        banded_matrix<T [, F, A]>
           m(size1, size2, n_lower, -n_upper);
        a banded matrix of values of type T of variable -size with n_lower sub diagonals and -n_upper super diagonals. Only the nonzero elements are -stored in the given order F. ("packed storage")
        symmetric_matrix<T [, TRI, F, A]>
           -m(size);
        a symmetric matrix of values of type T of -variable size. Only the given triangular matrix is stored in the -given order F.
        hermitian_matrix<T [, TRI, F, A]>
           -m(size);
        a hermitian matrix of values of type T of -variable size. Only the given triangular matrix is stored using -the order F.
        mapped_matrix<T, [F, S]>
           m(size1, size2 [, -non_zeros]);
        a sparse matrix of values of type T of variable -size. The sparse storage type S can be either std::map<size_t, -std::map<size_t, T> > or -map_array<size_t, map_array<size_t, -T> >.
        sparse_vector_of_sparse_vector<T, [F, C]>
           m(size1, -size2 [, non_zeros]);
        a sparse matrix of values of type T of variable -size.
        compressed_matrix<T, [F, IB, IA, TA]>
           m(size1, -size2 [, non_zeros]);
        a sparse matrix of values of type T of variable -size. The values are stored in compressed row/column storage.
        coordinate_matrix<T, [F, IB, IA, TA]>
           m(size1, -size2 [, non_zeros]);
        a sparse matrix of values of type T of variable -size. The values are stored in 3 parallel array as triples (i, j, -value). More than one value for each pair of indices is possible, -the real value is the sum of all.
        generalized_vector_of_vector<T, F, A>
           m(size1, -size2 [, non_zeros]);
        a sparse matrix of values of type T of variable -size. The values are stored as a vector of sparse vectors, e.g. -generalized_vector_of_vector<double, row_major, -unbounded_array<coordinate_vector<double> > >
        -

        Note: the default types are defined in -boost/numeric/ublas/fwd.hpp.

        - -

        Matrix Proxies

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DefinitionDescription
        triangular_adaptor<MAT, TRI>
           ta(m);
        a triangular matrix referencing a selection of elements of the -matrix m.
        symmetric_adaptor<MAT, TRI>
           sa(m);
        a symmetric matrix referencing a selection of elements of the -matrix m.
        hermitian_adaptor<MAT, TRI>
           ha(m);
        a hermitian matrix referencing a selection of elements of the -matrix m.
        banded_adaptor<MAT>
           ba(m, n_lower, -n_upper);
        a banded matrix referencing a selection of elements of the -matrix m.
        matrix_range<MAT, TRI>
           mr(m, range1, -range2);
        a matrix referencing a submatrix of elements in the matrix -m.
        matrix_slice<MAT, TRI>
           ms(m, slice1, -slice2);
        a matrix referencing a non continues submatrix of elements in -the matrix m.
        - - - -

        Special Storage Layouts

        - - -

        The library supports conventional dense, packed and basic sparse -vector and matrix storage layouts. The description of the most -common constructions of vectors and matrices comes next.

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ConstructionComment
        vector<T,
        - std::vector<T> >
        -  v (size)
        a dense vector, storage is provided by a standard -vector.
        -The storage layout usually is BLAS compliant.
        vector<T,
        - unbounded_array<T> >
        -  v (size)
        a dense vector, storage is provided by a heap-based -array.
        -The storage layout usually is BLAS compliant.
        vector<T,
        - bounded_array<T, N> >
        -  v (size)
        a dense vector, storage is provided by a stack-based -array.
        -The storage layout usually is BLAS compliant.
        mapped_vector<T,
        - std::map<std::size_t, T> >
        -  v (size, non_zeros)
        a sparse vector, storage is provided by a standard -map.
        mapped_vector<T,
        - map_array<std::size_t, T> >
        -  v (size, non_zeros)
        a sparse vector, storage is provided by a map -array.
        matrix<T,
        - row_major,
        - std::vector<T> >
        -  m (size1, size2)
        a dense matrix, orientation is row major, storage is -provided by a standard vector.
        matrix<T,
        - column_major,
        - std::vector<T> >
        -  m (size1, size2)
        a dense matrix, orientation is column major, storage -is provided by a standard vector.
        -The storage layout usually is BLAS compliant.
        matrix<T,
        - row_major,
        - unbounded_array<T> >
        -  m (size1, size2)
        a dense matrix, orientation is row major, storage is -provided by a heap-based array.
        matrix<T,
        - column_major,
        - unbounded_array<T> >
        -  m (size1, size2)
        a dense matrix, orientation is column major, storage -is provided by a heap-based array.
        -The storage layout usually is BLAS compliant.
        matrix<T,
        - row_major,
        - bounded_array<T, N1 * N2> >
        -  m (size1, size2)
        a dense matrix, orientation is row major, storage is -provided by a stack-based array.
        matrix<T,
        - column_major,
        - bounded_array<T, N1 * N2> >
        -  m (size1, size2)
        a dense matrix, orientation is column major, storage -is provided by a stack-based array.
        -The storage layout usually is BLAS compliant.
        triangular_matrix<T,
        - row_major, F, A>
        -  m (size)
        a packed triangular matrix, orientation is row -major.
        triangular_matrix<T,
        - column_major, F, A>
        -  m (size)
        a packed triangular matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        banded_matrix<T,
        - row_major, A>
        -  m (size1, size2, lower, upper)
        a packed banded matrix, orientation is row -major.
        banded_matrix<T,
        - column_major, A>
        -  m (size1, size2, lower, upper)
        a packed banded matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        symmetric_matrix<T,
        - row_major, F, A>
        -  m (size)
        a packed symmetric matrix, orientation is row -major.
        symmetric_matrix<T,
        - column_major, F, A>
        -  m (size)
        a packed symmetric matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        hermitian_matrix<T,
        - row_major, F, A>
        -  m (size)
        a packed hermitian matrix, orientation is row -major.
        hermitian_matrix<T,
        - column_major, F, A>
        -  m (size)
        a packed hermitian matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        mapped_matrix<T,
        - row_major,
        - std::map<std::size_t, T> >
        -  m (size1, size2, non_zeros)
        a sparse matrix, orientation is row major, storage -is provided by a standard map.
        mapped_matrix<T,
        - column_major,
        - std::map<std::size_t, T> >
        -  m (size1, size2, non_zeros)
        a sparse matrix, orientation is column major, -storage is provided by a standard map.
        mapped_matrix<T,
        - row_major,
        - map_array<std::size_t, T> >
        -  m (size1, size2, non_zeros)
        a sparse matrix, orientation is row major, storage -is provided by a map array.
        mapped_matrix<T,
        - column_major,
        - map_array<std::size_t, T> >
        -  m (size1, size2, non_zeros)
        a sparse matrix, orientation is column major, -storage is provided by a map array.
        compressed_matrix<T,
        - row_major>
        -  m (size1, size2, non_zeros)
        a compressed matrix, orientation is row major.
        -The storage layout usually is BLAS compliant.
        compressed_matrix<T,
        - column_major>
        -  m (size1, size2, non_zeros)
        a compressed matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        coordinate_matrix<T,
        - row_major>
        -  m (size1, size2, non_zeros)
        a coordinate matrix, orientation is row major.
        -The storage layout usually is BLAS compliant.
        coordinate_matrix<T,
        - column_major>
        -  m (size1, size2, non_zeros)
        a coordinate matrix, orientation is column -major.
        -The storage layout usually is BLAS compliant.
        - -
        -

        Copyright (©) 2000-2004 Joerg Walter, Mathias Koch, Gunter -Winkler, Michael Stevens
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/ublas.css b/doc/ublas.css deleted file mode 100644 index 1531be7f..00000000 --- a/doc/ublas.css +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2000-2009 Michael Stevens, Mathias Koch, - * Joerg Walter, Gunter Winkler. - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt - * or copy at http://www.boost.org/LICENSE_1_0.txt). - */ -table { - border-width: medium; - background-color: #F8F8F8; - margin: 1em; -} - -td { - padding-left: 0.5em; - padding-right: 0.5em; -} - -th { - text-align: left; -} - -pre.screen { - border: 1px solid #DCDCDC; - display: block; - font-size: 9pt; - margin: 1pc 4% 0; - padding: 0.5pc; -} - -p.credit { - font-style: italic; -} - -@media print { - div.toc { display: none; } -} - -div.toc { - margin: 10px; - padding: 3px; -} - -div#toc ul { - list-style: none; - margin: 1px; - padding-left: 1em; - margin-bottom: 0.25em; -} - -div#toc ul li ul { - margin-bottom: 0.25em; -} - -div#toc ul li ul li ul { - margin-bottom: 0.25em; -} \ No newline at end of file diff --git a/doc/unbounded_array.htm b/doc/unbounded_array.htm deleted file mode 100644 index bd49abce..00000000 --- a/doc/unbounded_array.htm +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - -Unbounded array - - -

        Unbounded Array Storage

        -
        -

        Unbounded Array

        -

        Description

        -

        The templated class unbounded_array<T, ALLOC> implements a unbounded storage array using an allocator. -The unbounded array is similar to a std::vector in that in can grow in size beyond any fixed bound. -However unbounded_array is aimed at optimal performance. Therefore unbounded_array does not model a -Sequence like std::vector does. -

        When resized unbounded_array will reallocate it's storage even if the new size requirement is smaller. It is therefore inefficient to resize a unbounded_array

        -

        Example

        -
        -#include <boost/numeric/ublas/storage.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    unbounded_array<double> a (3);
        -    for (unsigned i = 0; i < a.size (); ++ i) {
        -        a [i] = i;
        -        std::cout << a [i] << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header storage.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the array.
        ALLOCAn STL Allocatorstd::allocator
        -

        Model of

        -

        Storage

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Storage.

        -

        Public base classes

        -

        None.

        -

        Members

        -
          -
        • The description does not describe what the member actually does, this can be looked up -in the corresponding concept documentation, but instead contains a remark on the implementation of the -member inside this model of the concept.
        • -
        • Typography: -
            -
          • Members that are not part of the implemented concepts are in blue.
          • -
          -
        • -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberWhere definedDescription
        value_typeContainer
        pointerContainerDefined as value_type*
        const_pointerContainerDefined as const value_type*
        referenceContainerDefined as value_type&
        const_referenceContainerDefined as const value_type&
        size_typeContainerDefined as Alloc::size_type
        difference_typeContainerDefined as Alloc::difference_type
        iteratorContainerDefined as pointer
        const_iteratorContainerDefined as const_pointer
        revere_iteratorContainerDefined as std::reverse_iterator<iterator>
        const_revere_iteratorContainerDefined as std::reverse_iterator<const_iterator>
        allocator_typeDefined as ALLOC
        explicit unbounded_array (ALLOC &a = ALLOC())StorageCreates an unbounded_array that holds zero elements, using a specified allocator.
        explicit unbounded_array (size_type size, ALLOC &a = ALLOC())StorageCreates a uninitialized unbounded_array that holds size elements, using a specified allocator. All the elements are default constructed.
        unbounded_array (size_type size, const T& init, ALLOC& a = ALLOC())StorageCreates an initialized unbounded_array that holds size elements, using a specified allocator. All the elements are constructed from the init value.
        unbounded_array (const unbounded_array &a)ContainerThe copy constructor.
        ~unbounded_array ()ContainerDeallocates the unbounded_array itself.
        void resize (size_type n)StorageReallocates an unbounded_array to hold n elements. Values are uninitialised.
        void resize(size_type n, const T& t)StorageReallocates an unbounded_array to hold n elements. Values are copies of t -
        size_type size () constContainerReturns the size of the unbounded_array.
        const_reference operator [] (size_type i) constContainerReturns a const reference of the i -th element.
        reference operator [] (size_type i)ContainerReturns a reference of the i-th element.
        unbounded_array &operator = (const unbounded_array &a)ContainerThe assignment operator.
        unbounded_array &assign_temporary (unbounded_array &a)Assigns a temporary. May change the array a.
        void swap (unbounded_array &a)ContainerSwaps the contents of the arrays.
        const_iterator begin () constContainerReturns a const_iterator pointing to the beginning -of the unbounded_array.
        const_iterator end () constContainerReturns a const_iterator pointing to the end of -the unbounded_array.
        iterator begin ()ContainerReturns a iterator pointing to the beginning of -the unbounded_array.
        iterator end ()ContainerReturns a iterator pointing to the end of the -unbounded_array.
        const_reverse_iterator rbegin () constReversible ContainerReturns a const_reverse_iterator pointing to the beginning of the reversed unbounded_array.
        const_reverse_iterator rend () constReversible ContainerReturns a const_reverse_iterator pointing to the end of the reversed unbounded_array.
        reverse_iterator rbegin ()Reversible ContainerReturns a reverse_iterator pointing to the beginning of the reversed unbounded_array.
        reverse_iterator rend ()Reversible ContainerReturns a reverse_iterator pointing to the end of the reversed unbounded_array.
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/vector.htm b/doc/vector.htm deleted file mode 100644 index ed73dc1f..00000000 --- a/doc/vector.htm +++ /dev/null @@ -1,755 +0,0 @@ - - - - - - - - - -Vector - - -

        Vector

        -
        -

        Vector

        -

        Description

        -

        The templated class vector<T, A> is the base -container adaptor for dense vectors. For a n-dimensional -vector and 0 <= i < n every element -vi is mapped to the i-th -element of the container.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the vector.
        AThe type of the Storage array. [1]unbounded_array<T>
        -

        Model of

        -

        Vector, -RandomAccessContainer -

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector -and RandomAccessContainer.

        -

        Public base classes

        -

        vector_container<vector<T, A> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberWhere definedDescription
        value_type -VectorExpression
        reference -VectorExpression
        const_reference -VectorExpression
        size_type -VectorExpression
        difference_type -VectorExpression
        const_iterator -VectorExpression
        iterator -VectorExpression
        const_reverse_iterator -VectorExpression
        reverse_iterator -VectorExpression
        array_type -Vector
        vector ()VectorExpressionAllocates an uninitialized vector that holds zero -elements.
        vector (size_type size)VectorAllocates an uninitialized vector that holds -size elements.
        vector (const vector &v)The copy constructor.
        template<class AE>
        -vector (const vector_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size, bool preserve = -true)VectorReallocates a vector to hold size -elements. The existing elements of the vector are -preseved when specified.
        size_type size () constVectorExpressionReturns the size of the vector.
        size_type max_size () constRandomAccessContainerReturns the upper bound on the size of the vector.
        bool empty () constRandomAccessContainerEquivilent to size () == 0.
        const array_type& data () constVector
        array_type& data ()Vector
        const_reference operator () (size_type i) -constVectorExpressionReturns a const reference of the i --th element.
        reference operator () (size_type i)VectorExpressionReturns a reference of the i-th element.
        const_reference operator [] (size_type i) constVectorReturns a const reference of the i --th element.
        reference operator [] (size_type i)VectorReturns a reference of the i-th element.
        vector &operator = (const vector &v)VectorExpressionThe assignment operator.
        vector &assign_temporary (vector &v)VectorExpressionAssigns a temporary. May change the vector v.
        template<class AE>
        -vector &operator = (const vector_expression<AE> -&ae)
        VectorExpressionThe extended assignment operator.
        template<class AE>
        -vector &assign (const vector_expression<AE> -&ae)
        VectorExpressionAssigns a vector expression to the vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -vector &operator += (const vector_expression<AE> -&ae)
        VectorExpressionA computed assignment operator. Adds the vector expression to -the vector.
        template<class AE>
        -vector &plus_assign (const vector_expression<AE> -&ae)
        VectorExpressionAdds a vector expression to the vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -vector &operator -= (const vector_expression<AE> -&ae)
        VectorExpressionA computed assignment operator. Subtracts the vector expression -from the vector.
        template<class AE>
        -vector &minus_assign (const vector_expression<AE> -&ae)
        VectorExpressionSubtracts a vector expression from the vector. Left and right -hand side of the assignment should be independent.
        template<class AT>
        -vector &operator *= (const AT &at)
        VectorExpressionA computed assignment operator. Multiplies the vector with a -scalar.
        template<class AT>
        -vector &operator /= (const AT &at)
        VectorExpressionA computed assignment operator. Divides the vector through a -scalar.
        void swap (vector &v)VectorExpressionSwaps the contents of the vectors.
        void insert_element (size_type i, const_reference t)VectorInserts the value t at the i-th -element.
        void erase_element (size_type i)VectorErases the value at the i-th element.
        void clear ()VectorClears the vector.
        const_iterator begin () constVectorExpressionReturns a const_iterator pointing to the beginning -of the vector.
        const_iterator end () constVectorExpressionReturns a const_iterator pointing to the end of -the vector.
        iterator begin ()VectorExpressionReturns a iterator pointing to the beginning of -the vector.
        iterator end ()VectorExpressionReturns a iterator pointing to the end of the -vector.
        const_reverse_iterator rbegin () constVectorExpressionReturns a const_reverse_iterator pointing to the -beginning of the reversed vector.
        const_reverse_iterator rend () constVectorExpressionReturns a const_reverse_iterator pointing to the -end of the reversed vector.
        reverse_iterator rbegin ()VectorExpressionReturns a reverse_iterator pointing to the -beginning of the reversed vector.
        reverse_iterator rend ()VectorExpressionReturns a reverse_iterator pointing to the end of -the reversed vector.
        -

        Notes

        -

        [1] Common parameters -for the Storage array are unbounded_array<T> , -bounded_array<T> and -std::vector<T> .

        -

        Unit Vector

        -

        Description

        -

        The templated class unit_vector<T, ALLOC> represents -canonical unit vectors. For the k-th -n-dimensional canonical unit vector and 0 <= i < -n holds uki -= 0, if i <> k, and -uki = -1.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    for (int i = 0; i < 3; ++ i) {
        -        unit_vector<double> v (3, i);
        -        std::cout << v << std::endl;
        -    }
        -}
        -
        -

        Definition

        -

        Defined in the header vector.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the vector.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Vector .

        -

        Public base classes

        -

        vector_container<unit_vector<T> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        unit_vector ()Constructs an unit_vector that holds zero -elements.
        unit_vector (size_type size, size_type index)Constructs the index-th unit_vector -that holds size elements.
        unit_vector (const unit_vector &v)The copy constructor.
        void resize (size_type size, bool preserve = -true)Resizes a unit_vector to hold size -elements. Therefore the existing elements of the -unit_vector are always preseved.
        size_type size () constReturns the size of the unit_vector.
        size_type index () constReturns the index of the unit_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        unit_vector &operator = (const unit_vector -&v)The assignment operator.
        unit_vector &assign_temporary (unit_vector -&v)Assigns a temporary. May change the unit vector v -.
        void swap (unit_vector &v)Swaps the contents of the unit vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the unit_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the unit_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed unit_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed unit_vector.
        -

        Zero Vector

        -

        Description

        -

        The templated class zero_vector<T, ALLOC> represents -zero vectors. For a n-dimensional zero vector and 0 -<= i < n holds zi = -0.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    zero_vector<double> v (3);
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the vector.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Vector .

        -

        Public base classes

        -

        vector_container<zero_vector<T> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        zero_vector ()Constructs a zero_vector that holds zero -elements.
        zero_vector (size_type size)Constructs a zero_vector that holds -size elements.
        zero_vector (const zero_vector &v)The copy constructor.
        void resize (size_type size, bool preserve = -true)Resizes a zero_vector to hold size -elements. Therefore the existing elements of the -zero_vector are always preseved.
        size_type size () constReturns the size of the zero_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        zero_vector &operator = (const zero_vector -&v)The assignment operator.
        zero_vector &assign_temporary (zero_vector -&v)Assigns a temporary. May change the zero vector v -.
        void swap (zero_vector &v)Swaps the contents of the zero vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the zero_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the zero_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed zero_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed zero_vector.
        -

        Scalar Vector

        -

        Description

        -

        The templated class scalar_vector<T, ALLOC> -represents scalar vectors. For a n-dimensional scalar -vector and 0 <= i < n holds -zi = s.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    scalar_vector<double> v (3);
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the vector.int
        ALLOCAn STL Allocator for size_type and difference_type.std::allocator
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of -Vector .

        -

        Public base classes

        -

        vector_container<scalar_vector<T> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        scalar_vector ()Constructs a scalar_vector that holds zero -elements.
        scalar_vector (size_type size, const value_type -&value)Constructs a scalar_vector that holds -size elements each of the specified value.
        scalar_vector (const scalar_vector &v)The copy constructor.
        void resize (size_type size, bool preserve = -true)Resizes a scalar_vector to hold size -elements. Therefore the existing elements of the -scalar_vector are always preseved.
        size_type size () constReturns the size of the scalar_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        scalar_vector &operator = (const scalar_vector -&v)The assignment operator.
        scalar_vector &assign_temporary (scalar_vector -&v)Assigns a temporary. May change the scalar vector -v .
        void swap (scalar_vector &v)Swaps the contents of the scalar vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the scalar_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the scalar_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed scalar_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed scalar_vector.
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/vector_expression.htm b/doc/vector_expression.htm deleted file mode 100644 index 82c207f9..00000000 --- a/doc/vector_expression.htm +++ /dev/null @@ -1,969 +0,0 @@ - - - - - - - - - -Vector Expressions - - -

        Vector Expressions

        -
        -

        Vector Expression

        -

        Description

        -

        The templated class vector_expression<E> -is required to be a public base of all classes which model the Vector Expression concept.

        -

        Definition

        -

        Defined in the header expression_types.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the vector expression. 
        -

        Model of

        -

        None. Not a Vector Expression! -

        -

        Type requirements

        -

        None.

        -

        Public base classes

        -

        None.

        -

        Members

        - - - - - - - - - - - - - - - -
        MemberDescription
        const expression_type &operator () () -constReturns a const reference of the expression.
        expression_type &operator () ()Returns a reference of the expression.
        -

        Notes

        -

        The range, slice and project functions have been removed. Use the free functions defined in vector proxy instead.

        - -

        Vector Container

        -

        Description

        -

        The templated class vector_container<C> -is required to be a public base of all classes which model the Vector concept. -This includes the class vector itself.

        -

        Definition

        -

        Defined in the header expression_types.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        CThe type of the vector container. 
        -

        Model of

        -

        None. Not a Vector Expression OR Vector! -

        -

        Type requirements

        -

        None.

        -

        Public base classes

        -

        vector_expression<C>

        -

        Members

        - - - - - - - - - - - - - - - -
        MemberDescription
        const container_type &operator () () -constReturns a const reference of the container.
        container_type &operator () ()Returns a reference of the container.
        - -

        Vector References

        -

        Reference

        -

        Description

        -

        The templated class vector_reference<E> -contains a reference to a vector expression.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the vector expression. 
        -

        Model of

        -

        Vector Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_reference<E> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_reference (expression_type &e)Constructs a reference of the expression.
        void resize (size_type size)Resizes the expression to hold at most size -elements.
        size_type size () constReturns the size of the expression.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the expression.
        const_iterator end () constReturns a const_iterator pointing to the end of -the expression.
        iterator begin ()Returns a iterator pointing to the beginning of -the expression.
        iterator end ()Returns a iterator pointing to the end of the -expression.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed expression.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed expression.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed expression.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed expression.
        -

        Vector Operations

        -

        Unary Operation Description

        -

        Description

        -

        The templated class vector_unary<E, F> -describes a unary vector operation.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        EThe type of the vector expression. 
        FThe type of the operation. 
        -

        Model of

        -

        Vector Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_unary<E, F> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_unary (const expression_type &e)Constructs a description of the expression.
        size_type size () constReturns the size of the expression.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the expression.
        const_iterator end () constReturns a const_iterator pointing to the end of -the expression.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed expression.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed expression.
        -

        Unary Operations

        -

        Prototypes

        -
        -template<class E, class F>
        -    struct vector_unary_traits {
        -        typedef vector_unary<typename E::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (- v) [i] = - v [i]
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_negate<typename E::value_type> >::result_type
        -    operator - (const vector_expression<E> &e);
        -
        -    // (conj v) [i] = conj (v [i])
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_conj<typename E::value_type> >::result_type
        -    conj (const vector_expression<E> &e);
        -
        -    // (real v) [i] = real (v [i])
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_real<typename E::value_type> >::result_type
        -    real (const vector_expression<E> &e);
        -
        -    // (imag v) [i] = imag (v [i])
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_imag<typename E::value_type> >::result_type
        -    imag (const vector_expression<E> &e);
        -
        -    // (trans v) [i] = v [i]
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_identity<typename E::value_type> >::result_type
        -    trans (const vector_expression<E> &e);
        -
        -    // (herm v) [i] = conj (v [i])
        -    template<class E>
        -     typename vector_unary_traits<E, scalar_conj<typename E::value_type> >::result_type
        -    herm (const vector_expression<E> &e);
        -
        -

        Description

        -

        operator - computes the additive inverse of a -vector expression. conj computes the complex conjugate -of a vector expression. real and imag -compute the real and imaginary parts of a vector expression. -trans computes the transpose of a vector expression. -herm computes the hermitian, i.e. the complex -conjugate of the transpose of a vector expression.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Linear depending from the size of the vector expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<std::complex<double> > v (3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = std::complex<double> (i, i);
        -
        -    std::cout << - v << std::endl;
        -    std::cout << conj (v) << std::endl;
        -    std::cout << real (v) << std::endl;
        -    std::cout << imag (v) << std::endl;
        -    std::cout << trans (v) << std::endl;
        -    std::cout << herm (v) << std::endl;
        -}
        -
        -

        Binary Operation Description

        -

        Description

        -

        The templated class vector_binary<E1, E2, F> -describes a binary vector operation.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1The type of the first vector expression.
        E2The type of the second vector expression.
        FThe type of the operation.
        -

        Model of

        -

        Vector Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_binary<E1, E2, F> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_binary (const expression1_type &e1, const -expression2_type &e2)Constructs a description of the expression.
        size_type size () constReturns the size of the expression.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the expression.
        const_iterator end () constReturns a const_iterator pointing to the end of -the expression.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed expression.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed expression.
        -

        Binary Operations

        -

        Prototypes

        -
        -template<class E1, class E2, class F>
        -    struct vector_binary_traits {
        -        typedef vector_binary<typename E1::const_closure_type,
        -                               typename E2::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (v1 + v2) [i] = v1 [i] + v2 [i]
        -    template<class E1, class E2>
        -    typename vector_binary_traits<E1, E2, scalar_plus<typename E1::value_type,
        -                                                       typename E2::value_type> >::result_type
        -    operator + (const vector_expression<E1> &e1,
        -                 const vector_expression<E2> &e2);
        -
        -    // (v1 - v2) [i] = v1 [i] - v2 [i]
        -    template<class E1, class E2>
        -    typename vector_binary_traits<E1, E2, scalar_minus<typename E1::value_type,
        -                                                        typename E2::value_type> >::result_type
        -    operator - (const vector_expression<E1> &e1,
        -                 const vector_expression<E2> &e2);
        -
        -

        Description

        -

        operator + computes the sum of two vector -expressions. operator - computes the difference of two -vector expressions.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size () == e2 ().size ()
        • -
        -

        Complexity

        -

        Linear depending from the size of the vector expressions.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v1 (3), v2 (3);
        -    for (unsigned i = 0; i < std::min (v1.size (), v2.size ()); ++ i)
        -        v1 (i) = v2 (i) = i;
        -
        -    std::cout << v1 + v2 << std::endl;
        -    std::cout << v1 - v2 << std::endl;
        -}
        -
        -

        Binary Outer Operation Description

        -

        Description

        -

        The templated class vector_matrix_binary<E1, E2, -F> describes a binary outer vector operation.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1The type of the first vector expression.
        E2The type of the second vector expression.
        FThe type of the operation.
        -

        Model of

        -

        Matrix Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Matrix Expression .

        -

        Public base classes

        -

        matrix_expression<vector_matrix_binary<E1, E2, F> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_matrix_binary (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        size_type size1 () constReturns the number of rows.
        size_type size2 () constReturns the number of columns.
        const_reference operator () (size_type i, size_type j) -constReturns the value of the j-th element in the -i-th row.
        const_iterator1 begin1 () constReturns a const_iterator1 pointing to the -beginning of the expression.
        const_iterator1 end1 () constReturns a const_iterator1 pointing to the end of -the expression.
        const_iterator2 begin2 () constReturns a const_iterator2 pointing to the -beginning of the expression.
        const_iterator2 end2 () constReturns a const_iterator2 pointing to the end of -the expression.
        const_reverse_iterator1 rbegin1 () constReturns a const_reverse_iterator1 pointing to the -beginning of the reversed expression.
        const_reverse_iterator1 rend1 () constReturns a const_reverse_iterator1 pointing to the -end of the reversed expression.
        const_reverse_iterator2 rbegin2 () constReturns a const_reverse_iterator2 pointing to the -beginning of the reversed expression.
        const_reverse_iterator2 rend2 () constReturns a const_reverse_iterator2 pointing to the -end of the reversed expression.
        -

        Binary Outer Operations

        -

        Prototypes

        -
        -template<class E1, class E2, class F>
        -    struct vector_matrix_binary_traits {
        -        typedef vector_matrix_binary<typename E1::const_closure_type,
        -                                      typename E2::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -     };
        -
        -    // (outer_prod (v1, v2)) [i] [j] = v1 [i] * v2 [j]
        -    template<class E1, class E2>
        -    typename vector_matrix_binary_traits<E1, E2, scalar_multiplies<typename E1::value_type, typename E2::value_type> >::result_type
        -    outer_prod (const vector_expression<E1> &e1,
        -                 const vector_expression<E2> &e2);
        -
        -

        Description

        -

        outer_prod computes the outer product of two vector -expressions.

        -

        Definition

        -

        Defined in the header matrix_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Quadratic depending from the size of the vector expressions.

        -

        Examples

        -
        -#include <boost/numeric/ublas/matrix.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v1 (3), v2 (3);
        -    for (unsigned i = 0; i < std::min (v1.size (), v2.size ()); ++ i)
        -        v1 (i) = v2 (i) = i;
        -
        -    std::cout << outer_prod (v1, v2) << std::endl;
        -}
        -
        -

        Scalar Vector Operation Description

        -

        Description

        -

        The templated classes vector_binary_scalar1<E1, E2, -F> and vector_binary_scalar2<E1, E2, -F> describe binary operations between a scalar and a -vector.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        E1/E2The type of the scalar expression.
        E2/E1The type of the vector expression.
        FThe type of the operation.
        -

        Model of

        -

        Vector Expression -.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_binary_scalar1<E1, E2, -F> > and -vector_expression<vector_binary_scalar2<E1, E2, F> -> resp.

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_binary_scalar1 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        vector_binary_scalar2 (const expression1_type &e1, -const expression2_type &e2)Constructs a description of the expression.
        size_type size () constReturns the size of the expression.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the expression.
        const_iterator end () constReturns a const_iterator pointing to the end of -the expression.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed expression.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed expression.
        -

        Scalar Vector Operations

        -

        Prototypes

        -
        -template<class T1, class E2, class F>
        -    struct vector_binary_scalar1_traits {
        -        typedef vector_binary_scalar1<scalar_const_reference<T1>,
        -                                      typename E2::const_closure_type, F> expression_type;
        -        typedef expression_type result_type;
        -    };
        -
        -    // (t * v) [i] = t * v [i]
        -    template<class T1, class E2>
        -    typename vector_binary_scalar1_traits<T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type
        -    operator * (const T1 &e1,
        -                const vector_expression<E2> &e2);
        -
        -    template<class E1, class T2, class F>
        -    struct vector_binary_scalar2_traits {
        -        typedef vector_binary_scalar2<typename E1::const_closure_type,
        -                                      scalar_const_reference<T2>, F> expression_type;
        -        typedef expression_type result_type;
        -    };
        -
        -    // (v * t) [i] = v [i] * t
        -    template<class E1, class T2>
        -    typename vector_binary_scalar2_traits<E1, T2, scalar_multiplies<typename E1::value_type, T2> >::result_type
        -    operator * (const vector_expression<E1> &e1,
        -                const T2 &e2);
        -
        -    // (v / t) [i] = v [i] / t
        -    template<class E1, class T2>
        -    typename vector_binary_scalar2_traits<E1, T2, scalar_divides<typename E1::value_type, T2> >::result_type
        -    operator / (const vector_expression<E1> &e1,
        -                const T2 &e2);
        -
        -

        Description

        -

        operator * computes the product of a scalar and a -vector expression. operator / multiplies the vector -with the reciprocal of the scalar.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Linear depending from the size of the vector expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -
        -    std::cout << 2.0 * v << std::endl;
        -    std::cout << v * 2.0 << std::endl;
        -}
        -
        -

        Vector Reductions

        -

        Unary Reductions

        -

        Prototypes

        -
        -template<class E, class F>
        -    struct vector_scalar_unary_traits {
        -         typedef typename F::result_type result_type;
        -    };
        -
        -    // sum v = sum (v [i])
        -    template<class E>
        -    typename vector_scalar_unary_traits<E, vector_sum<typename E::value_type> >::result_type
        -    sum (const vector_expression<E> &e);
        -
        -    // norm_1 v = sum (abs (v [i]))
        -    template<class E>
        -    typename vector_scalar_unary_traits<E, vector_norm_1<typename E::value_type> >::result_type
        -    norm_1 (const vector_expression<E> &e);
        -
        -    // norm_2 v = sqrt (sum (v [i] * v [i]))
        -    template<class E>
        -    typename vector_scalar_unary_traits<E, vector_norm_2<typename E::value_type> >::result_type
        -    norm_2 (const vector_expression<E> &e);
        -
        -    // norm_inf v = max (abs (v [i]))
        -    template<class E>
        -    typename vector_scalar_unary_traits<E, vector_norm_inf<typename E::value_type> >::result_type
        -    norm_inf (const vector_expression<E> &e);
        -
        -    // index_norm_inf v = min (i: abs (v [i]) == max (abs (v [i])))
        -    template<class E>
        -    typename vector_scalar_unary_traits<E, vector_index_norm_inf<typename E::value_type> >::result_type
        -    index_norm_inf (const vector_expression<E> &e);
        -
        -

        Description

        -

        sum computes the sum of the vector expression's -elements. norm_1, norm_2 and -norm_inf compute the corresponding -||.||1, -||.||2 and -||.||inf vector norms. -index_norm_1 computes the index of the vector -expression's first element having maximal absolute value.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -

        None.

        -

        Complexity

        -

        Linear depending from the size of the vector expression.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -
        -    std::cout << sum (v) << std::endl;
        -    std::cout << norm_1 (v) << std::endl;
        -    std::cout << norm_2 (v) << std::endl;
        -    std::cout << norm_inf (v) << std::endl;
        -    std::cout << index_norm_inf (v) << std::endl;
        -}
        -
        -

        Binary Reductions

        -

        Prototypes

        -
        -template<class E1, class E2, class F>
        -    struct vector_scalar_binary_traits {
        -        typedef typename F::result_type result_type;
        -    };
        -
        -    // inner_prod (v1, v2) = sum (v1 [i] * v2 [i])
        -    template<class E1, class E2>
        -    typename vector_scalar_binary_traits<E1, E2, vector_inner_prod<typename E1::value_type,
        -                                                                   typename E2::value_type,
        -                                                                   typename promote_traits<typename E1::value_type,
        -                                                                                           typename E2::value_type>::promote_type> >::result_type
        -    inner_prod (const vector_expression<E1> &e1,
        -                const vector_expression<E2> &e2);
        -
        -    template<class E1, class E2>
        -    typename vector_scalar_binary_traits<E1, E2, vector_inner_prod<typename E1::value_type,
        -                                                                   typename E2::value_type,
        -                                                                   typename type_traits<typename promote_traits<typename E1::value_type,
        -                                                                                                                typename E2::value_type>::promote_type>::precision_type> >::result_type
        -    prec_inner_prod (const vector_expression<E1> &e1,
        -                     const vector_expression<E2> &e2);
        -
        -

        Description

        -

        inner_prod computes the inner product of the vector -expressions. prec_inner_prod computes the double -precision inner product of the vector expressions.

        -

        Definition

        -

        Defined in the header vector_expression.hpp.

        -

        Type requirements

        - -

        Preconditions

        -
          -
        • e1 ().size () == e2 ().size ()
        • -
        -

        Complexity

        -

        Linear depending from the size of the vector expressions.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v1 (3), v2 (3);
        -    for (unsigned i = 0; i < std::min (v1.size (), v2.size ()); ++ i)
        -        v1 (i) = v2 (i) = i;
        -
        -    std::cout << inner_prod (v1, v2) << std::endl;
        -}
        -
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/vector_proxy.htm b/doc/vector_proxy.htm deleted file mode 100644 index b5193224..00000000 --- a/doc/vector_proxy.htm +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - - - - -Vector Proxies - - -

        Vector Proxies

        -
        -

        Vector Range

        -

        Description

        -

        The templated class vector_range<V> allows -addressing a sub-range of a vector's element.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/vector_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    vector_range<vector<double> > vr (v, range (0, 3));
        -    for (unsigned i = 0; i < vr.size (); ++ i)
        -        vr (i) = i;
        -    std::cout << vr << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        VThe type of vector referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified range falls outside that of the index range of -the vector, then the vector_range is not a well formed -Vector Expression. That is, access to an element which is outside -of index range of the vector is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_range<V> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_range (vector_type &data, const range -&r)Constructs a sub vector.
        size_type start () constReturns the start of the sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        reference operator [] (size_type i)Returns a reference of the i-th element.
        vector_range &operator = (const vector_range -&vr)The assignment operator.
        vector_range &assign_temporary (vector_range -&vr)Assigns a temporary. May change the vector range -vr .
        template<class AE>
        -vector_range &operator = (const vector_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -vector_range &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -vector_range &operator += (const vector_expression<AE> -&ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -vector_range &plus_assign (const vector_expression<AE> -&ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -vector_range &operator -= (const vector_expression<AE> -&ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -vector_range &minus_assign (const vector_expression<AE> -&ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -vector_range &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -vector_range &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (vector_range &vr)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the vector_range.
        const_iterator end () constReturns a const_iterator pointing to the end of -the vector_range.
        iterator begin ()Returns a iterator pointing to the beginning of -the vector_range.
        iterator end ()Returns a iterator pointing to the end of the -vector_range.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed vector_range.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed vector_range.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed vector_range.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed vector_range.
        -

        Simple Projections

        -

        Description

        -

        The free subrange functions support the construction -of vector ranges.

        -

        Prototypes

        -
        
        -    template<class V>
        -    vector_range<V> subrange (V &data,
        -       V::size_type start, V::size_type stop);
        -    template<class V>
        -    const vector_range<const V> subrange (const V &data,
        -       V::size_type start, V::size_type stop);
        -
        -

        Generic Projections

        -

        Description

        -

        The free project functions support the construction -of vector ranges. Existing matrix_range's can be composed with a further range. The resulting range is computed using this existing range's compose function.

        -

        Prototypes

        -
        
        -    template<class V>
        -    vector_range<V> project (V &data, const range &r);
        -    template<class V>
        -    const vector_range<const V> project (const V &data, const range &r);
        -    template<class V>
        -    vector_range<V> project (vector_range<V> &data, const range &r);
        -    template<class V>
        -    const vector_range<V> project (const vector_range<V> &data, const range &r);
        -
        -

        Definition

        -

        Defined in the header vector_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Linear depending from the size of the range.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/vector_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    for (int i = 0; i < 3; ++ i)
        -        project (v, range (0, 3)) (i) = i;
        -    std::cout << project (v, range (0, 3)) << std::endl;
        -}
        -
        -

        Vector Slice

        -

        Description

        -

        The templated class vector_slice<V> allows -addressing a slice of a vector.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/vector_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    vector_slice<vector<double> > vs (v, slice (0, 1, 3));
        -    for (unsigned i = 0; i < vs.size (); ++ i)
        -        vs (i) = i;
        -    std::cout << vs << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector_proxy.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        VThe type of vector referenced.
        -

        Model of

        -

        Vector Expression -.

        -

        If the specified slice falls outside that of the index range of -the vector, then the vector_slice is not a well formed -Vector Expression. That is, access to an element which is outside -of index range of the vector is undefined.

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector Expression .

        -

        Public base classes

        -

        vector_expression<vector_slice<V> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        vector_slice (vector_type &data, const slice -&s)Constructs a sub vector.
        size_type size () constReturns the size of the sub vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        reference operator [] (size_type i)Returns a reference of the i-th element.
        vector_slice &operator = (const vector_slice -&vs)The assignment operator.
        vector_slice &assign_temporary (vector_slice -&vs)Assigns a temporary. May change the vector slice -vs .
        template<class AE>
        -vector_slice &operator = (const vector_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -vector_slice &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the sub vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -vector_slice &operator += (const vector_expression<AE> -&ae)
        A computed assignment operator. Adds the vector expression to -the sub vector.
        template<class AE>
        -vector_slice &plus_assign (const vector_expression<AE> -&ae)
        Adds a vector expression to the sub vector. Left and right hand -side of the assignment should be independent.
        template<class AE>
        -vector_slice &operator -= (const vector_expression<AE> -&ae)
        A computed assignment operator. Subtracts the vector expression -from the sub vector.
        template<class AE>
        -vector_slice &minus_assign (const vector_expression<AE> -&ae)
        Subtracts a vector expression from the sub vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -vector_slice &operator *= (const AT &at)
        A computed assignment operator. Multiplies the sub vector with -a scalar.
        template<class AT>
        -vector_slice &operator /= (const AT &at)
        A computed assignment operator. Divides the sub vector through -a scalar.
        void swap (vector_slice &vs)Swaps the contents of the sub vectors.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the vector_slice.
        const_iterator end () constReturns a const_iterator pointing to the end of -the vector_slice.
        iterator begin ()Returns a iterator pointing to the beginning of -the vector_slice.
        iterator end ()Returns a iterator pointing to the end of the -vector_slice.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed vector_slice.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed vector_slice.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed vector_slice.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed vector_slice.
        -

        Simple Projections

        -

        Description

        -

        The free subslice functions support the construction -of vector slices.

        -

        Prototypes

        -
        
        -    template<class V>
        -    vector_slice<V> subslice (V &data,
        -       V::size_type start, V::difference_type stride, V::size_type size);
        -    template<class V>
        -    const vector_slice<const V> subslice (const V &data,
        -       V::size_type start, V::difference_type stride, V::size_type size);
        -
        -

        Generic Projections

        -

        Description

        -

        The free project functions support the construction -of vector slices. Existing vector_slice's can be composed with a further range or slices. The resulting slice is computed using this existing slices's compose function.

        -

        Prototypes

        -
        
        -    template<class V>
        -    vector_slice<V> project (V &data, const slice &s);
        -    template<class V>
        -    const vector_slice<const V> project (const V &data, const slice &s);
        -    template<class V>
        -    vector_slice<V> project (vector_slice<V> &data, const range &r);
        -    template<class V>
        -    const vector_slice<V> project (const vector_slice<V> &data, const range &r);
        -    template<class V>
        -    vector_slice<V> project (vector_slice<V> &data, const slice &s);
        -    template<class V>
        -    const vector_slice<V> project (const vector_slice<V> &data, const slice &s);
        -
        -

        Definition

        -

        Defined in the header vector_proxy.hpp.

        -

        Type requirements

        - -

        Complexity

        -

        Linear depending from the size of the slice.

        -

        Examples

        -
        -#include <boost/numeric/ublas/vector.hpp>
        -#include <boost/numeric/ublas/vector_proxy.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    vector<double> v (3);
        -    for (int i = 0; i < 3; ++ i)
        -        project (v, slice (0, 1, 3)) (i) = i;
        -    std::cout << project (v, slice (0, 1, 3)) << std::endl;
        -}
        -
        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/doc/vector_sparse.htm b/doc/vector_sparse.htm deleted file mode 100644 index 628a5b41..00000000 --- a/doc/vector_sparse.htm +++ /dev/null @@ -1,800 +0,0 @@ - - - - - - - - - - - - -

        Sparse Vector

        -
        -

        Mapped Vector

        -

        Description

        -

        The templated class mapped_vector<T, A> is -the base container adaptor for sparse vectors using element maps. For a -n-dimensional sparse vector and 0 <= i < n -the non-zero elements vi are mapped to -consecutive elements of the associative container, i.e. for -elements k = -vi1and -k + 1 = -vi2of the -container holds i1 < -i2.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    mapped_vector<double> v (3, 3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the mapped vector.
        AThe type of the adapted array. [1]map_std<std::size_t, T>
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector .

        -

        Public base classes

        -

        vector_container<mapped_vector<T, A> ->

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        mapped_vector ()Allocates a mapped_vector that holds zero -elements.
        mapped_vector (size_type size, size_type -non_zeros = 0)Allocates a mapped_vector that holds at most -size elements.
        mapped_vector (const mapped_vector &v)The copy constructor.
        template<class AE>
        -mapped_vector (size_type non_zeros, const -vector_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size, bool -preserve = true)Reallocates a mapped_vector to hold at most -size elements. The existing elements of the -mapped_vector are preseved when specified.
        size_type size () constReturns the size of the mapped_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        reference operator [] (size_type i)Returns a reference of the i-th element.
        mapped_vector &operator = (const mapped_vector -&v)The assignment operator.
        mapped_vector &assign_temporary (mapped_vector -&v)Assigns a temporary. May change the mapped vector -v .
        template<class AE>
        -mapped_vector &operator = (const vector_expression<AE> -&ae)
        The extended assignment operator.
        template<class AE>
        -mapped_vector &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the mapped vector. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -mapped_vector &operator += (const vector_expression<AE> -&ae)
        A computed assignment operator. Adds the vector expression to -the mapped vector.
        template<class AE>
        -mapped_vector &plus_assign (const vector_expression<AE> -&ae)
        Adds a vector expression to the mapped vector. Left and right -hand side of the assignment should be independent.
        template<class AE>
        -mapped_vector &operator -= (const vector_expression<AE> -&ae)
        A computed assignment operator. Subtracts the vector expression -from the mapped vector.
        template<class AE>
        -mapped_vector &minus_assign (const vector_expression<AE> -&ae)
        Subtracts a vector expression from the mapped vector. Left and -right hand side of the assignment should be independent.
        template<class AT>
        -mapped_vector &operator *= (const AT &at)
        A computed assignment operator. Multiplies the mapped vector -with a scalar.
        template<class AT>
        -mapped_vector &operator /= (const AT &at)
        A computed assignment operator. Divides the mapped vector -through a scalar.
        void swap (mapped_vector &v)Swaps the contents of the mapped vectors.
        true_reference insert_element (size_type i, const_reference t)Inserts the value t at the i-th -element. Duplicates elements are not allowed.
        void erase_element (size_type i)Erases the value at the i-th element.
        void clear ()Clears the mapped vector.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the mapped_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the mapped_vector.
        iterator begin ()Returns a iterator pointing to the beginning of -the mapped_vector.
        iterator end ()Returns a iterator pointing to the end of the -mapped_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed mapped_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed mapped_vector.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed mapped_vector.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed mapped_vector.
        -

        Notes

        -

        [1] Supported -parameters for the adapted array are -map_array<std::size_t, T> and -map_std<std::size_t, T>. The latter is -equivalent to std::map<std::size_t, T>.

        -

        Compressed Vector

        -

        Description

        -

        The templated class compressed_vector<T, IB, IA, -TA> is the base container adaptor for compressed vectors. -For a n-dimensional compressed vector and 0 <= i -< n the non-zero elements vi -are mapped to consecutive elements of the index and value -container, i.e. for elements k = -vi1and -k + 1 = -vi2of these -containers holds i1 < -i2.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    compressed_vector<double> v (3, 3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the compressed vector.
        IBThe index base of the compressed vector. [1]0
        IAThe type of the adapted array for indices. [2]unbounded_array<std::size_t>
        TAThe type of the adapted array for values. [2]unbounded_array<T>
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector .

        -

        Public base classes

        -

        vector_container<compressed_vector<T, IB, IA, -TA> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        compressed_vector ()Allocates a compressed_vector that holds zero -elements.
        compressed_vector (size_type size, size_type -non_zeros)Allocates a compressed_vector that holds at most -size elements.
        compressed_vector (const compressed_vector -&v)The copy constructor.
        template<class AE>
        -compressed_vector (size_type non_zeros, const -vector_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size, bool -preserve = true)Reallocates a compressed_vector to hold at most -size elements. The existing elements of the -compress_vector are preseved when specified.
        size_type size () constReturns the size of the compressed_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        reference operator [] (size_type i)Returns a reference of the i-th element.
        compressed_vector &operator = (const -compressed_vector &v)The assignment operator.
        compressed_vector &assign_temporary -(compressed_vector &v)Assigns a temporary. May change the compressed vector -v.
        template<class AE>
        -compressed_vector &operator = (const -vector_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -compressed_vector &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the compressed vector. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -compressed_vector &operator += (const -vector_expression<AE> &ae)
        A computed assignment operator. Adds the vector expression to -the compressed vector.
        template<class AE>
        -compressed_vector &plus_assign (const -vector_expression<AE> &ae)
        Adds a vector expression to the compressed vector. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -compressed_vector &operator -= (const -vector_expression<AE> &ae)
        A computed assignment operator. Subtracts the vector expression -from the compressed vector.
        template<class AE>
        -compressed_vector &minus_assign (const -vector_expression<AE> &ae)
        Subtracts a vector expression from the compressed vector. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -compressed_vector &operator *= (const AT &at)
        A computed assignment operator. Multiplies the compressed -vector with a scalar.
        template<class AT>
        -compressed_vector &operator /= (const AT &at)
        A computed assignment operator. Divides the compressed vector -through a scalar.
        void swap (compressed_vector &v)Swaps the contents of the compressed vectors.
        true_reference insert_element (size_type i, const_reference t)Inserts the value t at the i-th -element. Duplicates elements are not allowed.
        void erase_element (size_type i)Erases the value at the i-th element.
        void clear ()Clears the compressed vector.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the compressed_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the compressed_vector.
        iterator begin ()Returns a iterator pointing to the beginning of -the compressed_vector.
        iterator end ()Returns a iterator pointing to the end of the -compressed_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed compressed_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed compressed_vector.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed compressed_vector.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed compressed_vector.
        -

        Notes

        -

        [1] -Supported parameters for the index base are 0 and -1 at least.

        -

        [2] -Supported parameters for the adapted array are -unbounded_array<> , -bounded_array<> and -std::vector<> .

        -

        Coordinate Vector

        -

        Description

        -

        The templated class coordinate_vector<T, IB, IA, -TA> is the base container adaptor for compressed vectors. -For a n-dimensional sorted coordinate vector and 0 -<= i < n the non-zero elements -vi are mapped to consecutive elements -of the index and value container, i.e. for elements k = -vi1and -k + 1 = -vi2of these -containers holds i1 < -i2.

        -

        Example

        -
        -#include <boost/numeric/ublas/vector_sparse.hpp>
        -#include <boost/numeric/ublas/io.hpp>
        -
        -int main () {
        -    using namespace boost::numeric::ublas;
        -    coordinate_vector<double> v (3, 3);
        -    for (unsigned i = 0; i < v.size (); ++ i)
        -        v (i) = i;
        -    std::cout << v << std::endl;
        -}
        -
        -

        Definition

        -

        Defined in the header vector_sparse.hpp.

        -

        Template parameters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ParameterDescriptionDefault
        TThe type of object stored in the coordinate vector.
        IBThe index base of the coordinate vector. [1]0
        IAThe type of the adapted array for indices. [2]unbounded_array<std::size_t>
        TAThe type of the adapted array for values. [2]unbounded_array<T>
        -

        Model of

        -

        Vector .

        -

        Type requirements

        -

        None, except for those imposed by the requirements of Vector .

        -

        Public base classes

        -

        vector_container<coordinate_vector<T, IB, IA, -TA> >

        -

        Members

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        MemberDescription
        coordinate_vector ()Allocates a coordinate_vector that holds zero -elements.
        coordinate_vector (size_type size, size_type -non_zeros)Allocates a coordinate_vector that holds at most -size elements.
        coordinate_vector (const coordinate_vector -&v)The copy constructor.
        template<class AE>
        -coordinate_vector (size_type non_zeros, const -vector_expression<AE> &ae)
        The extended copy constructor.
        void resize (size_type size, bool -preserve = true)Reallocates a coordinate_vector to hold at most -size elements. The existing elements of the -coordinate_vector are preseved when specified.
        size_type size () constReturns the size of the coordinate_vector.
        const_reference operator () (size_type i) -constReturns the value of the i-th element.
        reference operator () (size_type i)Returns a reference of the i-th element.
        const_reference operator [] (size_type i) -constReturns the value of the i-th element.
        reference operator [] (size_type i)Returns a reference of the i-th element.
        coordinate_vector &operator = (const -coordinate_vector &v)The assignment operator.
        coordinate_vector &assign_temporary -(coordinate_vector &v)Assigns a temporary. May change the coordinate vector -v.
        template<class AE>
        -coordinate_vector &operator = (const -vector_expression<AE> &ae)
        The extended assignment operator.
        template<class AE>
        -coordinate_vector &assign (const vector_expression<AE> -&ae)
        Assigns a vector expression to the coordinate vector. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -coordinate_vector &operator += (const -vector_expression<AE> &ae)
        A computed assignment operator. Adds the vector expression to -the coordinate vector.
        template<class AE>
        -coordinate_vector &plus_assign (const -vector_expression<AE> &ae)
        Adds a vector expression to the coordinate vector. Left and -right hand side of the assignment should be independent.
        template<class AE>
        -coordinate_vector &operator -= (const -vector_expression<AE> &ae)
        A computed assignment operator. Subtracts the vector expression -from the coordinate vector.
        template<class AE>
        -coordinate_vector &minus_assign (const -vector_expression<AE> &ae)
        Subtracts a vector expression from the coordinate vector. Left -and right hand side of the assignment should be independent.
        template<class AT>
        -coordinate_vector &operator *= (const AT &at)
        A computed assignment operator. Multiplies the coordinate -vector with a scalar.
        template<class AT>
        -coordinate_vector &operator /= (const AT &at)
        A computed assignment operator. Divides the coordinate vector -through a scalar.
        void swap (coordinate_vector &v)Swaps the contents of the coordinate vectors.
        true_reference insert_element (size_type i, const_reference t)Inserts the value t at the i-th -element. Duplicates elements are not allowed.
        void append_element (size_type i, size_type j, const_reference t)Appends the value t at the i-th element. -Duplicate elements can be appended to a coordinate_vector. They are merged into a single -arithmetically summed element by the sort function.
        void erase_element (size_type i)Erases the value at the i-th element.
        void clear ()Clears the coordinate vector.
        const_iterator begin () constReturns a const_iterator pointing to the beginning -of the coordinate_vector.
        const_iterator end () constReturns a const_iterator pointing to the end of -the coordinate_vector.
        iterator begin ()Returns a iterator pointing to the beginning of -the coordinate_vector.
        iterator end ()Returns a iterator pointing to the end of the -coordinate_vector.
        const_reverse_iterator rbegin () constReturns a const_reverse_iterator pointing to the -beginning of the reversed coordinate_vector.
        const_reverse_iterator rend () constReturns a const_reverse_iterator pointing to the -end of the reversed coordinate_vector.
        reverse_iterator rbegin ()Returns a reverse_iterator pointing to the -beginning of the reversed coordinate_vector.
        reverse_iterator rend ()Returns a reverse_iterator pointing to the end of -the reversed coordinate_vector.
        -

        Notes

        -

        [1] -Supported parameters for the index base are 0 and -1 at least.

        -

        [2] -Supported parameters for the adapted array are -unbounded_array<> , -bounded_array<> and -std::vector<> .

        -
        -

        Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
        - Use, modification and distribution are subject to the - Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt - or copy at - http://www.boost.org/LICENSE_1_0.txt - ). -

        - - - diff --git a/include/boost/numeric/ublas/exception.hpp b/exception.hpp similarity index 100% rename from include/boost/numeric/ublas/exception.hpp rename to exception.hpp diff --git a/include/boost/numeric/ublas/experimental/sparse_view.hpp b/experimental/sparse_view.hpp similarity index 100% rename from include/boost/numeric/ublas/experimental/sparse_view.hpp rename to experimental/sparse_view.hpp diff --git a/include/boost/numeric/ublas/expression_types.hpp b/expression_types.hpp similarity index 100% rename from include/boost/numeric/ublas/expression_types.hpp rename to expression_types.hpp diff --git a/include/boost/numeric/ublas/functional.hpp b/functional.hpp similarity index 100% rename from include/boost/numeric/ublas/functional.hpp rename to functional.hpp diff --git a/include/boost/numeric/ublas/fwd.hpp b/fwd.hpp similarity index 100% rename from include/boost/numeric/ublas/fwd.hpp rename to fwd.hpp diff --git a/include/boost/numeric/ublas/hermitian.hpp b/hermitian.hpp similarity index 100% rename from include/boost/numeric/ublas/hermitian.hpp rename to hermitian.hpp diff --git a/index.html b/index.html deleted file mode 100644 index 3100f73a..00000000 --- a/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - -Automatic redirection failed, please go to -doc/index.htm  
        -

        © Copyright Beman Dawes, 2001

        -

        Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy -at www.boost.org/LICENSE_1_0.txt)

        - - \ No newline at end of file diff --git a/include/boost/numeric/ublas/io.hpp b/io.hpp similarity index 100% rename from include/boost/numeric/ublas/io.hpp rename to io.hpp diff --git a/include/boost/numeric/ublas/lu.hpp b/lu.hpp similarity index 100% rename from include/boost/numeric/ublas/lu.hpp rename to lu.hpp diff --git a/include/boost/numeric/ublas/matrix.hpp b/matrix.hpp similarity index 100% rename from include/boost/numeric/ublas/matrix.hpp rename to matrix.hpp diff --git a/include/boost/numeric/ublas/matrix_expression.hpp b/matrix_expression.hpp similarity index 100% rename from include/boost/numeric/ublas/matrix_expression.hpp rename to matrix_expression.hpp diff --git a/include/boost/numeric/ublas/matrix_proxy.hpp b/matrix_proxy.hpp similarity index 100% rename from include/boost/numeric/ublas/matrix_proxy.hpp rename to matrix_proxy.hpp diff --git a/include/boost/numeric/ublas/matrix_sparse.hpp b/matrix_sparse.hpp similarity index 100% rename from include/boost/numeric/ublas/matrix_sparse.hpp rename to matrix_sparse.hpp diff --git a/include/boost/numeric/ublas/operation.hpp b/operation.hpp similarity index 100% rename from include/boost/numeric/ublas/operation.hpp rename to operation.hpp diff --git a/include/boost/numeric/ublas/operation/begin.hpp b/operation/begin.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/begin.hpp rename to operation/begin.hpp diff --git a/include/boost/numeric/ublas/operation/c_array.hpp b/operation/c_array.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/c_array.hpp rename to operation/c_array.hpp diff --git a/include/boost/numeric/ublas/operation/end.hpp b/operation/end.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/end.hpp rename to operation/end.hpp diff --git a/include/boost/numeric/ublas/operation/num_columns.hpp b/operation/num_columns.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/num_columns.hpp rename to operation/num_columns.hpp diff --git a/include/boost/numeric/ublas/operation/num_rows.hpp b/operation/num_rows.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/num_rows.hpp rename to operation/num_rows.hpp diff --git a/include/boost/numeric/ublas/operation/size.hpp b/operation/size.hpp similarity index 100% rename from include/boost/numeric/ublas/operation/size.hpp rename to operation/size.hpp diff --git a/include/boost/numeric/ublas/operation_blocked.hpp b/operation_blocked.hpp similarity index 100% rename from include/boost/numeric/ublas/operation_blocked.hpp rename to operation_blocked.hpp diff --git a/include/boost/numeric/ublas/operation_sparse.hpp b/operation_sparse.hpp similarity index 100% rename from include/boost/numeric/ublas/operation_sparse.hpp rename to operation_sparse.hpp diff --git a/include/boost/numeric/ublas/operations.hpp b/operations.hpp similarity index 100% rename from include/boost/numeric/ublas/operations.hpp rename to operations.hpp diff --git a/include/boost/numeric/ublas/storage.hpp b/storage.hpp similarity index 100% rename from include/boost/numeric/ublas/storage.hpp rename to storage.hpp diff --git a/include/boost/numeric/ublas/storage_sparse.hpp b/storage_sparse.hpp similarity index 100% rename from include/boost/numeric/ublas/storage_sparse.hpp rename to storage_sparse.hpp diff --git a/include/boost/numeric/ublas/symmetric.hpp b/symmetric.hpp similarity index 100% rename from include/boost/numeric/ublas/symmetric.hpp rename to symmetric.hpp diff --git a/include/boost/numeric/ublas/tags.hpp b/tags.hpp similarity index 100% rename from include/boost/numeric/ublas/tags.hpp rename to tags.hpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 deleted file mode 100644 index 75a5eb6e..00000000 --- a/test/Jamfile.v2 +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright (c) 2004 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -# Bring in rules for testing -import testing ; - -# Define features to test: -# Value types: USE_FLOAT USE_DOUBLE USE_STD_COMPLEX -# Proxies: USE_RANGE USE_SLICE -# Storage types: USE_BOUNDED_ARRAY USE_UNBOUNDED_ARRAY -# Vector types: USE_STD_VECTOR USE_BOUNDED_VECTOR -# Matrix types: USE_MATRIX USE_BOUNDED_MATRIX USE_VECTOR_OF_VECTOR -# Adaptors: USE_ADAPTOR - -UBLAS_TESTSET = [ modules.peek : UBLAS_TESTSET ] ; -UBLAS_TESTSET ?= - USE_DOUBLE USE_STD_COMPLEX - USE_RANGE USE_SLICE - USE_UNBOUNDED_ARRAY USE_STD_VECTOR USE_BOUNDED_VECTOR USE_MATRIX - ; - -# Sparse storage: USE_MAP_ARRAY USE_STD_MAP -# Sparse vectors: USE_MAPPED_VECTOR USE_COMPRESSED_VECTOR USE_COORDINATE_VECTOR -# Sparse matrices: USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX USE_COORDINATE_MATRIX USE_MAPPED_VECTOR_OF_MAPPED_VECTOR USE_GENERALIZED_VECTOR_OF_VECTOR - -UBLAS_TESTSET_SPARSE = [ modules.peek : UBLAS_TESTSET_SPARSE ] ; -UBLAS_TESTSET_SPARSE ?= - USE_DOUBLE USE_STD_COMPLEX - # 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 - ; -# Generalize VofV still failing -# USE_GENERALIZED_VECTOR_OF_VECTOR - - -# Project settings -project - : requirements - BOOST_UBLAS_NO_EXCEPTIONS - vacpp:"BOOST_UBLAS_NO_ELEMENT_PROXIES" - ; - - -test-suite numeric/uBLAS - : [ run test1.cpp - test11.cpp - test12.cpp - test13.cpp - : # args - : # input files - : # requirements - $(UBLAS_TESTSET) - ] - [ run test2.cpp - test21.cpp - test22.cpp - test23.cpp - : : : - $(UBLAS_TESTSET) - ] - [ run test3.cpp - test31.cpp - test32.cpp - test33.cpp - : : : - $(UBLAS_TESTSET_SPARSE) - ] - [ run test4.cpp - test42.cpp - test43.cpp - : : : - $(UBLAS_TESTSET) - ] - [ run test5.cpp - test52.cpp - test53.cpp - : : : - $(UBLAS_TESTSET) - ] - [ run test6.cpp - test62.cpp - test63.cpp - : : : - $(UBLAS_TESTSET) - ] -# Test commented out because boost::interval does not behave like a scalar type -# [ run test7.cpp -# test71.cpp -# test72.cpp -# test73.cpp -# : : : -# BOOST_UBLAS_USE_INTERVAL -# $(UBLAS_TESTSET) -# ] - - [ run placement_new.cpp - ] - [ compile concepts.cpp - : # requirements - EXTERNAL -# INTERAL -# SKIP_BAD - intel-linux:"-Xc" - darwin:"-fabi-version=0" - ] - [ run test_lu.cpp - ] - [ run triangular_access.cpp - : : : - NOMESSAGES - ] - [ run triangular_layout.cpp - ] - [ run comp_mat_erase.cpp - ] - [ run sparse_view_test.cpp - ] - [ run begin_end.cpp - ] - [ run num_columns.cpp - ] - [ run num_rows.cpp - ] - [ run size.cpp - ] - [ run test_coordinate_matrix_sort.cpp - ] - [ run test_complex_norms.cpp - ] - ; diff --git a/test/README b/test/README deleted file mode 100644 index 2e3e7177..00000000 --- a/test/README +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2000-2004 Joerg Walter, Mathias Koch - -Distributed under the Boost Software License, Version 1.0. (See -accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) - -uBLAS test director - Use boost::test to test various uBLAS containers and expressions - -The tests can be used individually or automaticaly as part of the uBLAS regression tests. - -The tests are broken down in directorys as follows: - -test1 - dense vector and matrix tests -test2 - BLAS tests -test3 - sparse vector and matrix tests -test4 - banded/diagonal matrix tests -test5 - triangular matrix tests -test6 - symmetric matrix tests -test7 - dense vector and matrix tests with boost::numeric::internal values - -Each test directory contains: - testX.hpp Headers and types to be tested - testX.cpp Call the test functions for the defined types - testX1.cpp Implements vector tests - testX2.cpp Implements vector/matrix tests - testX3.cpp Implements matrix tests - -Missing in these tests - a) Runtime result validation. - b) Iterator interface tests. Only complete container expressions are tested diff --git a/test/begin_end.cpp b/test/begin_end.cpp deleted file mode 100644 index db4d8246..00000000 --- a/test/begin_end.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/** -*- c++ -*- \file begin_end.hpp \brief Test the \c begin and \c end operations. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "libs/numeric/ublas/test/utils.hpp" - - -static const double TOL(1.0e-5); ///< Used for comparing two real numbers. - -#ifdef BOOST_UBLAS_NO_NESTED_CLASS_RELATION -#error "sorry this feature is not supported by your compiler" -#endif - -BOOST_UBLAS_TEST_DEF( test_vector_iteration ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Vector Iteration" ); - - typedef double value_type; - typedef boost::numeric::ublas::vector vector_type; - - vector_type v(5); - - v(0) = 0.555950; - v(1) = 0.108929; - v(2) = 0.948014; - v(3) = 0.023787; - v(4) = 1.023787; - - - vector_type::size_type ix = 0; - for ( - boost::numeric::ublas::iterator_type::type it = boost::numeric::ublas::begin(v); - it != boost::numeric::ublas::end(v); - ++it - ) { - BOOST_UBLAS_DEBUG_TRACE( "*it = " << *it << " ==> " << v(ix) ); - BOOST_UBLAS_TEST_CHECK( std::fabs(*it - v(ix)) <= TOL ); - ++ix; - } -} - - -BOOST_UBLAS_TEST_DEF( test_vector_const_iteration ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Vector Const Iteration" ); - - typedef double value_type; - typedef boost::numeric::ublas::vector vector_type; - - vector_type v(5); - - v(0) = 0.555950; - v(1) = 0.108929; - v(2) = 0.948014; - v(3) = 0.023787; - v(4) = 1.023787; - - - vector_type::size_type ix = 0; - for ( - boost::numeric::ublas::const_iterator_type::type it = boost::numeric::ublas::begin(v); - it != boost::numeric::ublas::end(v); - ++it - ) { - BOOST_UBLAS_DEBUG_TRACE( "*it = " << *it << " ==> " << v(ix) ); - BOOST_UBLAS_TEST_CHECK( std::fabs(*it - v(ix)) <= TOL ); - ++ix; - } -} - - -BOOST_UBLAS_TEST_DEF( test_row_major_matrix_iteration ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Row-major Matrix Iteration" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - typedef boost::numeric::ublas::iterator_type::type outer_iterator_type; - typedef boost::numeric::ublas::iterator_type::type inner_iterator_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - matrix_type::size_type row(0); - for ( - outer_iterator_type outer_it = boost::numeric::ublas::begin(A); - outer_it != boost::numeric::ublas::end(A); - ++outer_it - ) { - matrix_type::size_type col(0); - - for ( - inner_iterator_type inner_it = boost::numeric::ublas::begin(outer_it); - inner_it != boost::numeric::ublas::end(outer_it); - ++inner_it - ) { - BOOST_UBLAS_DEBUG_TRACE( "*it = " << *inner_it << " ==> " << A(row,col) ); - BOOST_UBLAS_TEST_CHECK( std::fabs(*inner_it - A(row,col)) <= TOL ); - - ++col; - } - - ++row; - } -} - - -BOOST_UBLAS_TEST_DEF( test_col_major_matrix_iteration ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Column-major Matrix Iteration" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - typedef boost::numeric::ublas::iterator_type::type outer_iterator_type; - typedef boost::numeric::ublas::iterator_type::type inner_iterator_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - matrix_type::size_type col(0); - for ( - outer_iterator_type outer_it = boost::numeric::ublas::begin(A); - outer_it != boost::numeric::ublas::end(A); - ++outer_it - ) { - matrix_type::size_type row(0); - - for ( - inner_iterator_type inner_it = boost::numeric::ublas::begin(outer_it); - inner_it != boost::numeric::ublas::end(outer_it); - ++inner_it - ) { - BOOST_UBLAS_DEBUG_TRACE( "*it = " << *inner_it << " ==> " << A(row,col) ); - BOOST_UBLAS_TEST_CHECK( std::fabs(*inner_it - A(row,col)) <= TOL ); - - ++row; - } - - ++col; - } -} - - -int main() -{ - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_vector_iteration ); - BOOST_UBLAS_TEST_DO( test_vector_const_iteration ); - BOOST_UBLAS_TEST_DO( test_row_major_matrix_iteration ); - BOOST_UBLAS_TEST_DO( test_col_major_matrix_iteration ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/common/init.hpp b/test/common/init.hpp deleted file mode 100644 index a9691b4e..00000000 --- a/test/common/init.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2004 Michael Stevens - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -/* - * Default construct test when possible - */ - -template -struct default_construct -{ - static void test() {} -}; -template -struct default_construct > -{ - static void test () - { - VC default_constuct; - initialize_vector (default_constuct); - std::cout << "default construct = " << default_constuct << std::endl; - } -}; -template -struct default_construct > -{ - static void test () - { - MC default_constuct; - initialize_vector (default_constuct); - std::cout << "default construct = " << default_constuct << std::endl; - } -}; - -/* - * Initialise test values in vector/matrix - */ - -template -void initialize_vector (V &v) { - typename V::size_type size = v.size (); - for (typename V::size_type i = 0; i < size; ++ i) - v [i] = typename V::value_type ( i + 1.f ); -} - -template -void initialize_matrix_impl (M &m, ublas::packed_proxy_tag) { - typename M::size_type size1 = m.size1 (); -#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION - for (typename M::iterator1 i = m.begin1(); i != m.end1(); ++ i) - for (typename M::iterator2 j = i.begin(); j != i.end(); ++ j) - *j = typename M::value_type ( i.index1() * size1 + j.index2() + 1.f ); -#else - for (typename M::iterator1 i = m.begin1(); i != m.end1(); ++ i) - for (typename M::iterator2 j = ublas::begin (i, ublas::iterator1_tag ()); j != ublas::end (i, ublas::iterator1_tag ()); ++ j) - *j = typename M::value_type ( i.index1() * size1 + j.index2() + 1.f ); -#endif -} - -template -void initialize_matrix_impl (M &m, ublas::sparse_proxy_tag) { - typename M::size_type size1 = m.size1 (); - typename M::size_type size2 = m.size2 (); - for (typename M::size_type i = 0; i < size1; ++ i) - for (typename M::size_type j = 0; j < size2; ++ j) - m (i, j) = typename M::value_type (i * size1 + j + 1.f); -} - -template -void initialize_matrix (M &m) { - initialize_matrix_impl (m, typename M::storage_category()); -} - -template -void initialize_matrix (M &m, ublas::lower_tag) { - typename M::size_type size1 = m.size1 (); - typename M::size_type size2 = m.size2 (); - for (typename M::size_type i = 0; i < size1; ++ i) { - typename M::size_type j = 0; - for (; j <= i; ++ j) - m (i, j) = i * size1 + j + 1.f; - for (; j < size2; ++ j) - m (i, j) = 0.f; - } -} -template -void initialize_matrix (M &m, ublas::upper_tag) { - typename M::size_type size1 = m.size1 (); - typename M::size_type size2 = m.size2 (); - for (typename M::size_type i = 0; i < size1; ++ i) { - typename M::size_type j = 0; - for (; j < i; ++ j) - m (i, j) = 0.f; - for (; j < size2; ++ j) - m (i, j) = i * size1 + j + 1.f; - } -} diff --git a/test/common/testhelper.hpp b/test/common/testhelper.hpp deleted file mode 100644 index 4fbf9c4d..00000000 --- a/test/common/testhelper.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2008 Gunter Winkler -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - - -#ifndef _HPP_TESTHELPER_ -#define _HPP_TESTHELPER_ - -#include - -static unsigned _success_counter = 0; -static unsigned _fail_counter = 0; - -static inline -void assertTrue(const char* message, bool condition) { -#ifndef NOMESSAGES - std::cout << message; -#endif - if ( condition ) { - ++ _success_counter; - std::cout << "1\n"; // success - } else { - ++ _fail_counter; - std::cout << "0\n"; // failed - } -} - -template < class T > -void assertEquals(const char* message, T expected, T actual) { -#ifndef NOMESSAGES - std::cout << message; -#endif - if ( expected == actual ) { - ++ _success_counter; - std::cout << "1\n"; // success - } else { - #ifndef NOMESSAGES - std::cout << " expected " << expected << " actual " << actual << " "; - #endif - ++ _fail_counter; - std::cout << "0\n"; // failed - } -} - -static -std::pair getResults() { - return std::make_pair(_success_counter, _fail_counter); -} - -template < class M1, class M2 > -bool compare( const boost::numeric::ublas::matrix_expression & m1, - const boost::numeric::ublas::matrix_expression & m2 ) { - size_t size1 = (std::min)(m1().size1(), m2().size1()); - size_t size2 = (std::min)(m1().size2(), m2().size2()); - for (size_t i=0; i < size1; ++i) { - for (size_t j=0; j < size2; ++j) { - if ( m1()(i,j) != m2()(i,j) ) return false; - } - } - return true; -} - -template < class M1, class M2 > -bool compare( const boost::numeric::ublas::vector_expression & m1, - const boost::numeric::ublas::vector_expression & m2 ) { - size_t size = (std::min)(m1().size(), m2().size()); - for (size_t i=0; i < size; ++i) { - if ( m1()(i) != m2()(i) ) return false; - } - return true; -} - -#endif diff --git a/test/comp_mat_erase.cpp b/test/comp_mat_erase.cpp deleted file mode 100644 index 9adb027e..00000000 --- a/test/comp_mat_erase.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "boost/numeric/ublas/matrix_sparse.hpp" - -#define BOOST_TEST_MODULE SparseMatrixErasureTest -#include - - -BOOST_AUTO_TEST_CASE( compressed_matrix_erase_after_end ) -{ - boost::numeric::ublas::compressed_matrix A(2, 2); - - BOOST_CHECK_EQUAL( A.filled1(), 1 ); - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - - A(0,0) = 1; - - BOOST_CHECK_EQUAL( A.nnz(), 1 ); - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - - // check new element - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.index2_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.value_data()[0], 1 ); - // check end of list marker - BOOST_CHECK_EQUAL( A.index1_data()[1], 1 ); - - A.erase_element(1,0); - - BOOST_CHECK_EQUAL( A.nnz(), 1 ); - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 1 ); - - // check new element - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.index2_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.value_data()[0], 1 ); - // check end of list marker - BOOST_CHECK_EQUAL( A.index1_data()[1], 1 ); - - A.erase_element(0,0); - - BOOST_CHECK_EQUAL( A.nnz(), 0 ); - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 0 ); - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - -} - -BOOST_AUTO_TEST_CASE( compressed_matrix_erase_in_the_middle ) -{ - boost::numeric::ublas::compressed_matrix A(2, 2); - - BOOST_CHECK_EQUAL( A.filled1(), 1 ); - BOOST_CHECK_EQUAL( A.filled2(), 0 ); - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - - A.insert_element(0,1,5); - - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 1 ); - - // check new element - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.index2_data()[0], 1 ); - BOOST_CHECK_EQUAL( A.value_data()[0], 5 ); - // check end of list marker - BOOST_CHECK_EQUAL( A.index1_data()[1], 1 ); - - A.insert_element(0,0,4); - - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 2 ); - - // check new element - BOOST_CHECK_EQUAL( A.index2_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.value_data()[0], 4 ); - // check previous element - BOOST_CHECK_EQUAL( A.index2_data()[1], 1 ); - BOOST_CHECK_EQUAL( A.value_data()[1], 5 ); - // check end of list marker - BOOST_CHECK_EQUAL( A.index1_data()[1], 2 ); - - A.erase_element(0,0); - - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 1 ); - - BOOST_CHECK_EQUAL( A.index2_data()[0], 1 ); - BOOST_CHECK_EQUAL( A.value_data()[0], 5 ); - - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.index1_data()[1], 1 ); - - A.erase_element(0,1); - - BOOST_CHECK_EQUAL( A.filled1(), 2 ); - BOOST_CHECK_EQUAL( A.filled2(), 0 ); - BOOST_CHECK_EQUAL( A.index1_data()[0], 0 ); - BOOST_CHECK_EQUAL( A.index1_data()[1], 0 ); - -} diff --git a/test/concepts.cpp b/test/concepts.cpp deleted file mode 100644 index ba981292..00000000 --- a/test/concepts.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include - -namespace ublas = boost::numeric::ublas; - - -int main () { - void (* check) (void) = ublas::concept_checks; - boost::ignore_unused_variable_warning (check); -} diff --git a/test/manual/Jamfile.v2 b/test/manual/Jamfile.v2 deleted file mode 100644 index 5ef982db..00000000 --- a/test/manual/Jamfile.v2 +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2006 Michael Stevens -# Use, modification and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -exe sp_resize : sp_resize.cpp ; - -exe test_move_semantics : test_move_semantics.cpp ; diff --git a/test/manual/sp_resize.cpp b/test/manual/sp_resize.cpp deleted file mode 100644 index 2d52dbbd..00000000 --- a/test/manual/sp_resize.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2006 Michael Stevens - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#include - -#include - -typedef double Real; - -template -void printV(const V& v) { - std::cout << "size: " << v.size() << " nnz_capacity: " << v.nnz_capacity() << " nnz: " << v.nnz() << std::endl; - for (typename V::const_iterator i = v.begin(); i != v.end(); i++) { - std::cout << i.index() << ":" << (*i) << " "; - } - std::cout << std::endl; -} - -template -void run_test() -{ - V v(10); - - v[0] = 1; - v[5] = 1; - v[8] = 1; - v[9] = 1; - - printV(v); - - v.resize(9); printV(v); - v.resize(12); printV(v); - v.resize(2); printV(v); - v.resize(0); printV(v); - - v.resize(5); v[0] = 1; printV(v); - v.resize(5,false); printV(v); -} - -int main(int, char **) { - - std::cout << "---- MAPPED ----\n"; - run_test< boost::numeric::ublas::mapped_vector >(); - std::cout << "---- COMPRESSED ----\n"; - run_test< boost::numeric::ublas::compressed_vector >(); - std::cout << "---- COORDINATE ----\n"; - run_test< boost::numeric::ublas::coordinate_vector >(); - - return 0; -} - diff --git a/test/manual/test_move_semantics.cpp b/test/manual/test_move_semantics.cpp deleted file mode 100644 index 188491e4..00000000 --- a/test/manual/test_move_semantics.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/** test move semantics - run with and without BOOST_UBLAS_MOVE_SEMANTICS defined */ - -// Copyright Nasos Iliopoulos, Gunter Winkler 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_UBLAS_MOVE_SEMANTICS -#include -#include -#include - -namespace ublas= boost::numeric::ublas; -std::vector a; - -ublas::vector doubleit(ublas::vector m) -{ - ublas::vector r; - r=2.0*m; - std::cout << "Temporary pointer: " << &r[0] << std::endl; - return r; -} -template -ublas::bounded_vector doubleit(ublas::bounded_vector m) -{ - ublas::bounded_vector r; - r=2.0*m; - std::cout << "Temporary pointer: " << &r[0] << std::endl; - return r; -} - -template -ublas::c_vector doubleit(ublas::c_vector m) -{ - ublas::c_vector r; - r=2.0*m; - std::cout << "Temporary pointer: " << &r[0] << std::endl; - return r; -} - -ublas::matrix doubleit(ublas::matrix m) -{ - ublas::matrix r; - r=2.0*m; - std::cout << "Temporary pointer r: " << &r(0,0) << std::endl; - return r; -} -template -ublas::bounded_matrix doubleit(ublas::bounded_matrix m) -{ - ublas::bounded_matrix r; - r=2.0*m; - std::cout << "Temporary pointer: " << &(r(0,0)) << std::endl; - return r; -} - -template -ublas::c_matrix doubleit(ublas::c_matrix m) -{ - ublas::c_matrix r; - r=2.0*m; - std::cout << "Temporary pointer: " << &(r(0,0)) << std::endl; - return r; -} - - -void test1() -{ - std::cout << "vector --------------------------------------------------------------------" << std::endl; - ublas::vector a(ublas::scalar_vector(2,2.0)); - a = doubleit(a); - std::cout << "Pointer (must be equal to temp. pointer if move semantics are enabled) : " << &a[0] << std::endl; - - std::cout << a << std::endl; - - std::cout << "bounded_vector --------------------------------------------------------------------" << std::endl; - ublas::bounded_vector b(ublas::scalar_vector(2,2.0)); - ublas::bounded_vector c; - noalias(c)=doubleit(b); - std::cout << "Pointer (bounded_vector swaps by copy this should be different than temp. pointer) : " << &c[0] << std::endl; - c(1)=0.0; - std::cout << b << std::endl; - std::cout << c << std::endl; - - std::cout << "c_vector --------------------------------------------------------------------" << std::endl; - ublas::c_vector e=ublas::scalar_vector(2,2.0); - ublas::c_vector f; - f=doubleit(e); - std::cout << "Pointer (c_vector swaps by copy this should be different than temp. pointer) : " << &f[0] << std::endl; - f(1)=0; - std::cout << e << std::endl; - std::cout << f << std::endl; - -} - -void test2() { - std::cout << "matrix --------------------------------------------------------------------" << std::endl; - ublas::matrix a(ublas::scalar_matrix(2, 3, 2.0)); - a = doubleit(a); - std::cout << "Pointer (must be equal to temp. pointer if move semantics are enabled) : " << &(a(0,0)) << std::endl; - std::cout << a << std::endl; - - std::cout << "bounded_matrix --------------------------------------------------------------------" << std::endl; - ublas::bounded_matrix b(ublas::scalar_matrix(2,3, 2.0)); - ublas::bounded_matrix c; - noalias(c)=doubleit(b); - std::cout << "Pointer (bounded_matrix swaps by copy this should be different than temp. pointer) : " << &(c(0,0)) << std::endl; - c(1,1)=0.0; - std::cout << b << std::endl; - std::cout << c << std::endl; - - std::cout << "c_matrix --------------------------------------------------------------------" << std::endl; - ublas::c_matrix e=ublas::scalar_matrix(2,3, 2.0); - ublas::c_matrix f; - f=doubleit(e); - std::cout << "Pointer (c_matrix swaps by copy this should be different than temp. pointer) : " << &(f(0,0)) << std::endl; - f(1,1)=0; - std::cout << e << std::endl; - std::cout << f << std::endl; -} - -int main(){ - test1(); - test2(); - return 0; -} - diff --git a/test/num_columns.cpp b/test/num_columns.cpp deleted file mode 100644 index 91a9e04a..00000000 --- a/test/num_columns.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** -*- c++ -*- \file num_columns.cpp \breif Test for the \c num_columns operation. */ - -#include -#include -#include -#include -#include -#include "libs/numeric/ublas/test/utils.hpp" - - -BOOST_UBLAS_TEST_DEF( test_row_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Row-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_columns(A) = " << boost::numeric::ublas::num_columns(A) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_columns(A) == A.size2() ); -} - - -BOOST_UBLAS_TEST_DEF( test_col_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Column-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_columns(A) = " << boost::numeric::ublas::num_columns(A) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_columns(A) == A.size2() ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_expression ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Expression" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_columns(A') = " << boost::numeric::ublas::num_columns(boost::numeric::ublas::trans(A)) << " ==> " << boost::numeric::ublas::trans(A).size2() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_columns(boost::numeric::ublas::trans(A)) == boost::numeric::ublas::trans(A).size2() ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_reference ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Reference" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - typedef boost::numeric::ublas::matrix_reference matrix_reference_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_columns(reference(A)) = " << boost::numeric::ublas::num_columns(matrix_reference_type(A)) << " ==> " << matrix_reference_type(A).size2() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_columns(matrix_reference_type(A)) == matrix_reference_type(A).size2() ); -} - - -int main() -{ - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_row_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_col_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_matrix_expression ); - BOOST_UBLAS_TEST_DO( test_matrix_reference ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/num_rows.cpp b/test/num_rows.cpp deleted file mode 100644 index f0146608..00000000 --- a/test/num_rows.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** -*- c++ -*- \file num_rows.hpp \file Test the \c num_rows operation. */ - -#include -#include -#include -#include -#include -#include "libs/numeric/ublas/test/utils.hpp" - - -BOOST_UBLAS_TEST_DEF( test_row_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Row-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_rows(A) = " << boost::numeric::ublas::num_rows(A) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_rows(A) == A.size1() ); -} - - -BOOST_UBLAS_TEST_DEF( test_col_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Column-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_rows(A) = " << boost::numeric::ublas::num_rows(A) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_rows(A) == A.size1() ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_expression ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Expression" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_rows(A') = " << boost::numeric::ublas::num_rows(boost::numeric::ublas::trans(A)) << " ==> " << boost::numeric::ublas::trans(A).size1() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_rows(boost::numeric::ublas::trans(A)) == boost::numeric::ublas::trans(A).size1() ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_reference ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Reference" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - typedef boost::numeric::ublas::matrix_reference matrix_reference_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - BOOST_UBLAS_DEBUG_TRACE( "num_rows(reference(A)) = " << boost::numeric::ublas::num_rows(matrix_reference_type(A)) << " ==> " << matrix_reference_type(A).size1() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::num_rows(matrix_reference_type(A)) == matrix_reference_type(A).size1() ); -} - - -int main() -{ - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_row_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_col_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_matrix_expression ); - BOOST_UBLAS_TEST_DO( test_matrix_reference ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/placement_new.cpp b/test/placement_new.cpp deleted file mode 100644 index 940da7da..00000000 --- a/test/placement_new.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2004 Michael Stevens - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -/* - * Test placement new and array placement new for uBLAS - * See if base pointer is effected by array count cookie - */ - -#include -#include -#include - -// User defined type to capture base pointer on construction - -class udt { -public: - udt () { - base_pointer = this; - } - ~udt () {} // required for GCC prior to 3.4 to generate cookie - - static udt* base_pointer; -}; - -udt* udt::base_pointer; - -int main () -{ - udt a; - udt* ap = &a; - - // Capture placement new offsets for a udt - new (ap) udt; - int new_offset = int (udt::base_pointer - ap); - new (ap) udt [1]; - int array_new_offset = int (udt::base_pointer - ap); - - // Print offsets - we expect 0,0 or 0,sizeof(std::size_t) - std::cout << new_offset <<','<< array_new_offset << std::endl; - - // Return status - if (new_offset != 0) - return -1; // Very bad if new has an offset - -#ifdef BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW - bool expect_array_offset = false; -#else - bool expect_array_offset = true; -#endif - // Check match between config and array - if (!expect_array_offset && array_new_offset != 0) { - return -2; // Bad config should not enable array new - } - if (expect_array_offset && array_new_offset == 0) { - return -3; // Config could enable array new - } - - return 0; -} diff --git a/test/size.cpp b/test/size.cpp deleted file mode 100644 index 327081dd..00000000 --- a/test/size.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/** -*- c++ -*- \file size.hpp \brief Test the \c size operation. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "libs/numeric/ublas/test/utils.hpp" - - -BOOST_UBLAS_TEST_DEF( test_vector_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Vector Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::vector vector_type; - - vector_type v(5); - - v(0) = 0.555950; - v(1) = 0.108929; - v(2) = 0.948014; - v(3) = 0.023787; - v(4) = 1.023787; - - - // size(v) - BOOST_UBLAS_DEBUG_TRACE( "size(v) = " << boost::numeric::ublas::size(v) << " ==> " << v.size() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::size(v) == v.size() ); - - // size<1>(v) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(v) = " << (boost::numeric::ublas::size<1>(v)) << " ==> " << v.size() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(v) == v.size()) ); - - // [NOT_COMPILE]: this should *correctly* cause a compilation error - // size<2>(v) - //BOOST_UBLAS_DEBUG_TRACE( "size<2>(v) = " << (boost::numeric::ublas::size(v)) << " ==> " << v.size() ); - //BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(v) == v.size()) ); - // [/NOT_COMPILE] -} - - -BOOST_UBLAS_TEST_DEF( test_vector_expression ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Vector Expression" ); - - typedef double value_type; - typedef boost::numeric::ublas::vector vector_type; - - vector_type v(5); - - v(0) = 0.555950; - v(1) = 0.108929; - v(2) = 0.948014; - v(3) = 0.023787; - v(4) = 1.023787; - - - // size(-v) - BOOST_UBLAS_DEBUG_TRACE( "size(-v) = " << boost::numeric::ublas::size(-v) << " ==> " << (-v).size() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::size(-v) == (-v).size() ); - - // size<1>(-v) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(-v) = " << (boost::numeric::ublas::size<1>(-v)) << " ==> " << (-v).size() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(-v) == (-v).size()) ); -} - - -BOOST_UBLAS_TEST_DEF( test_vector_reference ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Vector Reference" ); - - typedef double value_type; - typedef boost::numeric::ublas::vector vector_type; - typedef boost::numeric::ublas::vector_reference vector_reference_type; - - vector_type v(5); - - v(0) = 0.555950; - v(1) = 0.108929; - v(2) = 0.948014; - v(3) = 0.023787; - v(4) = 1.023787; - - - // size(reference(v) - BOOST_UBLAS_DEBUG_TRACE( "size(reference(v)) = " << boost::numeric::ublas::size(vector_reference_type(v)) << " ==> " << vector_reference_type(v).size() ); - BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::size(vector_reference_type(v)) == vector_reference_type(v).size() ); - - // size<1>(reference(v)) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(reference(v)) = " << (boost::numeric::ublas::size<1>(vector_reference_type(v))) << " ==> " << vector_reference_type(v).size() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(vector_reference_type(v)) == vector_reference_type(v).size()) ); -} - - -BOOST_UBLAS_TEST_DEF( test_row_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Row-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - // [NOT_COMPILE] - // size(A) - //BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << boost::numeric::ublas::size(A) << " ==> " << A.size1() ); - //BOOST_UBLAS_TEST_CHECK( boost::numeric::ublas::size(A) == A.size1() ); - // [/NOT_COMPILE] - - // size<1>(A) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(A) = " << (boost::numeric::ublas::size<1>(A)) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(A) == A.size1()) ); - - // size<2>(A) - BOOST_UBLAS_DEBUG_TRACE( "size<2>(A) = " << (boost::numeric::ublas::size<2>(A)) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(A) == A.size2()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size1()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size2()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size2()) ); -} - - -BOOST_UBLAS_TEST_DEF( test_col_major_matrix_container ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Column-major Matrix Container" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - // size<1>(A) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(A) = " << (boost::numeric::ublas::size<1>(A)) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(A) == A.size1()) ); - - // size<2>(A) - BOOST_UBLAS_DEBUG_TRACE( "size<2>(A) = " << (boost::numeric::ublas::size<2>(A)) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(A) == A.size2()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size2()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size1()) ); - - // size(A) - BOOST_UBLAS_DEBUG_TRACE( "size(A) = " << (boost::numeric::ublas::size(A)) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(A) == A.size1()) ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_expression ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Expression" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - // size<1>(A') - BOOST_UBLAS_DEBUG_TRACE( "size<1>(A') = " << (boost::numeric::ublas::size<1>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(boost::numeric::ublas::trans(A)) == A.size2()) ); - - // size<2>(A') - BOOST_UBLAS_DEBUG_TRACE( "size<2>(A') = " << (boost::numeric::ublas::size<2>(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(boost::numeric::ublas::trans(A)) == A.size1()) ); - - // size(A') [A is row-major => A' column-major, and viceversa] - BOOST_UBLAS_DEBUG_TRACE( "size(A') = " << (boost::numeric::ublas::size(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(boost::numeric::ublas::trans(A)) == A.size1()) ); - - // size(A') [A is row-major => A' column-major, and viceversa] - BOOST_UBLAS_DEBUG_TRACE( "size(A') = " << (boost::numeric::ublas::size(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(boost::numeric::ublas::trans(A)) == A.size2()) ); - - // size(A') [A row-major => A' column-major, and viceversa] - BOOST_UBLAS_DEBUG_TRACE( "size(A') = " << (boost::numeric::ublas::size(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(boost::numeric::ublas::trans(A)) == A.size2()) ); -} - - -BOOST_UBLAS_TEST_DEF( test_matrix_reference ) -{ - BOOST_UBLAS_DEBUG_TRACE( "TEST Matrix Reference" ); - - typedef double value_type; - typedef boost::numeric::ublas::matrix matrix_type; - typedef boost::numeric::ublas::matrix_reference matrix_reference_type; - - matrix_type A(5,4); - - A(0,0) = 0.555950; A(0,1) = 0.274690; A(0,2) = 0.540605; A(0,3) = 0.798938; - A(1,0) = 0.108929; A(1,1) = 0.830123; A(1,2) = 0.891726; A(1,3) = 0.895283; - A(2,0) = 0.948014; A(2,1) = 0.973234; A(2,2) = 0.216504; A(2,3) = 0.883152; - A(3,0) = 0.023787; A(3,1) = 0.675382; A(3,2) = 0.231751; A(3,3) = 0.450332; - A(4,0) = 1.023787; A(4,1) = 1.675382; A(4,2) = 1.231751; A(4,3) = 1.450332; - - - // size<1>(reference(A)) - BOOST_UBLAS_DEBUG_TRACE( "size<1>(reference(A)) = " << (boost::numeric::ublas::size<1>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<1>(matrix_reference_type(A)) == matrix_reference_type(A).size1()) ); - - // size<2>(reference(A)) - BOOST_UBLAS_DEBUG_TRACE( "size<2>(reference(A)) = " << (boost::numeric::ublas::size<2>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<2>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); - - // size(reference(A)) - BOOST_UBLAS_DEBUG_TRACE( "size(reference(A) = " << (boost::numeric::ublas::size(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(matrix_reference_type(A)) == matrix_reference_type(A).size1()) ); - - // size(reference(A)) - BOOST_UBLAS_DEBUG_TRACE( "size(reference(A)) = " << (boost::numeric::ublas::size(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); - - // size(reference(A)) - BOOST_UBLAS_DEBUG_TRACE( "size(reference(A)) = " << (boost::numeric::ublas::size(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); - BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size(matrix_reference_type(A)) == matrix_reference_type(A).size2()) ); -} - - -int main() -{ - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_vector_container ); - BOOST_UBLAS_TEST_DO( test_vector_expression ); - BOOST_UBLAS_TEST_DO( test_vector_reference ); - BOOST_UBLAS_TEST_DO( test_row_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_col_major_matrix_container ); - BOOST_UBLAS_TEST_DO( test_matrix_expression ); - BOOST_UBLAS_TEST_DO( test_matrix_reference ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/sparse_view_test.cpp b/test/sparse_view_test.cpp deleted file mode 100644 index f60d27db..00000000 --- a/test/sparse_view_test.cpp +++ /dev/null @@ -1,107 +0,0 @@ - -/* Test program to test find functions of triagular matrices - * - * author: Gunter Winkler ( guwi17 at gmx dot de ) - */ - - -// ublas headers - -#include - -#include -#include -#include - -#include - -// other boost headers - -// headers for testcase - -#define BOOST_TEST_MODULE SparseMatrixErasureTest -#include - -// standard and system headers - -#include -#include - -namespace ublas = boost::numeric::ublas; - - /* - sparse input matrix: - - 1 2 0 0 - 0 3 9 0 - 0 1 4 0 - */ - - static const std::string inputMatrix = "[3,4]((1,2,0,0),(0,3,9,0),(0,1,4,0))\n"; - - const unsigned int NNZ = 6; - const unsigned int IB = 1; - const double VA[] = { 1.0, 2.0, 3.0, 9.0, 1.0, 4.0 }; - const unsigned int IA[] = { 1, 3, 5, 7 }; - const unsigned int JA[] = { 1, 2, 2, 3, 2, 3 }; - -BOOST_AUTO_TEST_CASE( test_construction_and_basic_operations ) -{ - - typedef ublas::matrix DENSE_MATRIX; - - // prepare data - - DENSE_MATRIX A; - - std::istringstream iss(inputMatrix); - iss >> A; - - std::cout << A << std::endl; - - std::cout << ( ublas::make_compressed_matrix_view(3,4,NNZ,IA,JA,VA) ) << std::endl; - - typedef ublas::compressed_matrix_view COMPMATVIEW; - - COMPMATVIEW viewA(3,4,NNZ,IA,JA,VA); - - std::cout << viewA << std::endl; - -} - - - -BOOST_AUTO_TEST_CASE( test_construction_from_pointers ) -{ - - std::cout << ( ublas::make_compressed_matrix_view(4,3,NNZ - , ublas::c_array_view(4,&(IA[0])) - , ublas::c_array_view(6,&(JA[0])) - , ublas::c_array_view(6,&(VA[0]))) ) << std::endl; - - unsigned int * ia = new unsigned int[4](); - unsigned int * ja = new unsigned int[6](); - double * va = new double[6](); - - std::copy(&(IA[0]),&(IA[4]),ia); - std::copy(&(JA[0]),&(JA[6]),ja); - std::copy(&(VA[0]),&(VA[6]),va); - - typedef ublas::compressed_matrix_view - , ublas::c_array_view - , ublas::c_array_view > COMPMATVIEW; - - COMPMATVIEW viewA(4,3,NNZ - , ublas::c_array_view(4,ia) - , ublas::c_array_view(6,ja) - , ublas::c_array_view(6,va)); - - std::cout << viewA << std::endl; - - delete[] va; - delete[] ja; - delete[] ia; - -} diff --git a/test/test1.cpp b/test/test1.cpp deleted file mode 100644 index 53de7901..00000000 --- a/test/test1.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test1.hpp" - -int main () { - test_vector (); - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test1.hpp b/test/test1.hpp deleted file mode 100644 index fcf3d67a..00000000 --- a/test/test1.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST1_H -#define TEST1_H - -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -void test_vector (); -void test_matrix_vector (); -void test_matrix (); - - -#endif diff --git a/test/test11.cpp b/test/test11.cpp deleted file mode 100644 index 29d8fd12..00000000 --- a/test/test11.cpp +++ /dev/null @@ -1,260 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test1.hpp" - -// Test vector expression templates -template -struct test_my_vector { - typedef typename V::value_type value_type; - typedef typename V::size_type size_type; - typedef typename ublas::type_traits::real_type real_type; - - template - void test_container_with (VP &v1) const { - // Container type tests in addition to expression types - // Insert and erase - v1.insert_element (0, 55); - v1.erase_element (1); - v1.clear (); - } - - template - void test_expression_with (VP &v1, VP &v2, VP &v3) const { - // Expression type tests - value_type t; - size_type i; - real_type n; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_vector (v1); - initialize_vector (v2); - v1 = v2; - std::cout << "v1 = v2 = " << v1 << std::endl; - v1.assign_temporary (v2); - std::cout << "v1.assign_temporary (v2) = " << v1 << std::endl; - v1.swap (v2); - std::cout << "v1.swap (v2) = " << v1 << " " << v2 << std::endl; - - // Zero assignment - v1 = ublas::zero_vector<> (v1.size ()); - std::cout << "v1.zero_vector = " << v1 << std::endl; - v1 = v2; - -#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; - std::cout << "- v1 = " << v2 << std::endl; - v2 = ublas::conj (v1); - std::cout << "conj (v1) = " << v2 << std::endl; - - // Binary vector operations resulting in a vector - initialize_vector (v1); - initialize_vector (v2); - v3 = v1 + v2; - std::cout << "v1 + v2 = " << v3 << std::endl; - v3 = v1 - v2; - std::cout << "v1 - v2 = " << v3 << std::endl; - v3 = ublas::element_prod (v1, v2); - std::cout << "element_prod (v1, v2) = " << v3 << std::endl; - - // Scaling a vector - t = N; - initialize_vector (v1); - v2 = value_type (1.) * v1; - std::cout << "1. * v1 = " << v2 << std::endl; - v2 = t * v1; - std::cout << "N * v1 = " << v2 << std::endl; - initialize_vector (v1); - v2 = v1 * value_type (1.); - std::cout << "v1 * 1. = " << v2 << std::endl; - v2 = v1 * t; - std::cout << "v1 * N = " << v2 << std::endl; - - // Some assignments - initialize_vector (v1); - initialize_vector (v2); - v2 += v1; - std::cout << "v2 += v1 = " << v2 << std::endl; - v2 -= v1; - std::cout << "v2 -= v1 = " << v2 << std::endl; - v2 = v2 + v1; - std::cout << "v2 = v2 + v1 = " << v2 << std::endl; - v2 = v2 - v1; - std::cout << "v2 = v2 - v1 = " << v2 << std::endl; - v1 *= value_type (1.); - std::cout << "v1 *= 1. = " << v1 << std::endl; - v1 *= t; - std::cout << "v1 *= N = " << v1 << std::endl; - - // Unary vector operations resulting in a scalar - initialize_vector (v1); - t = ublas::sum (v1); - std::cout << "sum (v1) = " << t << std::endl; - n = ublas::norm_1 (v1); - std::cout << "norm_1 (v1) = " << n << std::endl; - n = ublas::norm_2 (v1); - std::cout << "norm_2 (v1) = " << n << std::endl; - n = ublas::norm_inf (v1); - std::cout << "norm_inf (v1) = " << n << std::endl; - - i = ublas::index_norm_inf (v1); - std::cout << "index_norm_inf (v1) = " << i << std::endl; - - // Binary vector operations resulting in a scalar - initialize_vector (v1); - initialize_vector (v2); - t = ublas::inner_prod (v1, v2); - std::cout << "inner_prod (v1, v2) = " << t << std::endl; - - // Scalar and Binary vector expression resulting in a vector - initialize_vector (v1); - initialize_vector (v2); - v1 = v1 * ublas::inner_prod (v1, v2); - std::cout << "v1 * inner_prod (v1, v2) = " << v1 << std::endl; - } - - void operator () () const { - V v1 (N), v2 (N), v3 (N); - test_expression_with (v1, v2, v3); - test_container_with (v1); - -#ifdef USE_RANGE - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)), - vr3 (v3, ublas::range (0, N)); - test_expression_with (vr1, vr2, vr3); -#endif - -#ifdef USE_SLICE - ublas::vector_slice vs1 (v1, ublas::slice (0, 1, N)), - vs2 (v2, ublas::slice (0, 1, N)), - vs3 (v3, ublas::slice (0, 1, N)); - test_expression_with (vs1, vs2, vs3); -#endif - } -}; - -// Test vector -void test_vector () { - std::cout << "test_vector" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_vector, ublas::bounded_array, 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_vector, ublas::bounded_array, 3> >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_vector, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_vector, ublas::unbounded_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_vector, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_vector, std::vector > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_BOUNDED_VECTOR -#ifdef USE_FLOAT - std::cout << "float, bounded" << std::endl; - test_my_vector, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded" << std::endl; - test_my_vector, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded" << std::endl; - test_my_vector, 3>, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded" << std::endl; - test_my_vector, 3>, 3> () (); -#endif -#endif -#endif -} diff --git a/test/test12.cpp b/test/test12.cpp deleted file mode 100644 index 8c9e61da..00000000 --- a/test/test12.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test1.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v1 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v1 << std::endl; - v1 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v1 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; - } - } - void operator () () const { - { - V v1 (N), v2 (N); - M m1 (N, N); - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, 0), mr2 (m1, 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 0), mc2 (m1, 1); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_MATRIX -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::matrix, ublas::row_major, std::vector > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::matrix, ublas::row_major, std::vector > >, 3> () (); -#endif -#endif -#endif -#endif - -#ifdef USE_BOUNDED_MATRIX -#ifdef USE_FLOAT - std::cout << "float, bounded" << std::endl; - test_my_matrix_vector, - ublas::bounded_matrix, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded" << std::endl; - test_my_matrix_vector, - ublas::bounded_matrix, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded" << std::endl; - test_my_matrix_vector, 3>, - ublas::bounded_matrix, 3, 3>, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded" << std::endl; - test_my_matrix_vector, 3>, - ublas::bounded_matrix, 3, 3>, 3> () (); -#endif -#endif -#endif - -#ifdef USE_VECTOR_OF_VECTOR -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::vector_of_vector, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::vector_of_vector, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector > >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::vector_of_vector, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::vector_of_vector, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::vector_of_vector > >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::vector_of_vector, ublas::row_major, std::vector > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::vector_of_vector, ublas::row_major, std::vector > > >, 3> () (); -#endif -#endif -#endif -#endif -} diff --git a/test/test13.cpp b/test/test13.cpp deleted file mode 100644 index ecb8eeb7..00000000 --- a/test/test13.cpp +++ /dev/null @@ -1,321 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test1.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_container_with (VP &v1) const { - // Container type tests in addition to expression types - // Insert and erase - v1.insert_element (0,0, 55); - v1.erase_element (1,1); - v1.clear (); - } - - template - void test_expression_with (MP &m1, MP &m2, MP &m3) const { - value_type t; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix<> (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - -#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; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - m3 = ublas::element_prod (m1, m2); - std::cout << "element_prod (m1, m2) = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m2 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - m2 = ublas::trans (m1); - std::cout << "trans (m1) = " << m2 << std::endl; - - // Hermitean - initialize_matrix (m1); - m2 = ublas::herm (m1); - std::cout << "herm (m1) = " << m2 << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - m3 = ublas::prod (m1, m2); - std::cout << "prod (m1, m2) = " << m3 << std::endl; - } - - void operator () () const { - M m1 (N, N), m2 (N, N), m3 (N, N); - test_expression_with (m1, m2, m3); - test_container_with (m1); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_expression_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_expression_with (ms1, ms2, ms3); -#endif - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_MATRIX -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3> () (); -#endif -#endif -#endif -#endif - -#ifdef USE_BOUNDED_MATRIX -#ifdef USE_FLOAT - std::cout << "float, bounded" << std::endl; - test_my_matrix, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded" << std::endl; - test_my_matrix, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded" << std::endl; - test_my_matrix, 3, 3>, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded" << std::endl; - test_my_matrix, 3, 3>, 3> () (); -#endif -#endif -#endif - -#ifdef USE_VECTOR_OF_VECTOR -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix > >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix > >, 3> () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > > >, 3> () (); -#endif -#endif -#endif -#endif -} diff --git a/test/test2.cpp b/test/test2.cpp deleted file mode 100644 index 07a4c755..00000000 --- a/test/test2.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test2.hpp" - -int main () { -#ifdef USE_FLOAT - std::cout << "float" << std::endl; - test_blas_1, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double" << std::endl; - test_blas_1, 3> ().test (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; - test_blas_1 >, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; - test_blas_1 >, 3> ().test (); -#endif -#endif - - std::cout << "test_blas_2" << std::endl; - -#ifdef USE_FLOAT - std::cout << "float" << std::endl; - test_blas_2, ublas::matrix, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double" << std::endl; - test_blas_2, ublas::matrix, 3> ().test (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; - test_blas_2 >, ublas::matrix >, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; - test_blas_2 >, ublas::matrix >, 3> ().test (); -#endif -#endif - - std::cout << "test_blas_3" << std::endl; - -#ifdef USE_FLOAT - std::cout << "float" << std::endl; - test_blas_3, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double" << std::endl; - test_blas_3, 3> ().test (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex" << std::endl; - test_blas_3 >, 3> ().test (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex" << std::endl; - test_blas_3 >, 3> ().test (); -#endif -#endif - - return 0; -} diff --git a/test/test2.hpp b/test/test2.hpp deleted file mode 100644 index 21b9cbe6..00000000 --- a/test/test2.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST2_H -#define TEST2_H - -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -template -struct test_blas_1 { - typedef typename V::value_type value_type; - typedef typename ublas::type_traits::real_type real_type; - - void test (); -}; - -template -struct test_blas_2 { - typedef typename V::value_type value_type; - - void test (); -}; - -template -struct test_blas_3 { - typedef typename M::value_type value_type; - - void test (); -}; - - -#endif diff --git a/test/test21.cpp b/test/test21.cpp deleted file mode 100644 index df631089..00000000 --- a/test/test21.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test2.hpp" - -template -void test_blas_1::test () { - { - value_type t; - real_type n; - V v1 (N), v2 (N); - - // _asum - initialize_vector (v1); - n = ublas::blas_1::asum (v1); - std::cout << "asum (v1) = " << n << std::endl; - - // _amax - initialize_vector (v1); - n = ublas::blas_1::amax (v1); - std::cout << "amax (v1) = " << n << std::endl; - - // _nrm2 - initialize_vector (v1); - n = ublas::blas_1::nrm2 (v1); - std::cout << "nrm2 (v1) = " << n << std::endl; - - // _dot - // _dotu - // _dotc - initialize_vector (v1); - initialize_vector (v2); - t = ublas::blas_1::dot (v1, v2); - std::cout << "dot (v1, v2) = " << t << std::endl; - t = ublas::blas_1::dot (ublas::conj (v1), v2); - std::cout << "dot (conj (v1), v2) = " << t << std::endl; - - // _copy - initialize_vector (v2); - ublas::blas_1::copy (v1, v2); - std::cout << "copy (v1, v2) = " << v1 << std::endl; - - // _swap - initialize_vector (v1); - initialize_vector (v2); - ublas::blas_1::swap (v1, v2); - std::cout << "swap (v1, v2) = " << v1 << " " << v2 << std::endl; - - // _scal - // csscal - // zdscal - initialize_vector (v1); - ublas::blas_1::scal (v1, value_type (1)); - std::cout << "scal (v1, 1) = " << v1 << std::endl; - - // _axpy - initialize_vector (v1); - initialize_vector (v2); - ublas::blas_1::axpy (v1, value_type (1), v2); - std::cout << "axpy (v1, 1, v2) = " << v1 << std::endl; - - // _rot - initialize_vector (v1); - initialize_vector (v2); - ublas::blas_1::rot (value_type (1), v1, value_type (1), v2); - std::cout << "rot (1, v1, 1, v2) = " << v1 << " " << v2 << std::endl; - } -} - -#ifdef USE_FLOAT -template struct test_blas_1, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_1, 3>; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct test_blas_1 >, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_1 >, 3>; -#endif -#endif diff --git a/test/test22.cpp b/test/test22.cpp deleted file mode 100644 index 6f6d2c21..00000000 --- a/test/test22.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test2.hpp" - -template -void test_blas_2::test () { - { - V v1 (N), v2 (N); - M m (N, N); - - // _t_mv - initialize_vector (v1); - initialize_matrix (m); - ublas::blas_2::tmv (v1, m); - std::cout << "tmv (v1, m) = " << v1 << std::endl; - initialize_vector (v1); - initialize_matrix (m); - ublas::blas_2::tmv (v1, ublas::trans (m)); - std::cout << "tmv (v1, trans (m)) = " << v1 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_vector (v1); - initialize_matrix (m); - ublas::blas_2::tmv (v1, ublas::herm (m)); - std::cout << "tmv (v1, herm (m)) = " << v1 << std::endl; -#endif - - // _t_sv - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::lower_tag ()); - ublas::blas_2::tsv (v1, m, ublas::lower_tag ()); - std::cout << "tsv (v1, m) = " << v1 << " " << ublas::prod (m, v1) - v2 << std::endl; - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::upper_tag ()); - ublas::blas_2::tsv (v1, ublas::trans (m), ublas::lower_tag ()); - std::cout << "tsv (v1, trans (m)) = " << v1 << " " << ublas::prod (ublas::trans (m), v1) - v2 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::upper_tag ()); - ublas::blas_2::tsv (v1, ublas::herm (m), ublas::lower_tag ()); - std::cout << "tsv (v1, herm (m)) = " << v1 << " " << ublas::prod (ublas::herm (m), v1) - v2 << std::endl; -#endif - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::upper_tag ()); - ublas::blas_2::tsv (v1, m, ublas::upper_tag ()); - std::cout << "tsv (v1, m) = " << v1 << " " << ublas::prod (m, v1) - v2 << std::endl; - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::lower_tag ()); - ublas::blas_2::tsv (v1, ublas::trans (m), ublas::upper_tag ()); - std::cout << "tsv (v1, trans (m)) = " << v1 << " " << ublas::prod (ublas::trans (m), v1) - v2 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m, ublas::lower_tag ()); - ublas::blas_2::tsv (v1, ublas::herm (m), ublas::upper_tag ()); - std::cout << "tsv (v1, herm (m)) = " << v1 << " " << ublas::prod (ublas::herm (m), v1) - v2 << std::endl; -#endif - - // _g_mv - // _s_mv - // _h_mv - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m); - ublas::blas_2::gmv (v1, value_type (1), value_type (1), m, v2); - std::cout << "gmv (v1, 1, 1, m, v2) = " << v1 << std::endl; - ublas::blas_2::gmv (v1, value_type (1), value_type (1), ublas::trans (m), v2); - std::cout << "gmv (v1, 1, 1, trans (m), v2) = " << v1 << std::endl; -#ifdef USE_STD_COMPLEX - ublas::blas_2::gmv (v1, value_type (1), value_type (1), ublas::herm (m), v2); - std::cout << "gmv (v1, 1, 1, herm (m), v2) = " << v1 << std::endl; -#endif - - // _g_r - // _g_ru - // _g_rc - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m); - ublas::blas_2::gr (m, value_type (1), v1, v2); - std::cout << "gr (m, 1, v1, v2) = " << m << std::endl; - ublas::blas_2::gr (m, value_type (1), v1, ublas::conj (v2)); - std::cout << "gr (m, 1, v1, conj (v2)) = " << m << std::endl; - - // _s_r - initialize_vector (v1); - initialize_matrix (m); - ublas::blas_2::sr (m, value_type (1), v1); - std::cout << "sr (m, 1, v1) = " << m << std::endl; - -#ifdef USE_STD_COMPLEX - // _h_r - initialize_vector (v1); - initialize_matrix (m); - ublas::blas_2::hr (m, value_type (1), v1); - std::cout << "hr (m, 1, v1) = " << m << std::endl; -#endif - - // _s_r2 - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m); - ublas::blas_2::sr2 (m, value_type (1), v1, v2); - std::cout << "sr2 (m, 1, v1, v2) = " << m << std::endl; - -#ifdef USE_STD_COMPLEX - // _h_r2 - initialize_vector (v1); - initialize_vector (v2); - initialize_matrix (m); - ublas::blas_2::hr2 (m, value_type (1), v1, v2); - std::cout << "hr2 (m, 1, v1, v2) = " << m << std::endl; -#endif - } -} - -#ifdef USE_FLOAT -template struct test_blas_2, ublas::matrix, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_2, ublas::matrix, 3>; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct test_blas_2 >, ublas::matrix >, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_2 >, ublas::matrix >, 3>; -#endif -#endif diff --git a/test/test23.cpp b/test/test23.cpp deleted file mode 100644 index b0780560..00000000 --- a/test/test23.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test2.hpp" - -template -void test_blas_3::test () { - { - M m1 (N, N), m2 (N, N), m3 (N, N); - - // _t_mm - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), m2, m1); - std::cout << "tmm (m1, 1, m2, m1) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), m2, ublas::trans (m1)); - std::cout << "tmm (m1, 1, m2, trans (m1)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::trans (m2), m1); - std::cout << "tmm (m1, 1, trans (m2), m1) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::trans (m2), ublas::trans (m1)); - std::cout << "tmm (m1, 1, trans (m2), trans (m1)) = " << m1 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), m2, ublas::herm (m1)); - std::cout << "tmm (m1, 1, m2, herm (m1)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::herm (m2), m1); - std::cout << "tmm (m1, 1, herm (m2), m1) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::trans (m2), ublas::herm (m1)); - std::cout << "tmm (m1, 1, trans (m2), herm (m1)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::herm (m2), ublas::trans (m1)); - std::cout << "tmm (m1, 1, herm (m2), trans (m1)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::tmm (m1, value_type (1), ublas::herm (m2), ublas::herm (m1)); - std::cout << "tmm (m1, 1, herm (m2), herm (m1)) = " << m1 << std::endl; -#endif - - // _t_sm - initialize_matrix (m1); - initialize_matrix (m2, ublas::lower_tag ()); - initialize_matrix (m3); - ublas::blas_3::tsm (m1, value_type (1), m2, ublas::lower_tag ()); - std::cout << "tsm (m1, 1, m2) = " << m1 << " " << ublas::prod (m2, m1) - value_type (1) * m3 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2, ublas::upper_tag ()); - ublas::blas_3::tsm (m1, value_type (1), ublas::trans (m2), ublas::lower_tag ()); - std::cout << "tsm (m1, 1, trans (m2)) = " << m1 << " " << ublas::prod (ublas::trans (m2), m1) - value_type (1) * m3 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_matrix (m1); - initialize_matrix (m2, ublas::upper_tag ()); - ublas::blas_3::tsm (m1, value_type (1), ublas::herm (m2), ublas::lower_tag ()); - std::cout << "tsm (m1, 1, herm (m2)) = " << m1 << " " << ublas::prod (ublas::herm (m2), m1) - value_type (1) * m3 << std::endl; -#endif - initialize_matrix (m1); - initialize_matrix (m2, ublas::upper_tag ()); - ublas::blas_3::tsm (m1, value_type (1), m2, ublas::upper_tag ()); - std::cout << "tsm (m1, 1, m2) = " << m1 << " " << ublas::prod (m2, m1) - value_type (1) * m3 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2, ublas::lower_tag ()); - ublas::blas_3::tsm (m1, value_type (1), ublas::trans (m2), ublas::upper_tag ()); - std::cout << "tsm (m1, 1, trans (m2)) = " << m1 << " " << ublas::prod (ublas::trans (m2), m1) - value_type (1) * m3 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_matrix (m1); - initialize_matrix (m2, ublas::lower_tag ()); - ublas::blas_3::tsm (m1, value_type (1), ublas::herm (m2), ublas::upper_tag ()); - std::cout << "tsm (m1, 1, herm (m2)) = " << m1 << " " << ublas::prod (ublas::herm (m2), m1) - value_type (1) * m3 << std::endl; -#endif - - // _g_mm - // _s_mm - // _h_mm - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), m2, m3); - std::cout << "gmm (m1, 1, 1, m2, m3) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::trans (m2), m3); - std::cout << "gmm (m1, 1, 1, trans (m2), m3) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), m2, ublas::trans (m3)); - std::cout << "gmm (m1, 1, 1, m2, trans (m3)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::trans (m2), ublas::trans (m3)); - std::cout << "gmm (m1, 1, 1, trans (m2), trans (m3)) = " << m1 << std::endl; -#ifdef USE_STD_COMPLEX - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::herm (m2), m3); - std::cout << "gmm (m1, 1, 1, herm (m2), m3) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), m2, ublas::herm (m3)); - std::cout << "gmm (m1, 1, 1, m2, herm (m3)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::herm (m2), ublas::trans (m3)); - std::cout << "gmm (m1, 1, 1, herm (m2), trans (m3)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::trans (m2), ublas::herm (m3)); - std::cout << "gmm (m1, 1, 1, trans (m2), herm (m3)) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::gmm (m1, value_type (1), value_type (1), ublas::herm (m2), ublas::herm (m3)); - std::cout << "gmm (m1, 1, 1, herm (m2), herm (m3)) = " << m1 << std::endl; -#endif - - // s_rk - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::srk (m1, value_type (1), value_type (1), m2); - std::cout << "srk (m1, 1, 1, m2) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::srk (m1, value_type (1), value_type (1), ublas::trans (m2)); - std::cout << "srk (m1, 1, 1, trans (m2)) = " << m1 << std::endl; - -#ifdef USE_STD_COMPLEX - // h_rk - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::hrk (m1, value_type (1), value_type (1), m2); - std::cout << "hrk (m1, 1, 1, m2) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - ublas::blas_3::hrk (m1, value_type (1), value_type (1), ublas::herm (m2)); - std::cout << "hrk (m1, 1, 1, herm (m2)) = " << m1 << std::endl; -#endif - - // s_r2k - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::sr2k (m1, value_type (1), value_type (1), m2, m3); - std::cout << "sr2k (m1, 1, 1, m2, m3) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::sr2k (m1, value_type (1), value_type (1), ublas::trans (m2), ublas::trans (m3)); - std::cout << "sr2k (m1, 1, 1, trans (m2), trans (m3)) = " << m1 << std::endl; - -#ifdef USE_STD_COMPLEX - // h_r2k - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::hr2k (m1, value_type (1), value_type (1), m2, m3); - std::cout << "hr2k (m1, 1, 1, m2, m3) = " << m1 << std::endl; - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - ublas::blas_3::hr2k (m1, value_type (1), value_type (1), ublas::herm (m2), ublas::herm (m3)); - std::cout << "hr2k (m1, 1, 1, herm (m2), herm (m3)) = " << m1 << std::endl; -#endif - } -} - -#ifdef USE_FLOAT -template struct test_blas_3, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_3, 3>; -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT -template struct test_blas_3 >, 3>; -#endif - -#ifdef USE_DOUBLE -template struct test_blas_3 >, 3>; -#endif -#endif diff --git a/test/test3.cpp b/test/test3.cpp deleted file mode 100644 index fb2b94da..00000000 --- a/test/test3.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test3.hpp" - -int main () { - test_vector (); - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test3.hpp b/test/test3.hpp deleted file mode 100644 index a9d4fc95..00000000 --- a/test/test3.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST3_H -#define TEST3_H - -#include - -#include -#include -#include -#include -#include -#include -#include -#ifdef USE_GENERALIZED_VECTOR_OF_VECTOR -#include -#endif -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -void test_vector (); -void test_matrix_vector (); -void test_matrix (); - -#endif diff --git a/test/test31.cpp b/test/test31.cpp deleted file mode 100644 index 77622872..00000000 --- a/test/test31.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test3.hpp" - -// Test vector expression templates -template -struct test_my_vector { - typedef typename V::value_type value_type; - typedef typename V::size_type size_type; - typedef typename ublas::type_traits::real_type real_type; - - template - void test_with (VP &v1, VP &v2, VP &v3) const { - { - value_type t; - size_type i; - real_type n; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_vector (v1); - initialize_vector (v2); - v1 = v2; - std::cout << "v1 = v2 = " << v1 << std::endl; - v1.assign_temporary (v2); - std::cout << "v1.assign_temporary (v2) = " << v1 << std::endl; - v1.swap (v2); - std::cout << "v1.swap (v2) = " << v1 << " " << v2 << std::endl; - - // Zero assignment - v1 = ublas::zero_vector<> (v1.size ()); - std::cout << "v1.zero_vector = " << v1 << std::endl; - v1 = v2; - -#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; - std::cout << "- v1 = " << v2 << std::endl; - v2 = ublas::conj (v1); - std::cout << "conj (v1) = " << v2 << std::endl; - - // Binary vector operations resulting in a vector - initialize_vector (v1); - initialize_vector (v2); - initialize_vector (v3); - v3 = v1 + v2; - std::cout << "v1 + v2 = " << v3 << std::endl; - - v3 = v1 - v2; - std::cout << "v1 - v2 = " << v3 << std::endl; - - // Scaling a vector - t = N; - initialize_vector (v1); - v2 = value_type (1.) * v1; - std::cout << "1. * v1 = " << v2 << std::endl; - v2 = t * v1; - std::cout << "N * v1 = " << v2 << std::endl; - initialize_vector (v1); - v2 = v1 * value_type (1.); - std::cout << "v1 * 1. = " << v2 << std::endl; - v2 = v1 * t; - std::cout << "v1 * N = " << v2 << std::endl; - - // Some assignments - initialize_vector (v1); - initialize_vector (v2); - v2 += v1; - std::cout << "v2 += v1 = " << v2 << std::endl; - v2 -= v1; - std::cout << "v2 -= v1 = " << v2 << std::endl; - v2 = v2 + v1; - std::cout << "v2 = v2 + v1 = " << v2 << std::endl; - v2 = v2 - v1; - std::cout << "v2 = v2 - v1 = " << v2 << std::endl; - v1 *= value_type (1.); - std::cout << "v1 *= 1. = " << v1 << std::endl; - v1 *= t; - std::cout << "v1 *= N = " << v1 << std::endl; - - // Unary vector operations resulting in a scalar - initialize_vector (v1); - t = ublas::sum (v1); - std::cout << "sum (v1) = " << t << std::endl; - n = ublas::norm_1 (v1); - std::cout << "norm_1 (v1) = " << n << std::endl; - n = ublas::norm_2 (v1); - std::cout << "norm_2 (v1) = " << n << std::endl; - n = ublas::norm_inf (v1); - std::cout << "norm_inf (v1) = " << n << std::endl; - - i = ublas::index_norm_inf (v1); - std::cout << "index_norm_inf (v1) = " << i << std::endl; - - // Binary vector operations resulting in a scalar - initialize_vector (v1); - initialize_vector (v2); - t = ublas::inner_prod (v1, v2); - std::cout << "inner_prod (v1, v2) = " << t << std::endl; - } - } - void operator () () const { - { - V v1 (N, N), v2 (N, N), v3 (N, N); - test_with (v1, v2, v3); - -#ifdef USE_RANGE - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)), - vr3 (v3, ublas::range (0, N)); - test_with (vr1, vr2, vr3); -#endif - -#ifdef USE_SLICE - ublas::vector_slice vs1 (v1, ublas::slice (0, 1, N)), - vs2 (v2, ublas::slice (0, 1, N)), - vs3 (v3, ublas::slice (0, 1, N)); - test_with (vs1, vs2, vs3); -#endif - } - } -}; - -// Test vector -void test_vector () { - std::cout << "test_vector" << std::endl; - -#ifdef USE_SPARSE_VECTOR -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; - test_my_vector, ublas::map_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; - test_my_vector, ublas::map_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; - test_my_vector, std::map > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; - test_my_vector, std::map > > , 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_COMPRESSED_VECTOR -#ifdef USE_FLOAT - std::cout << "float compressed" << std::endl; - test_my_vector, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double compressed" << std::endl; - test_my_vector, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex compressed" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex compressed" << std::endl; - test_my_vector >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_COORDINATE_VECTOR -#ifdef USE_FLOAT - std::cout << "float coordinate" << std::endl; - test_my_vector, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double coordinate" << std::endl; - test_my_vector, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex coordinate" << std::endl; - test_my_vector >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex coordinate" << std::endl; - test_my_vector >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test32.cpp b/test/test32.cpp deleted file mode 100644 index 2ffc5021..00000000 --- a/test/test32.cpp +++ /dev/null @@ -1,324 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test3.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v1 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v1 << std::endl; - v1 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v1 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; - } - } - void operator () () const { - { - V v1 (N, N), v2 (N, N); - M m1 (N, N, N * N); - - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, 0), mr2 (m1, N - 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 0), mc2 (m1, N - 1); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - std::cout << "float, map_array" << std::endl; - test_my_matrix_vector >, - ublas::mapped_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, map_array" << std::endl; - test_my_matrix_vector >, - ublas::mapped_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, map_array" << std::endl; - test_my_matrix_vector, ublas::map_array > >, - ublas::mapped_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, map_array" << std::endl; - test_my_matrix_vector, ublas::map_array > >, - ublas::mapped_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - std::cout << "float, std::map" << std::endl; - test_my_matrix_vector >, - ublas::mapped_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::map" << std::endl; - test_my_matrix_vector >, - ublas::mapped_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::map" << std::endl; - test_my_matrix_vector, std::map > >, - ublas::mapped_matrix, ublas::row_major, std::map > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::map" << std::endl; - test_my_matrix_vector, std::map > >, - ublas::mapped_matrix, ublas::row_major, std::map > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_SPARSE_VECTOR_OF_SPARSE_VECTOR -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - std::cout << "float, mapped_vector map_array" << std::endl; - test_my_matrix_vector >, - ublas::mapped_vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_vector map_array" << std::endl; - test_my_matrix_vector >, - ublas::mapped_vector > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_vector map_array" << std::endl; - test_my_matrix_vector, ublas::map_array > >, - ublas::mapped_vector, ublas::row_major, ublas::map_array > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex,mapped_vector map_array" << std::endl; - test_my_matrix_vector, ublas::map_array > >, - ublas::mapped_vector, ublas::row_major, ublas::map_array > > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - std::cout << "float, mapped_vector std::map" << std::endl; - test_my_matrix_vector >, - ublas::mapped_vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_vector std::map" << std::endl; - test_my_matrix_vector >, - ublas::mapped_vector > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_vector std::map" << std::endl; - test_my_matrix_vector, std::map > >, - ublas::mapped_vector, ublas::row_major, std::map > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, mapped_vector std::map" << std::endl; - test_my_matrix_vector, std::map > >, - ublas::mapped_vector, ublas::row_major, std::map > > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_GENERALIZED_VECTOR_OF_VECTOR -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - 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 >, - ublas::generalized_vector_of_vector >, ublas::map_array > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 >, - ublas::generalized_vector_of_vector >, ublas::map_array > > > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - 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 > >, - ublas::generalized_vector_of_vector, ublas::row_major, ublas::mapped_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 > >, - ublas::generalized_vector_of_vector, ublas::row_major, ublas::mapped_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - 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 >, - ublas::generalized_vector_of_vector >, std::map > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 >, - ublas::generalized_vector_of_vector >, std::map > > > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - 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 > >, - ublas::generalized_vector_of_vector, ublas::row_major, ublas::mapped_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 > >, - ublas::generalized_vector_of_vector, ublas::row_major, ublas::mapped_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX -#ifdef USE_FLOAT - std::cout << "float compressed" << std::endl; - test_my_matrix_vector, - ublas::compressed_matrix, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 compressed" << std::endl; - test_my_matrix_vector >, - ublas::compressed_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex compressed" << std::endl; - test_my_matrix_vector >, - ublas::compressed_matrix >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_COORDINATE_MATRIX -#ifdef USE_FLOAT - std::cout << "float coordinate" << std::endl; - test_my_matrix_vector, - ublas::coordinate_matrix, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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 coordinate" << std::endl; - test_my_matrix_vector >, - ublas::coordinate_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex coordinate" << std::endl; - test_my_matrix_vector >, - ublas::coordinate_matrix >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test33.cpp b/test/test33.cpp deleted file mode 100644 index bf7a3d28..00000000 --- a/test/test33.cpp +++ /dev/null @@ -1,347 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test3.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_with (MP &m1, MP &m2, MP &m3) const { - { - value_type t; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix<> (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - -#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; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - initialize_matrix (m3); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m2 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - m2 = ublas::trans (m1); - std::cout << "trans (m1) = " << m2 << std::endl; - - // Hermitean - initialize_matrix (m1); - m2 = ublas::herm (m1); - std::cout << "herm (m1) = " << m2 << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - m3 = ublas::prod (m1, m2); - std::cout << "prod (m1, m2) = " << m3 << std::endl; - } - } - void operator () () const { - { - M m1 (N, N, N * N), m2 (N, N, N * N), m3 (N, N, N * N); - test_with (m1, m2, m3); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_SPARSE_MATRIX -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - std::cout << "float, mapped_matrix map_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_matrix map_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_matrix map_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, mapped_matrix map_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::map_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - std::cout << "float, mapped_matrix std::map" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_matrix std::map" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_matrix std::map" << std::endl; - test_my_matrix, ublas::row_major, std::map > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, mapped_matrix std::map" << std::endl; - test_my_matrix, ublas::row_major, std::map > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_SPARSE_VECTOR_OF_SPARSE_VECTOR -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - std::cout << "float, mapped_vector_of_mapped_vector map_array" << std::endl; - test_my_matrix > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_vector_of_mapped_vector map_array" << std::endl; - test_my_matrix > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_vector_of_mapped_vector map_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::map_array > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, mapped_vector_of_mapped_vectormap_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::map_array > > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - std::cout << "float, mapped_vector_of_mapped_vector std::map" << std::endl; - test_my_matrix > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, mapped_vector_of_mapped_vector std::map" << std::endl; - test_my_matrix > >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, mapped_vector_of_mapped_vector std::map" << std::endl; - test_my_matrix, ublas::row_major, std::map > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, mapped_vector_of_mapped_vector std::map" << std::endl; - test_my_matrix, ublas::row_major, std::map > > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_GENERALIZED_VECTOR_OF_VECTOR -#ifdef USE_MAP_ARRAY -#ifdef USE_FLOAT - 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, 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, 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::mapped_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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::mapped_vector, ublas::map_array > >, ublas::map_array, ublas::map_array > > > > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_MAP -#ifdef USE_FLOAT - 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, 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, 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::mapped_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - 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::mapped_vector, std::map > >, std::map, std::map > > > > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_COMPRESSED_MATRIX -#ifdef USE_FLOAT - std::cout << "float compressed_matrix" << std::endl; - test_my_matrix, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double compressed_matrix" << std::endl; - test_my_matrix, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex compressed_matrix" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex compressed_matrix" << std::endl; - test_my_matrix >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_COORDINATE_MATRIX -#ifdef USE_FLOAT - std::cout << "float coordinate_matrix" << std::endl; - test_my_matrix, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double coordinate_matrix" << std::endl; - test_my_matrix, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex coordinate_matrix" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex coordinate_matrix" << std::endl; - test_my_matrix >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test4.cpp b/test/test4.cpp deleted file mode 100644 index bf5816f5..00000000 --- a/test/test4.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test4.hpp" - -int main () { - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test4.hpp b/test/test4.hpp deleted file mode 100644 index fc5b48cb..00000000 --- a/test/test4.hpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST4_H -#define TEST4_H - -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -//#define USE_BANDED -#define USE_DIAGONAL - - -void test_matrix_vector (); -void test_matrix (); - - -// FIXME slice are failing in assignment to zero elements -#undef USE_SLICE - -#endif diff --git a/test/test42.cpp b/test/test42.cpp deleted file mode 100644 index a1fd3f27..00000000 --- a/test/test42.cpp +++ /dev/null @@ -1,361 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test4.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { -#ifndef USE_DIAGONAL - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v2 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v2 << std::endl; - v2 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v2 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - v1 (0) = 0; - v1 (N - 1) = 0; - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; -#endif - } - } - void operator () () const { - { - V v1 (N), v2 (N); -#ifdef USE_BANDED - M m1 (N, N, 1, 1); -#endif -#ifdef USE_DIAGONAL - M m1 (N, N); -#endif - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, 1), mr2 (m1, 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 1), mc2 (m1, 1); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } - - void operator () (int) const { -#ifdef USE_ADAPTOR - { -#ifdef USE_BANDED - V v1 (N), v2 (N); - M m1 (N, N, 1, 1); - ublas::banded_adaptor bam1 (m1, 1, 1); - test_with (v1, v2, bam1); - - ublas::matrix_row > mr1 (bam1, 1), mr2 (bam1, 1); - test_with (mr1, mr2, bam1); - - ublas::matrix_column > mc1 (bam1, 1), mc2 (bam1, 1); - test_with (mc1, mc2, bam1); - -#ifdef USE_RANGE - ublas::matrix_vector_range > mvr1 (bam1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (bam1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, bam1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice > mvs1 (bam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (bam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, bam1); -#endif -#endif -#ifdef USE_DIAGONAL - V v1 (N), v2 (N); - M m1 (N, N); - ublas::diagonal_adaptor dam1 (m1); - test_with (v1, v2, dam1); - - ublas::matrix_row > mr1 (dam1, 1), mr2 (dam1, 1); - test_with (mr1, mr2, dam1); - - ublas::matrix_column > mc1 (dam1, 1), mc2 (dam1, 1); - test_with (mc1, mc2, dam1); - -#ifdef USE_RANGE - ublas::matrix_vector_range > mvr1 (dam1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (dam1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, dam1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice > mvs1 (dam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (dam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, dam1); -#endif -#endif - } -#endif - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_BANDED -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::banded_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::banded_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::banded_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::banded_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::banded_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::banded_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::banded_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::banded_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::banded_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::banded_matrix, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::banded_matrix, ublas::row_major, std::vector > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::banded_matrix, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::banded_matrix, ublas::row_major, std::vector > >, 3> () (0); -#endif -#endif -#endif -#endif - -#ifdef USE_DIAGONAL -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::diagonal_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::diagonal_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::diagonal_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::diagonal_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::diagonal_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::diagonal_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::diagonal_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::diagonal_matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::diagonal_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::diagonal_matrix, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::diagonal_matrix, ublas::row_major, std::vector > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::diagonal_matrix, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::diagonal_matrix, ublas::row_major, std::vector > >, 3> () (0); -#endif -#endif -#endif -#endif -} diff --git a/test/test43.cpp b/test/test43.cpp deleted file mode 100644 index 9db3c9b2..00000000 --- a/test/test43.cpp +++ /dev/null @@ -1,326 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test4.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_with (MP &m1, MP &m2, MP &m3) const { - { - value_type t; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix<> (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - - // Unary matrix operations resulting in a matrix - initialize_matrix (m1); - m2 = - m1; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m2 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - m2 = ublas::trans (m1); - std::cout << "trans (m1) = " << m2 << std::endl; - - // Hermitean - initialize_matrix (m1); - m2 = ublas::herm (m1); - std::cout << "herm (m1) = " << m2 << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - // Banded times banded isn't banded - std::cout << "prod (m1, m2) = " << ublas::prod (m1, m2) << std::endl; - } - } - void operator () () const { - { -#ifdef USE_BANDED - M m1 (N, N, 1, 1), m2 (N, N, 1, 1), m3 (N, N, 1, 1); -#endif -#ifdef USE_DIAGONAL - M m1 (N, N), m2 (N, N), m3 (N, N); -#endif - test_with (m1, m2, m3); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } - -#ifdef USE_ADAPTOR - { -#ifdef USE_BANDED - M m1 (N, N, 1, 1), m2 (N, N, 1, 1), m3 (N, N, 1, 1); - ublas::banded_adaptor bam1 (m1, 1, 1), bam2 (m2, 1, 1), bam3 (m3, 1, 1); - test_with (bam1, bam2, bam3); - -#ifdef USE_RANGE - ublas::matrix_range > mr1 (bam1, ublas::range (0, N), ublas::range (0, N)), - mr2 (bam2, ublas::range (0, N), ublas::range (0, N)), - mr3 (bam3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice > ms1 (bam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (bam2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (bam3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif -#endif -#ifdef USE_DIAGONAL - M m1 (N, N), m2 (N, N), m3 (N, N); - ublas::diagonal_adaptor dam1 (m1), dam2 (m2), dam3 (m3); - test_with (dam1, dam2, dam3); - -#ifdef USE_RANGE - ublas::matrix_range > mr1 (dam1, ublas::range (0, N), ublas::range (0, N)), - mr2 (dam2, ublas::range (0, N), ublas::range (0, N)), - mr3 (dam3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice > ms1 (dam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (dam2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (dam3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif -#endif - } -#endif - - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_BANDED -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif -#endif -#endif -#endif - -#ifdef USE_DIAGONAL -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif -#endif -#endif -#endif -} diff --git a/test/test5.cpp b/test/test5.cpp deleted file mode 100644 index 548cd603..00000000 --- a/test/test5.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test5.hpp" - -int main () { - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test5.hpp b/test/test5.hpp deleted file mode 100644 index a13dfa2e..00000000 --- a/test/test5.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST5_H -#define TEST5_H - -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -void test_matrix_vector (); -void test_matrix (); - - -// FIXME slice are failing in assignment to zero elements -#undef USE_SLICE - -#endif diff --git a/test/test52.cpp b/test/test52.cpp deleted file mode 100644 index 4803ce26..00000000 --- a/test/test52.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test5.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v2 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v2 << std::endl; - v2 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v2 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - v1 (0) = 0; - v2 (N - 1) = 0; - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; - } - } - void operator () () const { - { - V v1 (N), v2 (N); - M m1 (N, N); - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, N - 1), mr2 (m1, N - 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 0), mc2 (m1, 0); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } - - void operator () (int) const { -#ifdef USE_ADAPTOR - { - V v1 (N), v2 (N); - M m1 (N, N); - ublas::triangular_adaptor tam1 (m1); - test_with (v1, v2, tam1); - - ublas::matrix_row > mr1 (tam1, N - 1), mr2 (tam1, N - 1); - test_with (mr1, mr2, tam1); - - ublas::matrix_column > mc1 (tam1, 0), mc2 (tam1, 0); - test_with (mc1, mc2, tam1); - -#ifdef USE_RANGE - ublas::matrix_vector_range > mvr1 (tam1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (tam1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, tam1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice > mvs1 (tam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (tam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, tam1); -#endif - } -#endif - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::triangular_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (0); - - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::triangular_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (0); -#endif -#endif -#endif -} diff --git a/test/test53.cpp b/test/test53.cpp deleted file mode 100644 index 250d462d..00000000 --- a/test/test53.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test5.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_with (MP &m1, MP &m2, MP &m3) const { - { - value_type t; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix<> (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - - // Unary matrix operations resulting in a matrix - initialize_matrix (m1); - m2 = - m1; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m2 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - // Transpose of a triangular isn't triangular of the same kind - std::cout << "trans (m1) = " << ublas::trans (m1) << std::endl; - - // Hermitian - initialize_matrix (m1); - // Hermitian of a triangular isn't hermitian of the same kind - std::cout << "herm (m1) = " << ublas::herm (m1) << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - m3 = ublas::prod (m1, m2); - std::cout << "prod (m1, m2) = " << m3 << std::endl; - } - } - void operator () () const { - { - M m1 (N, N), m2 (N, N), m3 (N, N); - test_with (m1, m2, m3); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } - -#ifdef USE_ADAPTOR - { - M m1 (N, N), m2 (N, N), m3 (N, N); - ublas::triangular_adaptor tam1 (m1), tam2 (m2), tam3 (m3); - test_with (tam1, tam2, tam3); - -#ifdef USE_RANGE - ublas::matrix_range > mr1 (tam1, ublas::range (0, N), ublas::range (0, N)), - mr2 (tam2, ublas::range (0, N), ublas::range (0, N)), - mr3 (tam3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice > ms1 (tam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (tam2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (tam3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } -#endif - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE -std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, std::vector > >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test6.cpp b/test/test6.cpp deleted file mode 100644 index 61a5c310..00000000 --- a/test/test6.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test6.hpp" - -int main () { - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test6.hpp b/test/test6.hpp deleted file mode 100644 index 766d6b92..00000000 --- a/test/test6.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST6_H -#define TEST6_H - -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -void test_matrix_vector (); -void test_matrix (); - - -#endif diff --git a/test/test62.cpp b/test/test62.cpp deleted file mode 100644 index 5d7feb9a..00000000 --- a/test/test62.cpp +++ /dev/null @@ -1,218 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test6.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v2 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v2 << std::endl; - v2 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v2 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - v1 (0) = 0; - v1 (N - 1) = 0; - v2 (0) = 0; - v2 (N - 1) = 0; - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; - } - } - void operator () () const { - { - V v1 (N), v2 (N); - M m1 (N, N); - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, N - 1), mr2 (m1, N - 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 0), mc2 (m1, 0); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } - - void operator () (int) const { -#ifdef USE_ADAPTOR - { - V v1 (N), v2 (N); - M m1 (N, N); - ublas::symmetric_adaptor tam1 (m1); - test_with (v1, v2, tam1); - - ublas::matrix_row > mr1 (tam1, N - 1), mr2 (tam1, N - 1); - test_with (mr1, mr2, tam1); - - ublas::matrix_column > mc1 (tam1, 0), mc2 (tam1, 0); - test_with (mc1, mc2, tam1); - -#ifdef USE_RANGE - ublas::matrix_vector_range > mvr1 (tam1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (tam1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, tam1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice > mvs1 (tam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (tam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, tam1); -#endif - } -#endif - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (); - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3> () (0); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (); - test_my_matrix_vector >, - ublas::symmetric_matrix >, 3> () (0); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (0); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (); - test_my_matrix_vector, std::vector > >, - ublas::symmetric_matrix, ublas::lower, ublas::row_major, std::vector > >, 3> () (0); -#endif -#endif -#endif -} diff --git a/test/test63.cpp b/test/test63.cpp deleted file mode 100644 index 4a0013d2..00000000 --- a/test/test63.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test6.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_with (MP &m1, MP &m2, MP &m3) const { - { - value_type t; - - // Default Construct - default_construct::test (); - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix<> (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - - // Unary matrix operations resulting in a matrix - initialize_matrix (m1); - m2 = - m1; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m1 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - m2 = ublas::trans (m1); - std::cout << "trans (m1) = " << m2 << std::endl; - - // Hermitean - initialize_matrix (m1); - m2 = ublas::herm (m1); - std::cout << "herm (m1) = " << m2 << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - m3 = ublas::prod (m1, m2); - std::cout << "prod (m1, m2) = " << m3 << std::endl; - } - } - void operator () () const { - { - M m1 (N, N), m2 (N, N), m3 (N, N); - test_with (m1, m2, m3); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } - -#ifdef USE_ADAPTOR - { - M m1 (N, N), m2 (N, N), m3 (N, N); - ublas::symmetric_adaptor sam1 (m1), sam2 (m2), sam3 (m3); - test_with (sam1, sam2, sam3); - -#ifdef USE_RANGE - ublas::matrix_range > mr1 (sam1, ublas::range (0, N), ublas::range (0, N)), - mr2 (sam2, ublas::range (0, N), ublas::range (0, N)), - mr3 (sam3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice > ms1 (sam1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (sam2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (sam3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } -#endif - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, bounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, bounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "float, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, unbounded_array" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, unbounded_array" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "float, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "double, std::vector" << std::endl; - test_my_matrix >, 3 > () (); -#endif - -#ifdef USE_STD_COMPLEX -#ifdef USE_FLOAT - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "std::complex, std::vector" << std::endl; - test_my_matrix, ublas::lower, ublas::row_major, std::vector > >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test7.cpp b/test/test7.cpp deleted file mode 100644 index f564031c..00000000 --- a/test/test7.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include - -#include -#include - -#include -#include -#include - -#include "test7.hpp" - -// this testcase requires fix of task #2473 - -int main () { - test_vector (); - test_matrix_vector (); - test_matrix (); - return 0; -} diff --git a/test/test7.hpp b/test/test7.hpp deleted file mode 100644 index 5dbae1fc..00000000 --- a/test/test7.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#ifndef TEST7_H -#define TEST7_H - -#include - -#include -#include - -#include -#include -#include -#include -#include - -namespace ublas = boost::numeric::ublas; - -#include "common/init.hpp" - -void test_vector (); -void test_matrix_vector (); -void test_matrix (); - - -#endif diff --git a/test/test71.cpp b/test/test71.cpp deleted file mode 100644 index 89e9ccf7..00000000 --- a/test/test71.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test7.hpp" - -// Test vector expression templates -template -struct test_my_vector { - typedef typename V::value_type value_type; - typedef typename V::size_type size_type; - typedef typename ublas::type_traits::real_type real_type; - - template - void test_with (VP &v1, VP &v2, VP &v3) const { - { - value_type t; - size_type i; - real_type n; - - // Copy and swap - initialize_vector (v1); - initialize_vector (v2); - v1 = v2; - std::cout << "v1 = v2 = " << v1 << std::endl; - v1.assign_temporary (v2); - std::cout << "v1.assign_temporary (v2) = " << v1 << std::endl; - v1.swap (v2); - std::cout << "v1.swap (v2) = " << v1 << " " << v2 << std::endl; - - // Zero assignment - v1 = ublas::zero_vector (v1.size ()); - std::cout << "v1.zero_vector = " << v1 << std::endl; - v1 = v2; - - // Unary vector operations resulting in a vector - initialize_vector (v1); - v2 = - v1; - std::cout << "- v1 = " << v2 << std::endl; - v2 = ublas::conj (v1); - std::cout << "conj (v1) = " << v2 << std::endl; - - // Binary vector operations resulting in a vector - initialize_vector (v1); - initialize_vector (v2); - v3 = v1 + v2; - std::cout << "v1 + v2 = " << v3 << std::endl; - - v3 = v1 - v2; - std::cout << "v1 - v2 = " << v3 << std::endl; - - // Scaling a vector - t = value_type (N); - initialize_vector (v1); - v2 = value_type (1.) * v1; - std::cout << "1. * v1 = " << v2 << std::endl; -// v2 = t * v1; - std::cout << "N * v1 = " << v2 << std::endl; - initialize_vector (v1); -// v2 = v1 * value_type (1.); - std::cout << "v1 * 1. = " << v2 << std::endl; -// v2 = v1 * t; - std::cout << "v1 * N = " << v2 << std::endl; - - // Some assignments - initialize_vector (v1); - initialize_vector (v2); - v2 += v1; - std::cout << "v2 += v1 = " << v2 << std::endl; - v2 -= v1; - std::cout << "v2 -= v1 = " << v2 << std::endl; - v2 = v2 + v1; - std::cout << "v2 = v2 + v1 = " << v2 << std::endl; - v2 = v2 - v1; - std::cout << "v2 = v2 - v1 = " << v2 << std::endl; - v1 *= value_type (1.); - std::cout << "v1 *= 1. = " << v1 << std::endl; - v1 *= t; - std::cout << "v1 *= N = " << v1 << std::endl; - - // Unary vector operations resulting in a scalar - initialize_vector (v1); - t = ublas::sum (v1); - std::cout << "sum (v1) = " << t << std::endl; - n = ublas::norm_1 (v1); - std::cout << "norm_1 (v1) = " << n << std::endl; - n = ublas::norm_2 (v1); - std::cout << "norm_2 (v1) = " << n << std::endl; - n = ublas::norm_inf (v1); - std::cout << "norm_inf (v1) = " << n << std::endl; - - i = ublas::index_norm_inf (v1); - std::cout << "index_norm_inf (v1) = " << i << std::endl; - - // Binary vector operations resulting in a scalar - initialize_vector (v1); - initialize_vector (v2); - t = ublas::inner_prod (v1, v2); - std::cout << "inner_prod (v1, v2) = " << t << std::endl; - } - } - void operator () () const { - { - V v1 (N), v2 (N), v3 (N); - test_with (v1, v2, v3); - -#ifdef USE_RANGE - ublas::vector_range vr1 (v1, ublas::range (0, N)), - vr2 (v2, ublas::range (0, N)), - vr3 (v3, ublas::range (0, N)); - test_with (vr1, vr2, vr3); -#endif - -#ifdef USE_SLICE - ublas::vector_slice vs1 (v1, ublas::slice (0, 1, N)), - vs2 (v2, ublas::slice (0, 1, N)), - vs3 (v3, ublas::slice (0, 1, N)); - test_with (vs1, vs2, vs3); -#endif - } - } -}; - -// Test vector -void test_vector () { - std::cout << "test_vector" << std::endl; - -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_vector, ublas::bounded_array, 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_vector, ublas::bounded_array, 3> >, 3 > () (); -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_vector, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_vector, ublas::unbounded_array > >, 3 > () (); -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_vector, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_vector, std::vector > >, 3 > () (); -#endif -#endif -} diff --git a/test/test72.cpp b/test/test72.cpp deleted file mode 100644 index bdc3f3e8..00000000 --- a/test/test72.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test7.hpp" - -// Test matrix & vector expression templates -template -struct test_my_matrix_vector { - typedef typename V::value_type value_type; - - template - void test_with (VP &v1, VP &v2, MP &m1) const { - { - // Rows and columns - initialize_matrix (m1); - for (int i = 0; i < N; ++ i) { - v1 = ublas::row (m1, i); - std::cout << "row (m, " << i << ") = " << v1 << std::endl; - v1 = ublas::column (m1, i); - std::cout << "column (m, " << i << ") = " << v1 << std::endl; - } - - // Outer product - initialize_vector (v1); - initialize_vector (v2); - m1 = ublas::outer_prod (v1, v2); - std::cout << "outer_prod (v1, v2) = " << m1 << std::endl; - - // Matrix vector product - initialize_matrix (m1); - initialize_vector (v1); - v2 = ublas::prod (m1, v1); - std::cout << "prod (m1, v1) = " << v2 << std::endl; - v2 = ublas::prod (v1, m1); - std::cout << "prod (v1, m1) = " << v2 << std::endl; - } - } - void operator () () const { - { - V v1 (N), v2 (N); - M m1 (N, N); - test_with (v1, v2, m1); - - ublas::matrix_row mr1 (m1, 0), mr2 (m1, 1); - test_with (mr1, mr2, m1); - - ublas::matrix_column mc1 (m1, 0), mc2 (m1, 1); - test_with (mc1, mc2, m1); - -#ifdef USE_RANGE - ublas::matrix_vector_range mvr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mvr2 (m1, ublas::range (0, N), ublas::range (0, N)); - test_with (mvr1, mvr2, m1); -#endif - -#ifdef USE_SLICE - ublas::matrix_vector_slice mvs1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - mvs2 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (mvs1, mvs2, m1); -#endif - } - } -}; - -// Test matrix & vector -void test_matrix_vector () { - std::cout << "test_matrix_vector" << std::endl; - -#ifdef USE_MATRIX -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3> () (); -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::matrix, ublas::row_major, ublas::unbounded_array > >, 3> () (); -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::matrix, ublas::row_major, std::vector > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::matrix, ublas::row_major, std::vector > >, 3> () (); -#endif -#endif -#endif - -#ifdef USE_VECTOR_OF_VECTOR -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::vector_of_vector, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix_vector, ublas::bounded_array, 3> >, - ublas::vector_of_vector, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3> () (); -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::vector_of_vector, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix_vector, ublas::unbounded_array > >, - ublas::vector_of_vector, ublas::row_major, ublas::unbounded_array > > >, 3> () (); -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::vector_of_vector, ublas::row_major, std::vector > > >, 3> () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix_vector, std::vector > >, - ublas::vector_of_vector, ublas::row_major, std::vector > > >, 3> () (); -#endif -#endif -#endif -} diff --git a/test/test73.cpp b/test/test73.cpp deleted file mode 100644 index e2d68cee..00000000 --- a/test/test73.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// -// Copyright (c) 2000-2002 -// Joerg Walter, Mathias Koch -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// The authors gratefully acknowledge the support of -// GeNeSys mbH & Co. KG in producing this work. -// - -#include "test7.hpp" - -// Test matrix expression templates -template -struct test_my_matrix { - typedef typename M::value_type value_type; - - template - void test_with (MP &m1, MP &m2, MP &m3) const { - { - value_type t; - - // Copy and swap - initialize_matrix (m1); - initialize_matrix (m2); - m1 = m2; - std::cout << "m1 = m2 = " << m1 << std::endl; - m1.assign_temporary (m2); - std::cout << "m1.assign_temporary (m2) = " << m1 << std::endl; - m1.swap (m2); - std::cout << "m1.swap (m2) = " << m1 << " " << m2 << std::endl; - - // Zero assignment - m1 = ublas::zero_matrix (m1.size1 (), m1.size2 ()); - std::cout << "m1.zero_matrix = " << m1 << std::endl; - m1 = m2; - - // Unary matrix operations resulting in a matrix - initialize_matrix (m1); - m2 = - m1; - std::cout << "- m1 = " << m2 << std::endl; - m2 = ublas::conj (m1); - std::cout << "conj (m1) = " << m2 << std::endl; - - // Binary matrix operations resulting in a matrix - initialize_matrix (m1); - initialize_matrix (m2); - m3 = m1 + m2; - std::cout << "m1 + m2 = " << m3 << std::endl; - m3 = m1 - m2; - std::cout << "m1 - m2 = " << m3 << std::endl; - - // Scaling a matrix - t = N; - initialize_matrix (m1); - m2 = value_type (1.) * m1; - std::cout << "1. * m1 = " << m2 << std::endl; - m2 = t * m1; - std::cout << "N * m1 = " << m2 << std::endl; - initialize_matrix (m1); - m2 = m1 * value_type (1.); - std::cout << "m1 * 1. = " << m2 << std::endl; - m2 = m1 * t; - std::cout << "m1 * N = " << m2 << std::endl; - - // Some assignments - initialize_matrix (m1); - initialize_matrix (m2); - m2 += m1; - std::cout << "m2 += m1 = " << m2 << std::endl; - m2 -= m1; - std::cout << "m2 -= m1 = " << m2 << std::endl; - m2 = m2 + m1; - std::cout << "m2 = m2 + m1 = " << m2 << std::endl; - m2 = m2 - m1; - std::cout << "m2 = m1 - m1 = " << m2 << std::endl; - m1 *= value_type (1.); - std::cout << "m1 *= 1. = " << m1 << std::endl; - m1 *= t; - std::cout << "m1 *= N = " << m1 << std::endl; - - // Transpose - initialize_matrix (m1); - m2 = ublas::trans (m1); - std::cout << "trans (m1) = " << m2 << std::endl; - - // Hermitean - initialize_matrix (m1); - m2 = ublas::herm (m1); - std::cout << "herm (m1) = " << m2 << std::endl; - - // Matrix multiplication - initialize_matrix (m1); - initialize_matrix (m2); - m3 = ublas::prod (m1, m2); - std::cout << "prod (m1, m2) = " << m3 << std::endl; - } - } - void operator () () const { - { - M m1 (N, N), m2 (N, N), m3 (N, N); - test_with (m1, m2, m3); - -#ifdef USE_RANGE - ublas::matrix_range mr1 (m1, ublas::range (0, N), ublas::range (0, N)), - mr2 (m2, ublas::range (0, N), ublas::range (0, N)), - mr3 (m3, ublas::range (0, N), ublas::range (0, N)); - test_with (mr1, mr2, mr3); -#endif - -#ifdef USE_SLICE - ublas::matrix_slice ms1 (m1, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms2 (m2, ublas::slice (0, 1, N), ublas::slice (0, 1, N)), - ms3 (m3, ublas::slice (0, 1, N), ublas::slice (0, 1, N)); - test_with (ms1, ms2, ms3); -#endif - } - } -}; - -// Test matrix -void test_matrix () { - std::cout << "test_matrix" << std::endl; - -#ifdef USE_MATRIX -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3 * 3> >, 3 > () (); -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > >, 3 > () (); -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > >, 3 > () (); -#endif -#endif -#endif - -#ifdef USE_VECTOR_OF_VECTOR -#ifdef USE_BOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, bounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::bounded_array, 3>, 3 + 1> >, 3 > () (); -#endif -#endif - -#ifdef USE_UNBOUNDED_ARRAY -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, unbounded_array" << std::endl; - test_my_matrix, ublas::row_major, ublas::unbounded_array > > >, 3 > () (); -#endif -#endif - -#ifdef USE_STD_VECTOR -#ifdef USE_FLOAT - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > > >, 3 > () (); -#endif - -#ifdef USE_DOUBLE - std::cout << "boost::numeric::interval, std::vector" << std::endl; - test_my_matrix, ublas::row_major, std::vector > > >, 3 > () (); -#endif -#endif -#endif -} diff --git a/test/test_complex_norms.cpp b/test/test_complex_norms.cpp deleted file mode 100644 index 041972ab..00000000 --- a/test/test_complex_norms.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2010 Gunter Winkler -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include -#include - -#include "libs/numeric/ublas/test/utils.hpp" - -using namespace boost::numeric::ublas; - -static const double TOL(1.0e-5); ///< Used for comparing two real numbers. - -BOOST_UBLAS_TEST_DEF ( test_double_complex_norm_inf ) { - typedef std::complex dComplex; - vector v(4); - for (unsigned int i = 0; i < v.size(); ++i) - v[i] = dComplex(i, i + 1); - - const double expected = abs(v[3]); - - BOOST_UBLAS_DEBUG_TRACE( "norm is " << norm_inf(v) ); - BOOST_UBLAS_TEST_CHECK(std::abs(norm_inf(v) - expected) < TOL); - v *= 3.; - BOOST_UBLAS_TEST_CHECK(std::abs(norm_inf(v) - (3.0*expected)) < TOL); -} - -BOOST_UBLAS_TEST_DEF ( test_double_complex_norm_2 ) { - typedef std::complex dComplex; - vector v(4); - for (unsigned int i = 0; i < v.size(); ++i) - v[i] = dComplex(i, i + 1); - - const double expected = sqrt(44.0); - - BOOST_UBLAS_DEBUG_TRACE( "norm is " << norm_2(v) ); - BOOST_UBLAS_TEST_CHECK(std::abs(norm_2(v) - expected) < TOL); - v *= 3.; - BOOST_UBLAS_TEST_CHECK(std::abs(norm_2(v) - (3.0*expected)) < TOL); -} - -BOOST_UBLAS_TEST_DEF ( test_float_complex_norm_inf ) { - typedef std::complex dComplex; - vector v(4); - for (unsigned int i = 0; i < v.size(); ++i) - v[i] = dComplex(i, i + 1); - - const float expected = abs(v[3]); - - BOOST_UBLAS_DEBUG_TRACE( "norm is " << norm_inf(v) ); - BOOST_UBLAS_TEST_CHECK(std::abs(norm_inf(v) - expected) < TOL); - v *= 3.; - BOOST_UBLAS_TEST_CHECK(std::abs(norm_inf(v) - (3.0*expected)) < TOL); -} - -BOOST_UBLAS_TEST_DEF ( test_float_complex_norm_2 ) { - typedef std::complex dComplex; - vector v(4); - for (unsigned int i = 0; i < v.size(); ++i) - v[i] = dComplex(i, i + 1); - - const float expected = sqrt(44.0); - - BOOST_UBLAS_DEBUG_TRACE( "norm is " << norm_2(v) ); - BOOST_UBLAS_TEST_CHECK(std::abs(norm_2(v) - expected) < TOL); - v *= 3.; - BOOST_UBLAS_TEST_CHECK(std::abs(norm_2(v) - (3.0*expected)) < TOL); -} - -int main() { - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_double_complex_norm_inf ); - BOOST_UBLAS_TEST_DO( test_float_complex_norm_inf ); - BOOST_UBLAS_TEST_DO( test_double_complex_norm_2 ); - BOOST_UBLAS_TEST_DO( test_float_complex_norm_2 ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/test_coordinate_matrix_sort.cpp b/test/test_coordinate_matrix_sort.cpp deleted file mode 100644 index afa58b45..00000000 --- a/test/test_coordinate_matrix_sort.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES -# define BOOST_UBLAS_NO_ELEMENT_PROXIES -#endif - -#include -#include - -#include "libs/numeric/ublas/test/utils.hpp" - -using std::cout; -using std::endl; - -BOOST_UBLAS_TEST_DEF( test_coordinate_matrix_sort ) -{ - - boost::numeric::ublas::coordinate_matrix matrix_mask(3, 3, 2); - cout << "Setting matrix(1,1) = 2.1" << endl; - matrix_mask(1,1) = 2.1; - - cout << "Displaying matrix(1,1)" << endl; - std::cout << matrix_mask(1,1) << std::endl; - - BOOST_UBLAS_DEBUG_TRACE( "Displaying matrix(1,1)" << matrix_mask(1,1) ); - BOOST_UBLAS_TEST_CHECK( matrix_mask(1,1) == 2.1 ); - - BOOST_UBLAS_TEST_CHECK( matrix_mask.index1_data()[0] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.index2_data()[0] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.value_data()[0] == 2.1 ); - - BOOST_UBLAS_DEBUG_TRACE( "Setting matrix(0,1) = 1.1" ); - matrix_mask(0, 1) = 1.1; - - BOOST_UBLAS_TEST_CHECK( matrix_mask.index1_data()[0] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.index2_data()[0] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.value_data()[0] == 2.1 ); - - BOOST_UBLAS_TEST_CHECK( matrix_mask.index1_data()[1] == 0 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.index2_data()[1] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.value_data()[1] == 1.1 ); - - BOOST_UBLAS_DEBUG_TRACE( "Sort the matrix - this would be triggered by any element lookup." ); - matrix_mask.sort(); - - BOOST_UBLAS_TEST_CHECK( matrix_mask.index1_data()[1] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.index2_data()[1] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.value_data()[1] == 2.1 ); - - BOOST_UBLAS_TEST_CHECK( matrix_mask.index1_data()[0] == 0 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.index2_data()[0] == 1 ); - BOOST_UBLAS_TEST_CHECK( matrix_mask.value_data()[0] == 1.1 ); - - BOOST_UBLAS_DEBUG_TRACE( "Displaying matrix(1,1)" << matrix_mask(1,1) ); - BOOST_UBLAS_TEST_CHECK( matrix_mask(1,1) == 2.1 ); - - BOOST_UBLAS_DEBUG_TRACE( "Displaying matrix(0,1)" << matrix_mask(0,1) ); - BOOST_UBLAS_TEST_CHECK( matrix_mask(0,1) == 1.1 ); - -} - -int main() -{ - BOOST_UBLAS_TEST_BEGIN(); - - BOOST_UBLAS_TEST_DO( test_coordinate_matrix_sort ); - - BOOST_UBLAS_TEST_END(); -} diff --git a/test/test_lu.cpp b/test/test_lu.cpp deleted file mode 100644 index e2b203f8..00000000 --- a/test/test_lu.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2008 Gunter Winkler -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// switch automatic singular check off -#define BOOST_UBLAS_TYPE_CHECK 0 - -#include -#include -#include - -#include "common/testhelper.hpp" - -#include -#include - -using namespace boost::numeric::ublas; -using std::string; - -static const string matrix_IN = "[3,3]((1,2,2),(2,3,3),(3,4,6))\0"; -static const string matrix_LU = "[3,3]((3,4,6),(3.33333343e-01,6.66666627e-01,0),(6.66666687e-01,4.99999911e-01,-1))\0"; -static const string matrix_INV= "[3,3]((-3,2,-7.94728621e-08),(1.50000012,0,-5.00000060e-01),(4.99999911e-01,-1,5.00000060e-01))\0"; -static const string matrix_PM = "[3](2,2,2)"; - -int main () { - - typedef float TYPE; - - typedef matrix MATRIX; - - MATRIX A; - MATRIX LU; - MATRIX INV; - - { - std::istringstream is(matrix_IN); - is >> A; - } - { - std::istringstream is(matrix_LU); - is >> LU; - } - { - std::istringstream is(matrix_INV); - is >> INV; - } - permutation_matrix<>::vector_type temp; - { - std::istringstream is(matrix_PM); - is >> temp; - } - permutation_matrix<> PM(temp); - - permutation_matrix<> pm(3); - - int result = lu_factorize >(A, pm); - - assertTrue("factorization completed: ", 0 == result); - assertTrue("LU factors are correct: ", compare(A, LU)); - assertTrue("permutation is correct: ", compare(pm, PM)); - - MATRIX B = identity_matrix(A.size2()); - - lu_substitute(A, pm, B); - - assertTrue("inverse is correct: ", compare(B, INV)); - - return (getResults().second > 0) ? boost::exit_failure : boost::exit_success; -} diff --git a/test/triangular_access.cpp b/test/triangular_access.cpp deleted file mode 100644 index 9777632b..00000000 --- a/test/triangular_access.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* Test program to test find functions of triagular matrices - * - * author: Gunter Winkler ( guwi17 at gmx dot de ) - */ -// Copyright 2008 Gunter Winkler -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - - -#include -#include -#include - -#include "common/testhelper.hpp" - -#ifdef BOOST_UBLAS_NO_NESTED_CLASS_RELATION -using boost::numeric::ublas::iterator1_tag; -using boost::numeric::ublas::iterator2_tag; -#endif - -template < class MAT > -void test_iterator( MAT & A ) { - -#ifndef NOMESSAGES - std::cout << "=>"; -#endif - // check mutable iterators - typename MAT::iterator1 it1 = A.begin1(); - typename MAT::iterator1 it1_end = A.end1(); - - for ( ; it1 != it1_end; ++it1 ) { -#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION - typename MAT::iterator2 it2 = it1.begin(); - typename MAT::iterator2 it2_end = it1.end(); -#else - typename MAT::iterator2 it2 = begin(it1, iterator1_tag()); - typename MAT::iterator2 it2_end = end(it1, iterator1_tag()); -#endif - for ( ; it2 != it2_end ; ++ it2 ) { -#ifndef NOMESSAGES - std::cout << "( " << it2.index1() << ", " << it2.index2() << ") " << std::flush; -#endif - * it2 = ( 10 * it2.index1() + it2.index2() ); - } -#ifndef NOMESSAGES - std::cout << std::endl; -#endif - } - -} - -template < class MAT > -void test_iterator2( MAT & A ) { - -#ifndef NOMESSAGES - std::cout << "=>"; -#endif - // check mutable iterators - typename MAT::iterator2 it2 = A.begin2(); - typename MAT::iterator2 it2_end = A.end2(); - - for ( ; it2 != it2_end; ++it2 ) { -#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION - typename MAT::iterator1 it1 = it2.begin(); - typename MAT::iterator1 it1_end = it2.end(); -#else - typename MAT::iterator1 it1 = begin(it2, iterator2_tag()); - typename MAT::iterator1 it1_end = end(it2, iterator2_tag()); -#endif - for ( ; it1 != it1_end ; ++ it1 ) { -#ifndef NOMESSAGES - std::cout << "( " << it1.index1() << ", " << it1.index2() << ") " << std::flush; -#endif - * it1 = ( 10 * it1.index1() + it1.index2() ); - } -#ifndef NOMESSAGES - std::cout << std::endl; -#endif - } - -} - -template < class MAT > -typename MAT::value_type -test_iterator3( const MAT & A ) { - -#ifndef NOMESSAGES - std::cout << "=>"; -#endif - typename MAT::value_type result = 0; - - // check mutable iterators - typename MAT::const_iterator1 it1 = A.begin1(); - typename MAT::const_iterator1 it1_end = A.end1(); - - for ( ; it1 != it1_end; ++it1 ) { -#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION - typename MAT::const_iterator2 it2 = it1.begin(); - typename MAT::const_iterator2 it2_end = it1.end(); -#else - typename MAT::const_iterator2 it2 = begin(it1, iterator1_tag()); - typename MAT::const_iterator2 it2_end = end(it1, iterator1_tag()); -#endif - for ( ; it2 != it2_end ; ++ it2 ) { -#ifndef NOMESSAGES - std::cout << "( " << it2.index1() << ", " << it2.index2() << ") " << std::flush; -#endif - result += * it2; - } -#ifndef NOMESSAGES - std::cout << std::endl; -#endif - } - return result; - -} - - -int main (int argc, char * argv[]) { - using namespace boost::numeric::ublas; - - typedef double VALUE_TYPE; - typedef triangular_matrix LT; - typedef triangular_matrix ULT; - typedef triangular_matrix SLT; - typedef triangular_matrix UT; - typedef triangular_matrix UUT; - typedef triangular_matrix SUT; - - LT A(5,5); - - test_iterator(A); - test_iterator2(A); - - ULT B(5,5); - - test_iterator(B); - test_iterator2(B); - - SLT C(5,5); - - test_iterator(C); - test_iterator2(C); - - UT D(5,5); - - test_iterator(D); - test_iterator2(D); - - UUT E(5,5); - - test_iterator(E); - test_iterator2(E); - - SUT F(5,5); - - test_iterator(F); - test_iterator2(F); - - assertTrue("Write access using iterators: ", true); - - assertEquals(" LT: ",420.0,test_iterator3(A)); - assertEquals("ULT: ",315.0,test_iterator3(B)); - assertEquals("SLT: ",310.0,test_iterator3(C)); - assertEquals(" UT: ",240.0,test_iterator3(D)); - assertEquals("UUT: ",135.0,test_iterator3(E)); - assertEquals("SUT: ",130.0,test_iterator3(F)); - - assertTrue("Read access using iterators: ", true); - -#ifndef NOMESSAGES - std::cout << A << B << C << D << E << F << std::endl; -#endif - - typedef matrix MATRIX; - MATRIX mat(5,5); - triangular_adaptor lta((mat)); - triangular_adaptor ulta((mat)); - triangular_adaptor slta((mat)); - triangular_adaptor uta((mat)); - triangular_adaptor uuta((mat)); - triangular_adaptor suta((mat)); - - test_iterator ( lta ); - test_iterator2( lta ); - - test_iterator ( ulta ); - test_iterator2( ulta ); - - test_iterator ( slta ); - test_iterator2( slta ); - - test_iterator ( uta ); - test_iterator2( uta ); - - test_iterator ( uuta ); - test_iterator2( uuta ); - - test_iterator ( suta ); - test_iterator2( suta ); - - assertTrue("Write access using adaptors: ", true); - - assertEquals(" LTA: ",420.0,test_iterator3( lta )); - assertEquals("ULTA: ",315.0,test_iterator3( ulta )); - assertEquals("SLTA: ",310.0,test_iterator3( slta )); - - assertEquals(" UTA: ",240.0,test_iterator3( uta )); - assertEquals("UUTA: ",135.0,test_iterator3( uuta )); - assertEquals("SUTA: ",130.0,test_iterator3( suta )); - - assertTrue("Read access using adaptors: ", true); - -#ifndef NOMESSAGES - std::cout << mat << std::endl; -#endif - - return (getResults().second > 0) ? boost::exit_failure : boost::exit_success; -} diff --git a/test/triangular_layout.cpp b/test/triangular_layout.cpp deleted file mode 100644 index 8bd27faa..00000000 --- a/test/triangular_layout.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2008 Gunter Winkler -// Thanks to Tiago Requeijo for providing this test -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include -#include - -using namespace std; -namespace ublas = boost::numeric::ublas; - -int main(int argc, char* argv[]) -{ - int sz = 4; - ublas::symmetric_matrix UpCol (sz, sz); - ublas::symmetric_matrix UpRow (sz, sz); - ublas::symmetric_matrix LoCol (sz, sz); - ublas::symmetric_matrix LoRow (sz, sz); - - ublas::triangular_matrix TrUpCol (sz, sz); - ublas::triangular_matrix TrUpRow (sz, sz); - ublas::triangular_matrix TrLoCol (sz, sz); - ublas::triangular_matrix TrLoRow (sz, sz); - - for(int i=0; i - - -#define EXPAND_(x) x - -#define STRINGIFY_(x) #x - -#define JOIN_(x,y) x ## y - -#ifndef NDEBUG -# define BOOST_UBLAS_DEBUG_TRACE(x) std::cerr << "[Debug>> " << EXPAND_(x) << std::endl -#else -# define BOOST_UBLAS_DEBUG_TRACE(x) /**/ -#endif // NDEBUG - -#define BOOST_UBLAS_TEST_BEGIN() unsigned int test_fails_(0) - -#define BOOST_UBLAS_TEST_DEF(x) void EXPAND_(x)(unsigned int& test_fails_) - -#define BOOST_UBLAS_TEST_DO(x) EXPAND_(x)(test_fails_) - -#define BOOST_UBLAS_TEST_END() if (test_fails_ > 0) { std::cerr << "Number of failed tests: " << test_fails_ << std::endl; return -1; \ -} else { std::cerr << "No failed test" << std::endl; return 0; } - -#define BOOST_UBLAS_TEST_CHECK(x) if (!(x)) { std::cerr << "Failed assertion: " << STRINGIFY_(x) << std::endl; ++test_fails_; } - - -#endif // TEST_UTILS_HPP diff --git a/include/boost/numeric/ublas/traits.hpp b/traits.hpp similarity index 100% rename from include/boost/numeric/ublas/traits.hpp rename to traits.hpp diff --git a/include/boost/numeric/ublas/traits/c_array.hpp b/traits/c_array.hpp similarity index 100% rename from include/boost/numeric/ublas/traits/c_array.hpp rename to traits/c_array.hpp diff --git a/include/boost/numeric/ublas/traits/const_iterator_type.hpp b/traits/const_iterator_type.hpp similarity index 100% rename from include/boost/numeric/ublas/traits/const_iterator_type.hpp rename to traits/const_iterator_type.hpp diff --git a/include/boost/numeric/ublas/traits/iterator_type.hpp b/traits/iterator_type.hpp similarity index 100% rename from include/boost/numeric/ublas/traits/iterator_type.hpp rename to traits/iterator_type.hpp diff --git a/include/boost/numeric/ublas/triangular.hpp b/triangular.hpp similarity index 100% rename from include/boost/numeric/ublas/triangular.hpp rename to triangular.hpp diff --git a/include/boost/numeric/ublas/vector.hpp b/vector.hpp similarity index 100% rename from include/boost/numeric/ublas/vector.hpp rename to vector.hpp diff --git a/include/boost/numeric/ublas/vector_expression.hpp b/vector_expression.hpp similarity index 100% rename from include/boost/numeric/ublas/vector_expression.hpp rename to vector_expression.hpp diff --git a/include/boost/numeric/ublas/vector_of_vector.hpp b/vector_of_vector.hpp similarity index 100% rename from include/boost/numeric/ublas/vector_of_vector.hpp rename to vector_of_vector.hpp diff --git a/include/boost/numeric/ublas/vector_proxy.hpp b/vector_proxy.hpp similarity index 100% rename from include/boost/numeric/ublas/vector_proxy.hpp rename to vector_proxy.hpp diff --git a/include/boost/numeric/ublas/vector_sparse.hpp b/vector_sparse.hpp similarity index 100% rename from include/boost/numeric/ublas/vector_sparse.hpp rename to vector_sparse.hpp