27void move(std::vector<T>& v,
size_t sourceIdx,
size_t targetIdx)
29 if (sourceIdx > targetIdx)
31 std::rotate(v.rend() -
static_cast<int64_t
>(sourceIdx) - 1,
32 v.rend() -
static_cast<int64_t
>(sourceIdx), v.rend() -
static_cast<int64_t
>(targetIdx));
36 std::rotate(v.begin() +
static_cast<int64_t
>(sourceIdx),
37 v.begin() +
static_cast<int64_t
>(sourceIdx) + 1, v.begin() +
static_cast<int64_t
>(targetIdx) + 1);
45template<
typename Scalar>
48 std::vector<Scalar> container;
49 container.reserve(
static_cast<size_t>(std::ceil((end - start) / stepSize)));
53 container.push_back(start);
65[[nodiscard]]
bool operator==(
const std::vector<T>& lhs, std::span<const T> rhs)
67 if (lhs.size() != rhs.size()) {
return false; }
68 for (
size_t i = 0; i < lhs.size(); i++)
70 if (lhs[i] != rhs[i]) {
return false; }
80[[nodiscard]]
bool operator==(std::span<const T> lhs,
const std::vector<T>& rhs)
constexpr bool operator==(const Node::Kind &lhs, const Node::Kind &rhs)
Equal compares Node::Kind values.
Definition Node.hpp:494
std::vector< Scalar > genRangeVector(Scalar start, Scalar stepSize, Scalar end)
Returns a container filled with the given range.
Definition Vector.hpp:46
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
Definition Vector.hpp:27