Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BlasOverrideUtil.hpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // For more information, please see: http://www.nektar.info
4 //
5 // The MIT License
6 //
7 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
8 // Department of Aeronautics, Imperial College London (UK), and Scientific
9 // Computing and Imaging Institute, University of Utah (USA).
10 //
11 // License for the specific language governing rights and limitations under
12 // Permission is hereby granted, free of charge, to any person obtaining a
13 // copy of this software and associated documentation files (the "Software"),
14 // to deal in the Software without restriction, including without limitation
15 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 // and/or sell copies of the Software, and to permit persons to whom the
17 // Software is furnished to do so, subject to the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be included
20 // in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 // DEALINGS IN THE SOFTWARE.
29 //
30 // Description: Defines the global functions needed for matrix operations.
31 //
32 ///////////////////////////////////////////////////////////////////////////////
33 
34 #ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLAS_OVERRIDE_UTIL_HPP
35 #define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLAS_OVERRIDE_UTIL_HPP
36 
37 #ifdef NEKTAR_USE_EXPRESSION_TEMPLATES
38 
39 #include <ExpressionTemplates/Node.hpp>
40 #include <boost/type_traits.hpp>
41 #include <boost/utility/enable_if.hpp>
42 
43 namespace expt
44 {
45  template<typename NodeType, template <typename> class LhsTest, typename TestOpType,
46  template <typename> class RhsTest, typename enabled=void>
47  struct TestBinaryNode : public boost::false_type {};
48 
49  template<typename L, typename OpType, typename R, template <typename> class LhsTest,
50  typename TestOpType, template <typename> class RhsTest>
51  struct TestBinaryNode<Node<L, OpType, R>, LhsTest, TestOpType, RhsTest,
52  typename boost::enable_if
53  <
54  boost::mpl::and_
55  <
56  boost::is_same<OpType, TestOpType>,
57  LhsTest<typename L::ResultType>,
58  RhsTest<typename R::ResultType>
59  >
60  >::type> : public boost::true_type {};
61 
62  template<typename NodeType, template <typename> class T1Type, typename TestOp1Type, template <typename> class T2Type,
63  typename TestOp2Type, template <typename> class T3Type, typename enabled=void>
64  struct Test3ArgumentAssociativeNode : public boost::false_type {};
65 
66  template<typename A1, typename Op1Type, typename A2, typename Op2Type, typename A3,
67  template <typename> class T1Type, typename TestOp1Type, template <typename> class T2Type, typename TestOp2Type,
68  template <typename> class T3Type>
69  struct Test3ArgumentAssociativeNode<Node<Node<A1, Op1Type, A2>, Op2Type, A3>, T1Type, TestOp1Type, T2Type, TestOp2Type, T3Type,
70  typename boost::enable_if
71  <
72  boost::mpl::and_
73  <
74  boost::is_same<Op1Type, TestOp1Type>,
75  boost::is_same<Op2Type, TestOp2Type>,
76  T1Type<typename A1::ResultType>,
77  T2Type<typename A2::ResultType>,
78  T3Type<typename A3::ResultType>
79  >
80  >::type> : public boost::true_type {};
81 
82 }
83 
84 #endif
85 #endif
86 
87 
NekDouble L