Template Function sequant::opt::batch_priority_less

Function Documentation

template<typename TreeNode>
bool sequant::opt::batch_priority_less(const TreeNode &lhs, const TreeNode &rhs, std::span<const Index> batch_indices)

Orders trees by their batch indices, which are treated as having a “priority”: we start at the highest priority (first) batch index and compare on the first batch index that only one of the trees has. Trees with the lower priority batch indices (or even none) precede the ones with the higher priority (or more) batch indices. Trees that are not tensors are treated as having no batch indices.

Returns:

Whether lhs strictly precedes rhs