31#ifndef G2O_CERES_PUBLIC_INTERNAL_PARAMETER_DIMS_H_
32#define G2O_CERES_PUBLIC_INTERNAL_PARAMETER_DIMS_H_
49template <
int N,
int... Ts>
51 std::integer_sequence<int, N, Ts...>) {
52 return (N <= 0) ? false
54 std::integer_sequence<int, Ts...>());
67template <
bool IsDynamic,
int... Ns>
77 "Invalid parameter block dimension detected. Each parameter "
78 "block dimension must be bigger than zero.");
83 "At least one parameter block must be specified.");
86 Sum<std::integer_sequence<int, Ns...>>::Value;
100 template <
typename T,
int... Indices>
102 T* ptr, std::integer_sequence<int, Indices...>) {
103 return std::array<T*, kNumParameterBlocks>{{ptr + Indices...}};
106 static constexpr std::array<int, kNumParameterBlocks>
params_{Ns...};
112template <
bool IsDynamic,
int... Ns>
113constexpr std::array<int, ParameterDims<IsDynamic, Ns...>::kNumParameterBlocks>
114 ParameterDims<IsDynamic, Ns...>::params_;
static constexpr std::array< int, kNumParameterBlocks > params_
static constexpr int GetDim(int dim)
static constexpr bool kIsValid
static constexpr int kNumParameters
static constexpr int kNumParameterBlocks
std::integer_sequence< int, Ns... > Parameters
static constexpr bool kIsDynamic
static std::array< T *, kNumParameterBlocks > GetUnpackedParameters(T *ptr)
static std::array< T *, kNumParameterBlocks > GetUnpackedParameters(T *ptr, std::integer_sequence< int, Indices... >)
constexpr bool IsValidParameterDimensionSequence(std::integer_sequence< int >)
typename ExclusiveScanT< Seq >::Type ExclusiveScan
ParameterDims< false, Ns... > StaticParameterDims
ParameterDims< true > DynamicParameterDims