ceres-solver icon indicating copy to clipboard operation
ceres-solver copied to clipboard

Unclear line of code to check for constant parameter block in BlockJacobianWriter::CreateJacobian()

Open jwmak opened this issue 2 years ago • 1 comments
trafficstars

Inside the function BlockJacobianWriter::CreateJacobian() at line 186 in block_jacobian_writer.cc, the following line checks if the parameter block is constant:

if (residual_block->parameter_blocks()[j]->index() != -1)

For improved clarity, this line should be changed to:

if (!residual_block->parameter_blocks()[j]->IsConstant())

jwmak avatar May 07 '23 05:05 jwmak

Yes this is some ancient code, and it is likely that at this point parameter_block did not have an IsConstant method, I will look into modernizing it.

sandwichmaker avatar May 08 '23 00:05 sandwichmaker