32 #include <boost/fusion/container/vector.hpp>
33 #include <boost/fusion/algorithm/iteration.hpp>
34 #include <boost/mpl/bitor.hpp>
35 #include <boost/mpl/bitwise.hpp>
36 #include <boost/mpl/transform.hpp>
38 #include <boost/mpl/plus.hpp>
39 #include <boost/mpl/arithmetic.hpp>
44 namespace fusion = boost::fusion;
45 namespace mpl = boost::mpl;
53 template<
typename Sig>
56 template<
typename Lhs,
typename Rhs>
57 struct result<GetContext( Lhs,Rhs )>
58 #if BOOST_VERSION < 104200
59 : boost::remove_reference<Lhs>
61 : boost::remove_reference<Rhs>
65 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
66 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
67 #if BOOST_VERSION < 104200
68 typedef typename mpl::bitor_<mpl::size_t<lhs_noref_type::context>, rhs_noref_type >::type type;
70 typedef typename mpl::bitor_<mpl::size_t<rhs_noref_type::context>, lhs_noref_type >::type type;
74 template<
typename Expr1,
typename Expr2>
77 typedef typename mpl::bitor_<mpl::size_t<Expr1::context>, Expr2 >::type type;
80 template<
typename Lhs,
typename Rhs>
81 #if BOOST_VERSION < 104200
86 operator()(
const Lhs& lhs,
const Rhs& rhs )
const
93 template<
typename Sig>
96 template<
typename Lhs,
typename Rhs>
97 struct result<GetImOrder( Lhs,Rhs )>
98 #if BOOST_VERSION < 104200
99 : boost::remove_reference<Lhs>
101 : boost::remove_reference<Rhs>
105 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
106 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
107 #if BOOST_VERSION < 104200
108 typedef typename boost::mpl::max< boost::mpl::size_t<lhs_noref_type::imorder>, rhs_noref_type >::type type;
110 typedef typename boost::mpl::max< boost::mpl::size_t<rhs_noref_type::imorder>, lhs_noref_type >::type type;
114 template<
typename Lhs,
typename Rhs>
115 #if BOOST_VERSION < 104200
120 operator()(
const Lhs& lhs,
const Rhs& rhs )
const
126 template<
typename Sig>
129 template<
typename Lhs,
typename Rhs>
130 struct result<GetImIsPoly( Lhs,Rhs )>
131 #if BOOST_VERSION < 104200
132 : boost::remove_reference<Lhs>
134 : boost::remove_reference<Rhs>
138 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
139 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
140 #if BOOST_VERSION < 104200
141 typedef typename boost::mpl::and_< boost::mpl::bool_<lhs_noref_type::imIsPoly>, rhs_noref_type >::type type;
143 typedef typename boost::mpl::and_< boost::mpl::bool_<rhs_noref_type::imIsPoly>, lhs_noref_type >::type type;
147 template<
typename Lhs,
typename Rhs>
148 #if BOOST_VERSION < 104200
153 operator()(
const Lhs& lhs,
const Rhs& rhs )
const
157 template<
typename Func>
158 struct ExprHasTestFunction
160 template<
typename Sig>
163 template<
typename Lhs,
typename Rhs>
164 struct result<ExprHasTestFunction( Lhs,Rhs )>
165 #if BOOST_VERSION < 104200
166 : boost::remove_reference<Lhs>
168 : boost::remove_reference<Rhs>
172 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
173 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
174 #if BOOST_VERSION < 104200
175 typedef typename mpl::or_<mpl::bool_<lhs_noref_type::template HasTestFunction<Func>::result>, rhs_noref_type >::type type;
177 typedef typename mpl::or_<mpl::bool_<rhs_noref_type::template HasTestFunction<Func>::result>, lhs_noref_type >::type type;
180 template<
typename Lhs,
typename Rhs>
181 #if BOOST_VERSION < 104200
186 operator()(
const Lhs& lhs,
const Rhs& rhs )
const
189 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
190 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
191 return ( lhs_noref_type::template ExprHasTestFunction<Func>::result ||
192 lhs_noref_type::template ExprHasTestFunction<Func>::result );
196 template<
typename Func>
197 struct ExprHasTrialFunction
199 template<
typename Sig>
202 template<
typename Lhs,
typename Rhs>
203 struct result<ExprHasTrialFunction( Lhs,Rhs )>
204 #if BOOST_VERSION < 104200
205 : boost::remove_reference<Lhs>
207 : boost::remove_reference<Rhs>
211 typedef typename boost::remove_reference<Lhs>::type lhs_noref_type;
212 typedef typename boost::remove_reference<Rhs>::type rhs_noref_type;
213 #if BOOST_VERSION < 104200
214 typedef typename mpl::or_<mpl::bool_<lhs_noref_type::template HasTrialFunction<Func>::result>, rhs_noref_type >::type type;
216 typedef typename mpl::or_<mpl::bool_<rhs_noref_type::template HasTrialFunction<Func>::result>, lhs_noref_type >::type type;
219 template<
typename Lhs,
typename Rhs>
220 #if BOOST_VERSION < 104200
225 operator()(
const Lhs& lhs,
const Rhs& rhs )
const
228 return ( Lhs::template HasTrialFunction<Func>::result ||
229 Rhs::template HasTrialFunction<Func>::result );
233 template<
typename Geo_t,
typename Basis_i_t,
typename Basis_j_t>
234 struct initialize_expression_gij
236 template<
typename Sig>
239 template<
typename ExprT>
240 struct result<initialize_expression_gij( ExprT )>
242 typedef typename boost::remove_reference<ExprT>::type::template tensor<Geo_t, Basis_i_t, Basis_j_t> type;
245 initialize_expression_gij( Geo_t
const& geom , Basis_i_t
const& fev, Basis_j_t
const& feu )
252 template <
typename ExprT>
253 typename ExprT::template tensor<Geo_t, Basis_i_t, Basis_j_t>
254 operator()( ExprT& expr )
const
256 return typename ExprT::template tensor<Geo_t, Basis_i_t, Basis_j_t>( expr, M_geom, M_fev, M_feu );
259 const Basis_i_t& M_fev;
260 const Basis_j_t& M_feu;
262 template<
typename Geo_t,
typename Basis_i_t>
263 struct initialize_expression_gi
265 template<
typename Sig>
268 template<
typename ExprT>
269 struct result<initialize_expression_gi( ExprT )>
271 typedef typename boost::remove_reference<ExprT>::type::template tensor<Geo_t, Basis_i_t> type;
273 initialize_expression_gi( Geo_t
const& geom , Basis_i_t
const& fev )
279 template <
typename ExprT>
280 typename ExprT::template tensor<Geo_t, Basis_i_t>
281 operator()( ExprT& expr )
const
283 return typename ExprT::template tensor<Geo_t, Basis_i_t>( expr, M_geom, M_fev );
287 const Basis_i_t& M_fev;
290 template<
typename Geo_t>
291 struct initialize_expression_g
293 template<
typename Sig>
296 template<
typename ExprT>
297 struct result<initialize_expression_g( ExprT )>
299 typedef typename boost::remove_reference<ExprT>::type::template tensor<Geo_t> type;
301 initialize_expression_g( Geo_t
const& geom )
306 template <
typename ExprT>
307 typename ExprT::template tensor<Geo_t>
308 operator()( ExprT& expr )
const
310 return typename ExprT::template tensor<Geo_t>( expr, M_geom );
318 template<
typename Geo_t,
typename Basis_i_t,
typename Basis_j_t>
319 struct update_expression_gij
321 update_expression_gij( Geo_t
const& geom , Basis_i_t
const& fev, Basis_j_t
const& feu )
328 template <
typename ExprT>
329 void operator()( ExprT& expr )
const
331 expr.update( M_geom, M_fev, M_feu );
334 const Basis_i_t& M_fev;
335 const Basis_j_t& M_feu;
337 template<
typename Geo_t,
typename Basis_i_t>
338 struct update_expression_gi
340 update_expression_gi( Geo_t
const& geom , Basis_i_t
const& fev )
346 template <
typename ExprT>
347 void operator()( ExprT& expr )
const
349 expr.update( M_geom, M_fev );
352 const Basis_i_t& M_fev;
355 template<
typename Geo_t>
356 struct update_expression_g
358 update_expression_g( Geo_t
const& geom )
363 template <
typename ExprT>
364 void operator()( ExprT& expr )
const
366 expr.update( M_geom );
372 template<
typename Geo_t>
373 struct update_expression_face_g
375 update_expression_face_g( Geo_t
const& geom, uint16_type face )
381 template <
typename ExprT>
382 void operator()( ExprT& expr )
const
384 expr.update( M_geom, M_face );
387 const uint16_type M_face;
390 template<
typename IM_t>
391 struct init_expression
393 init_expression( IM_t
const& im )
398 template <
typename ExprT>
399 void operator()( ExprT& expr )
const
407 struct evaluate_expression_gij
409 template<
typename Sig>
412 template<
typename ExprT,
typename V>
413 #if BOOST_VERSION < 104200
414 struct result<evaluate_expression_gij<T>( ExprT,V )>
416 struct result<evaluate_expression_gij<T>( V,ExprT )>
419 boost::remove_reference<V>
421 evaluate_expression_gij( uint16_type indexi , uint16_type indexj, uint16_type c1, uint16_type q )
432 evaluate_expression_gij(
int n, uint16_type indexi, uint16_type indexj, uint16_type c1, uint16_type c2, uint16_type q )
439 M_index( M_c1*n+M_c2 ),
444 template <
typename ExprT>
446 #if BOOST_VERSION < 104200
447 operator()( ExprT
const& expr, T
const& res )
const
449 operator()( T
const& res, ExprT
const& expr )
const
454 if ( M_current == M_index )
455 ret = expr.evalijq( M_indexi, M_indexj, 0, 0, M_q );
460 const uint16_type& M_indexi;
461 const uint16_type& M_indexj;
462 const uint16_type M_c1;
463 const uint16_type M_c2;
464 const uint16_type M_q;
465 const uint16_type M_index;
466 mutable int M_current;
469 template<
typename T=
double>
470 struct evaluate_expression_gi
472 template<
typename Sig>
475 template<
typename ExprT,
typename V>
476 #if BOOST_VERSION < 104200
477 struct result<evaluate_expression_gi<T>( ExprT,V )>
479 struct result<evaluate_expression_gi<T>( V,ExprT )>
482 boost::remove_reference<V>
485 evaluate_expression_gi( uint16_type indexi, uint16_type c1, uint16_type q )
495 evaluate_expression_gi(
int n, uint16_type indexi, uint16_type c1, uint16_type c2, uint16_type q )
501 M_index( M_c1*n+M_c2 ),
505 template <
typename ExprT>
507 #if BOOST_VERSION < 104200
508 operator()( ExprT
const& expr, T
const& res )
const
510 operator()( T
const& res, ExprT
const& expr )
const
515 if ( M_current == M_index )
516 ret = expr.evaliq( M_indexi, 0, 0, M_q );
522 const uint16_type& M_indexi;
523 const uint16_type M_c1;
524 const uint16_type M_c2;
525 const uint16_type M_q;
526 const uint16_type M_index;
527 mutable int M_current;
530 template<
typename T=
double>
531 struct evaluate_expression_g
533 template<
typename Sig>
536 template<
typename ExprT,
typename V>
537 #if BOOST_VERSION < 104200
538 struct result<evaluate_expression_g<T>( ExprT,V )>
540 struct result<evaluate_expression_g<T>( V,ExprT )>
543 boost::remove_reference<V>
546 evaluate_expression_g( uint16_type c1, uint16_type q )
555 evaluate_expression_g(
int n, uint16_type c1, uint16_type c2, uint16_type q )
560 M_index( M_c1*n+M_c2 ),
565 template <
typename ExprT>
567 #if BOOST_VERSION < 104200
568 operator()( ExprT
const& expr, T
const& res )
const
570 operator()( T
const& res, ExprT
const& expr )
const
575 if ( M_current == M_index )
576 ret = expr.evalq( 0, 0, M_q );
581 const uint16_type M_c1;
582 const uint16_type M_c2;
583 const uint16_type M_q;
584 const uint16_type M_index;
585 mutable int M_current;
594 template<
typename VectorExpr>
603 static const size_type context = fusion::result_of::accumulate<VectorExpr,mpl::size_t<0>,GetContext>::type::value;
605 static const bool is_terminal =
false;
606 static const uint16_type imorder = fusion::result_of::accumulate<VectorExpr,mpl::size_t<0>,GetImOrder>::type::value;
607 static const bool imIsPoly = fusion::result_of::accumulate<VectorExpr,mpl::bool_<true>,GetImIsPoly>::type::value;
609 template<
typename Func>
610 struct HasTestFunction
612 static const bool result = fusion::result_of::accumulate<VectorExpr,mpl::bool_<false>,ExprHasTestFunction<Func> >::type::value;
614 template<
typename Func>
615 struct HasTrialFunction
617 static const bool result = fusion::result_of::accumulate<VectorExpr,mpl::bool_<false>,ExprHasTrialFunction<Func> >::type::value;
620 typedef VectorExpr expression_vector_type;
621 typedef Vec<expression_vector_type> this_type;
623 typedef double value_type;
625 static const uint16_type vector_size = fusion::result_of::size<expression_vector_type>::type::value;
633 Vec( VectorExpr
const& expr )
637 Vec( Vec
const & expr )
639 M_expr( expr.M_expr )
657 expression_vector_type
const& expression()
const
661 expression_vector_type & expression()
682 template<
typename Geo_t,
typename Basis_i_t = boost::none_t,
typename Basis_j_t = Basis_i_t>
685 typedef this_type expression_type;
686 typedef typename expression_type::expression_vector_type expression_vector_type;
687 typedef Shape<expression_type::vector_size, Vectorial, false, false> shape;
688 static const bool theshape = ( shape::M == expression_type::vector_size && shape::N == 1 );
689 BOOST_MPL_ASSERT_MSG( theshape,
690 INVALID_TENSOR_SHAPE_SHOULD_BE_RANK_1,
691 ( mpl::int_<shape::M>, mpl::int_<shape::N> ) );
693 typedef typename boost::remove_reference<typename fusion::result_of::at<expression_vector_type, boost::mpl::int_<0> >::type>::type::value_type value_type;
696 template<
typename ExprT>
697 struct ExpressionToTensor
699 typedef typename boost::remove_reference<ExprT>::type expr_type;
700 typedef typename expr_type::template tensor<Geo_t, Basis_i_t, Basis_j_t> type;
702 typedef typename mpl::transform<expression_vector_type, ExpressionToTensor<mpl::_1>, mpl::back_inserter<fusion::vector<> > >::type tensor_vector_type;
707 static const bool value =
false;
710 tensor( expression_type
const& expr,
712 Basis_i_t
const& fev,
713 Basis_j_t
const& feu )
715 M_expr( fusion::transform( expr.expression(), initialize_expression_gij<Geo_t,Basis_i_t,Basis_j_t>( geom, fev, feu ) ) )
718 update( geom, fev, feu );
720 tensor( expression_type
const& expr,
722 Basis_i_t
const& fev )
724 M_expr( fusion::transform( expr.expression(), initialize_expression_gi<Geo_t,Basis_i_t>( geom, fev ) ) )
728 tensor( expression_type
const& expr,
731 M_expr( fusion::transform( expr.expression(), initialize_expression_g<Geo_t>( geom ) ) )
735 template<
typename IM>
736 void init( IM
const& im )
738 fusion::for_each( M_expr,vf::detail::init_expression<IM>( im ) );
740 void update( Geo_t
const& geom, Basis_i_t
const& fev, Basis_j_t
const& feu )
742 fusion::for_each( M_expr,vf::detail::update_expression_gij<Geo_t, Basis_i_t, Basis_j_t>( geom, fev, feu ) );
745 void update( Geo_t
const& geom, Basis_i_t
const& fev )
747 fusion::for_each( M_expr,vf::detail::update_expression_gi<Geo_t, Basis_i_t>( geom, fev ) );
749 void update( Geo_t
const& geom )
751 fusion::for_each( M_expr,vf::detail::update_expression_g<Geo_t>( geom ) );
753 void update( Geo_t
const& geom, uint16_type face )
755 fusion::for_each( M_expr,vf::detail::update_expression_face_g<Geo_t>( geom, face ) );
759 evalijq( uint16_type i, uint16_type j, uint16_type c1, uint16_type , uint16_type q )
const
761 return fusion::accumulate( M_expr, value_type( 0 ),vf::detail::evaluate_expression_gij<value_type>( i, j, c1, q ) );
763 template<
int PatternContext>
765 evalijq( uint16_type i, uint16_type j, uint16_type c1, uint16_type , uint16_type q,
766 mpl::int_<PatternContext> )
const
768 return fusion::accumulate( M_expr, value_type( 0 ),
769 vf::detail::evaluate_expression_gij<value_type>( i, j, c1, q ) );
774 evaliq( uint16_type i, uint16_type c1, uint16_type , uint16_type q )
const
776 return fusion::accumulate( M_expr, value_type( 0 ),vf::detail::evaluate_expression_gi<value_type>( i, c1, q ) );
779 evalq( uint16_type c1, uint16_type , uint16_type q )
const
781 return fusion::accumulate( M_expr, value_type( 0 ),vf::detail::evaluate_expression_g<value_type>( c1, q ) );
783 tensor_vector_type M_expr;
793 expression_vector_type M_expr;
801 template<
typename Expr1>
803 Expr<vf::detail::Vec<fusion::vector<Expr1> > >
806 typedef vf::detail::Vec<fusion::vector<Expr1> > expr_t;
807 return Expr<expr_t>( expr_t( fusion::vector<Expr1>( expr1 ) ) );
812 template<
typename Expr1,
typename Expr2>
814 Expr<vf::detail::Vec<fusion::vector<Expr1, Expr2> > >
815 vec( Expr1 expr1, Expr2 expr2 )
817 typedef vf::detail::Vec<fusion::vector<Expr1, Expr2> > expr_t;
818 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2>( expr1, expr2 ) ) );
823 template<
typename Expr1,
typename Expr2,
typename Expr3>
825 Expr<vf::detail::Vec<fusion::vector<Expr1, Expr2, Expr3> > >
826 vec( Expr1 expr1, Expr2 expr2, Expr3 expr3 )
828 typedef vf::detail::Vec<fusion::vector<Expr1, Expr2, Expr3> > expr_t;
829 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3>( expr1, expr2, expr3 ) ) );
843 template<
int M,
int N,
typename MatrixExpr>
853 static const size_type context = fusion::result_of::accumulate<MatrixExpr,mpl::size_t<0>,GetContext>::type::value;
855 static const bool is_terminal =
false;
856 static const uint16_type imorder = fusion::result_of::accumulate<MatrixExpr,mpl::size_t<0>,GetImOrder>::type::value;
857 static const bool imIsPoly = fusion::result_of::accumulate<MatrixExpr,mpl::bool_<true>,GetImIsPoly>::type::value;
859 template<
typename Func>
860 struct HasTestFunction
862 static const bool result = fusion::result_of::accumulate<MatrixExpr,mpl::bool_<false>,ExprHasTestFunction<Func> >::type::value;
864 template<
typename Func>
865 struct HasTrialFunction
867 static const bool result = fusion::result_of::accumulate<MatrixExpr,mpl::bool_<false>,ExprHasTrialFunction<Func> >::type::value;
870 typedef MatrixExpr expression_matrix_type;
871 typedef Mat<M, N, expression_matrix_type> this_type;
873 typedef double value_type;
875 static const uint16_type matrix_size1 = M;
876 static const uint16_type matrix_size2 = N;
877 static const uint16_type matrix_size = M*N;
880 BOOST_MPL_ASSERT_MSG( ( M*N == fusion::result_of::size<expression_matrix_type>::type::value ),
881 ( INVALID_MATRIX_SIZE ),
882 ( mpl::int_<M>, mpl::int_<N>, mpl::int_<M*N>,
883 mpl::int_<fusion::result_of::size<expression_matrix_type>::type::value> ) );
891 Mat( MatrixExpr
const& expr )
896 Mat( Mat
const & expr )
898 M_expr( expr.M_expr )
917 expression_matrix_type
const& expression()
const
921 expression_matrix_type & expression()
942 template<
typename Geo_t,
typename Basis_i_t,
typename Basis_j_t = Basis_i_t>
945 typedef this_type expression_type;
946 typedef typename expression_type::expression_matrix_type expression_matrix_type;
947 typedef Shape<expression_type::matrix_size1, Tensor2, false, false> shape;
950 static const bool theshape = ( shape::M == expression_type::matrix_size && shape::N == 1 );
951 BOOST_MPL_ASSERT_MSG( theshape,
952 INVALID_TENSOR_SHAPE_SHOULD_BE_RANK_1,
953 ( mpl::int_<shape::M>, mpl::int_<shape::N> ) );
956 typedef typename boost::remove_reference<typename fusion::result_of::at<expression_matrix_type, boost::mpl::int_<0> >::type>::type::value_type value_type;
957 typedef typename boost::remove_reference<typename fusion::result_of::at<expression_matrix_type, boost::mpl::int_<0> >::type>::type::value_type first_value_type;
961 template<
typename ExprT>
962 struct ExpressionToTensor
964 typedef typename boost::remove_reference<ExprT>::type expr_type;
965 typedef typename expr_type::template tensor<Geo_t, Basis_i_t, Basis_j_t> type;
967 typedef typename mpl::transform<expression_matrix_type, ExpressionToTensor<mpl::_1>, mpl::back_inserter<fusion::vector<> > >::type tensor_matrix_type;
972 static const bool value =
false;
975 tensor( expression_type
const& expr,
977 Basis_i_t
const& fev,
978 Basis_j_t
const& feu )
980 M_expr( fusion::transform( expr.expression(), initialize_expression_gij<Geo_t,Basis_i_t,Basis_j_t>( geom, fev, feu ) ) )
983 update( geom, fev, feu );
985 tensor( expression_type
const& expr,
987 Basis_i_t
const& fev )
989 M_expr( fusion::transform( expr.expression(), initialize_expression_gi<Geo_t,Basis_i_t>( geom, fev ) ) )
993 tensor( expression_type
const& expr,
996 M_expr( fusion::transform( expr.expression(), initialize_expression_g<Geo_t>( geom ) ) )
1000 template<
typename IM>
1001 void init( IM
const& im )
1003 fusion::for_each( M_expr,vf::detail::init_expression<IM>( im ) );
1005 void update( Geo_t
const& geom, Basis_i_t
const& fev, Basis_j_t
const& feu )
1007 fusion::for_each( M_expr,vf::detail::update_expression_gij<Geo_t, Basis_i_t, Basis_j_t>( geom, fev, feu ) );
1010 void update( Geo_t
const& geom, Basis_i_t
const& fev )
1012 fusion::for_each( M_expr,vf::detail::update_expression_gi<Geo_t, Basis_i_t>( geom, fev ) );
1014 void update( Geo_t
const& geom )
1016 fusion::for_each( M_expr,vf::detail::update_expression_g<Geo_t>( geom ) );
1018 void update( Geo_t
const& geom, uint16_type face )
1020 fusion::for_each( M_expr,vf::detail::update_expression_face_g<Geo_t>( geom, face ) );
1024 evalijq( uint16_type i, uint16_type j, uint16_type c1, uint16_type c2, uint16_type q )
const
1026 return fusion::accumulate( M_expr, value_type( 0 ),
1027 vf::detail::evaluate_expression_gij<value_type>( expression_type::matrix_size2,
1028 i, j, c1, c2, q ) );
1030 template<
int PatternContext>
1032 evalijq( uint16_type i, uint16_type j, uint16_type c1, uint16_type c2, uint16_type q,
1033 mpl::int_<PatternContext> )
const
1035 return fusion::accumulate( M_expr, value_type( 0 ),
1036 vf::detail::evaluate_expression_gij<value_type>( expression_type::matrix_size2,
1037 i, j, c1, c2, q ) );
1041 evaliq( uint16_type i, uint16_type c1, uint16_type c2, uint16_type q )
const
1043 return fusion::accumulate( M_expr, value_type( 0 ),
1044 vf::detail::evaluate_expression_gi<value_type>( expression_type::matrix_size2, i, c1, c2, q ) );
1048 evalq( uint16_type c1, uint16_type c2, uint16_type q )
const
1050 return fusion::accumulate( M_expr, value_type( 0 ),vf::detail::evaluate_expression_g<value_type>( expression_type::matrix_size2,
1053 tensor_matrix_type M_expr;
1063 expression_matrix_type M_expr;
1071 template<
int M,
int N,
typename Expr1>
1073 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1> > >
1076 BOOST_MPL_ASSERT_MSG( ( M == 1 && N == 1 ), INVALID_MATRIX_SIZE_SHOULD_BE_1_1, ( mpl::int_<M>, mpl::int_<N> ) );
1077 typedef vf::detail::Mat<M, N, fusion::vector<Expr1> > expr_t;
1078 return Expr<expr_t>( expr_t( fusion::vector<Expr1>( expr1 ) ) );
1084 template<
int M,
int N,
typename Expr1,
typename Expr2>
1086 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2> > >
1087 mat( Expr1 expr1, Expr2 expr2 )
1089 BOOST_MPL_ASSERT_MSG( ( M == 2 && N == 1 || M == 1 && N == 2 ), INVALID_MATRIX_SIZE, ( mpl::int_<M>, mpl::int_<N> ) );
1090 typedef vf::detail::Mat<M,N,fusion::vector<Expr1, Expr2> > expr_t;
1091 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2>( expr1, expr2 ) ) );
1097 template<
int M,
int N,
typename Expr1,
typename Expr2,
typename Expr3>
1099 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3> > >
1100 mat( Expr1 expr1, Expr2 expr2, Expr3 expr3 )
1103 BOOST_MPL_ASSERT_MSG( ( M == 3 && N == 1 ||
1105 ( INVALID_MATRIX_SIZE ),
1106 ( mpl::int_<M>, mpl::int_<N> ) );
1108 typedef vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3> > expr_t;
1109 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3>( expr1, expr2, expr3 ) ) );
1115 template<
int M,
int N,
typename Expr1,
typename Expr2,
typename Expr3,
typename Expr4>
1117 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4> > >
1118 mat( Expr1 expr1, Expr2 expr2, Expr3 expr3, Expr4 expr4 )
1121 BOOST_MPL_ASSERT_MSG( ( M == 4 && N == 1 ||
1124 ( INVALID_MATRIX_SIZE ),
1125 ( mpl::int_<M>, mpl::int_<N> ) );
1127 typedef vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4> > expr_t;
1128 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3, Expr4>( expr1, expr2, expr3, expr4 ) ) );
1134 template<
int M,
int N,
typename Expr1,
typename Expr2,
typename Expr3,
typename Expr4,
typename Expr5>
1136 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5> > >
1137 mat( Expr1 expr1, Expr2 expr2, Expr3 expr3, Expr4 expr4, Expr5 expr5 )
1140 BOOST_MPL_ASSERT_MSG( ( M == 4 && N == 1 ||
1143 ( INVALID_MATRIX_SIZE ),
1144 ( mpl::int_<M>, mpl::int_<N> ) );
1146 typedef vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5> > expr_t;
1147 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5>( expr1, expr2, expr3, expr4, expr5 ) ) );
1153 template<
int M,
int N,
typename Expr1,
typename Expr2,
typename Expr3,
typename Expr4,
typename Expr5,
typename Expr6>
1155 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5, Expr6> > >
1156 mat( Expr1 expr1, Expr2 expr2, Expr3 expr3, Expr4 expr4, Expr5 expr5, Expr6 expr6 )
1159 BOOST_MPL_ASSERT_MSG( ( M == 4 && N == 1 ||
1162 ( INVALID_MATRIX_SIZE ),
1163 ( mpl::int_<M>, mpl::int_<N> ) );
1165 typedef vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5, Expr6> > expr_t;
1166 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5, Expr6>( expr1, expr2, expr3, expr4, expr5, expr6 ) ) );
1172 template<
int M,
int N,
1173 typename Expr1,
typename Expr2,
typename Expr3,
typename Expr4,
1174 typename Expr5,
typename Expr6,
typename Expr7,
typename Expr8,
1177 Expr<vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5, Expr6, Expr7, Expr8, Expr9 > > >
1178 mat( Expr1 expr1, Expr2 expr2, Expr3 expr3, Expr4 expr4,
1179 Expr5 expr5, Expr6 expr6, Expr7 expr7, Expr8 expr8, Expr9 expr9 )
1182 BOOST_MPL_ASSERT_MSG( ( M == 4 && N == 1 ||
1185 ( INVALID_MATRIX_SIZE ),
1186 ( mpl::int_<M>, mpl::int_<N> ) );
1188 typedef vf::detail::Mat<M, N, fusion::vector<Expr1, Expr2, Expr3, Expr4,Expr5, Expr6, Expr7, Expr8, Expr9> > expr_t;
1189 return Expr<expr_t>( expr_t( fusion::vector<Expr1, Expr2, Expr3, Expr4, Expr5, Expr6, Expr7, Expr8, Expr9>( expr1, expr2, expr3, expr4, expr5, expr6, expr7, expr8, expr9 ) ) );
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319