aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
work.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <cassert>
5
6namespace aligator {
7namespace gar {
8using uint = unsigned int;
9
14
17constexpr workrange_t get_work(uint horz, uint thread_id, uint num_threads) {
18 uint start = thread_id * (horz + 1) / num_threads;
19 uint stop = (thread_id + 1) * (horz + 1) / num_threads;
20 assert(stop <= horz + 1);
21 return {start, stop};
22}
23
24} // namespace gar
25} // namespace aligator
constexpr workrange_t get_work(uint horz, uint thread_id, uint num_threads)
Get a balanced work range corresponding to a horizon horz, thread ID tid, and number of threads num_t...
Definition work.hpp:17
unsigned int uint
Definition work.hpp:8
Main package namespace.