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
6
namespace
aligator
{
7
namespace
gar
{
8
using
uint
=
unsigned
int;
9
10
struct
workrange_t
{
11
uint
beg
;
12
uint
end
;
13
};
14
17
constexpr
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
aligator::gar
Definition
block-tridiagonal.hpp:10
aligator::gar::get_work
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
aligator::gar::uint
unsigned int uint
Definition
work.hpp:8
aligator
Main package namespace.
Definition
action-model-wrap.hpp:14
aligator::gar::workrange_t
Definition
work.hpp:10
aligator::gar::workrange_t::beg
uint beg
Definition
work.hpp:11
aligator::gar::workrange_t::end
uint end
Definition
work.hpp:12
include
aligator
gar
work.hpp
Generated by
1.13.2