| 411 | } |
| 412 | |
| 413 | bool Program::IsParameterBlockSetIndependent( |
| 414 | const std::set<double*>& independent_set) const { |
| 415 | // Loop over each residual block and ensure that no two parameter |
| 416 | // blocks in the same residual block are part of |
| 417 | // parameter_block_ptrs as that would violate the assumption that it |
| 418 | // is an independent set in the Hessian matrix. |
| 419 | for (const ResidualBlock* residual_block : residual_blocks_) { |
| 420 | ParameterBlock* const* parameter_blocks = |
| 421 | residual_block->parameter_blocks(); |
| 422 | const int num_parameter_blocks = residual_block->NumParameterBlocks(); |
| 423 | int count = 0; |
| 424 | for (int i = 0; i < num_parameter_blocks; ++i) { |
| 425 | count += independent_set.count(parameter_blocks[i]->mutable_user_state()); |
| 426 | } |
| 427 | if (count > 1) { |
| 428 | return false; |
| 429 | } |
| 430 | } |
| 431 | return true; |
| 432 | } |
| 433 | |
| 434 | std::unique_ptr<TripletSparseMatrix> |
| 435 | Program::CreateJacobianBlockSparsityTranspose(int start_residual_block) const { |
no test coverage detected