[boost-doc-zh] r402 committed - 升级至1.43.0,第4批,libs/目录n-q子目录

  • From: boost-doc-zh@xxxxxxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Sat, 29 May 2010 14:53:04 +0000

Revision: 402
Author: alai04
Date: Sat May 29 07:51:36 2010
Log: 升级至1.43.0,第4批,libs/目录n-q子目录
http://code.google.com/p/boost-doc-zh/source/detail?r=402

Added:
 /trunk/libs/numeric/ublas/test
 /trunk/libs/numeric/ublas/test/Jamfile.v2
 /trunk/libs/numeric/ublas/test/README
 /trunk/libs/numeric/ublas/test/begin_end.cpp
 /trunk/libs/numeric/ublas/test/common
 /trunk/libs/numeric/ublas/test/common/init.hpp
 /trunk/libs/numeric/ublas/test/common/testhelper.hpp
 /trunk/libs/numeric/ublas/test/comp_mat_erase.cpp
 /trunk/libs/numeric/ublas/test/concepts.cpp
 /trunk/libs/numeric/ublas/test/manual
 /trunk/libs/numeric/ublas/test/manual/Jamfile.v2
 /trunk/libs/numeric/ublas/test/manual/sp_resize.cpp
 /trunk/libs/numeric/ublas/test/manual/test_move_semantics.cpp
 /trunk/libs/numeric/ublas/test/num_columns.cpp
 /trunk/libs/numeric/ublas/test/num_rows.cpp
 /trunk/libs/numeric/ublas/test/placement_new.cpp
 /trunk/libs/numeric/ublas/test/size.cpp
 /trunk/libs/numeric/ublas/test/test1.cpp
 /trunk/libs/numeric/ublas/test/test1.hpp
 /trunk/libs/numeric/ublas/test/test11.cpp
 /trunk/libs/numeric/ublas/test/test12.cpp
 /trunk/libs/numeric/ublas/test/test13.cpp
 /trunk/libs/numeric/ublas/test/test2.cpp
 /trunk/libs/numeric/ublas/test/test2.hpp
 /trunk/libs/numeric/ublas/test/test21.cpp
 /trunk/libs/numeric/ublas/test/test22.cpp
 /trunk/libs/numeric/ublas/test/test23.cpp
 /trunk/libs/numeric/ublas/test/test3.cpp
 /trunk/libs/numeric/ublas/test/test3.hpp
 /trunk/libs/numeric/ublas/test/test31.cpp
 /trunk/libs/numeric/ublas/test/test32.cpp
 /trunk/libs/numeric/ublas/test/test33.cpp
 /trunk/libs/numeric/ublas/test/test4.cpp
 /trunk/libs/numeric/ublas/test/test4.hpp
 /trunk/libs/numeric/ublas/test/test42.cpp
 /trunk/libs/numeric/ublas/test/test43.cpp
 /trunk/libs/numeric/ublas/test/test5.cpp
 /trunk/libs/numeric/ublas/test/test5.hpp
 /trunk/libs/numeric/ublas/test/test52.cpp
 /trunk/libs/numeric/ublas/test/test53.cpp
 /trunk/libs/numeric/ublas/test/test6.cpp
 /trunk/libs/numeric/ublas/test/test6.hpp
 /trunk/libs/numeric/ublas/test/test62.cpp
 /trunk/libs/numeric/ublas/test/test63.cpp
 /trunk/libs/numeric/ublas/test/test7.cpp
 /trunk/libs/numeric/ublas/test/test7.hpp
 /trunk/libs/numeric/ublas/test/test71.cpp
 /trunk/libs/numeric/ublas/test/test72.cpp
 /trunk/libs/numeric/ublas/test/test73.cpp
 /trunk/libs/numeric/ublas/test/test_complex_norms.cpp
 /trunk/libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp
 /trunk/libs/numeric/ublas/test/test_lu.cpp
 /trunk/libs/numeric/ublas/test/triangular_access.cpp
 /trunk/libs/numeric/ublas/test/triangular_layout.cpp
 /trunk/libs/numeric/ublas/test/utils.hpp
 /trunk/libs/property_map/doc/dynamic_property_map.rst
 /trunk/libs/property_map/test/Jamfile.v2
 /trunk/libs/proto/doc/reference/concepts/Domain.xml
 /trunk/libs/proto/doc/reference/concepts/Expr.xml
 /trunk/libs/proto/doc/release_notes.qbk
 /trunk/libs/python/test/calling_conventions.cpp
 /trunk/libs/python/test/calling_conventions.py
 /trunk/libs/python/test/calling_conventions_mf.cpp
 /trunk/libs/python/test/calling_conventions_mf.py
Modified:
 /trunk/libs/numeric/ublas/doc/index.htm
 /trunk/libs/numeric/ublas/doc/release_notes.htm
 /trunk/libs/property_map/doc/dynamic_property_map.html
 /trunk/libs/property_map/test/dynamic_properties_test.cpp
 /trunk/libs/property_map/test/property_map_cc.cpp
 /trunk/libs/proto/doc/acknowledgements.qbk
 /trunk/libs/proto/doc/front_end.qbk
 /trunk/libs/proto/doc/history.qbk
 /trunk/libs/proto/doc/implementation.qbk
 /trunk/libs/proto/doc/propdocs.sh
 /trunk/libs/proto/doc/proto.qbk
 /trunk/libs/proto/doc/rationale.qbk
 /trunk/libs/proto/doc/reference/debug.xml
 /trunk/libs/proto/doc/reference/domain.xml
 /trunk/libs/proto/doc/reference/extends.xml
 /trunk/libs/proto/doc/reference/fusion.xml
 /trunk/libs/proto/doc/reference/literal.xml
 /trunk/libs/proto/doc/reference/matches.xml
 /trunk/libs/proto/doc/reference/transform/fold.xml
 /trunk/libs/proto/doc/reference/transform/when.xml
 /trunk/libs/proto/doc/reference.xml
 /trunk/libs/proto/example/calc2.cpp
 /trunk/libs/proto/example/calc3.cpp
 /trunk/libs/proto/test/matches.cpp
 /trunk/libs/python/doc/v2/configuration.html
 /trunk/libs/python/doc/v2/object.html
 /trunk/libs/python/test/Jamfile.v2
 /trunk/libs/python/test/destroy_test.cpp

