MCPcopy Create free account
hub / github.com/ceres-solver/ceres-solver / IsParameterBlockSetIndependent

Method IsParameterBlockSetIndependent

internal/ceres/program.cc:413–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413bool 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
434std::unique_ptr<TripletSparseMatrix>
435Program::CreateJacobianBlockSparsityTranspose(int start_residual_block) const {

Callers 2

IsOrderingValidMethod · 0.80

Calls 2

countMethod · 0.80
NumParameterBlocksMethod · 0.45

Tested by

no test coverage detected