aboutsummaryrefslogtreecommitdiff
path: root/internal/ceres/trust_region_strategy.cc
blob: 89bc19d084b51e1de0b142d8b9285647fae2c6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "ceres/trust_region_strategy.h"
#include "ceres/dogleg_strategy.h"
#include "ceres/levenberg_marquardt_strategy.h"

namespace ceres {
namespace internal {

TrustRegionStrategy::~TrustRegionStrategy() {}

TrustRegionStrategy* TrustRegionStrategy::Create(const Options& options) {
  switch (options.trust_region_strategy_type) {
    case LEVENBERG_MARQUARDT:
      return new LevenbergMarquardtStrategy(options);
    case DOGLEG:
      return new DoglegStrategy(options);
    default:
      LOG(FATAL) << "Unknown trust region strategy: "
                 << options.trust_region_strategy_type;
  }

  LOG(FATAL) << "Unknown trust region strategy: "
             << options.trust_region_strategy_type;
  return NULL;
}

}  // namespace internal
}  // namespace ceres