26 #ifndef TILEDARRAY_TILE_INTERFACE_SHIFT_H__INCLUDED 27 #define TILEDARRAY_TILE_INTERFACE_SHIFT_H__INCLUDED 29 #include "../type_traits.h" 41 template <
typename Arg,
typename Index>
42 inline auto shift(
const Arg& arg,
const Index& range_shift)
43 {
return arg.shift(range_shift); }
53 template <
typename Arg,
typename Index>
54 inline auto shift_to(Arg& arg,
const Index& range_shift)
55 {
return arg.shift_to(range_shift); }
58 namespace tile_interface {
65 decltype(
shift(std::declval<T>(),
66 std::declval<std::vector<long> >()))>::type;
71 std::declval<std::vector<long> >()))>::type;
73 template <
typename Result,
typename Arg,
typename Enabler =
void>
80 template <
typename Index>
82 const Index& range_shift)
const 83 {
return shift(arg, range_shift); }
86 template <
typename Result,
typename Arg>
88 typename
std::enable_if<
89 ! std::is_same<Result, result_of_shift_t<Arg> >::value
100 template <
typename Index>
102 const Index& range_shift)
const 103 {
return Cast_::operator()(
shift(arg, range_shift)); }
107 template <
typename Result,
typename Arg,
typename Enabler =
void>
114 template <
typename Index>
116 const Index& range_shift)
const 117 {
return shift_to(arg, range_shift); }
121 template <
typename Result,
typename Arg>
123 typename
std::enable_if<
124 ! std::is_same<Result, result_of_shift_to_t<Arg> >::value
135 template <
typename Index>
137 const Index& range_shift)
const 138 {
return Cast_::operator()(
shift_to(arg, range_shift)); }
143 template <
typename Arg,
typename Enabler =
void>
149 template <
typename Arg>
151 typename
std::enable_if<
152 TiledArray::detail::is_type<result_of_shift_t<Arg> >::value
167 template <
typename Result,
typename Arg>
177 template <
typename Result,
typename Arg>
183 #endif // TILEDARRAY_TILE_INTERFACE_SHIFT_H__INCLUDED Shift the range of tile in place.
detail::ShiftWrapper< T > shift(T &tensor)
Shift a tensor from one range to another.
Result result_type
Result tile type.
result_type operator()(const argument_type &arg, const Index &range_shift) const
result_of_shift_t< Arg > type
typename std::decay< decltype(shift(std::declval< T >(), std::declval< std::vector< long > >()))>::type result_of_shift_t
Result result_type
Result tile type.
result_type operator()(argument_type &arg, const Index &range_shift) const
result_type operator()(const argument_type &arg, const Index &range_shift) const
Result result_type
Result tile type.
Result result_type
Result tile type.
result_type operator()(argument_type &arg, const Index &range_shift) const
Arg argument_type
Argument tile type.
Arg argument_type
Argument tile type.
typename std::decay< decltype(shift_to(std::declval< T >(), std::declval< std::vector< long > >()))>::type result_of_shift_to_t
Tile< Arg > & shift_to(Tile< Arg > &arg, const Index &range_shift)
Shift the range of arg in place.
Arg argument_type
Argument tile type.
Arg argument_type
Argument tile type.