Sized cost function using variadic templates

This PR changes the interface of sized_cost_fucntion,
autodiff_cost_function and numeric_diff_costfunction from using ten
hardcoded parameter blocks to a variable number of parameter blocks
using variadic templates.

Trailing parameter blocks of size zero are now considered as error.

Change-Id: I37b9a0a420ef0eda6476a46672bbf6bd57e19760
This commit is contained in:
Johannes Beck
2018-10-13 22:34:53 +02:00
parent f8e8951611
commit 8eef94de4e
12 changed files with 380 additions and 591 deletions
@@ -265,14 +265,12 @@ void QuaternionParameterizationTestHelper(
double* jacobian_array[2] = { NULL, jacobian_ref };
// Autodiff jacobian at delta_x = 0.
internal::AutoDiff<Plus,
double,
kGlobalSize,
kLocalSize>::Differentiate(Plus(),
parameters,
kGlobalSize,
x_plus_delta,
jacobian_array);
internal::AutoDifferentiate<StaticParameterDims<kGlobalSize, kLocalSize>>(
Plus(),
parameters,
kGlobalSize,
x_plus_delta,
jacobian_array);
double jacobian[12];
parameterization.ComputeJacobian(x, jacobian);