Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jwmak opened this issue May 7, 2023 · 1 comment
Assignees
Labels

Comments

@jwmak
Copy link

jwmak commented May 7, 2023

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())

@sandwichmaker
Copy link
Contributor

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 sandwichmaker self-assigned this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants