Skip to content

Commit

Permalink
Avoid code-duplication by generalizing the existing einsum function.
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalgaudel committed Nov 28, 2023
1 parent 3cd64db commit f246756
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 259 deletions.
3 changes: 2 additions & 1 deletion src/TiledArray/einsum/range.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ using small_vector = TiledArray::container::svector<T>;
struct Range {
using value_type = int64_t;
using iterator = boost::counting_iterator<value_type>;
template<class Pair>
template <class Pair, typename std::enable_if_t<
!std::is_convertible_v<Pair, Range>, bool> = true>
explicit Range(Pair &&pair) : Range(pair.first, pair.second) {}
Range(value_type begin, value_type end) : begin_(begin), end_(end) {}
auto begin() const { return iterator(begin_); }
Expand Down
Loading

0 comments on commit f246756

Please sign in to comment.