)]}'
{
  "commit": "6dd18563a19cf3ede796cd960c88251666f84c7d",
  "tree": "77ef0b7db04ba3bd5e6ffd8c60df1f3a3dd2534d",
  "parents": [
    "1b89595b4cdef0b0f3da586618b5b41c65cc6c74"
  ],
  "author": {
    "name": "Richard Stebbing",
    "email": "richie.stebbing@gmail.com",
    "time": "Mon Jun 17 07:27:26 2013 +0100"
  },
  "committer": {
    "name": "Richard Stebbing",
    "email": "richie.stebbing@gmail.com",
    "time": "Wed Jun 19 02:24:31 2013 +0100"
  },
  "message": "Fix DynamicAutoDiffCostFunction\n\nChanged DynamicAutoDiffCostFunction to handle multiple derivative\nsections as opposed to just a single contiguous block.\n\nIn the previous implementation it was assumed that non-constant\nparameters occur in a single contiguous block so that constant\nparameters could NOT lie between non-constant parameters. Previously,\nstart_derivative_section was first set as soon as the first\nnon-constant parameter block (marked by jacobians[i] !\u003d NULL) was\nencountered. After this, entries in input_jets[parameter_cursor].v were\naccessed with `parameter_cursor - start_derivative_section`. For\ncontiguous non-constant parameter blocks this is fine, but if constant\nparameter blocks fall between then this indexing is incorrect because\n`parameter_cursor - start_derivative_section` can go out of bounds.\n\nFor a concrete example, take a cost function with three parameter\nblocks, each of size 1 and with the center block fixed. Assume that\nStride\u003d1 so that two passes are required. On the first pass\nstart_derivative_section\u003d0, and the first variable block is handled\ncorrectly. At the end of the first pass end_derivative_section\u003d1, so\nfor the second pass start_derivative_section\u003d1. Now comes the problem.\nWhen parameter_cursor\u003d1, parameter_cursor \u003e\u003d start_derivative_section\nso jacobian[1] is checked to be NULL. Since it is NULL (second\nparameter block is constant) then nothing is done and\nactive_parameter_count is NOT incremented. Next, when\nparameter_cursor\u003d2, parameter_cursor \u003e\u003d start_derivative_section and\njacobian[2] is checked. Since it is not NULL then\ninput_jets[parameter_cursor].v[parameter_cursor -\nstart_derivative_section] is set to 1.0, BUT parameter_cursor -\nstart_derivative_section \u003d 2 - 1 \u003d 1 which is out of bounds\n(input_jets[parameter_cursor].v is only of size Stride\u003d1).\n\nThe proposed solution records the start of each contiguous block of\nnon-constant parameters and indexing into\ninput_jets[parameter_cursor].v is independent of parameter_cursor.\n\nChange-Id: I388ab6a0bafa35d317491135ec6fe980453ff888\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "38bdb0aa61861e7119e010306a60deb109763029",
      "old_mode": 33188,
      "old_path": "include/ceres/dynamic_autodiff_cost_function.h",
      "new_id": "5d8f188e5a71c7d550f1532213c2af03223cebc1",
      "new_mode": 33188,
      "new_path": "include/ceres/dynamic_autodiff_cost_function.h"
    },
    {
      "type": "modify",
      "old_id": "b62b56a90cd6f5aaf1073b88b7c172605598ea29",
      "old_mode": 33188,
      "old_path": "internal/ceres/dynamic_autodiff_cost_function_test.cc",
      "new_id": "a42a37441c70b0b5914e66ec63d0ecd28d6eacfb",
      "new_mode": 33188,
      "new_path": "internal/ceres/dynamic_autodiff_cost_function_test.cc"
    }
  ]
}
