Skip to content

Commit

Permalink
more TsrExpr::block variants tagged by preserve_lobound_t
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Sep 14, 2024
1 parent d4142d7 commit 2f80dc0
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion src/TiledArray/expressions/tsr_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,24 @@ class TsrExpr<const Array, true> : public Expr<TsrExpr<const Array, true>> {

/// Block expression

/// \tparam Index1 An integral range type
/// \tparam Index2 An integral range type
/// \param lower_bound The lower_bound of the block
/// \param upper_bound The upper_bound of the block
template <typename Index1, typename Index2,
typename = std::enable_if_t<
TiledArray::detail::is_integral_range_v<Index1> &&
TiledArray::detail::is_integral_range_v<Index2>>>
BlkTsrExpr<const Array, true> block(const Index1& lower_bound,
const Index2& upper_bound,
preserve_lobound_t) const {
return BlkTsrExpr<const Array, true>(array_, annotation_, lower_bound,
upper_bound)
.preserve_lobound();
}

/// Block expression

/// \tparam Index1 An integral type
/// \tparam Index2 An integral type
/// \param lower_bound The lower_bound of the block
Expand All @@ -539,8 +557,27 @@ class TsrExpr<const Array, true> : public Expr<TsrExpr<const Array, true>> {

/// Block expression

/// \tparam Index1 An integral type
/// \tparam Index2 An integral type
/// \param lower_bound The lower_bound of the block
/// \param upper_bound The upper_bound of the block
template <typename Index1, typename Index2,
typename = std::enable_if_t<std::is_integral_v<Index1> &&
std::is_integral_v<Index2>>>
BlkTsrExpr<const Array, true> block(
const std::initializer_list<Index1>& lower_bound,
const std::initializer_list<Index2>& upper_bound,
preserve_lobound_t) const {
return BlkTsrExpr<const Array, true>(array_, annotation_, lower_bound,
upper_bound)
.preserve_lobound();
}

/// Block expression

/// \tparam PairRange Type representing a range of generalized pairs (see
/// TiledArray::detail::is_gpair_v ) \param bounds The {lower,upper} bounds of
/// TiledArray::detail::is_gpair_v )
/// \param bounds The {lower,upper} bounds of
/// the block
template <typename PairRange,
typename = std::enable_if_t<
Expand All @@ -551,6 +588,21 @@ class TsrExpr<const Array, true> : public Expr<TsrExpr<const Array, true>> {

/// Block expression

/// \tparam PairRange Type representing a range of generalized pairs (see
/// TiledArray::detail::is_gpair_v )
/// \param bounds The {lower,upper} bounds of
/// the block
template <typename PairRange,
typename = std::enable_if_t<
TiledArray::detail::is_gpair_range_v<PairRange>>>
BlkTsrExpr<const Array, true> block(const PairRange& bounds,
preserve_lobound_t) const {
return BlkTsrExpr<const Array, true>(array_, annotation_, bounds)
.preserve_lobound();
}

/// Block expression

/// \tparam Index An integral type
/// \param bounds The {lower,upper} bounds of the block
template <typename Index,
Expand All @@ -560,6 +612,19 @@ class TsrExpr<const Array, true> : public Expr<TsrExpr<const Array, true>> {
return BlkTsrExpr<const Array, true>(array_, annotation_, bounds);
}

/// Block expression

/// \tparam Index An integral type
/// \param bounds The {lower,upper} bounds of the block
template <typename Index,
typename = std::enable_if_t<std::is_integral_v<Index>>>
BlkTsrExpr<const Array, true> block(
const std::initializer_list<std::initializer_list<Index>>& bounds,
preserve_lobound_t) const {
return BlkTsrExpr<const Array, true>(array_, annotation_, bounds)
.preserve_lobound();
}

/// Conjugated-tensor expression factor

/// \return A conjugated expression object
Expand Down

0 comments on commit 2f80dc0

Please sign in to comment.