|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60734 - in sandbox/numeric_bindings/boost/numeric/bindings/traits: . detail
From: thomas.klimpel_at_[hidden]
Date: 2010-03-20 08:56:22
Author: klimpel
Date: 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
New Revision: 60734
URL: http://svn.boost.org/trac/boost/changeset/60734
Log:
removed unused files from bindings/traits
Removed:
sandbox/numeric_bindings/boost/numeric/bindings/traits/algorithm.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/boost_array.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array2.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/dense_traits.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array_impl.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/dense_ordering.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/generate_const.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/symm_herm_traits.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_ordering.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_uplo.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/fortran.h
sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_matrix.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_vector.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/is_complex.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/is_numeric.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/is_real.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_raw.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_traits.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/sparse_traits.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray2.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector2.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/symm_herm_raw.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/tnt.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/traits.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/transpose.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_banded.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_hermitian.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_matrix.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_sparse.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_storage.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_symmetric.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector2.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_raw.hpp
sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_traits.hpp
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/algorithm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/algorithm.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,29 +0,0 @@
-#ifndef boost_numeric_bindings_traits_algorithm_hpp
-#define boost_numeric_bindings_traits_algorithm_hpp
-
-#include <boost/numeric/bindings/traits/type_traits.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- ///
- /// To be used instead of operator== for numeric types
- /// Implemented as functor instead of free function because of specialisation
- /// rationale: operator== on builtin types can not be overloaded.
-
- template < typename T >
- struct is_equal
- {
- is_equal(typename type_traits< T >::real_type tolerance) : tolerance_( tolerance ) {}
-
- bool operator()(const T& a, const T& b)
- { return std::abs( a - b ) < tolerance_ ; }
-
- // bool operator()(const T& a, const T& b, typename value_traits< T >::value_type tolerance)
- // { return std::abs( a - b ) < tolerance ; }
-
- typename type_traits< T >::real_type tolerance_ ;
- } ;
-
-}}}}
-
-#endif // boost_numeric_bindings_traits_algorithm_hpp
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/boost_array.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/boost_array.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_BOOST_ARRAY_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_BOOST_ARRAY_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-#include <boost/array.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // boost::array
- template <typename T, std::size_t N, typename V>
- struct vector_detail_traits< boost::array< T, N>, V >:
- public default_vector_traits< V, T > {};
-
-}}}}
-
-#else
-
-#error with your compiler boost::array<> cannot be used in bindings
-
-#endif
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // built-in array
- template <typename T, std::size_t N, typename V>
- struct vector_detail_traits<T[N], V> {
-
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<T[N], typename boost::remove_const<V>::type>::value)
- );
-#endif
-
- typedef T identifier_type [N]; // C++ syntax is amazing ;o)
- typedef V vector_type;
- typedef T value_type;
- typedef typename detail::generate_const<V, T>::type* pointer;
-
- static pointer storage (vector_type& v) { return v; }
- static int size (vector_type&) { return N; }
- static int stride (vector_type&) { return 1; }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler plain C array cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/c_array2.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- * Copyright (c) 2008 Markus Rickert
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY2_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY2_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/c_array.hpp>
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // built-in array as matrix (nx1)
- template <typename T, std::size_t N, typename V>
- struct matrix_detail_traits<T[N], V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- T[N],
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef T identifier_type [N];
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (matrix_type& v) {
- return vector_traits<matrix_type>::storage (v);
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return N; }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return N; }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return N; }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler plain C array cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_C_ARRAY2_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/dense_traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/dense_traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,42 +0,0 @@
-//
-// Copyright Markus Rickert 2008
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_DENSE_TRAITS_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DENSE_TRAITS_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-#include <boost/numeric/bindings/traits/detail/dense_ordering.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- template <typename M>
- inline
- std::ptrdiff_t
- dense_matrix_stride1 (M& m) {
- return detail::dense_ordering< typename matrix_traits<M>::ordering_type >::stride1 (m);
- }
- template <typename M>
- inline
- std::ptrdiff_t
- dense_matrix_stride2 (M& m) {
- return detail::dense_ordering< typename matrix_traits<M>::ordering_type >::stride2 (m);
- }
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler dense matrices cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_DENSE_TRAITS_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2003
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_ARRAY_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_ARRAY_HPP
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/detail/array_impl.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- template <typename T>
- struct vector_traits<detail::array<T> > {
- typedef T value_type;
- typedef std::ptrdiff_t size_type;
- typedef T* pointer;
-
- static pointer storage (detail::array<T>& a) { return a.storage(); }
- static size_type size (detail::array<T>& a) { return a.size(); }
- };
-
-} namespace detail {
-
- template< typename T, typename Id, typename Enable >
- struct adaptor< traits::detail::array< T >, Id, Enable > {
- typedef typename copy_const< Id, T >::type value_type;
- typedef mpl::map<
- mpl::pair< tag::value_type, value_type >,
- mpl::pair< tag::entity, tag::vector >,
- mpl::pair< tag::size_type<1>, std::ptrdiff_t >,
- mpl::pair< tag::data_structure, tag::linear_array >,
- mpl::pair< tag::stride_type<1>, tag::contiguous >
- > property_map;
-
- static std::ptrdiff_t size1( const Id& t ) {
- return t.size();
- }
-
- static value_type* begin_value( Id& t ) {
- return t.storage();
- }
-
- static value_type* end_value( Id& t ) {
- return t.storage() + t.size();
- }
-};
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_ARRAY_HPP
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array_impl.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/array_impl.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2003
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_ARRAY_IMPL_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_ARRAY_IMPL_HPP
-
-/*
- very simple dynamic array class which is used in `higher level'
- bindings functions for pivot and work arrays
-
- Namely, there are (at least) two versions of all bindings functions
- where called LAPACK function expects work and/or pivot array, e.g.
-
- `lower' level (user should provide work and pivot arrays):
- int sysv (SymmA& a, IVec& i, MatrB& b, Work& w);
-
- `higher' level (with `internal' work and pivot arrays):
- int sysv (SymmA& a, MatrB& b);
-
- Probably you ask why I didn't use std::vector. There are two reasons.
- First is efficiency -- std::vector's constructor initialises vector
- elements. Second is consistency. LAPACK functions use `info' parameter
- as an error indicator. On the other hand, std::vector's allocator can
- throw an exception if memory allocation fails. detail::array's
- constructor uses `new (nothrow)' which returns 0 if allocation fails.
- So I can check whether array::storage == 0 and return appropriate error
- in `info'.
- */
-
-#include <new>
-#include <boost/noncopyable.hpp>
-
-namespace boost { namespace numeric { namespace bindings {
-
- namespace traits { namespace detail {
-
- template <typename T>
- class array : private noncopyable {
- public:
- typedef std::ptrdiff_t size_type ;
-
- array (size_type n) {
- stg = new (std::nothrow) T[n];
- sz = (stg != 0) ? n : 0;
- }
- ~array() { delete[] stg; }
-
- size_type size() const { return sz; }
- bool valid() const { return stg != 0; }
- void resize (int n) {
- delete[] stg;
- stg = new (std::nothrow) T[n];
- sz = (stg != 0) ? n : 0;
- }
-
- T* storage() { return stg; }
- T const* storage() const { return stg; }
-
- T& operator[] (int i) { return stg[i]; }
- T const& operator[] (int i) const { return stg[i]; }
-
- private:
- size_type sz;
- T* stg;
- };
-
- }}
-
-}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/dense_ordering.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/dense_ordering.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,55 +0,0 @@
-//
-// Copyright Markus Rickert 2008
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_DENSE_ORDERING_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_DENSE_ORDERING_H
-
-#include <boost/numeric/ublas/fwd.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace detail {
-
- template <typename StOrdTag>
- struct dense_ordering {};
-
- template<>
- struct dense_ordering<row_major_t> {
- typedef row_major_t type;
-
- template <typename M>
- static std::ptrdiff_t stride1( M const& m ) {
- return leading_dimension (m) ;
- }
-
- template <typename M>
- static std::ptrdiff_t stride2( M const& m ) {
- return 1 ;
- }
- };
-
- template<>
- struct dense_ordering<column_major_t> {
- typedef column_major_t type;
-
- template <typename M>
- static std::ptrdiff_t stride1( M const& m ) {
- return 1 ;
- }
-
- template <typename M>
- static std::ptrdiff_t stride2( M const& m ) {
- return leading_dimension (m) ;
- }
- };
-
- }
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_DENSE_ORDERING_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/generate_const.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/generate_const.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * First author acknowledges the support of the Faculty of Civil
- * Engineering, University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_GENERATE_CONST_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_GENERATE_CONST_HPP
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-namespace boost { namespace numeric { namespace bindings { namespace traits { namespace detail {
-
- /// Copy const from V to X if present
-
- template <typename V, typename X>
- struct generate_const {
- typedef X type;
- };
-
- template <typename V, typename X>
- struct generate_const< const V, X > {
- typedef X const type;
- };
-
- template <typename V, typename X>
- struct generate_const< V const, X const > {
- typedef X const type;
- };
-
- template <typename T, int N, typename X>
- struct generate_const< const T[N], X > {
- typedef X const type;
- };
-
- template <typename T, int N, typename X>
- struct generate_const< const T[N], X const > {
- typedef X const type;
- };
-
-}}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_GENERATE_CONST_HPP
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/symm_herm_traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/symm_herm_traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2002
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_SYMM_HERM_TRAITS_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_SYMM_HERM_TRAITS_HPP
-
-#include <boost/numeric/bindings/traits/type.hpp>
-#include <boost/numeric/bindings/traits/traits.hpp>
-#include <boost/static_assert.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace detail {
-
- // select symmetric or hermitian matrix structure
-
- template <typename T>
- struct symm_herm_t {};
- template<>
- struct symm_herm_t<float> {
- typedef symmetric_t type;
- };
- template<>
- struct symm_herm_t<double> {
- typedef symmetric_t type;
- };
- template<>
- struct symm_herm_t<complex_f> {
- typedef hermitian_t type;
- };
- template<>
- struct symm_herm_t<complex_d> {
- typedef hermitian_t type;
- };
-
- template <typename T>
- struct symm_herm_pack_t {};
- template<>
- struct symm_herm_pack_t<float> {
- typedef symmetric_packed_t type;
- };
- template<>
- struct symm_herm_pack_t<double> {
- typedef symmetric_packed_t type;
- };
- template<>
- struct symm_herm_pack_t<complex_f> {
- typedef hermitian_packed_t type;
- };
- template<>
- struct symm_herm_pack_t<complex_d> {
- typedef hermitian_packed_t type;
- };
-
-
- template <class T, class S>
- struct symm_herm_compatible {
- BOOST_STATIC_CONSTANT( bool, value=false ) ;
- };
-
- template <class T>
- struct symm_herm_compatible< T, hermitian_t > {
- BOOST_STATIC_CONSTANT( bool, value=true ) ;
- };
-
- template <class T>
- struct symm_herm_compatible< T, symmetric_t > {
- BOOST_STATIC_CONSTANT( bool, value=true ) ;
- };
-
- template <class T>
- struct symm_herm_compatible< std::complex<T>, symmetric_t > {
- BOOST_STATIC_CONSTANT( bool, value=false ) ;
- };
-
- }
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_SYMM_HERM_TRAITS_HPP
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2002
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_BANDED_ORDERING_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_BANDED_ORDERING_H
-
-#include <boost/numeric/ublas/fwd.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace detail {
-
- template <typename StOrdTag>
- struct ublas_banded_ordering {};
-
- template<>
- struct ublas_banded_ordering<boost::numeric::ublas::row_major_tag> {
- // When orientation_category==row_major_tag then the ublas banded format corresponds to
- // the LAPACK band format, which really is a column_major format.
- typedef column_major_t type;
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.lower() + m.upper() + 1 ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return 1 ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return leading_dimension(m)-1 ;
- }
- };
-
- template<>
- struct ublas_banded_ordering<boost::numeric::ublas::column_major_tag> {
- // The type row_major_t is just used to indicate that this is not a column_major format.
- typedef row_major_t type;
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.size2() ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return leading_dimension(m) ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return 1-leading_dimension(m) ;
- }
- };
- }
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_ordering.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_ordering.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2002
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_ORDERING_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_ORDERING_H
-
-#include <boost/numeric/ublas/fwd.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace detail {
-
- template <typename StOrdTag>
- struct ublas_ordering {};
-
- template<>
- struct ublas_ordering<boost::numeric::ublas::row_major_tag> {
- typedef row_major_t type;
- typedef boost::numeric::ublas::row_major functor_type;
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.size2() ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return m.size2() ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return 1 ;
- }
- };
-
- template<>
- struct ublas_ordering<boost::numeric::ublas::column_major_tag> {
- typedef column_major_t type;
- typedef boost::numeric::ublas::column_major functor_type;
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.size1() ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return 1 ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return m.size1() ;
- }
- };
- }
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_uplo.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/detail/ublas_uplo.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright (c) Kresimir Fresl 2002
- *
- * 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)
- *
- * Author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_UPLO_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_UPLO_H
-
-#include <boost/numeric/ublas/fwd.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace detail {
-
- template <typename UpLoTag>
- struct ublas_uplo {};
-
- template<>
- struct ublas_uplo<boost::numeric::ublas::lower_tag> {
- typedef lower_t type;
- };
-
- template<>
- struct ublas_uplo<boost::numeric::ublas::upper_tag> {
- typedef upper_t type;
- };
-
- template<typename I>
- struct ublas_uplo< boost::numeric::ublas::basic_upper<I> > {
- typedef upper_t type;
- };
-
- template<typename I>
- struct ublas_uplo< boost::numeric::ublas::basic_lower<I> > {
- typedef lower_t type;
- };
-
- }
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/fortran.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/fortran.h 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,51 +0,0 @@
-//
-// Copyright (C) 2002, 2003 Si-Lab b.v.b.a., Toon Knapen and Kresimir Fresl
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_FORTRAN_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_FORTRAN_H
-
-#if defined(BIND_FORTRAN_LOWERCASE_UNDERSCORE) || defined(BIND_FORTRAN_LOWERCASE)
-// Allow manual override of the defaults, e.g. if you want to use a fortran
-// lib compiled with gcc from MSVC
-#else
-
-// First we need to know what the conventions for linking
-// C with Fortran is on this platform/toolset
-#if defined(__GNUC__) || defined(__ICC) || defined(__sgi) || defined(__COMO__) || defined(__KCC)
-#define BIND_FORTRAN_LOWERCASE_UNDERSCORE
-#elif defined(__IBMCPP__) || defined(_MSC_VER)
-#define BIND_FORTRAN_LOWERCASE
-#else
-#error do not know how to link with fortran for the given platform
-#endif
-
-#endif
-
-// Next we define macro's to convert our symbols to
-// the current convention
-#if defined(BIND_FORTRAN_LOWERCASE_UNDERSCORE)
-#define FORTRAN_ID( id ) id##_
-#elif defined(BIND_FORTRAN_LOWERCASE)
-#define FORTRAN_ID( id ) id
-#else
-#error do not know how to bind to fortran calling convention
-#endif
-
-
-// "g77" or clapack or "gfortran -ff2c"
-//#define BIND_FORTRAN_F2C_RETURN_CONVENTIONS
-// "g77 -fno-f2c" or "gfortran"
-//#define BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS
-
-// As long as f2c return conventions are the common case,
-// we turn them on unless requested otherwise
-#ifndef BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS
-#define BIND_FORTRAN_F2C_RETURN_CONVENTIONS
-#endif
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_FORTRAN_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_matrix.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_matrix.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,39 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_IS_BINDABLE_MATRIX_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_IS_BINDABLE_MATRIX_HPP
-
-#include <boost/mpl/bool.hpp>
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace traits {
-
-template< typename T >
-struct is_bindable_matrix {
-
- typedef char yes;
- typedef char (&no)[2];
-
- template< typename M >
- static yes tester( typename matrix_traits<M>::pointer );
-
- template< typename M >
- static no tester( ... );
-
- static bool const value = sizeof(tester<T>(0)) == sizeof(yes);
-
- typedef mpl::bool_<value> type;
-};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/is_bindable_vector.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,39 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_IS_BINDABLE_VECTOR_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_IS_BINDABLE_VECTOR_HPP
-
-#include <boost/mpl/bool.hpp>
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace traits {
-
-template< typename T >
-struct is_bindable_vector {
-
- typedef char yes;
- typedef char (&no)[2];
-
- template< typename V >
- static yes tester( typename vector_traits<V>::pointer );
-
- template< typename V >
- static no tester( ... );
-
- static bool const value = sizeof(tester<T>(0)) == sizeof(yes);
-
- typedef mpl::bool_<value> type;
-};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/is_complex.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/is_complex.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,32 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_IS_COMPLEX_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_IS_COMPLEX_HPP
-
-#include <boost/mpl/bool.hpp>
-#include <boost/numeric/bindings/traits/type.h>
-#include <boost/type_traits/is_complex.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace traits {
-
-template< typename T >
-struct is_complex: boost::is_complex<T> {};
-
-template<>
-struct is_complex< fcomplex_t >: boost::mpl::bool_<true> {};
-
-template<>
-struct is_complex< dcomplex_t >: boost::mpl::bool_<true> {};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/is_numeric.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/is_numeric.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,27 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_IS_NUMERIC_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_IS_NUMERIC_HPP
-
-#include <boost/mpl/or.hpp>
-#include <boost/numeric/bindings/traits/is_real.hpp>
-#include <boost/numeric/bindings/traits/is_complex.hpp>
-#include <boost/type_traits/is_integral.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace traits {
-
-template< typename T >
-struct is_numeric: mpl::or_< is_real<T>, is_complex<T>, is_integral<T> > {};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/is_real.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/is_real.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,24 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_IS_REAL_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_IS_REAL_HPP
-
-#include <boost/type_traits/is_floating_point.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace traits {
-
-template< typename T >
-struct is_real: boost::is_floating_point<T> {};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_raw.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_raw.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,360 +0,0 @@
-//
-// Copyright (c) 2002-2003
-// Toon Knapen, Kresimir Fresl, Joerg Walter
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_RAW_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_RAW_HPP
-
-#include <cstddef>
-#include <boost/numeric/ublas/config.hpp>
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/matrix.hpp>
-#endif
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace ublas = boost::numeric::ublas;
-
- // size:
-
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_num_rows (const M &m) {
- return (std::ptrdiff_t) m.size1();
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_num_columns (const M &m) {
- return (std::ptrdiff_t) m.size2();
- }
-
-#if 0
- // MSVC seems to dislike overloads if there is 'generic' template
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_num_rows (const ublas::matrix_reference<M> &m) {
- return matrix_num_rows (m.expression());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_num_columns (const ublas::matrix_reference<M> &m) {
- return matrix_num_columns (m.expression());
- }
-#endif // 0
-
-
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m, ublas::row_major_tag) {
- return (std::ptrdiff_t) m.size2();
- }
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m, ublas::column_major_tag) {
- return (std::ptrdiff_t) m.size1();
- }
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m) {
- typedef ublas::matrix<T,F,A> matrix_t;
- return bindings::traits::leading_dimension
- (m, BOOST_UBLAS_TYPENAME matrix_t::orientation_category());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::matrix_reference<M> &m) {
- return bindings::traits::leading_dimension (m.expression());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::matrix_range<M> &m) {
- return bindings::traits::leading_dimension (m.data());
- }
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t leading_dimension (const ublas::c_matrix<T, M, N> &m) {
- return (std::ptrdiff_t) N;
- }
-
-
- // stride:
-
-#if 0
- // MSVC seems to dislike overloads if there is 'generic' template
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const M &m) {
- typedef typename M::functor_type functor_type;
- return (std::ptrdiff_t) functor_type::one1 (m.size1(), m.size2());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const M &m) {
- typedef typename M::functor_type functor_type;
- return (std::ptrdiff_t) functor_type::one2 (m.size1(), m.size2());
- }
-#endif // 0
-
- template <typename M, typename F, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const ublas::matrix<M,F,A> &m) {
- return (std::ptrdiff_t) F::one1 (m.size1(), m.size2());
- }
- template <typename M, typename F, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const ublas::matrix<M,F,A> &m) {
- return (std::ptrdiff_t) F::one2 (m.size1(), m.size2());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const ublas::matrix_reference<M> &m) {
- return matrix_stride1 (m.expression());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const ublas::matrix_reference<M> &m) {
- return matrix_stride2 (m.expression());
- }
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const ublas::c_matrix<T, M, N> &m) { return (std::ptrdiff_t) N; }
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const ublas::c_matrix<T, M, N> &m) { return 1; }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const ublas::matrix_range<M> &m) {
- return matrix_stride1 (m.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const ublas::matrix_range<M> &m) {
- return matrix_stride2 (m.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride1 (const ublas::matrix_slice<M> &m) {
- return (std::ptrdiff_t) (m.stride1() * matrix_stride1 (m.data()));
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t matrix_stride2 (const ublas::matrix_slice<M> &m) {
- return (std::ptrdiff_t) (m.stride2() * matrix_stride2 (m.data()));
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::matrix_row<M> &v) {
- return matrix_stride2 (v.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::matrix_column<M> &v) {
- return matrix_stride1 (v.data());
- }
-
-
- // storage:
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::matrix<T,F,A>::const_pointer
- matrix_storage (const ublas::matrix<T,F,A> &m) {
- return &m.data().begin()[0];
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::matrix<T,F,A>::const_pointer
- matrix_storage_const (const ublas::matrix<T,F,A> &m) {
- return &m.data().begin()[0];
- }
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::matrix<T,F,A>::pointer
- matrix_storage (ublas::matrix<T,F,A> &m) {
- return &m.data().begin()[0];
- }
-
-#if 0
- // MSVC seems to dislike overloads if there is 'generic' template
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer matrix_storage (const M &m) {
- return &m.data().begin()[0];
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer matrix_storage_const (const M &m) {
- return &m.data().begin()[0];
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (M &m) {
- return &m.data().begin()[0];
- }
-#endif // 0
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage (const ublas::matrix_reference<M> &m) {
- return matrix_storage (m.expression ());
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage_const (const ublas::matrix_reference<M> &m) {
- return matrix_storage_const (m.expression ());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (ublas::matrix_reference<M> &m) {
- return matrix_storage (m.expression ());
- }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_matrix<T, M, N>::const_pointer
- matrix_storage (const ublas::c_matrix<T, M, N> &m) {
- return m.data();
- }
-#endif
-#ifndef BOOST_MSVC
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_matrix<T, M, N>::const_pointer
- matrix_storage_const (const ublas::c_matrix<T, M, N> &m) {
- return m.data();
- }
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_matrix<T, M, N>::pointer
- matrix_storage (ublas::c_matrix<T, M, N> &m) {
- return m.data();
- }
-#endif
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage (const ublas::matrix_range<M> &m) {
- return matrix_storage (m.data())
- + m.start1() * matrix_stride1 (m.data())
- + m.start2() * matrix_stride2 (m.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage (const ublas::matrix_slice<M> &m) {
- return matrix_storage (m.data())
- + m.start1() * matrix_stride1 (m.data ())
- + m.start2() * matrix_stride2 (m.data ());
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage_const (const ublas::matrix_range<M> &m) {
- return matrix_storage_const (m.data())
- + m.start1() * matrix_stride1 (m.data ())
- + m.start2() * matrix_stride2 (m.data ());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage_const (const ublas::matrix_slice<M> &m) {
- return matrix_storage_const (m.data())
- + m.start1() * matrix_stride1 (m.data ())
- + m.start2() * matrix_stride2 (m.data ());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (ublas::matrix_range<M> &m) {
- return matrix_storage (m.data())
- + m.start1() * matrix_stride1 (m.data ())
- + m.start2() * matrix_stride2 (m.data ());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (ublas::matrix_slice<M> &m) {
- return matrix_storage (m.data())
- + m.start1() * matrix_stride1 (m.data ())
- + m.start2() * matrix_stride2 (m.data ());
- }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- vector_storage (const ublas::matrix_row<M> &v) {
- return matrix_storage (v.data())
- + v.index() * matrix_stride1 (v.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- vector_storage (const ublas::matrix_column<M> &v) {
- return matrix_storage (v.data())
- + v.index() * matrix_stride2 (v.data());
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- vector_storage_const (const ublas::matrix_row<M> &v) {
- return matrix_storage_const (v.data())
- + v.index() * matrix_stride1 (v.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- vector_storage_const (const ublas::matrix_column<M> &v) {
- return matrix_storage_const (v.data())
- + v.index() * matrix_stride2 (v.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer vector_storage (ublas::matrix_row<M> &v) {
- return matrix_storage (v.data())
- + v.index() * matrix_stride1 (v.data());
- }
- template <typename M>
- BOOST_UBLAS_INLINE
- typename M::pointer vector_storage (ublas::matrix_column<M> &v) {
- return matrix_storage (v.data())
- + v.index() * matrix_stride2 (v.data());
- }
-
-}}}}
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_NO_SYMMETRIC_TRAITS
-
-#include <boost/numeric/bindings/traits/symm_herm_raw.hpp>
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_NO_SYMMETRIC_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_RAW_HPP
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/matrix_traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,170 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_TRAITS_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_TRAITS_HPP
-
-#include <boost/numeric/bindings/traits/config.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/numeric/bindings/traits/is_numeric.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/detail/generate_const.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
-# include <boost/type_traits/is_same.hpp>
-# include <boost/static_assert.hpp>
-#endif
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- /// There is no default implementation since there is no reasonable default.
- /// Most matrix libraries provide totally different functions.
-
-
- /// Auxiliary traits class to reduce the number of specializations.
- /// MType is the actual matrix type.
- /// MIdentifier is used to specialize the traits for a specific matrix type, e.g.
- /// matrix_detail_traits< ublas::matrix<double>, ublas::matrix<double> const >
- /// matrix_detail_traits< ublas::matrix<double>, ublas::matrix<double> >
- /// Note that remove_const<MType>::type == MIdentifier
- template <typename MIdentifier, typename MType>
- struct matrix_detail_traits {
- typedef MIdentifier identifier_type;
- typedef MType matrix_type;
- };
-
- /// matrix_traits<> generic version: no specialization(s)
- template< typename M, typename Enable = void >
- struct matrix_traits {};
-
- /// matrix_traits<> generic version which will be
- /// enabled if the matrix_detail_traits<>::value_type is a numeric type
- template< typename M >
- struct matrix_traits< M, typename boost::enable_if< is_numeric<
- typename matrix_detail_traits< typename boost::remove_const<M>::type, M>::value_type
- > >::type >:
- matrix_detail_traits< typename boost::remove_const<M>::type, M> {
- // typedefs:
- // matrix_structure
- // ordering_type
- // value_type
- // pointer
- // symmetric/hermitian typedefs:
- // uplo_type
- // static functions:
- // pointer storage()
- // std::ptrdiff_t num_rows()
- // std::ptrdiff_t num_columns()
- // std::ptrdiff_t lower_bandwidth() // only banded matrix types
- // std::ptrdiff_t upper_bandwidth() // only banded matrix types
- // std::ptrdiff_t leading_dimension() // not all matrix types
- };
-
- // matrix structure tags:
- struct general_t {};
- struct symmetric_t {};
- struct symmetric_packed_t {};
- struct hermitian_t {};
- struct hermitian_packed_t {};
- struct banded_t {};
- struct triangular_t {};
- struct triangular_packed_t {};
- // If all else fails...
- struct unknown_structure_t {};
-
- // storage ordering tags:
- struct row_major_t {};
- struct column_major_t {};
-
- // upper/lower non-unit/unit triangular type tags
- struct upper_t {};
- struct lower_t {};
- struct unit_upper_t {};
- struct unit_lower_t {};
-
- ///////////////////////////
- //
- // free accessor functions
- //
- ///////////////////////////
-
- template <typename M>
- inline
- typename matrix_traits<M>::pointer matrix_storage (M& m) {
- return matrix_traits<M>::storage (m);
- }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_num_rows (M& m) { return matrix_traits<M>::num_rows (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_num_columns (M& m) { return matrix_traits<M>::num_columns (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_stride1 (M& m) { return matrix_traits<M>::stride1 (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_stride2 (M& m) { return matrix_traits<M>::stride2 (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_upper_bandwidth (M& m) { return matrix_traits<M>::upper_bandwidth (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_lower_bandwidth (M& m) { return matrix_traits<M>::lower_bandwidth (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t leading_dimension (M& m) {
- return matrix_traits<M>::leading_dimension (m);
- }
-
- namespace detail {
-
- inline char matrix_uplo_tag (upper_t const&) { return 'U'; }
- inline char matrix_uplo_tag (lower_t const&) { return 'L'; }
-
- }
-
- template <typename SymmM>
- inline
- char matrix_uplo_tag (SymmM&) {
- typedef typename matrix_traits<SymmM>::uplo_type uplo_t;
- return detail::matrix_uplo_tag (uplo_t());
- }
-
- // Retain for older bindings:
- template <typename M>
- inline
- std::ptrdiff_t matrix_size1 (M& m) { return matrix_traits<M>::num_rows (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t matrix_size2 (M& m) { return matrix_traits<M>::num_columns (m); }
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/matrix_raw.hpp>
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_MATRIX_TRAITS_HPP
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/sparse_traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/sparse_traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright (c) 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF author acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_SPARSE_TRAITS_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_SPARSE_TRAITS_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- /// There is no default implementation since there is no reasonable default.
- /// Most matrix libraries provide totally different functions.
-
- /// Auxiliary traits class to reduce the number of specializations.
- template <typename MIdentifier, typename MType>
- struct sparse_matrix_detail_traits {
- typedef MIdentifier identifier_type;
- typedef MType matrix_type;
- };
-
- /// sparse_matrix_traits<> generic version:
- template <typename M>
- struct sparse_matrix_traits
- : sparse_matrix_detail_traits <typename boost::remove_const<M>::type, M>
- {
- // typedefs:
- // matrix_structure
- // storage_format
- // ordering_type
- // value_type
- // value_pointer
- // index_pointer
- // enum (or static size_t const):
- // index_base
- // static functions:
- // index_pointer index1_storage()
- // - compressed column: array of column start locations
- // - compressed row: array of row start locations
- // - coordinate, column major: column indices of nonzeros
- // - coordinate, row major: row indices of nonzeros
- // index_pointer index2_storage()
- // - compressed column: array of row indices of nonzeros
- // - compressed row: array of column indices of nonzeros
- // - coordinate, column major: row indices of nonzeros
- // - coordinate, row major: column indices of nonzeros
- // value_pointer value_storage()
- // - array of nonzeros
- // std::ptrdiff_t num_rows()
- // std::ptrdiff_t num_columns()
- // std::ptrdiff_t num_nonzeros()
- };
-
-
- // storage format tags
- struct compressed_t {};
- struct coordinate_t {};
-
-
- ///////////////////////////
- //
- // free accessor functions
- //
- ///////////////////////////
-
- template <typename M>
- inline
- typename sparse_matrix_traits<M>::index_pointer
- spmatrix_index1_storage (M& m) {
- return sparse_matrix_traits<M>::index1_storage (m);
- }
- template <typename M>
- inline
- typename sparse_matrix_traits<M>::index_pointer
- spmatrix_index2_storage (M& m) {
- return sparse_matrix_traits<M>::index2_storage (m);
- }
-
- template <typename M>
- inline
- typename sparse_matrix_traits<M>::value_pointer
- spmatrix_value_storage (M& m) {
- return sparse_matrix_traits<M>::value_storage (m);
- }
-
- template <typename M>
- inline
- std::ptrdiff_t spmatrix_num_rows (M& m) { return sparse_matrix_traits<M>::num_rows (m); }
- template <typename M>
- inline
- std::ptrdiff_t spmatrix_num_columns (M& m) { return sparse_matrix_traits<M>::num_columns (m); }
-
- template <typename M>
- inline
- std::ptrdiff_t spmatrix_num_nonzeros (M& m) {
- return sparse_matrix_traits<M>::num_nonzeros (m);
- }
-
- // Retain for older codes
-
- template <typename M>
- inline
- std::ptrdiff_t spmatrix_size1 (M& m) { return sparse_matrix_traits<M>::num_rows (m); }
- template <typename M>
- inline
- std::ptrdiff_t spmatrix_size2 (M& m) { return sparse_matrix_traits<M>::num_columns (m); }
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler sparse matrices cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_SPARSE_TRAITS_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * Permission to copy, modify, use and distribute this software
- * for any non-commercial or commercial purpose is granted provided
- * that this license appear on all copies of the software source code.
- *
- * Authors assume no responsibility whatsoever for its use and makes
- * no guarantees about its quality, correctness or reliability.
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-#include <valarray>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // std::valarray<>
- template <typename T, typename V>
- struct vector_detail_traits<std::valarray<T>, V>
- : default_vector_traits<V, T>
- {
-
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- std::valarray<T>, typename boost::remove_const<V>::type
- >::value)
- );
-#endif
-
- typedef std::valarray<T> identifier_type;
- typedef V vector_type;
- typedef typename default_vector_traits<V, T>::pointer pointer;
-
- static pointer storage (vector_type& va) {
- std::valarray<T>& ncva = const_cast<std::valarray<T>&> (va);
- return &ncva[0];
- }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler std::valarray<> cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/std_valarray2.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- * Copyright (c) 2008 Markus Rickert
- *
- * Permission to copy, modify, use and distribute this software
- * for any non-commercial or commercial purpose is granted provided
- * that this license appear on all copies of the software source code.
- *
- * Authors assume no responsibility whatsoever for its use and makes
- * no guarantees about its quality, correctness or reliability.
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY2_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY2_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-#include <valarray>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // std::valarray<> treated as matrix (nx1)
- template <typename T, typename V>
- struct matrix_detail_traits<std::valarray<T>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- std::valarray<T>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef std::valarray<T> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (matrix_type& v) {
- return vector_traits<matrix_type>::storage (v);
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler std::valarray<> cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_STD_VALARRAY2_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <vector>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // std::vector<>
- template <typename T, typename Alloc, typename V>
- struct vector_detail_traits<std::vector<T, Alloc>, V>
- : default_vector_traits< V, T >
- {
-
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< std::vector<T, Alloc>, typename boost::remove_const<V>::type >::value) );
-#endif
-
- typedef std::vector<T,Alloc> identifier_type;
- typedef V vector_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (vector_type& v) { return &v.front(); }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/std_vector2.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR2_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR2_H
-
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <vector>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // std::vector<> treated as matrix (nx1)
- template <typename T, typename Alloc, typename V>
- struct matrix_detail_traits<std::vector<T, Alloc>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- std::vector<T, Alloc>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef std::vector<T, Alloc> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (matrix_type& v) {
- return vector_traits<matrix_type>::storage (v);
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR2_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/symm_herm_raw.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/symm_herm_raw.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,171 +0,0 @@
-//
-// Copyright (c) 2002-2003
-// Toon Knapen, Kresimir Fresl, Joerg Walter
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_SYMM_HERM_RAW_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_SYMM_HERM_RAW_HPP
-
-#include <boost/numeric/bindings/traits/matrix_raw.hpp>
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/symmetric.hpp>
-# include <boost/numeric/ublas/hermitian.hpp>
-#endif
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- namespace ublas = boost::numeric::ublas;
-
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::symmetric_adaptor<M, F> &m) {
- return bindings::traits::leading_dimension (m.data());
- }
-
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::hermitian_adaptor<M, F> &m) {
- return bindings::traits::leading_dimension (m.data());
- }
-
-
-
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::symmetric_adaptor<M, F> &m) {
- return matrix_storage_size (m.data());
- }
-
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::hermitian_adaptor<M, F> &m) {
- return matrix_storage_size (m.data());
- }
-
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::symmetric_matrix<T,F1,F2,A> &m) {
- return (int) ((m.size1() * (m.size1() + 1)) / 2);
- }
-
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::hermitian_matrix<T,F1,F2,A> &m) {
- return (int) ((m.size1() * (m.size1() + 1)) / 2);
- }
-
-
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::symmetric_matrix<T,F1,F2,A>::const_pointer
- matrix_storage (const ublas::symmetric_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
-#endif
- // We need data_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::symmetric_matrix<T,F1,F2,A>::const_pointer
- matrix_storage_const (const ublas::symmetric_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::symmetric_matrix<T,F1,F2,A>::pointer
- matrix_storage (ublas::symmetric_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage (const ublas::symmetric_adaptor<M, F> &m) {
- return matrix_storage (m.data());
- }
-#endif
- // We need data_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage_const (const ublas::symmetric_adaptor<M, F> &m) {
- return matrix_storage_const (m.data());
- }
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (ublas::symmetric_adaptor<M, F> &m) {
- return matrix_storage (m.data());
- }
-
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::hermitian_matrix<T,F1,F2,A>::const_pointer
- matrix_storage (const ublas::hermitian_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
-#endif
- // We need data_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::hermitian_matrix<T,F1,F2,A>::const_pointer
- matrix_storage_const (const ublas::hermitian_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
- template<typename T, typename F1, typename F2, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::hermitian_matrix<T,F1,F2,A>::pointer
- matrix_storage (ublas::hermitian_matrix<T,F1,F2,A> &m) {
- return &m.data().begin()[0];
- }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage (const ublas::hermitian_adaptor<M, F> &m) {
- return matrix_storage (m.data());
- }
-#endif
- // We need data_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::const_pointer
- matrix_storage_const (const ublas::hermitian_adaptor<M, F> &m) {
- return matrix_storage_const (m.data());
- }
- template <typename M, typename F>
- BOOST_UBLAS_INLINE
- typename M::pointer matrix_storage (ublas::hermitian_adaptor<M, F> &m) {
- return matrix_storage (m.data());
- }
-
- namespace detail {
-
- inline char m_uplo_tag (ublas::upper_tag const&) { return 'U'; }
- inline char m_uplo_tag (ublas::lower_tag const&) { return 'L'; }
-
- }
-
- template <typename SymmM>
- inline
- char matrix_uplo_tag (SymmM&) {
- typedef typename SymmM::packed_category uplo_t;
- return detail::m_uplo_tag (uplo_t());
- }
-
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/tnt.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/tnt.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,134 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_TNT_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_TNT_H
-
-// Roldan Pozo's TNT (Template Numerical Toolkit)
-// see: http://math.nist.gov/tnt/index.html
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-#include <tnt/tnt_array1d.h>
-#include <tnt/tnt_fortran_array1d.h>
-#include <tnt/tnt_array2d.h>
-#include <tnt/tnt_fortran_array2d.h>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // TNT::Array1D<>
- template <typename T, typename V>
- struct vector_detail_traits<TNT::Array1D<T>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- TNT::Array1D<T>, typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef TNT::Array1D<T> identifier_type;
- typedef V vector_type;
- typedef T value_type;
- typedef typename detail::generate_const<V,T>::type* pointer;
-
- static pointer storage (vector_type& v) { return &v[0]; }
- static int size (vector_type& v) { return v.dim(); }
- static int stride (vector_type& v) { return 1; }
- };
-
- // TNT::Fortran_Array1D<>
- template <typename T, typename V>
- struct vector_detail_traits<TNT::Fortran_Array1D<T>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- TNT::Fortran_Array1D<T>, typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef TNT::Fortran_Array1D<T> identifier_type;
- typedef V vector_type;
- typedef T value_type;
- typedef typename detail::generate_const<V,T>::type* pointer;
-
- static pointer storage (vector_type& v) { return &v(1); }
- static int size (vector_type& v) { return v.dim(); }
- static int stride (vector_type& v) { return 1; }
- };
-
-
- // TNT::Array2D<>
- template <typename T, typename M>
- struct matrix_detail_traits<TNT::Array2D<T>, M>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- TNT::Array2D<T>, typename boost::remove_const<M>::type
- >::value) );
-#endif
-
- typedef TNT::Array2D<T> identifier_type;
- typedef M matrix_type;
- typedef general_t matrix_structure;
- typedef row_major_t ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<M,T>::type* pointer;
-
- static pointer storage (matrix_type& m) { return m[0]; }
- static int num_rows (matrix_type& m) { return m.dim1(); }
- static int num_columns (matrix_type& m) { return m.dim2(); }
- static int storage_size (matrix_type& m) { return m.dim1() * m.dim2(); }
- static int leading_dimension (matrix_type& m) { return m.dim2(); }
- };
-
- // TNT::Fortran_Array2D<>
- template <typename T, typename M>
- struct matrix_detail_traits<TNT::Fortran_Array2D<T>, M> {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- TNT::Fortran_Array2D<T>, typename boost::remove_const<M>::type
- >::value) );
-#endif
-
- typedef TNT::Fortran_Array2D<T> identifier_type;
- typedef M matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<M,T>::type* pointer;
-
- static pointer storage (matrix_type& m) { return &m(1, 1); }
- static int num_rows (matrix_type& m) { return m.dim1(); }
- static int num_columns (matrix_type& m) { return m.dim2(); }
- static int storage_size (matrix_type& m) { return m.dim1() * m.dim2(); }
- static int leading_dimension (matrix_type& m) { return m.dim1(); }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler TNT cannot be used in bindings
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_TNT_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,20 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_H
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/transpose.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/transpose.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,48 +0,0 @@
-//
-// Copyright Kresimir Fresl, Toon Knapen, and Karl Meerbergen 2002, 2003
-//
-// 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 BOOST_BINDINGS_TRANSPOSE_HPP
-#define BOOST_BINDINGS_TRANSPOSE_HPP
-
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-//#include <boost/numeric/bindings/traits/is_decorated.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
-const char NO_TRANSPOSE = 'N' ;
-const char TRANSPOSE = 'T' ;
-const char CONJUGATE = 'C' ;
-
-struct no_transpose_t {};
-struct transpose_t {};
-struct conjugate_t {};
-
-template< typename Matrix, typename Decoration >
-struct decoration_impl {
- typedef Matrix underlying_type;
- typedef Decoration decoration_type;
- decoration_impl( Matrix &m ): m_matrix(m) {}
- inline underlying_type& get() {
- return m_matrix;
- }
- Matrix& m_matrix;
-};
-
-template< typename Matrix >
-decoration_impl< Matrix, transpose_t > trans( Matrix &m ) {
- return decoration_impl<Matrix, transpose_t >(m);
-}
-
-template< typename Matrix >
-decoration_impl< Matrix, conjugate_t > conj( Matrix &m ) {
- return decoration_impl<Matrix, conjugate_t >(m);
-}
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_banded.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_banded.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_BANDED_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_BANDED_H
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/banded.hpp>
-#endif
-#include <boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp>
-
-#if defined (BOOST_NUMERIC_BINDINGS_FORTRAN) || !defined (BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK)
-# include <boost/static_assert.hpp>
-# include <boost/type_traits/same_traits.hpp>
-#endif
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::matrix_banded<>
- // When orientation_category==row_major_tag then the ublas banded format corresponds to
- // the LAPACK band format.
- // Specialization using matrix_detail_traits so that we can specialize for
- // matrix_detail_traits< banded<T, F, ArrT>, banded<T, F, ArrT> >
- // matrix_detail_traits< banded<T, F, ArrT>, banded<T, F, ArrT> const >
- // at once.
- template <typename T, typename F, typename ArrT, typename M>
- struct matrix_detail_traits< boost::numeric::ublas::banded_matrix<T, F, ArrT>, M >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::banded_matrix<T, F, ArrT>, typename boost::remove_const<M>::type>::value) );
-#endif
-#ifdef BOOST_NUMERIC_BINDINGS_FORTRAN
- BOOST_STATIC_ASSERT((boost::is_same<
- typename F::orientation_category,
- boost::numeric::ublas::row_major_tag
- >::value));
-#endif
-
- typedef boost::numeric::ublas::banded_matrix<T, F, ArrT> identifier_type ;
- typedef M matrix_type;
- typedef banded_t matrix_structure;
- typedef typename detail::ublas_banded_ordering<
- typename F::orientation_category
- >::type ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<M,T>::type* pointer;
-
- static pointer storage (matrix_type& m) {
- typedef typename detail::generate_const<M,ArrT>::type array_type ;
- return vector_traits<array_type>::storage (m.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t lower_bandwidth (matrix_type& m) { return m.lower() ; }
- static std::ptrdiff_t upper_bandwidth (matrix_type& m) { return m.upper() ; }
- static std::ptrdiff_t leading_dimension (matrix_type& m) {
- typedef typename identifier_type::orientation_category orientation_category;
- return detail::ublas_banded_ordering<orientation_category>::leading_dimension(m) ;
- }
-
- // stride1 == distance (m (i, j), m (i+1, j))
- static std::ptrdiff_t stride1 (matrix_type& m) {
- typedef typename identifier_type::orientation_category orientation_category;
- return detail::ublas_banded_ordering<orientation_category>::stride1(m) ;
- }
- // stride2 == distance (m (i, j), m (i, j+1))
- static std::ptrdiff_t stride2 (matrix_type& m) {
- typedef typename identifier_type::orientation_category orientation_category;
- return detail::ublas_banded_ordering<orientation_category>::stride2(m) ;
- }
- };
-
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_BANDED_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_hermitian.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_hermitian.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_HERMITIAN_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_HERMITIAN_H
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/hermitian.hpp>
-#endif
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/detail/ublas_uplo.hpp>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::hermitian_matrix<>
- template <typename T, typename F1, typename F2, typename A, typename M>
- struct matrix_detail_traits<boost::numeric::ublas::hermitian_matrix<T, F1, F2, A>, M>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::hermitian_matrix<T, F1, F2, A>, typename boost::remove_const<M>::type>::value) );
-#endif
-#ifdef BOOST_BINDINGS_FORTRAN
- BOOST_STATIC_ASSERT((boost::is_same<
- typename F2::orientation_category,
- boost::numeric::ublas::column_major_tag
- >::value));
-#endif
-
- typedef boost::numeric::ublas::hermitian_matrix<T, F1, F2, A> identifier_type;
- typedef M matrix_type;
-
- typedef hermitian_packed_t matrix_structure;
- typedef typename detail::ublas_ordering<
- typename F2::orientation_category
- >::type ordering_type;
- typedef typename detail::ublas_uplo< F1 >::type uplo_type;
-
- typedef T value_type ;
- typedef typename detail::generate_const<M,T>::type* pointer ;
-
- static pointer storage (matrix_type& hm) {
- typedef typename detail::generate_const<M,A>::type array_type ;
- return vector_traits<array_type>::storage (hm.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& hm) { return hm.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& hm) { return hm.size2(); }
- };
-
-
- namespace detail {
- template <typename M>
- std::ptrdiff_t matrix_bandwidth( M const& m, upper_t ) {
- return matrix_traits<M const>::upper_bandwidth( m ) ;
- }
-
- template <typename M>
- std::ptrdiff_t matrix_bandwidth( M const& m, lower_t ) {
- // When the lower triangular band matrix is stored the
- // upper bandwidth must be zero
- assert( 0 == matrix_traits<M const>::upper_bandwidth( m ) ) ;
- return matrix_traits<M const>::lower_bandwidth( m ) ;
- }
- } // namespace detail
-
- // ublas::hermitian_adaptor<>
- template <typename M, typename F1, typename MA>
- struct matrix_detail_traits<boost::numeric::ublas::hermitian_adaptor<M, F1>, MA>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::hermitian_adaptor<M, F1>, typename boost::remove_const<MA>::type>::value) );
-#endif
-
- typedef boost::numeric::ublas::hermitian_adaptor<M, F1> identifier_type;
- typedef MA matrix_type;
- typedef hermitian_t matrix_structure;
- typedef typename matrix_traits<M>::ordering_type ordering_type;
- typedef typename detail::ublas_uplo< F1 >::type uplo_type;
-
- typedef typename M::value_type value_type;
- typedef typename detail::generate_const<MA, value_type>::type* pointer;
-
- private:
- typedef typename detail::generate_const<MA, typename MA::matrix_closure_type>::type m_type;
-
- public:
- static pointer storage (matrix_type& hm) {
- return matrix_traits<m_type>::storage (hm.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& hm) { return hm.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& hm) { return hm.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& hm) {
- return matrix_traits<m_type>::leading_dimension (hm.data());
- }
- // For banded M
- static std::ptrdiff_t upper_bandwidth(matrix_type& hm) {
- return detail::matrix_bandwidth( hm.data(), uplo_type() );
- }
- static std::ptrdiff_t lower_bandwidth(matrix_type& hm) {
- return detail::matrix_bandwidth( hm.data(), uplo_type() );
- }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_HERMITIAN_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_matrix.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_matrix.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,445 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_MATRIX_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_MATRIX_H
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-#include <boost/numeric/bindings/traits/ublas_storage.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/matrix.hpp>
-#endif
-#include <boost/numeric/bindings/traits/detail/ublas_ordering.hpp>
-
-#if defined (BOOST_NUMERIC_BINDINGS_FORTRAN) || !defined (BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK)
-# include <boost/static_assert.hpp>
-# include <boost/type_traits/same_traits.hpp>
-#endif
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::matrix<>
- // Specialization using matrix_detail_traits so that we can specialize for
- // matrix_detail_traits< matrix<T, F, ArrT>, matrix<T, F, ArrT> >
- // matrix_detail_traits< matrix<T, F, ArrT>, matrix<T, F, ArrT> const >
- // at once.
- template <typename T, typename F, typename ArrT, typename M>
- struct matrix_detail_traits< boost::numeric::ublas::matrix<T, F, ArrT>, M >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::matrix<T, F, ArrT>, typename boost::remove_const<M>::type>::value) );
-#endif
-#ifdef BOOST_NUMERIC_BINDINGS_FORTRAN
- BOOST_STATIC_ASSERT((boost::is_same<
- typename F::orientation_category,
- boost::numeric::ublas::column_major_tag
- >::value));
-#endif
-
- typedef boost::numeric::ublas::matrix<T, F, ArrT> identifier_type ;
- typedef M matrix_type;
- typedef general_t matrix_structure;
- typedef typename detail::ublas_ordering<
- typename F::orientation_category
- >::type ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<M,T>::type* pointer;
-
- typedef typename identifier_type::orientation_category orientation_category;
- typedef typename detail::ublas_ordering<orientation_category>::functor_type functor_t ;
-
- static pointer storage (matrix_type& m) {
- typedef typename detail::generate_const<M,ArrT>::type array_type ;
- return vector_traits<array_type>::storage (m.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& m) {
- // g++ 2.95.4 and 3.0.4 (with -pedantic) dislike
- // identifier_type::functor_type::size2()
- //return functor_t::size_m (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::leading_dimension( m ) ;
- }
-
- // stride1 == distance (m (i, j), m (i+1, j))
- static std::ptrdiff_t stride1 (matrix_type& m) {
- //return functor_t::one1 (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::stride1( m ) ;
- }
- // stride2 == distance (m (i, j), m (i, j+1))
- static std::ptrdiff_t stride2 (matrix_type& m) {
- //return functor_t::one2 (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::stride2( m ) ;
- }
- };
-
-
- // ublas::matrix_reference<>
- template <typename M, typename MR>
- struct matrix_detail_traits<boost::numeric::ublas::matrix_reference<M>, MR >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_reference<M>, typename boost::remove_const<MR>::type>::value) ) ;
-#endif
-
- typedef boost::numeric::ublas::matrix_reference<M> identifier_type;
- typedef MR matrix_type;
- typedef typename matrix_traits<M>::matrix_structure matrix_structure;
- typedef typename matrix_traits<M>::ordering_type ordering_type;
-
- typedef typename M::value_type value_type;
- typedef typename detail::generate_const<MR,value_type>::type* pointer;
-
- private:
- typedef typename detail::generate_const<MR, M>::type m_type;
-
- public:
- static pointer storage (matrix_type& mr) {
- return matrix_traits<m_type>::storage (mr.expression());
- }
-
- static std::ptrdiff_t num_rows (matrix_type& mr) { return mr.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& mr) { return mr.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& mr) {
- return matrix_traits<m_type>::leading_dimension (mr.expression());
- }
-
- static std::ptrdiff_t stride1 (matrix_type& mr) {
- return matrix_traits<m_type>::stride1 (mr.expression());
- }
- static std::ptrdiff_t stride2 (matrix_type& mr) {
- return matrix_traits<m_type>::stride2 (mr.expression());
- }
- // Only for banded matrices
- static std::ptrdiff_t upper_bandwidth(matrix_type& mr) {
- return matrix_traits<m_type>::upper_bandwidth(mr.expression());
- }
- static std::ptrdiff_t lower_bandwidth(matrix_type& mr) {
- return matrix_traits<m_type>::lower_bandwidth(mr.expression());
- }
- };
-
-
- // ublas::matrix_range<>
- template <typename M, typename MR>
- struct matrix_detail_traits<boost::numeric::ublas::matrix_range<M>, MR >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_range<M>, typename boost::remove_const<MR>::type>::value) ) ;
-#endif
-
- typedef boost::numeric::ublas::matrix_range<M> identifier_type;
- typedef MR matrix_type;
- typedef typename matrix_traits<M>::matrix_structure matrix_structure;
- typedef typename matrix_traits<M>::ordering_type ordering_type;
-
- private:
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
-
- public:
- typedef typename matrix_traits<m_type>::value_type value_type;
- typedef typename matrix_traits<m_type>::pointer pointer ;
-
- public:
- static pointer storage (matrix_type& mr) {
- m_type& mt = mr.data();
- pointer ptr = matrix_traits<m_type>::storage (mt);
- ptr += mr.start1() * matrix_traits<m_type>::stride1 (mt);
- ptr += mr.start2() * matrix_traits<m_type>::stride2 (mt);
- return ptr;
- }
-
- static std::ptrdiff_t num_rows (matrix_type& mr) { return mr.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& mr) { return mr.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& mr) {
- return matrix_traits<m_type>::leading_dimension (mr.data());
- }
-
- static std::ptrdiff_t stride1 (matrix_type& mr) {
- return matrix_traits<m_type>::stride1 (mr.data());
- }
- static std::ptrdiff_t stride2 (matrix_type& mr) {
- return matrix_traits<m_type>::stride2 (mr.data());
- }
- // For band matrices only
- static std::ptrdiff_t upper_bandwidth (matrix_type& mr) {
- return matrix_traits<m_type>::upper_bandwidth(mr.data());
- }
- static std::ptrdiff_t lower_bandwidth (matrix_type& mr) {
- return matrix_traits<m_type>::lower_bandwidth(mr.data());
- }
- };
-
-
- // ublas::matrix_slice<>
- template <typename M, typename MS>
- struct matrix_detail_traits<boost::numeric::ublas::matrix_slice<M>, MS >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_slice<M>, typename boost::remove_const<MS>::type>::value) ) ;
-#endif
-
- typedef boost::numeric::ublas::matrix_slice<M> identifier_type;
- typedef MS matrix_type;
- typedef unknown_structure_t matrix_structure;
- typedef typename matrix_traits<M>::ordering_type ordering_type;
-
- typedef typename M::value_type value_type;
- typedef typename detail::generate_const<MS,value_type>::type* pointer;
-
- private:
- typedef typename detail::generate_const<MS, typename MS::matrix_closure_type>::type m_type;
-
- public:
- static pointer storage (matrix_type& ms) {
- m_type& mt = ms.data();
- pointer ptr = matrix_traits<M>::storage (mt);
- ptr += ms.start1() * matrix_traits<M>::stride1 (mt);
- ptr += ms.start2() * matrix_traits<M>::stride2 (mt);
- return ptr;
- }
-
- static std::ptrdiff_t num_rows (matrix_type& ms) { return ms.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& ms) { return ms.size2(); }
-
- private:
- static std::ptrdiff_t ld (std::ptrdiff_t s1, std::ptrdiff_t s2, boost::numeric::ublas::row_major_tag) {
- return s1;
- }
- static std::ptrdiff_t ld (std::ptrdiff_t s1, std::ptrdiff_t s2, boost::numeric::ublas::column_major_tag) {
- return s2;
- }
- public:
- static std::ptrdiff_t leading_dimension (matrix_type& ms) {
- typedef typename identifier_type::orientation_category oc_t;
- return ld (ms.stride1(), ms.stride2(), oc_t())
- * matrix_traits<m_type>::leading_dimension (ms.data());
- }
-
- static std::ptrdiff_t stride1 (matrix_type& ms) {
- return ms.stride1() * matrix_traits<m_type>::stride1 (ms.data());
- }
- static std::ptrdiff_t stride2 (matrix_type& ms) {
- return ms.stride2() * matrix_traits<m_type>::stride2 (ms.data());
- }
-
- };
-
-
- // matrix_row<> and matrix_column<> are vectors:
-
- // ublas::matrix_row<>
- template <typename M, typename MR>
- struct vector_detail_traits< boost::numeric::ublas::matrix_row<M>, MR >
- : default_vector_traits< MR, typename M::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_row<M>, typename boost::remove_const<MR>::type>::value) ) ;
-#endif
-
- typedef boost::numeric::ublas::matrix_row<M> identifier_type;
- typedef MR vector_type;
- typedef typename M::value_type value_type;
- typedef typename default_vector_traits<MR,value_type>::pointer pointer;
-
- private:
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
-
- public:
- static pointer storage (vector_type& mr) {
- m_type& mt = mr.data();
- pointer ptr = matrix_traits<m_type>::storage (mt);
- ptr += mr.index() * matrix_traits<m_type>::stride1 (mt);
- return ptr;
- }
- static std::ptrdiff_t stride (vector_type& mr) {
- return matrix_traits<m_type>::stride2 (mr.data());
- }
- };
-
-
- // ublas::matrix_column<>
- template <typename M, typename MC>
- struct vector_detail_traits< boost::numeric::ublas::matrix_column<M>, MC >
- : default_vector_traits< MC, typename M::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_column<M>, typename boost::remove_const<MC>::type>::value) ) ;
-#endif
-
- typedef boost::numeric::ublas::matrix_column<M> identifier_type;
- typedef MC vector_type;
- typedef typename M::value_type value_type ;
- typedef typename default_vector_traits<MC,value_type>::pointer pointer;
-
- private:
- typedef typename detail::generate_const<MC, typename MC::matrix_closure_type>::type m_type;
-
- public:
- static pointer storage (vector_type& mc) {
- m_type& mt = mc.data();
- pointer ptr = matrix_traits<m_type>::storage (mt);
- ptr += mc.index() * matrix_traits<m_type>::stride2 (mt);
- return ptr;
- }
- static std::ptrdiff_t stride (vector_type& mc) {
- return matrix_traits<m_type>::stride1 (mc.data());
- }
- };
-
-
-#ifndef BOOST_NUMERIC_BINDINGS_FORTRAN
-
- // (undocumented) ublas::c_matrix<>
- template <typename T, std::size_t M, std::size_t N, typename Matr>
- struct matrix_detail_traits< boost::numeric::ublas::c_matrix<T,M,N>, Matr >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::c_matrix<T,M,N>, typename boost::remove_const<Matr>::type>::value) );
-#endif
-
- typedef boost::numeric::ublas::c_matrix<T,M,N> identifier_type ;
- typedef Matr matrix_type;
- typedef general_t matrix_structure;
- typedef row_major_t ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<Matr,T>::type* pointer;
-
- static pointer storage (matrix_type& m) { return m.data(); }
- static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& m) { return N; }
-
- // stride1 == distance (m (i, j), m (i+1, j))
- static std::ptrdiff_t stride1 (matrix_type& m) { return N; }
- // stride2 == distance (m (i, j), m (i, j+1))
- static std::ptrdiff_t stride2 (matrix_type& m) { return 1; }
- };
-
-#endif // BOOST_NUMERIC_BINDINGS_FORTRAN
-
-
- // ublas::matrix_vector_range<>
- template <typename M, typename MR>
- struct vector_detail_traits< boost::numeric::ublas::matrix_vector_range<M>, MR >
- : default_vector_traits< MR, typename M::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_vector_range<M>, typename boost::remove_const<MR>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::matrix_vector_range<M> identifier_type;
- typedef MR vector_type;
- typedef typename M::value_type value_type;
- typedef typename default_vector_traits<MR,value_type>::pointer pointer;
-
- static pointer storage (vector_type& mr) {
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
- return matrix_traits<m_type>::storage (mr.data()) + mr.start1() * matrix_traits<m_type>::stride1 (mr.data()) + mr.start2() * matrix_traits<m_type>::stride2 (mr.data());
- }
- static std::ptrdiff_t stride (vector_type& mr) {
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
- return matrix_traits<m_type>::stride1 (mr.data()) + matrix_traits<m_type>::stride2 (mr.data());
- }
- };
-
-
- // ublas::matrix_vector_slice<>
- template <typename M, typename MR>
- struct vector_detail_traits< boost::numeric::ublas::matrix_vector_slice<M>, MR >
- : default_vector_traits< MR, typename M::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::matrix_vector_slice<M>, typename boost::remove_const<MR>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::matrix_vector_slice<M> identifier_type;
- typedef MR vector_type;
- typedef typename M::value_type value_type;
- typedef typename default_vector_traits<MR,value_type>::pointer pointer;
-
- static pointer storage (vector_type& mr) {
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
- return matrix_traits<m_type>::storage (mr.data()) + mr.start1() * matrix_traits<m_type>::stride1 (mr.data()) + mr.start2() * matrix_traits<m_type>::stride2 (mr.data());
- }
- static std::ptrdiff_t stride (vector_type& mr) {
- typedef typename detail::generate_const<MR, typename MR::matrix_closure_type>::type m_type;
- return mr.stride1() * matrix_traits<m_type>::stride1 (mr.data()) + mr.stride2() * matrix_traits<m_type>::stride2 (mr.data());
- }
- };
-
-
- // ublas::bounded_matrix<>
- template <typename T, std::size_t R, std::size_t C, typename F, typename M>
- struct matrix_detail_traits< boost::numeric::ublas::bounded_matrix<T, R, C, F>, M >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::bounded_matrix<T, R, C, F>, typename boost::remove_const<M>::type>::value) );
-#endif
-#ifdef BOOST_NUMERIC_BINDINGS_FORTRAN
- BOOST_STATIC_ASSERT((boost::is_same<
- typename F::orientation_category,
- boost::numeric::ublas::column_major_tag
- >::value));
-#endif
-
- typedef boost::numeric::ublas::bounded_matrix<T, R, C, F> identifier_type ;
- typedef M matrix_type;
- typedef general_t matrix_structure;
- typedef typename detail::ublas_ordering<
- typename F::orientation_category
- >::type ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<M,T>::type* pointer;
-
- typedef typename identifier_type::orientation_category orientation_category;
- typedef typename detail::ublas_ordering<orientation_category>::functor_type functor_t ;
-
- static pointer storage (matrix_type& m) {
- typedef typename detail::generate_const<M,typename identifier_type::array_type>::type array_type ;
- return vector_traits<array_type>::storage (m.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& m) { return m.size1() * m.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& m) {
- // g++ 2.95.4 and 3.0.4 (with -pedantic) dislike
- // identifier_type::functor_type::size2()
- //return functor_t::size_m (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::leading_dimension( m ) ;
- }
-
- // stride1 == distance (m (i, j), m (i+1, j))
- static std::ptrdiff_t stride1 (matrix_type& m) {
- //return functor_t::one1 (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::stride1( m ) ;
- }
- // stride2 == distance (m (i, j), m (i, j+1))
- static std::ptrdiff_t stride2 (matrix_type& m) {
- //return functor_t::one2 (m.size1(), m.size2());
- return detail::ublas_ordering<orientation_category>::stride2( m ) ;
- }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_MATRIX_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_sparse.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_sparse.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,152 +0,0 @@
-/*
- *
- * Copyright (c) 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SPARSE_MATRIX_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SPARSE_MATRIX_H
-
-#include <cstddef>
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/matrix_sparse.hpp>
-#endif
-#include <boost/numeric/bindings/traits/sparse_traits.hpp>
-#include <boost/numeric/bindings/traits/ublas_storage.hpp>
-#include <boost/numeric/bindings/traits/detail/ublas_ordering.hpp>
-#include <algorithm>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::compressed_matrix<>
- template <typename T, typename F, std::size_t IB, typename IA, typename TA,
- typename MType
- >
- struct sparse_matrix_detail_traits<
- boost::numeric::ublas::compressed_matrix<T,F,IB,IA,TA>,
- MType
- >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::compressed_matrix<T,F,IB,IA,TA>,
- typename boost::remove_const<MType>::type
- >::value)
- );
-#endif
-
- typedef
- boost::numeric::ublas::compressed_matrix<T,F,IB,IA,TA> identifier_type;
- typedef MType matrix_type;
-
- typedef general_t matrix_structure;
- typedef compressed_t storage_format;
- typedef typename detail::ublas_ordering<
- typename F::orientation_category
- >::type ordering_type;
- typedef F layout_type;
-
- typedef T value_type;
-
- private:
- typedef typename detail::generate_const<MType,TA>::type val_array_t;
- typedef typename detail::generate_const<MType,IA>::type idx_array_t;
-
- public:
- typedef typename vector_traits<val_array_t>::pointer value_pointer;
- typedef typename vector_traits<idx_array_t>::pointer index_pointer;
-
- BOOST_STATIC_CONSTANT (std::size_t, index_base = IB);
-
- static index_pointer index1_storage (matrix_type& cm) {
- //assert (cm.filled1() == layout_type::num_rows (cm.size1(), cm.size2()) + 1);
- return vector_traits<idx_array_t>::storage (cm.index1_data());
- }
- static index_pointer index2_storage (matrix_type& cm) {
- return vector_traits<idx_array_t>::storage (cm.index2_data());
- }
- static value_pointer value_storage (matrix_type& cm) {
- return vector_traits<val_array_t>::storage (cm.value_data());
- }
-
- static std::ptrdiff_t num_rows (matrix_type& cm) { return cm.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& cm) { return cm.size2(); }
- static std::ptrdiff_t num_nonzeros (matrix_type& cm) {
- return cm.nnz();
- // Joerg, this isn't very intuitive :o(
- // return cm.non_zeros();
- }
- };
-
-
- // ublas::coordinate_matrix<>
- template <typename T, typename F, std::size_t IB, typename IA, typename TA,
- typename MType
- >
- struct sparse_matrix_detail_traits<
- boost::numeric::ublas::coordinate_matrix<T,F,IB,IA,TA>,
- MType
- >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::coordinate_matrix<T,F,IB,IA,TA>,
- typename boost::remove_const<MType>::type
- >::value)
- );
-#endif
-
- typedef
- boost::numeric::ublas::coordinate_matrix<T,F,IB,IA,TA> identifier_type;
- typedef MType matrix_type;
-
- typedef general_t matrix_structure;
- typedef coordinate_t storage_format;
- typedef typename detail::ublas_ordering<
- typename F::orientation_category
- >::type ordering_type;
-
- typedef T value_type;
-
- private:
- typedef typename detail::generate_const<MType,TA>::type val_array_t;
- typedef typename detail::generate_const<MType,IA>::type idx_array_t;
-
- public:
- typedef typename vector_traits<val_array_t>::pointer value_pointer;
- typedef typename vector_traits<idx_array_t>::pointer index_pointer;
-
- BOOST_STATIC_CONSTANT (std::size_t, index_base = IB);
-
- static index_pointer index1_storage (matrix_type& cm) {
- return vector_traits<idx_array_t>::storage (cm.index1_data());
- }
- static index_pointer index2_storage (matrix_type& cm) {
- return vector_traits<idx_array_t>::storage (cm.index2_data());
- }
- static value_pointer value_storage (matrix_type& cm) {
- return vector_traits<val_array_t>::storage (cm.value_data());
- }
-
- static int num_rows (matrix_type& cm) { return cm.size1(); }
- static int num_columns (matrix_type& cm) { return cm.size2(); }
- static int num_nonzeros (matrix_type& cm) {
- return cm.nnz();
- // Joerg, this isn't very intuitive :o(
- // return cm.non_zeros();
- }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SPARSE_MATRIX_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_storage.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_storage.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,32 +0,0 @@
-//
-// Copyright (c) 2009 by Rutger ter Borg and Thomas Klimpel
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_STORAGE_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_STORAGE_HPP
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/storage.hpp>
-#endif
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::bounded array
- template <typename T, std::size_t N, typename V>
- struct vector_detail_traits< ublas::bounded_array< T, N>, V >:
- public default_vector_traits< V, T > {};
-
- // ublas::unbounded array
- template< typename T, typename Allocator, typename V >
- struct vector_detail_traits< ublas::unbounded_array< T, Allocator >, V >:
- public default_vector_traits< V, T > {};
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_symmetric.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_symmetric.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SYMMETRIC_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SYMMETRIC_H
-
-#include <boost/numeric/bindings/traits/traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/symmetric.hpp>
-#endif
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/detail/ublas_uplo.hpp>
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::symmetric_matrix<>
- template <typename T, typename F1, typename F2, typename A, typename M>
- struct matrix_detail_traits<boost::numeric::ublas::symmetric_matrix<T, F1, F2, A>, M>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::symmetric_matrix<T, F1, F2, A>, typename boost::remove_const<M>::type>::value) );
-#endif
-#ifdef BOOST_BINDINGS_FORTRAN
- BOOST_STATIC_ASSERT((boost::is_same<
- typename F2::orientation_category,
- boost::numeric::ublas::column_major_tag
- >::value));
-#endif
-
- typedef boost::numeric::ublas::symmetric_matrix<T, F1, F2, A> identifier_type;
- typedef M matrix_type;
-
- typedef symmetric_packed_t matrix_structure;
- typedef typename detail::ublas_ordering<
- typename F2::orientation_category
- >::type ordering_type;
- typedef typename detail::ublas_uplo< F1 >::type uplo_type;
-
- typedef T value_type ;
- typedef typename detail::generate_const<M,T>::type* pointer ;
-
- static pointer storage (matrix_type& sm) {
- typedef typename detail::generate_const<M,A>::type array_type ;
- return vector_traits<array_type>::storage (sm.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& sm) { return sm.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& sm) { return sm.size2(); }
- };
-
-
- // ublas::symmetric_adaptor<>
- template <typename M, typename F1, typename MA>
- struct matrix_detail_traits<boost::numeric::ublas::symmetric_adaptor<M, F1>, MA>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same<boost::numeric::ublas::symmetric_adaptor<M, F1>, typename boost::remove_const<MA>::type>::value) );
-#endif
-
- typedef boost::numeric::ublas::symmetric_adaptor<M, F1> identifier_type;
- typedef MA matrix_type;
- typedef symmetric_t matrix_structure;
- typedef typename matrix_traits<M>::ordering_type ordering_type;
- typedef typename detail::ublas_uplo< F1 >::type uplo_type;
-
- typedef typename M::value_type value_type;
- typedef typename detail::generate_const<MA, value_type>::type* pointer;
-
- private:
- typedef typename detail::generate_const<MA, typename MA::matrix_closure_type>::type m_type;
-
- public:
- static pointer storage (matrix_type& sm) {
- return matrix_traits<m_type>::storage (sm.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& sm) { return sm.size1(); }
- static std::ptrdiff_t num_columns (matrix_type& sm) { return sm.size2(); }
- static std::ptrdiff_t leading_dimension (matrix_type& sm) {
- return matrix_traits<m_type>::leading_dimension (sm.data());
- }
- };
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_SYMMETRIC_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,177 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_H
-
-#include <boost/numeric/bindings/traits/vector_traits.hpp>
-#include <boost/numeric/bindings/traits/ublas_storage.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/vector.hpp>
-#endif
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::vector<>
- template <typename T, typename ArrT, typename V>
- struct vector_detail_traits< boost::numeric::ublas::vector<T, ArrT>, V >
- : default_vector_traits< V, T >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::vector<T, ArrT>, typename boost::remove_const<V>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector<T, ArrT> identifier_type;
- typedef V vector_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (vector_type& v) {
- typedef typename detail::generate_const<V,ArrT>::type array_type ;
- return vector_traits<array_type>::storage (v.data());
- }
- };
-
- // ublas::vector_reference<>
- template <typename V, typename VR>
- struct vector_detail_traits< boost::numeric::ublas::vector_reference<V>, VR >
- : default_vector_traits< VR, typename V::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::vector_reference<V>, typename boost::remove_const<VR>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector_reference<V> identifier_type;
- typedef VR vector_type;
- typedef typename V::value_type value_type ;
- typedef typename default_vector_traits<VR,value_type>::pointer pointer;
-
- private:
- typedef typename detail::generate_const<VR,V>::type vct_t;
-
- public:
- static pointer storage (vector_type& v) {
- return vector_traits<vct_t>::storage (v.expression());
- }
- static std::ptrdiff_t stride (vector_type& v) {
- return vector_traits<vct_t>::stride (v.expression());
- }
- };
-
- // ublas::vector_range<>
- template <typename V, typename VR>
- struct vector_detail_traits< boost::numeric::ublas::vector_range<V>, VR >
- : default_vector_traits< VR, typename V::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::vector_range<V>, typename boost::remove_const<VR>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector_range<V> identifier_type;
- typedef VR vector_type;
- typedef typename V::value_type value_type ;
- typedef typename default_vector_traits<VR,value_type>::pointer pointer;
-
- private:
- typedef typename detail::generate_const<VR, typename VR::vector_closure_type>::type v_type;
-
- public:
- static pointer storage (vector_type& vr) {
- pointer ptr = vector_traits<v_type>::storage (vr.data());
- ptr += vr.start() * vector_traits<v_type>::stride (vr.data());
- return ptr;
- }
- static std::ptrdiff_t stride (vector_type& vr) {
- return vector_traits<v_type>::stride (vr.data());
- }
- };
-
-
- // ublas::vector_slice<>
- template <typename V, typename VS>
- struct vector_detail_traits<boost::numeric::ublas::vector_slice<V>, VS >
- : default_vector_traits< VS, typename V::value_type >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::vector_slice<V>, typename boost::remove_const<VS>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector_slice<V> identifier_type;
- typedef VS vector_type;
- typedef typename V::value_type value_type ;
- typedef typename default_vector_traits<VS,value_type>::pointer pointer;
-
- private:
- typedef typename detail::generate_const<VS, typename VS::vector_closure_type>::type v_type;
-
- public:
- static pointer storage (vector_type& vs) {
- pointer ptr = vector_traits<v_type>::storage (vs.data());
- ptr += vs.start() * vector_traits<v_type>::stride (vs.data());
- return ptr;
- }
- static std::ptrdiff_t stride (vector_type& vs) {
- return vs.stride() * vector_traits<v_type>::stride (vs.data());
- }
- };
-
-
-#ifndef BOOST_NUMERIC_BINDINGS_FORTRAN
-
- // (undocumented) ublas::c_vector<>
- template <typename T, std::size_t N, typename V>
- struct vector_detail_traits< boost::numeric::ublas::c_vector<T, N>, V >
- : default_vector_traits< V, T >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::c_vector<T,N>, typename boost::remove_const<V>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::c_vector<T,N> identifier_type;
- typedef V vector_type;
- typedef typename default_vector_traits<V,T>::pointer pointer;
-
- static pointer storage (vector_type& v) { return v.data(); }
- };
-
-#endif // BOOST_NUMERIC_BINDINGS_FORTRAN
-
-
- // ublas::bounded_vector<>
- template <typename T, std::size_t N, typename V>
- struct vector_detail_traits< boost::numeric::ublas::bounded_vector<T, N>, V >
- : default_vector_traits< V, T >
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT( (boost::is_same< boost::numeric::ublas::bounded_vector<T, N>, typename boost::remove_const<V>::type >::value) );
-#endif
-
- typedef boost::numeric::ublas::bounded_vector<T, N> identifier_type;
- typedef V vector_type;
- typedef typename default_vector_traits< V, T >::pointer pointer;
-
- static pointer storage (vector_type& v) {
- typedef typename detail::generate_const<V,typename identifier_type::array_type>::type array_type ;
- return vector_traits<array_type>::storage (v.data());
- }
- };
-
-
-}}}}
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/ublas_vector2.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,169 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_AS_MATRIX_H
-#define BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_AS_MATRIX_H
-
-#include <boost/numeric/bindings/traits/config.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#endif
-#include <boost/numeric/bindings/traits/matrix_traits.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
-# include <boost/static_assert.hpp>
-# include <boost/type_traits/same_traits.hpp>
-# include <boost/mpl/if.hpp>
-#endif
-
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- // ublas::vector<> treated as matrix (nx1)
- template <typename T, typename ArrT, typename V>
- struct matrix_detail_traits<boost::numeric::ublas::vector<T, ArrT>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::vector<T, ArrT>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector<T, ArrT> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<V,T>::type* pointer;
-
- static pointer storage (matrix_type& v) {
- typedef typename detail::generate_const<V,ArrT>::type array_type;
- return vector_traits<array_type>::storage (v.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
- };
-
-
- // ublas::vector_range<> treated as matrix (nx1)
- template <typename T, typename V>
- struct matrix_detail_traits<boost::numeric::ublas::vector_range<T>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::vector_range<T>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef boost::numeric::ublas::vector_range<T> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef typename T::value_type value_type;
- typedef typename detail::generate_const<V,value_type>::type* pointer;
-
- static pointer storage (matrix_type& v) {
- return vector_traits<V>::storage (v);
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
- };
-
-
-#ifndef BOOST_NUMERIC_BINDINGS_FORTRAN
-
- // (undocumented) ublas::c_vector<>
- template <typename T, std::size_t N, typename V>
- struct matrix_detail_traits<boost::numeric::ublas::c_vector<T,N>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::c_vector<T,N>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef boost::numeric::ublas::c_vector<T,N> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef row_major_t ordering_type; // consistent with c_matrix<>
-
- typedef T value_type;
- typedef typename detail::generate_const<V,T>::type* pointer;
-
- static pointer storage (matrix_type& v) { return v.data(); }
- static std::ptrdiff_t num_rows (matrix_type&) { return 1; }
- static std::ptrdiff_t num_columns (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t leading_dimension (matrix_type&) { return N; }
- };
-
-#endif // BOOST_NUMERIC_BINDINGS_FORTRAN
-
-
- // ublas::bounded_vector<> treated as matrix (nx1)
- template <typename T, std::size_t N, typename V>
- struct matrix_detail_traits<boost::numeric::ublas::bounded_vector<T, N>, V>
- {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
- BOOST_STATIC_ASSERT(
- (boost::is_same<
- boost::numeric::ublas::bounded_vector<T, N>,
- typename boost::remove_const<V>::type
- >::value) );
-#endif
-
- typedef boost::numeric::ublas::bounded_vector<T, N> identifier_type;
- typedef V matrix_type;
- typedef general_t matrix_structure;
- typedef column_major_t ordering_type;
-
- typedef T value_type;
- typedef typename detail::generate_const<V,T>::type* pointer;
-
- static pointer storage (matrix_type& v) {
- typedef typename detail::generate_const<V,typename identifier_type::array_type>::type array_type;
- return vector_traits<array_type>::storage (v.data());
- }
- static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
- static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
- };
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#error with your compiler ublas::vector<> cannot be used as matrix
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_UBLAS_VECTOR_AS_MATRIX_H
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_raw.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_raw.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,276 +0,0 @@
-//
-// Copyright (c) 2002,2003,2004
-// Toon Knapen, Kresimir Fresl, Joerg Walter, Karl Meerbergen
-//
-// 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 BOOST_NUMERIC_BINDINGS_TRAITS_VECTOR_RAW_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_VECTOR_RAW_HPP
-
-#include <cstddef>
-#include <boost/numeric/ublas/config.hpp>
-#ifndef BOOST_UBLAS_HAVE_BINDINGS
-# include <boost/numeric/ublas/vector.hpp>
-#endif
-#include <vector>
-#include <boost/numeric/bindings/traits/detail/array_impl.hpp>
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_size (const V &v) {
- return (std::ptrdiff_t) v.size();
- }
-
- ////////////////////////////////////////////////////////////////
- // ublas::vector<> etc.
-
- namespace ublas = boost::numeric::ublas;
-
-#if 0
- // MSVC seems to dislike overloads if there is `generic' template
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_size (const ublas::vector_reference<V> &v) {
- return vector_size (v.expression());
- }
-#endif
-
-#if 0
- // MSVC seems to dislike overloads if there is `generic' template
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const V &v) { return 1; }
-#endif
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::vector<T,A> &v) { return 1; }
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::vector_reference<V> &v) {
- return (std::ptrdiff_t) vector_stride (v.expression());
- }
- template <typename T, std::size_t N>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::c_vector<T, N> &v) { return 1; }
- template <typename V>
- std::ptrdiff_t vector_stride (const ublas::vector_slice<V>&);
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::vector_range<V> &v) {
- return (std::ptrdiff_t) vector_stride (v.data());
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const ublas::vector_slice<V> &v) {
- return (std::ptrdiff_t) (v.stride() * vector_stride (v.data()));
- }
-
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::vector<T,A>::value_type const*
- vector_storage (const ublas::vector<T,A> &v) {
- return &v.data().begin()[0];
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::vector<T,A>::value_type const*
- vector_storage_const (const ublas::vector<T,A> &v) {
- return &v.data().begin()[0];
- }
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename ublas::vector<T,A>::value_type*
- vector_storage (ublas::vector<T,A> &v) {
- return &v.data().begin()[0];
- }
-
-#if 0
- // MSVC seems to dislike overloads if there is `generic' template
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::const_pointer vector_storage (const V &v) {
- return &v.data().begin()[0];
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::const_pointer vector_storage_const (const V &v) {
- return &v.data().begin()[0];
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::pointer vector_storage (V &v) {
- return &v.data().begin()[0];
- }
-#endif
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const*
- vector_storage (const ublas::vector_reference<V> &v) {
- return vector_storage (v.expression());
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const*
- vector_storage_const (const ublas::vector_reference<V> &v) {
- return vector_storage_const (v.expression());
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type* vector_storage (ublas::vector_reference<V> &v) {
- return vector_storage (v.expression());
- }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_vector<T, N>::value_type const*
- vector_storage (const ublas::c_vector<T, N> &v) {
- return v.data();
- }
-#endif
-#ifndef BOOST_MSVC
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_vector<T, N>::value_type const*
- vector_storage_const (const ublas::c_vector<T, N> &v) {
- return v.data();
- }
- template <typename T, std::size_t N>
- BOOST_UBLAS_INLINE
- typename ublas::c_vector<T, N>::value_type*
- vector_storage (ublas::c_vector<T, N> &v) {
- return v.data();
- }
-#endif
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename V>
- typename V::value_type const* vector_storage (const ublas::vector_slice<V>&);
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const* vector_storage (const ublas::vector_range<V> &v) {
- typename V::value_type const* ptr = vector_storage (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const* vector_storage (const ublas::vector_slice<V> &v) {
- typename V::value_type const* ptr = vector_storage (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename V>
- typename V::value_type const*
- vector_storage_const (const ublas::vector_slice<V>&);
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const*
- vector_storage_const (const ublas::vector_range<V> &v) {
- typename V::value_type const* ptr = vector_storage_const (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type const*
- vector_storage_const (const ublas::vector_slice<V> &v) {
- typename V::value_type const* ptr = vector_storage_const (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
- template <typename V>
- typename V::value_type* vector_storage (ublas::vector_slice<V>&);
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type* vector_storage (ublas::vector_range<V> &v) {
- typename V::value_type* ptr = vector_storage (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
- template <typename V>
- BOOST_UBLAS_INLINE
- typename V::value_type* vector_storage (ublas::vector_slice<V> &v) {
- typename V::value_type* ptr = vector_storage (v.data());
- ptr += v.start() * vector_stride (v.data());
- return ptr;
- }
-
-
- //////////////////////////////////////////////////////////////////
- // std::vector<>
-
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const std::vector<T,A> &v) { return 1; }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename std::vector<T, A>::value_type const*
- vector_storage (const std::vector<T, A> &v) { return &v.front(); }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename std::vector<T, A>::value_type const*
- vector_storage_const (const std::vector<T, A> &v) { return &v.front(); }
- template <typename T, typename A>
- BOOST_UBLAS_INLINE
- typename std::vector<T, A>::value_type* vector_storage (std::vector<T, A> &v) {
- return &v.front();
- }
-
-
- //////////////////////////////////////////////////////////////////
- // bindings::traits::detail::array<>
-
- template <typename T>
- BOOST_UBLAS_INLINE
- std::ptrdiff_t vector_stride (const detail::array<T> &a) { return 1; }
-
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template <typename T>
- BOOST_UBLAS_INLINE
- const T* vector_storage (const detail::array<T> &a) { return a.storage(); }
-#endif
- // We need storage_const() mostly due to MSVC 6.0.
- // But how shall we write portable code otherwise?
- template <typename T>
- BOOST_UBLAS_INLINE
- const T* vector_storage_const (const detail::array<T> &a) {
- return a.storage();
- }
- template <typename T>
- BOOST_UBLAS_INLINE
- T* vector_storage (detail::array<T> &a) { return a.storage(); }
-
-
-}}}}
-
-#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_traits.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/traits/vector_traits.hpp 2010-03-20 08:56:19 EDT (Sat, 20 Mar 2010)
+++ (empty file)
@@ -1,102 +0,0 @@
-/*
- *
- * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen
- *
- * 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)
- *
- * KF acknowledges the support of the Faculty of Civil Engineering,
- * University of Zagreb, Croatia.
- *
- */
-
-#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_VECTOR_TRAITS_HPP
-#define BOOST_NUMERIC_BINDINGS_TRAITS_VECTOR_TRAITS_HPP
-
-#include <boost/numeric/bindings/traits/config.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/numeric/bindings/traits/is_numeric.hpp>
-
-#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/detail/generate_const.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK
-# include <boost/type_traits/is_same.hpp>
-# include <boost/static_assert.hpp>
-#endif
-
-namespace boost { namespace numeric { namespace bindings { namespace traits {
-
- /// default_vector_traits is just a base-class that can be
- /// used as the default vector_traits and the different
- /// specialisation to automatically define most of the
- /// functions.
- template <typename V, typename T = typename V::value_type >
- struct default_vector_traits {
- typedef T value_type;
- typedef typename detail::generate_const<V,value_type>::type* pointer; // if V is const, pointer will be a const value_type*
-
- static pointer storage (V& v) { return &v[0]; }
- static std::ptrdiff_t size (V& v) { return static_cast<std::ptrdiff_t>(v.size()); }
- static std::ptrdiff_t stride (V&) { return 1; }
- };
-
- // vector_detail_traits is used to implement specializations of vector_traits.
- // VIdentifier is the vector_type without const, while VType can have a const.
- // VIdentifier is used to write template specializations for VType and const VType.
- // e.g. vector_detail_traits< std::vector<int>, std::vector<int> const >
- // e.g. vector_detail_traits< std::vector<int>, std::vector<int> >
- // Note that boost::remove_const<VType>::type == VIdentifier.
- template <typename VIdentifier, typename VType>
- struct vector_detail_traits {
- typedef VIdentifier identifier_type;
- typedef VType vector_type;
- };
-
- // vector_traits<> generic version: no specialization(s)
- template< typename V, typename Enable = void>
- struct vector_traits {};
-
- // vector_traits<>, derives from vector_detail_traits<> if
- // vector_detail_traits<>::value_type is a numeric type
- template <typename V>
- struct vector_traits< V, typename boost::enable_if< is_numeric<
- typename vector_detail_traits< typename boost::remove_const<V>::type, V >::value_type
- > >::type >:
- vector_detail_traits< typename boost::remove_const<V>::type, V > {};
-
- ///////////////////////////
- //
- // free accessor functions:
- //
- ///////////////////////////
-
- template <typename V>
- inline
- typename vector_traits<V>::pointer vector_storage (V& v) {
- return vector_traits<V>::storage (v);
- }
-
- template <typename V>
- inline
- std::ptrdiff_t vector_size (V& v) {
- return vector_traits<V>::size (v);
- }
-
- template <typename V>
- inline
- std::ptrdiff_t vector_stride (V& v) {
- return vector_traits<V>::stride (v);
- }
-
-}}}}
-
-#else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#include <boost/numeric/bindings/traits/vector_raw.hpp>
-
-#endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
-
-#endif // BOOST_NUMERIC_BINDINGS_TRAITS_VECTOR_TRAITS_HPP
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk