/* * fusion_algebra.hpp * * Copyright 2011 Mario Mulansky * Copyright 2012 Karsten Ahnert * * 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 FUSION_ALGEBRA_HPP_ #define FUSION_ALGEBRA_HPP_ #include #include template< size_t n > struct fusion_algebra { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , n > &a , const boost::array< T , dim > k_vector[n] , const double dt ) { for( size_t i=0 ; i inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< double , n > &a , const boost::array< T , dim > k_vector[n] , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 1 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 1 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 2 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 2 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 3 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 3 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 4 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 4 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 5 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 5 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i struct fusion_algebra< 6 > { template< typename T , size_t dim > inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x , const boost::array< double , 6 > &a , const boost::array< T , dim > *k_vector , const double dt ) { for( size_t i=0 ; i inline static void foreach(boost::array &x_tmp , const boost::array &a , const boost::array *k_vector , const double dt) { for (size_t i = 0 ; i < dim ; ++i) { x_tmp[i] = a[0] * dt * k_vector[0][i] + a[1] * dt * k_vector[1][i] + a[2] * dt * k_vector[2][i] + a[3] * dt * k_vector[3][i] + a[4] * dt * k_vector[4][i] + a[5] * dt * k_vector[5][i]; } } }; //#endif /* BOOST_MSVC */ #endif /* FUSION_ALGEBRA_HPP_ */