aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
mpc-util.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <vector>
7#include <algorithm>
8
9namespace aligator {
10
16template <typename T, typename Alloc>
17void rotate_vec_left(std::vector<T, Alloc> &v, long n_head = 0,
18 long n_tail = 0) {
19 auto beg = std::next(v.begin(), n_head);
20 auto end = std::prev(v.end(), n_tail);
21 std::rotate(beg, beg + 1, end);
22}
23
24} // namespace aligator
Main package namespace.
void rotate_vec_left(std::vector< T, Alloc > &v, long n_head=0, long n_tail=0)
Simply rotate an entire std::vector to the left.
Definition mpc-util.hpp:17