=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/Jamfile.v2   Sat May 29 07:51:36 2010
@@ -0,0 +1,133 @@
+# 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
+       <define>BOOST_UBLAS_NO_EXCEPTIONS
+       <toolset>vacpp:<define>"BOOST_UBLAS_NO_ELEMENT_PROXIES"
+    ;
+
+
+test-suite numeric/uBLAS
+    : [ run test1.cpp
+            test11.cpp
+            test12.cpp
+            test13.cpp
+        : # args
+        : # input files
+        : # requirements
+            <define>$(UBLAS_TESTSET)
+      ]
+      [ run test2.cpp
+            test21.cpp
+            test22.cpp
+            test23.cpp
+        : : :
+            <define>$(UBLAS_TESTSET)
+      ]
+      [ run test3.cpp
+            test31.cpp
+            test32.cpp
+            test33.cpp
+        : : :
+            <define>$(UBLAS_TESTSET_SPARSE)
+      ]
+      [ run test4.cpp
+            test42.cpp
+            test43.cpp
+        : : :
+            <define>$(UBLAS_TESTSET)
+      ]
+      [ run test5.cpp
+            test52.cpp
+            test53.cpp
+        : : :
+            <define>$(UBLAS_TESTSET)
+      ]
+      [ run test6.cpp
+            test62.cpp
+            test63.cpp
+        : : :
+            <define>$(UBLAS_TESTSET)
+      ]
+# Test commented out because boost::interval does not behave like a scalar type
+#      [ run test7.cpp
+#            test71.cpp
+#            test72.cpp
+#            test73.cpp
+#        : : :
+#            <define>BOOST_UBLAS_USE_INTERVAL
+#            <define>$(UBLAS_TESTSET)
+#      ]
+
+      [ run placement_new.cpp
+      ]
+      [ compile concepts.cpp
+        : # requirements
+            <define>EXTERNAL
+#            <define>INTERAL
+#            <define>SKIP_BAD
+            <toolset>intel-linux:<cxxflags>"-Xc"
+            <toolset>darwin:<cxxflags>"-fabi-version=0"
+      ]
+      [ run test_lu.cpp
+      ]
+      [ run triangular_access.cpp
+        : : :
+            <define>NOMESSAGES
+      ]
+      [ run triangular_layout.cpp
+      ]
+      [ run comp_mat_erase.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
+      ]
+    ;
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/README       Sat May 29 07:51:36 2010
@@ -0,0 +1,31 @@
+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
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/begin_end.cpp        Sat May 29 07:51:36 2010
@@ -0,0 +1,177 @@
+/** -*- c++ -*- \file begin_end.hpp \brief Test the \c begin and \c end operations. */
+
+#include <cmath>
+#include <boost/numeric/ublas/traits/const_iterator_type.hpp>
+#include <boost/numeric/ublas/traits/iterator_type.hpp>
+#include <boost/numeric/ublas/traits/c_array.hpp>
+#include <boost/numeric/ublas/fwd.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_expression.hpp>
+#include <boost/numeric/ublas/operation/begin.hpp>
+#include <boost/numeric/ublas/operation/end.hpp>
+#include <boost/numeric/ublas/tags.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_expression.hpp>
+#include <iostream>
+#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<value_type> 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<vector_type>::type it = boost::numeric::ublas::begin<vector_type>(v);
+            it != boost::numeric::ublas::end<vector_type>(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<value_type> 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<vector_type>::type it = boost::numeric::ublas::begin<vector_type>(v);
+            it != boost::numeric::ublas::end<vector_type>(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<value_type, boost::numeric::ublas::row_major> matrix_type; + typedef boost::numeric::ublas::iterator_type<matrix_type, boost::numeric::ublas::tag::major>::type outer_iterator_type; + typedef boost::numeric::ublas::iterator_type<matrix_type, boost::numeric::ublas::tag::minor>::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<boost::numeric::ublas::tag::major>(A); + outer_it != boost::numeric::ublas::end<boost::numeric::ublas::tag::major>(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<value_type, boost::numeric::ublas::column_major> matrix_type; + typedef boost::numeric::ublas::iterator_type<matrix_type, boost::numeric::ublas::tag::major>::type outer_iterator_type; + typedef boost::numeric::ublas::iterator_type<matrix_type, boost::numeric::ublas::tag::minor>::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<boost::numeric::ublas::tag::major>(A); + outer_it != boost::numeric::ublas::end<boost::numeric::ublas::tag::major>(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();
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/common/init.hpp      Sat May 29 07:51:36 2010
@@ -0,0 +1,100 @@
+/*
+ * 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 <class E>
+struct default_construct
+{
+    static void test() {}
+};
+template <class VC>
+struct default_construct<boost::numeric::ublas::vector_container<VC> >
+{
+    static void test ()
+    {
+        VC default_constuct;
+        initialize_vector (default_constuct);
+ std::cout << "default construct = " << default_constuct << std::endl;
+    }
+};
+template <class MC>
+struct default_construct<boost::numeric::ublas::matrix_container<MC> >
+{
+    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<class V>
+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<class M>
+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<class M>
+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<class M>
+void initialize_matrix (M &m) {
+    initialize_matrix_impl (m, typename M::storage_category());
+}
+
+template<class M>
+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<class M>
+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;
+    }
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/common/testhelper.hpp Sat May 29 07:51:36 2010
@@ -0,0 +1,74 @@
+// Copyright 2008 Gunter Winkler <guwi17@xxxxxx>
+// 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 <utility>
+
+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<unsigned, unsigned> getResults() {
+  return std::make_pair(_success_counter, _fail_counter);
+}
+
+template < class M1, class M2 >
+bool compare( const boost::numeric::ublas::matrix_expression<M1> & m1,
+              const boost::numeric::ublas::matrix_expression<M2> & 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> & m1,
+              const boost::numeric::ublas::vector_expression<M2> & 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
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/comp_mat_erase.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,100 @@
+#include "boost/numeric/ublas/matrix_sparse.hpp"
+
+#define BOOST_TEST_MODULE SparseMatrixErasureTest
+#include <boost/test/included/unit_test.hpp>
+
+
+BOOST_AUTO_TEST_CASE( compressed_matrix_erase_after_end )
+{
+ boost::numeric::ublas::compressed_matrix<int, boost::numeric::ublas::row_major > 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<int, boost::numeric::ublas::row_major > 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 );
+
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/concepts.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,32 @@
+//
+//  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 <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_proxy.hpp>
+#include <boost/numeric/ublas/vector_sparse.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/banded.hpp>
+#include <boost/numeric/ublas/triangular.hpp>
+#include <boost/numeric/ublas/symmetric.hpp>
+#include <boost/numeric/ublas/hermitian.hpp>
+#include <boost/numeric/ublas/matrix_sparse.hpp>
+#include <boost/numeric/ublas/vector_of_vector.hpp>
+#include <boost/numeric/ublas/detail/concepts.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+
+int main () {
+    void (* check) (void) = ublas::concept_checks;
+    boost::ignore_unused_variable_warning (check);
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/manual/Jamfile.v2 Sat May 29 07:51:36 2010
@@ -0,0 +1,8 @@
+# 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 ;
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/manual/sp_resize.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,55 @@
+/*
+ * 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 <iostream>
+
+#include <boost/numeric/ublas/vector_sparse.hpp>
+
+typedef double Real;
+
+template <class V>
+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 <class V>
+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<Real> >();
+  std::cout << "---- COMPRESSED ----\n";
+  run_test< boost::numeric::ublas::compressed_vector<Real> >();
+  std::cout << "---- COORDINATE ----\n";
+  run_test< boost::numeric::ublas::coordinate_vector<Real> >();
+
+  return 0;
+}
+
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/manual/test_move_semantics.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,127 @@
+/** 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 <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+namespace ublas= boost::numeric::ublas;
+std::vector<double> a;
+
+ublas::vector<double> doubleit(ublas::vector<double> m)
+{
+    ublas::vector<double> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer: " << &r[0] << std::endl;
+    return r;
+}
+template <class T,size_t N>
+ublas::bounded_vector<T,N > doubleit(ublas::bounded_vector<T, N> m)
+{
+    ublas::bounded_vector<T,N> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer: " << &r[0] << std::endl;
+    return r;
+}
+
+template <class T,size_t N>
+ublas::c_vector<T,N > doubleit(ublas::c_vector<T, N> m)
+{
+    ublas::c_vector<T,N> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer: " << &r[0] << std::endl;
+    return r;
+}
+
+ublas::matrix<double> doubleit(ublas::matrix<double> m)
+{
+    ublas::matrix<double> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer r: " << &r(0,0) << std::endl;
+    return r;
+}
+template <class T,size_t N, size_t M>
+ublas::bounded_matrix<T,N, M > doubleit(ublas::bounded_matrix<T, N, M> m)
+{
+    ublas::bounded_matrix<T,N, M> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer: " <<  &(r(0,0)) << std::endl;
+    return r;
+}
+
+template <class T,size_t N, size_t M>
+ublas::c_matrix<T,N, M > doubleit(ublas::c_matrix<T, N, M> m)
+{
+    ublas::c_matrix<T,N, M> r;
+    r=2.0*m;
+    std::cout << "Temporary pointer: " << &(r(0,0)) << std::endl;
+    return r;
+}
+
+
+void test1()
+{
+ std::cout << "vector<double> --------------------------------------------------------------------" << std::endl;
+    ublas::vector<double> a(ublas::scalar_vector<double>(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<double,2> --------------------------------------------------------------------" << std::endl;
+    ublas::bounded_vector<double,2> b(ublas::scalar_vector<double>(2,2.0));
+    ublas::bounded_vector<double,2> 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<double,2> --------------------------------------------------------------------" << std::endl;
+    ublas::c_vector<double,2> e=ublas::scalar_vector<double>(2,2.0);
+    ublas::c_vector<double,2> 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<double> --------------------------------------------------------------------" << std::endl;
+    ublas::matrix<double> a(ublas::scalar_matrix<double>(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<double,2, 3> --------------------------------------------------------------------" << std::endl; + ublas::bounded_matrix<double,2, 3> b(ublas::scalar_matrix<double>(2,3, 2.0));
+    ublas::bounded_matrix<double,2, 3> 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<double,2 ,3> --------------------------------------------------------------------" << std::endl;
+    ublas::c_matrix<double,2, 3> e=ublas::scalar_matrix<double>(2,3, 2.0);
+    ublas::c_matrix<double,2, 3> 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;
+}
+
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/num_columns.cpp      Sat May 29 07:51:36 2010
@@ -0,0 +1,106 @@
+/** -*- c++ -*- \file num_columns.cpp \breif Test for the \c num_columns operation. */
+
+#include <boost/numeric/ublas/fwd.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_expression.hpp>
+#include <boost/numeric/ublas/operation/num_columns.hpp>
+#include <iostream>
+#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<value_type, boost::numeric::ublas::row_major> 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<value_type, boost::numeric::ublas::column_major> 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<value_type> 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<value_type> matrix_type;
+ typedef boost::numeric::ublas::matrix_reference<matrix_type> 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();
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/num_rows.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,106 @@
+/** -*- c++ -*- \file num_rows.hpp \file Test the \c num_rows operation. */
+
+#include <boost/numeric/ublas/fwd.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_expression.hpp>
+#include <boost/numeric/ublas/operation/num_rows.hpp>
+#include <iostream>
+#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<value_type, boost::numeric::ublas::row_major> 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<value_type, boost::numeric::ublas::column_major> 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<value_type> 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<value_type> matrix_type;
+ typedef boost::numeric::ublas::matrix_reference<matrix_type> 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();
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/placement_new.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,63 @@
+/*
+ * 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 <boost/numeric/ublas/storage.hpp>
+#include <iostream>
+#include <new>
+
+// 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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/size.cpp     Sat May 29 07:51:36 2010
@@ -0,0 +1,271 @@
+/** -*- c++ -*- \file size.hpp \brief Test the \c size operation. */
+
+#include <boost/numeric/ublas/fwd.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_expression.hpp>
+#include <boost/numeric/ublas/operation/size.hpp>
+#include <boost/numeric/ublas/tags.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_expression.hpp>
+#include <iostream>
+#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<value_type> 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<vector_type,2>(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<value_type> 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<value_type> vector_type;
+ typedef boost::numeric::ublas::vector_reference<vector_type> 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<value_type, boost::numeric::ublas::row_major> 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<major>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size1() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size1()) );
+
+    // size<minor>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size2()) );
+
+    // size<leading>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(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<value_type, boost::numeric::ublas::column_major> 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<major>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<major>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A)) << " ==> " << A.size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(A) == A.size2()) );
+
+    // size<minor>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A)) << " ==> " << A.size1() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(A) == A.size1()) );
+
+    // size<leading>(A)
+ BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(A)) << " ==> " << A.size1() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(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<value_type> 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<major>(A') [A is row-major => A' column-major, and viceversa]
+ BOOST_UBLAS_DEBUG_TRACE( "size<major>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A))) << " ==> " << A.size1() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(boost::numeric::ublas::trans(A)) == A.size1()) );
+
+    // size<minor>(A')  [A is row-major => A' column-major, and viceversa]
+ BOOST_UBLAS_DEBUG_TRACE( "size<minor>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(boost::numeric::ublas::trans(A)) == A.size2()) );
+
+    // size<leading>(A')  [A row-major => A' column-major, and viceversa]
+ BOOST_UBLAS_DEBUG_TRACE( "size<leading>(A') = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(boost::numeric::ublas::trans(A))) << " ==> " << A.size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(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<value_type> matrix_type;
+ typedef boost::numeric::ublas::matrix_reference<matrix_type> 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<major>(reference(A))
+ BOOST_UBLAS_DEBUG_TRACE( "size<major>(reference(A) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size1() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::major>(matrix_reference_type(A)) == matrix_reference_type(A).size1()) );
+
+    // size<minor>(reference(A))
+ BOOST_UBLAS_DEBUG_TRACE( "size<minor>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::minor>(matrix_reference_type(A)) == matrix_reference_type(A).size2()) );
+
+    // size<leading>(reference(A))
+ BOOST_UBLAS_DEBUG_TRACE( "size<leading>(reference(A)) = " << (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(matrix_reference_type(A))) << " ==> " << matrix_reference_type(A).size2() ); + BOOST_UBLAS_TEST_CHECK( (boost::numeric::ublas::size<boost::numeric::ublas::tag::leading>(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();
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test1.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,20 @@
+//
+//  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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test1.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,33 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_proxy.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+#include "common/init.hpp"
+
+void test_vector ();
+void test_matrix_vector ();
+void test_matrix ();
+
+
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test11.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,260 @@
+//
+//  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<class V, int N>
+struct test_my_vector {
+    typedef typename V::value_type value_type;
+    typedef typename V::size_type size_type;
+    typedef typename ublas::type_traits<value_type>::real_type real_type;
+
+    template<class VP>
+    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<class VP>
+    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<VP>::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<V> 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<V> 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<ublas::vector<float, ublas::bounded_array<float, 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_vector<ublas::vector<double, ublas::bounded_array<double, 3>
, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_vector<ublas::vector<float, ublas::unbounded_array<float> >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_vector<ublas::vector<double, ublas::unbounded_array<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_vector<ublas::vector<float, std::vector<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_vector<ublas::vector<double, std::vector<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_BOUNDED_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, bounded" << std::endl;
+    test_my_vector<ublas::bounded_vector<float, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded" << std::endl;
+    test_my_vector<ublas::bounded_vector<double, 3>, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded" << std::endl;
+    test_my_vector<ublas::bounded_vector<std::complex<float>, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded" << std::endl;
+ test_my_vector<ublas::bounded_vector<std::complex<double>, 3>, 3> () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test12.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,277 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, 0), mr2 (m1, 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 0), mc2 (m1, 1);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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::vector<float, ublas::bounded_array<float, 3> >, + ublas::matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 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::vector<float, ublas::unbounded_array<float> >, + ublas::matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::matrix<float, ublas::row_major, std::vector<float> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::matrix<double, ublas::row_major, std::vector<double> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3> () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_BOUNDED_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float, bounded" << std::endl;
+    test_my_matrix_vector<ublas::bounded_vector<float, 3>,
+                          ublas::bounded_matrix<float, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded" << std::endl;
+    test_my_matrix_vector<ublas::bounded_vector<double, 3>,
+                          ublas::bounded_matrix<double, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded" << std::endl;
+    test_my_matrix_vector<ublas::bounded_vector<std::complex<float>, 3>,
+ ublas::bounded_matrix<std::complex<float>, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded" << std::endl;
+    test_my_matrix_vector<ublas::bounded_vector<std::complex<double>, 3>,
+ ublas::bounded_matrix<std::complex<double>, 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<float, ublas::bounded_array<float, 3> >, + ublas::vector_of_vector<float, ublas::row_major, ublas::bounded_array<ublas::bounded_array<float, 3>, 3 + 1> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::vector_of_vector<double, ublas::row_major, ublas::bounded_array<ublas::bounded_array<double, 3>, 3 + 1> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::vector_of_vector<std::complex<float>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<std::complex<float>, 3>, 3 + 1>
, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::vector_of_vector<std::complex<double>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<std::complex<double>, 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<float, ublas::unbounded_array<float> >, + ublas::vector_of_vector<float, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::vector_of_vector<double, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<double> >
, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::vector_of_vector<std::complex<float>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<std::complex<float> > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::vector_of_vector<std::complex<double>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<std::complex<double> > > >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::vector_of_vector<float, ublas::row_major, std::vector<std::vector<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::vector_of_vector<double, ublas::row_major, std::vector<std::vector<double> > >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::vector_of_vector<std::complex<float>, ublas::row_major, std::vector<std::vector<std::complex<float> > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::vector_of_vector<std::complex<double>, ublas::row_major, std::vector<std::vector<std::complex<double> > > >, 3> () ();
+#endif
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test13.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,321 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class VP>
+    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<class MP>
+    void test_expression_with (MP &m1, MP &m2, MP &m3) const {
+        value_type t;
+
+        // Default Construct
+        default_construct<MP>::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<M> 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<M> 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<ublas::matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::matrix<float, ublas::row_major, std::vector<float> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::matrix<double, ublas::row_major, std::vector<double> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3> () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_BOUNDED_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float, bounded" << std::endl;
+    test_my_matrix<ublas::bounded_matrix<float, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded" << std::endl;
+    test_my_matrix<ublas::bounded_matrix<double, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded" << std::endl;
+ test_my_matrix<ublas::bounded_matrix<std::complex<float>, 3, 3>, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded" << std::endl;
+ test_my_matrix<ublas::bounded_matrix<std::complex<double>, 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<ublas::vector_of_vector<float, ublas::row_major, ublas::bounded_array<ublas::bounded_array<float, 3>, 3 + 1> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<double, ublas::row_major, ublas::bounded_array<ublas::bounded_array<double, 3>, 3 + 1> >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<float>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<std::complex<float>, 3>, 3 + 1>
, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<double>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<std::complex<double>, 3>, 3 + 1>
, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<float, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<double, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<double> > >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<float>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<std::complex<float> > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<double>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<std::complex<double> > > >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<float, ublas::row_major, std::vector<std::vector<float > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<double, ublas::row_major, std::vector<std::vector<double> > >, 3> () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<float>, ublas::row_major, std::vector<std::vector<std::complex<float> > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::vector_of_vector<std::complex<double>, ublas::row_major, std::vector<std::vector<std::complex<double> > > >, 3> () ();
+#endif
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test2.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,87 @@
+//
+//  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<ublas::vector<float>, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double" << std::endl;
+    test_blas_1<ublas::vector<double>, 3> ().test ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>" << std::endl;
+    test_blas_1<ublas::vector<std::complex<float> >, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>" << std::endl;
+    test_blas_1<ublas::vector<std::complex<double> >, 3> ().test ();
+#endif
+#endif
+
+    std::cout << "test_blas_2" << std::endl;
+
+#ifdef USE_FLOAT
+    std::cout << "float" << std::endl;
+    test_blas_2<ublas::vector<float>, ublas::matrix<float>, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double" << std::endl;
+ test_blas_2<ublas::vector<double>, ublas::matrix<double>, 3> ().test ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>" << std::endl;
+ test_blas_2<ublas::vector<std::complex<float> >, ublas::matrix<std::complex<float> >, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>" << std::endl;
+ test_blas_2<ublas::vector<std::complex<double> >, ublas::matrix<std::complex<double> >, 3> ().test ();
+#endif
+#endif
+
+    std::cout << "test_blas_3" << std::endl;
+
+#ifdef USE_FLOAT
+    std::cout << "float" << std::endl;
+    test_blas_3<ublas::matrix<float>, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double" << std::endl;
+    test_blas_3<ublas::matrix<double>, 3> ().test ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>" << std::endl;
+    test_blas_3<ublas::matrix<std::complex<float> >, 3> ().test ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>" << std::endl;
+    test_blas_3<ublas::matrix<std::complex<double> >, 3> ().test ();
+#endif
+#endif
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test2.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,51 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/triangular.hpp>
+#include <boost/numeric/ublas/io.hpp>
+#include <boost/numeric/ublas/blas.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+#include "common/init.hpp"
+
+template<class V, int N>
+struct test_blas_1 {
+    typedef typename V::value_type value_type;
+    typedef typename ublas::type_traits<value_type>::real_type real_type;
+
+    void test ();
+};
+
+template<class V, class M, int N>
+struct test_blas_2 {
+    typedef typename V::value_type value_type;
+
+    void test ();
+};
+
+template<class M, int N>
+struct test_blas_3 {
+    typedef typename M::value_type value_type;
+
+    void test ();
+};
+
+
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test21.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,95 @@
+//
+//  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<class V, int N>
+void test_blas_1<V, N>::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<ublas::vector<float>, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_1<ublas::vector<double>, 3>;
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+template struct test_blas_1<ublas::vector<std::complex<float> >, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_1<ublas::vector<std::complex<double> >, 3>;
+#endif
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test22.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,147 @@
+//
+//  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<class V, class M, int N>
+void test_blas_2<V, M, N>::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::vector<float>, ublas::matrix<float>, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_2<ublas::vector<double>, ublas::matrix<double>, 3>;
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+template struct test_blas_2<ublas::vector<std::complex<float> >, ublas::matrix<std::complex<float> >, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_2<ublas::vector<std::complex<double> >, ublas::matrix<std::complex<double> >, 3>;
+#endif
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test23.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,208 @@
+//
+//  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<class M, int N>
+void test_blas_3<M, N>::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<ublas::matrix<float>, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_3<ublas::matrix<double>, 3>;
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+template struct test_blas_3<ublas::matrix<std::complex<float> >, 3>;
+#endif
+
+#ifdef USE_DOUBLE
+template struct test_blas_3<ublas::matrix<std::complex<double> >, 3>;
+#endif
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test3.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,20 @@
+//
+//  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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test3.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,38 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_proxy.hpp>
+#include <boost/numeric/ublas/vector_sparse.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/matrix_sparse.hpp>
+#include <boost/numeric/ublas/vector_sparse.hpp>
+#ifdef USE_GENERALIZED_VECTOR_OF_VECTOR
+#include <boost/numeric/ublas/vector_of_vector.hpp>
+#endif
+#include <boost/numeric/ublas/io.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+#include "common/init.hpp"
+
+void test_vector ();
+void test_matrix_vector ();
+void test_matrix ();
+
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test31.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,248 @@
+//
+//  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<class V, int N>
+struct test_my_vector {
+    typedef typename V::value_type value_type;
+    typedef typename V::size_type size_type;
+    typedef typename ublas::type_traits<value_type>::real_type real_type;
+
+    template<class VP>
+    void test_with (VP &v1, VP &v2, VP &v3) const {
+        {
+            value_type t;
+            size_type i;
+            real_type n;
+
+            // Default Construct
+            default_construct<VP>::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<V> 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<V> 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<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, map_array" << std::endl;
+ test_my_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, map_array" << std::endl;
+ test_my_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, map_array" << std::endl;
+ test_my_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_MAP
+#ifdef USE_FLOAT
+    std::cout << "float, std::map" << std::endl;
+ test_my_vector<ublas::mapped_vector<float, std::map<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::map" << std::endl;
+ test_my_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::map" << std::endl;
+ test_my_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::map" << std::endl;
+ test_my_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > > , 3 > () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_COMPRESSED_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float compressed" << std::endl;
+    test_my_vector<ublas::compressed_vector<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double compressed" << std::endl;
+    test_my_vector<ublas::compressed_vector<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> compressed" << std::endl;
+ test_my_vector<ublas::compressed_vector<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> compressed" << std::endl;
+ test_my_vector<ublas::compressed_vector<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_COORDINATE_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float coordinate" << std::endl;
+    test_my_vector<ublas::coordinate_vector<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double coordinate" << std::endl;
+    test_my_vector<ublas::coordinate_vector<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> coordinate" << std::endl;
+ test_my_vector<ublas::coordinate_vector<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> coordinate" << std::endl;
+ test_my_vector<ublas::coordinate_vector<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test32.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,324 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, 0), mr2 (m1, N - 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 0), mc2 (m1, N - 1);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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_vector<float, ublas::map_array<std::size_t, float> >, + ublas::mapped_matrix<float, ublas::row_major, ublas::map_array<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, map_array" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, + ublas::mapped_matrix<double, ublas::row_major, ublas::map_array<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, map_array" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, + ublas::mapped_matrix<std::complex<float>, ublas::row_major, ublas::map_array<std::size_t, std::complex<float> > >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, map_array" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, + ublas::mapped_matrix<std::complex<double>, ublas::row_major, ublas::map_array<std::size_t, std::complex<double> > >, 3
() ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_MAP
+#ifdef USE_FLOAT
+    std::cout << "float, std::map" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<float, std::map<std::size_t, float> >, + ublas::mapped_matrix<float, ublas::row_major, std::map<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::map" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, + ublas::mapped_matrix<double, ublas::row_major, std::map<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::map" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, + ublas::mapped_matrix<std::complex<float>, ublas::row_major, std::map<std::size_t, std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::map" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, + ublas::mapped_matrix<std::complex<double>, ublas::row_major, std::map<std::size_t, std::complex<double> > >, 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<float, ublas::map_array<std::size_t, float> >, + ublas::mapped_vector<float, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, mapped_vector map_array" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, + ublas::mapped_vector<double, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, double> > >, 3
() ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_vector map_array" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, + ublas::mapped_vector<std::complex<float>, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, std::complex<float> > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>,mapped_vector map_array" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, + ublas::mapped_vector<std::complex<double>, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, std::complex<double> > > >, 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<float, std::map<std::size_t, float> >, + ublas::mapped_vector<float, ublas::row_major, std::map<std::size_t, std::map<std::size_t, float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, mapped_vector std::map" << std::endl;
+ test_my_matrix_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, + ublas::mapped_vector<double, ublas::row_major, std::map<std::size_t, std::map<std::size_t, double> > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_vector std::map" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, + ublas::mapped_vector<std::complex<float>, ublas::row_major, std::map<std::size_t, std::map<std::size_t, std::complex<float> > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, mapped_vector std::map" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, + ublas::mapped_vector<std::complex<double>, ublas::row_major, std::map<std::size_t, std::map<std::size_t, std::complex<double> > > >, 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::mapped_vector<float, ublas::map_array<std::size_t, float> >, + ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::vector<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> >, + ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> >, ublas::map_array<std::size_t, ublas::mapped_vector<float, ublas::map_array<std::size_t, float> > > > >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, + ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, + ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, ublas::map_array<std::size_t, ublas::mapped_vector<double, ublas::map_array<std::size_t, double> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, + ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, + ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, ublas::map_array<std::size_t, ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, + ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, + ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, ublas::map_array<std::size_t, ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > > > > >, 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::mapped_vector<float, std::map<std::size_t, float> >, + ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::vector<ublas::mapped_vector<float, std::map<std::size_t, float> > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<float, std::map<std::size_t, float> >, + ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<float, std::map<std::size_t, float> >, std::map<std::size_t, ublas::mapped_vector<float, std::map<std::size_t, float> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, + ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::vector<ublas::mapped_vector<double, std::map<std::size_t, double> > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, + ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, std::map<std::size_t, ublas::mapped_vector<double, std::map<std::size_t, double> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, + ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, + ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, std::map<std::size_t, ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, + ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > > > >, 3 > () (); + test_my_matrix_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, + ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, std::map<std::size_t, ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > > > > >, 3 > () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_COMPRESSED_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float compressed" << std::endl;
+    test_my_matrix_vector<ublas::compressed_vector<float>,
+                          ublas::compressed_matrix<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double compressed" << std::endl;
+    test_my_matrix_vector<ublas::compressed_vector<double>,
+                          ublas::compressed_matrix<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> compressed" << std::endl;
+    test_my_matrix_vector<ublas::compressed_vector<std::complex<float> >,
+ ublas::compressed_matrix<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> compressed" << std::endl;
+    test_my_matrix_vector<ublas::compressed_vector<std::complex<double> >,
+ ublas::compressed_matrix<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_COORDINATE_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float coordinate" << std::endl;
+    test_my_matrix_vector<ublas::coordinate_vector<float>,
+                          ublas::coordinate_matrix<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double coordinate" << std::endl;
+    test_my_matrix_vector<ublas::coordinate_vector<double>,
+                          ublas::coordinate_matrix<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> coordinate" << std::endl;
+    test_my_matrix_vector<ublas::coordinate_vector<std::complex<float> >,
+ ublas::coordinate_matrix<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> coordinate" << std::endl;
+    test_my_matrix_vector<ublas::coordinate_vector<std::complex<double> >,
+ ublas::coordinate_matrix<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test33.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,347 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class MP>
+    void test_with (MP &m1, MP &m2, MP &m3) const {
+        {
+            value_type t;
+
+            // Default Construct
+            default_construct<MP>::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<M> 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<M> 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<ublas::mapped_matrix<float, ublas::row_major, ublas::map_array<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, mapped_matrix map_array" << std::endl;
+ test_my_matrix<ublas::mapped_matrix<double, ublas::row_major, ublas::map_array<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_matrix map_array" << std::endl; + test_my_matrix<ublas::mapped_matrix<std::complex<float>, ublas::row_major, ublas::map_array<std::size_t, std::complex<float> > >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, mapped_matrix map_array" << std::endl; + test_my_matrix<ublas::mapped_matrix<std::complex<double>, ublas::row_major, ublas::map_array<std::size_t, std::complex<double> > >, 3
() ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_MAP
+#ifdef USE_FLOAT
+    std::cout << "float, mapped_matrix std::map" << std::endl;
+ test_my_matrix<ublas::mapped_matrix<float, ublas::row_major, std::map<std::size_t, float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, mapped_matrix std::map" << std::endl;
+ test_my_matrix<ublas::mapped_matrix<double, ublas::row_major, std::map<std::size_t, double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_matrix std::map" << std::endl; + test_my_matrix<ublas::mapped_matrix<std::complex<float>, ublas::row_major, std::map<std::size_t, std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, mapped_matrix std::map" << std::endl; + test_my_matrix<ublas::mapped_matrix<std::complex<double>, ublas::row_major, std::map<std::size_t, std::complex<double> > >, 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<ublas::mapped_vector_of_mapped_vector<float, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, mapped_vector_of_mapped_vector map_array" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<double, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, double> > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_vector_of_mapped_vector map_array" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<float>, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, std::complex<float> > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, mapped_vector_of_mapped_vectormap_array" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<double>, ublas::row_major, ublas::map_array<std::size_t, ublas::map_array<std::size_t, std::complex<double> > > >, 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<ublas::mapped_vector_of_mapped_vector<float, ublas::row_major, std::map<std::size_t, std::map<std::size_t, float> > >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, mapped_vector_of_mapped_vector std::map" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<double, ublas::row_major, std::map<std::size_t, std::map<std::size_t, double> > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, mapped_vector_of_mapped_vector std::map" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<float>, ublas::row_major, std::map<std::size_t, std::map<std::size_t, std::complex<float> > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, mapped_vector_of_mapped_vector std::map" << std::endl; + test_my_matrix<ublas::mapped_vector_of_mapped_vector<std::complex<double>, ublas::row_major, std::map<std::size_t, std::map<std::size_t, std::complex<double> > > >, 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<ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::vector<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<float, ublas::map_array<std::size_t, float> >, ublas::map_array<std::size_t, ublas::mapped_vector<float, ublas::map_array<std::size_t, float> > > > >, 3
() ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<double, ublas::map_array<std::size_t, double> >, ublas::map_array<std::size_t, ublas::mapped_vector<double, ublas::map_array<std::size_t, double> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > >, ublas::map_array<std::size_t, ublas::mapped_vector<std::complex<float>, ublas::map_array<std::size_t, std::complex<float> > > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, generalized_vector_of_vector map_array" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > >, ublas::map_array<std::size_t, ublas::mapped_vector<std::complex<double>, ublas::map_array<std::size_t, std::complex<double> > > > > >, 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<ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::vector<ublas::mapped_vector<float, std::map<std::size_t, float> > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<float, std::map<std::size_t, float> >, std::map<std::size_t, ublas::mapped_vector<float, std::map<std::size_t, float> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "double, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::vector<ublas::mapped_vector<double, std::map<std::size_t, double> > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<double, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<double, std::map<std::size_t, double> >, std::map<std::size_t, ublas::mapped_vector<double, std::map<std::size_t, double> > > > >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+ std::cout << "std::complex<float>, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<float>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > >, std::map<std::size_t, ublas::mapped_vector<std::complex<float>, std::map<std::size_t, std::complex<float> > > > > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "std::complex<double>, generalized_vector_of_vector std::map" << std::endl; + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > > > >, 3 > () (); + test_my_matrix<ublas::generalized_vector_of_vector<std::complex<double>, ublas::row_major, ublas::mapped_vector<ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > >, std::map<std::size_t, ublas::mapped_vector<std::complex<double>, std::map<std::size_t, std::complex<double> > > > > >, 3 > () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_COMPRESSED_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float compressed_matrix" << std::endl;
+    test_my_matrix<ublas::compressed_matrix<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double compressed_matrix" << std::endl;
+    test_my_matrix<ublas::compressed_matrix<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> compressed_matrix" << std::endl;
+ test_my_matrix<ublas::compressed_matrix<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> compressed_matrix" << std::endl;
+ test_my_matrix<ublas::compressed_matrix<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_COORDINATE_MATRIX
+#ifdef USE_FLOAT
+    std::cout << "float coordinate_matrix" << std::endl;
+    test_my_matrix<ublas::coordinate_matrix<float>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double coordinate_matrix" << std::endl;
+    test_my_matrix<ublas::coordinate_matrix<double>, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float> coordinate_matrix" << std::endl;
+ test_my_matrix<ublas::coordinate_matrix<std::complex<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double> coordinate_matrix" << std::endl;
+ test_my_matrix<ublas::coordinate_matrix<std::complex<double> >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test4.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,19 @@
+//
+//  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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test4.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,39 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/banded.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+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
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test42.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,361 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, 1), mr2 (m1, 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 1), mc2 (m1, 1);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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<M> bam1 (m1, 1, 1);
+            test_with (v1, v2, bam1);
+
+ ublas::matrix_row<ublas::banded_adaptor<M> > mr1 (bam1, 1), mr2 (bam1, 1);
+            test_with (mr1, mr2, bam1);
+
+ ublas::matrix_column<ublas::banded_adaptor<M> > mc1 (bam1, 1), mc2 (bam1, 1);
+            test_with (mc1, mc2, bam1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<ublas::banded_adaptor<M> > 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<ublas::banded_adaptor<M> > 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<M> dam1 (m1);
+            test_with (v1, v2, dam1);
+
+ ublas::matrix_row<ublas::diagonal_adaptor<M> > mr1 (dam1, 1), mr2 (dam1, 1);
+            test_with (mr1, mr2, dam1);
+
+ ublas::matrix_column<ublas::diagonal_adaptor<M> > mc1 (dam1, 1), mc2 (dam1, 1);
+            test_with (mc1, mc2, dam1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<ublas::diagonal_adaptor<M> > 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<ublas::diagonal_adaptor<M> > 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::vector<float, ublas::bounded_array<float, 3> >, + ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::bounded_array<float, 3> >, + ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 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::vector<float, ublas::unbounded_array<float> >, + ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::unbounded_array<float> >, + ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () (0);
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 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::vector<float, ublas::bounded_array<float, 3> >, + ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::bounded_array<float, 3> >, + ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 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::vector<float, ublas::unbounded_array<float> >, + ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::unbounded_array<float> >, + ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3> () (0);
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3> () (0);
+#endif
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test43.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,326 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class MP>
+    void test_with (MP &m1, MP &m2, MP &m3) const {
+        {
+            value_type t;
+
+            // Default Construct
+            default_construct<MP>::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<M> 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<M> 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<M> bam1 (m1, 1, 1), bam2 (m2, 1, 1), bam3 (m3, 1, 1);
+            test_with (bam1, bam2, bam3);
+
+#ifdef USE_RANGE
+ ublas::matrix_range<ublas::banded_adaptor<M> > 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<ublas::banded_adaptor<M> > 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<M> dam1 (m1), dam2 (m2), dam3 (m3);
+            test_with (dam1, dam2, dam3);
+
+#ifdef USE_RANGE
+ ublas::matrix_range<ublas::diagonal_adaptor<M> > 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<ublas::diagonal_adaptor<M> > 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<ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+#endif
+
+#ifdef USE_DIAGONAL
+#ifdef USE_BOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, bounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test5.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,19 @@
+//
+//  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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test5.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,35 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/triangular.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+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
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test52.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,214 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, N - 1), mr2 (m1, N - 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 0), mc2 (m1, 0);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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<M> tam1 (m1);
+            test_with (v1, v2, tam1);
+
+ ublas::matrix_row<ublas::triangular_adaptor<M> > mr1 (tam1, N - 1), mr2 (tam1, N - 1);
+            test_with (mr1, mr2, tam1);
+
+ ublas::matrix_column<ublas::triangular_adaptor<M> > mc1 (tam1, 0), mc2 (tam1, 0);
+            test_with (mc1, mc2, tam1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<ublas::triangular_adaptor<M> > 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<ublas::triangular_adaptor<M> > 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::vector<float, ublas::bounded_array<float, 3> >, + ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::bounded_array<float, 3> >, + ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 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::vector<float, ublas::unbounded_array<float> >, + ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::unbounded_array<float> >, + ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3> () ();
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3> () ();
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3> () (0);
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::triangular_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::triangular_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::triangular_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::triangular_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3> () (0);
+
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3> () (0);
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test53.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,223 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class MP>
+    void test_with (MP &m1, MP &m2, MP &m3) const {
+        {
+            value_type t;
+
+            // Default Construct
+            default_construct<MP>::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<M> 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<M> 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<M> tam1 (m1), tam2 (m2), tam3 (m3);
+            test_with (tam1, tam2, tam3);
+
+#ifdef USE_RANGE
+ ublas::matrix_range<ublas::triangular_adaptor<M> > 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<ublas::triangular_adaptor<M> > 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<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::triangular_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test6.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,19 @@
+//
+//  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;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test6.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,32 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/symmetric.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+#include "common/init.hpp"
+
+void test_matrix_vector ();
+void test_matrix ();
+
+
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test62.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,218 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, N - 1), mr2 (m1, N - 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 0), mc2 (m1, 0);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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<M> tam1 (m1);
+            test_with (v1, v2, tam1);
+
+ ublas::matrix_row<ublas::symmetric_adaptor<M> > mr1 (tam1, N - 1), mr2 (tam1, N - 1);
+            test_with (mr1, mr2, tam1);
+
+ ublas::matrix_column<ublas::symmetric_adaptor<M> > mc1 (tam1, 0), mc2 (tam1, 0);
+            test_with (mc1, mc2, tam1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<ublas::symmetric_adaptor<M> > 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<ublas::symmetric_adaptor<M> > 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::vector<float, ublas::bounded_array<float, 3> >, + ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::bounded_array<float, 3> >, + ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::bounded_array<double, 3> >, + ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::bounded_array<std::complex<float>, 3> >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::bounded_array<std::complex<double>, 3> >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 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::vector<float, ublas::unbounded_array<float> >, + ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3> () (); + test_my_matrix_vector<ublas::vector<float, ublas::unbounded_array<float> >, + ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3> () (); + test_my_matrix_vector<ublas::vector<double, ublas::unbounded_array<double> >, + ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3> () ();
+ test_my_matrix_vector<ublas::vector<std::complex<float>, ublas::unbounded_array<std::complex<float> > >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3> () ();
+ test_my_matrix_vector<ublas::vector<std::complex<double>, ublas::unbounded_array<std::complex<double> > >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3> () (0);
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<float, std::vector<float> >,
+ ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3> () ();
+    test_my_matrix_vector<ublas::vector<double, std::vector<double> >,
+ ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3> () (0);
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<float>, std::vector<std::complex<float> > >, + ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3> () (0);
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3> () (); + test_my_matrix_vector<ublas::vector<std::complex<double>, std::vector<std::complex<double> > >, + ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3> () (0);
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test63.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,223 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class MP>
+    void test_with (MP &m1, MP &m2, MP &m3) const {
+        {
+            value_type t;
+
+            // Default Construct
+            default_construct<MP>::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<M> 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<M> 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<M> sam1 (m1), sam2 (m2), sam3 (m3);
+            test_with (sam1, sam2, sam3);
+
+#ifdef USE_RANGE
+ ublas::matrix_range<ublas::symmetric_adaptor<M> > 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<ublas::symmetric_adaptor<M> > 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<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, bounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, bounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, bounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+    std::cout << "float, unbounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, unbounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<float>
>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, unbounded_array" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, ublas::unbounded_array<std::complex<double>
>, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+    std::cout << "float, std::vector" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<float, ublas::lower, ublas::row_major, std::vector<float> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "double, std::vector" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<double, ublas::lower, ublas::row_major, std::vector<double> >, 3 > () ();
+#endif
+
+#ifdef USE_STD_COMPLEX
+#ifdef USE_FLOAT
+    std::cout << "std::complex<float>, std::vector" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<float>, ublas::lower, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+    std::cout << "std::complex<double>, std::vector" << std::endl;
+ test_my_matrix<ublas::symmetric_matrix<std::complex<double>, ublas::lower, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test7.cpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,31 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/interval.hpp>
+#include <boost/numeric/interval/io.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+#include "test7.hpp"
+
+// this testcase requires fix of task #2473
+
+int main () {
+    test_vector ();
+    test_matrix_vector ();
+    test_matrix ();
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test7.hpp    Sat May 29 07:51:36 2010
@@ -0,0 +1,36 @@
+//
+//  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 <iostream>
+
+#include <boost/numeric/interval.hpp>
+#include <boost/numeric/interval/io.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_proxy.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+#include "common/init.hpp"
+
+void test_vector ();
+void test_matrix_vector ();
+void test_matrix ();
+
+
+#endif
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test71.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,170 @@
+//  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<class V, int N>
+struct test_my_vector {
+    typedef typename V::value_type value_type;
+    typedef typename V::size_type size_type;
+    typedef typename ublas::type_traits<value_type>::real_type real_type;
+
+    template<class VP>
+    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<value_type> (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<V> 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<V> 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<float>, bounded_array" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<float>, ublas::bounded_array<boost::numeric::interval<float>, 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, bounded_array" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<double>, ublas::bounded_array<boost::numeric::interval<double>, 3> >, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, unbounded_array" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<float>, ublas::unbounded_array<boost::numeric::interval<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, unbounded_array" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<double>, ublas::unbounded_array<boost::numeric::interval<double> > >, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, std::vector" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<float>, std::vector<boost::numeric::interval<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, std::vector" << std::endl; + test_my_vector<ublas::vector<boost::numeric::interval<double>, std::vector<boost::numeric::interval<double> > >, 3 > () ();
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test72.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,165 @@
+//
+//  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<class V, class M, int N>
+struct test_my_matrix_vector {
+    typedef typename V::value_type value_type;
+
+    template<class VP, class MP>
+    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<M> mr1 (m1, 0), mr2 (m1, 1);
+            test_with (mr1, mr2, m1);
+
+            ublas::matrix_column<M> mc1 (m1, 0), mc2 (m1, 1);
+            test_with (mc1, mc2, m1);
+
+#ifdef USE_RANGE
+ ublas::matrix_vector_range<M> 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<M> 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<float>, bounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, ublas::bounded_array<boost::numeric::interval<float>, 3> >, + ublas::matrix<boost::numeric::interval<float>, ublas::row_major, ublas::bounded_array<boost::numeric::interval<float>, 3 * 3> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, bounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, ublas::bounded_array<boost::numeric::interval<double>, 3> >, + ublas::matrix<boost::numeric::interval<double>, ublas::row_major, ublas::bounded_array<boost::numeric::interval<double>, 3 * 3> >, 3> () ();
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, unbounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, ublas::unbounded_array<boost::numeric::interval<float> > >, + ublas::matrix<boost::numeric::interval<float>, ublas::row_major, ublas::unbounded_array<boost::numeric::interval<float> >
, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, unbounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, ublas::unbounded_array<boost::numeric::interval<double> > >, + ublas::matrix<boost::numeric::interval<double>, ublas::row_major, ublas::unbounded_array<boost::numeric::interval<double> >
, 3> () ();
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, std::vector" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, std::vector<boost::numeric::interval<float> > >, + ublas::matrix<boost::numeric::interval<float>, ublas::row_major, std::vector<boost::numeric::interval<float> > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, std::vector" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, std::vector<boost::numeric::interval<double> > >, + ublas::matrix<boost::numeric::interval<double>, ublas::row_major, std::vector<boost::numeric::interval<double> > >, 3> () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_VECTOR_OF_VECTOR
+#ifdef USE_BOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, bounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, ublas::bounded_array<boost::numeric::interval<float>, 3> >, + ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<boost::numeric::interval<float>, 3>, 3 + 1> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, bounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, ublas::bounded_array<boost::numeric::interval<double>, 3> >, + ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<boost::numeric::interval<double>, 3>, 3 + 1> >, 3> () ();
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, unbounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, ublas::unbounded_array<boost::numeric::interval<float> > >, + ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<boost::numeric::interval<float>
> >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, unbounded_array" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, ublas::unbounded_array<boost::numeric::interval<double> > >, + ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<boost::numeric::interval<double>
> >, 3> () ();
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, std::vector" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<float>, std::vector<boost::numeric::interval<float> > >, + ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, std::vector<std::vector<boost::numeric::interval<float> > > >, 3> () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, std::vector" << std::endl; + test_my_matrix_vector<ublas::vector<boost::numeric::interval<double>, std::vector<boost::numeric::interval<double> > >, + ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, std::vector<std::vector<boost::numeric::interval<double> > > >, 3> () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test73.cpp   Sat May 29 07:51:36 2010
@@ -0,0 +1,202 @@
+//
+//  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<class M, int N>
+struct test_my_matrix {
+    typedef typename M::value_type value_type;
+
+    template<class MP>
+    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<value_type> (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<M> 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<M> 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<float>, bounded_array" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<float>, ublas::row_major, ublas::bounded_array<boost::numeric::interval<float>, 3 * 3> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, bounded_array" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<double>, ublas::row_major, ublas::bounded_array<boost::numeric::interval<double>, 3 * 3> >, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, unbounded_array" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<float>, ublas::row_major, ublas::unbounded_array<boost::numeric::interval<float> >
, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, unbounded_array" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<double>, ublas::row_major, ublas::unbounded_array<boost::numeric::interval<double> >
, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, std::vector" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<float>, ublas::row_major, std::vector<boost::numeric::interval<float> > >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, std::vector" << std::endl; + test_my_matrix<ublas::matrix<boost::numeric::interval<double>, ublas::row_major, std::vector<boost::numeric::interval<double> > >, 3 > () ();
+#endif
+#endif
+#endif
+
+#ifdef USE_VECTOR_OF_VECTOR
+#ifdef USE_BOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, bounded_array" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<boost::numeric::interval<float>, 3>, 3 + 1> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, bounded_array" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, ublas::bounded_array<ublas::bounded_array<boost::numeric::interval<double>, 3>, 3 + 1> >, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_UNBOUNDED_ARRAY
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, unbounded_array" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<boost::numeric::interval<float>
> >, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, unbounded_array" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, ublas::unbounded_array<ublas::unbounded_array<boost::numeric::interval<double>
> >, 3 > () ();
+#endif
+#endif
+
+#ifdef USE_STD_VECTOR
+#ifdef USE_FLOAT
+ std::cout << "boost::numeric::interval<float>, std::vector" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<float>, ublas::row_major, std::vector<std::vector<boost::numeric::interval<float> >
>, 3 > () ();
+#endif
+
+#ifdef USE_DOUBLE
+ std::cout << "boost::numeric::interval<double>, std::vector" << std::endl; + test_my_matrix<ublas::vector_of_vector<boost::numeric::interval<double>, ublas::row_major, std::vector<std::vector<boost::numeric::interval<double>
> >, 3 > () ();
+#endif
+#endif
+#endif
+}
=======================================
--- /dev/null
+++ /trunk/libs/numeric/ublas/test/test_complex_norms.cpp Sat May 29 07:51:36 2010
@@ -0,0 +1,82 @@
+// Copyright 2010 Gunter Winkler <guwi17@xxxxxx>
+// 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 <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/io.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <complex>
+
+#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<double> dComplex;
+    vector<dComplex> 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<double> dComplex;
+    vector<dComplex> 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<float> dComplex;
+    vector<dComplex> 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<float> dComplex;
+    vector<dComplex> 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();
+}
=======================================
***Additional files exist in this changeset.***

Other related posts:

  • » [boost-doc-zh] r402 committed - 升级至1.43.0,第4批,libs/目录n-q子目录 - boost-doc-zh