mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add OrderedGroups::MinNonZeroGroup.
Change-Id: If571c2435a7c884b472c33421722208cb2d036ff
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include "ceres/internal/port.h"
|
||||
#include "glog/logging.h"
|
||||
|
||||
namespace ceres {
|
||||
|
||||
@@ -171,6 +172,14 @@ class OrderedGroups {
|
||||
return group_to_elements_.size();
|
||||
}
|
||||
|
||||
// The first group with one or more elements. Calling this when
|
||||
// there are no groups with non-zero elements will result in a
|
||||
// crash.
|
||||
int MinNonZeroGroup() const {
|
||||
CHECK_NE(NumGroups(), 0);
|
||||
return group_to_elements_.begin()->first;
|
||||
}
|
||||
|
||||
const map<int, set<T> >& group_to_elements() const {
|
||||
return group_to_elements_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user