Fix off by one errors in perturbation code. Change-Id: I42cfc59b71e13e3163779ed6703073320298f948
diff --git a/examples/bal_problem.cc b/examples/bal_problem.cc index f73e805..2bca792 100644 --- a/examples/bal_problem.cc +++ b/examples/bal_problem.cc
@@ -136,7 +136,7 @@ camera[2] += rotation_sigma * RandNormal(); if (use_quaternions_) { - camera[4] += rotation_sigma * RandNormal(); + camera[3] += rotation_sigma * RandNormal(); // Normalize the quaternion. double norm = 0.0; @@ -152,9 +152,9 @@ if (translation_sigma > 0.0) { // Translation. + camera[camera_block_size() - 6] += translation_sigma * RandNormal(); camera[camera_block_size() - 5] += translation_sigma * RandNormal(); camera[camera_block_size() - 4] += translation_sigma * RandNormal(); - camera[camera_block_size() - 3] += translation_sigma * RandNormal(); } } }