mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Add explicit support for invalid steps
Change-Id: Ib4ff395a044bf053f81d06058d7fd13f5f4f54d7
This commit is contained in:
@@ -55,6 +55,14 @@ public:
|
||||
double* step);
|
||||
virtual void StepAccepted(double step_quality);
|
||||
virtual void StepRejected(double step_quality);
|
||||
virtual void StepIsInvalid() {
|
||||
// Treat the current step as a rejected step with no increase in
|
||||
// solution quality. Since rejected steps lead to decrease in the
|
||||
// size of the trust region, the next time ComputeStep is called,
|
||||
// this will lead to a better conditioned system.
|
||||
StepRejected(0.0);
|
||||
}
|
||||
|
||||
virtual double Radius() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -96,6 +96,12 @@ public:
|
||||
// decrease in the trust region model is step_quality.
|
||||
virtual void StepRejected(double step_quality) = 0;
|
||||
|
||||
// Inform the strategy that the current step has been rejected
|
||||
// because it was found to be numerically invalid.
|
||||
// StepRejected/StepAccepted will not be called for this step, and
|
||||
// the strategy is free to do what it wants with this information.
|
||||
virtual void StepIsInvalid() = 0;
|
||||
|
||||
// Current trust region radius.
|
||||
virtual double Radius() const = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user