MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
forward.hpp
1#ifndef MPQC_MATH_TENSOR_FORWARD_HPP
2#define MPQC_MATH_TENSOR_FORWARD_HPP
3
4#include "mpqc/math/tensor/order.hpp"
5
6#include <boost/fusion/include/boost_tuple.hpp>
7#include <boost/mpl/accumulate.hpp>
8#include <boost/mpl/print.hpp>
9
10#include <boost/type_traits/remove_const.hpp>
11#include <boost/type_traits/remove_reference.hpp>
12
13namespace mpqc {
14
15 template <typename T, size_t N, class Order = TensorColumnMajor >
16 struct TensorBase;
17
18}
19
20
21namespace mpqc {
22namespace detail {
23namespace Tensor {
24
25 template<class T>
26 struct is_integral {
27 typedef typename boost::is_integral<
28 typename boost::remove_reference<T>::type
29 >::type type;
30 };
31
33 template<class T>
35 static const bool value =
36 boost::mpl::accumulate<
37 T,
38 boost::mpl::bool_<true>,
39 boost::mpl::and_< is_integral<boost::mpl::_2>, boost::mpl::_1 >
40 >::type::value;
41 };
42
44 template<class Tie>
45 struct integral_tie : Tie {
46 integral_tie(const Tie &t) : Tie(t) {}
47 };
48
50 template<class Tie>
51 struct range_tie : Tie {
52 range_tie(const Tie &t) : Tie(t) {}
53 };
54
57 template<class Tie>
58 typename boost::enable_if<
61 >::type
62 tie(const Tie &t) {
63 return integral_tie<Tie>(t);
64 }
65
68 template<class Tie>
69 typename boost::disable_if<
70 is_integral_tuple<Tie>,
71 range_tie<Tie>
72 >::type
73 tie(const Tie &t) {
74 return range_tie<Tie>(t);
75 }
76
77} // Tensor
78} // detail
79} // mpqc
80
81
82#endif /* MPQC_MATH_TENSOR_FORWARD_HPP */
Tensor base class.
Definition forward.hpp:16
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37
Tensor reference class.
Definition tensor.hpp:13
index tie wrapper
Definition forward.hpp:45
"returns" true if every element of tuple T is an integral type
Definition forward.hpp:34
Definition forward.hpp:26
range tie wrapper
Definition forward.hpp:51

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.