Fix Eigen Row/ColMajor bug in NumericDiffCostFunction.

If the parameter block size is 1, asking Eigen to create
a row-major matrix triggers a compile time error. Previously
we were handling the case where the number of rows in the
jacobian block was known statically, but the problem is present
when the nummber of rows is dynamic.

This CL fixes this problem.

Thanks to Dominik Reitzle for reporting this.

Change-Id: I99c3eec3558e66ebf4efa51c4dee8ce292ffe0c1
2 files changed