[英]How to solve the following problem when I use Ceres Solver
When I run the following code in tutorial of ceres solver,I met some problem.当我在 ceres 求解器教程中运行以下代码时,遇到了一些问题。
Here is the code:这是代码:
#include <iostream>
#include "ceres/ceres.h"
#include "glog/logging.h"
using ceres::AutoDiffCostFunction;
using ceres::CostFunction;
using ceres::Problem;
using ceres::Solve;
using ceres::Solver;
struct CostFunctor {
template <typename T>
bool operator()(const T* const x, T* residual) const {
residual[0] = 10.0 - x[0];
return true;
}
};
int main(int argc, char *argv[])
{
double x = 0.5;
const double initial_x = x;
Problem problem;
CostFunction* cost_function =
new AutoDiffCostFunction<CostFunctor, 1, 1>(new CostFunctor);
problem.AddResidualBlock(cost_function, nullptr, &x);
Solver::Options options;
options.minimizer_progress_to_stdout = true;
Solver::Summary summary;
Solve(options, &problem, &summary);
std::cout << summary.BriefReport() << "\n";
std::cout << "x : " << initial_x << " -> " << x << "\n";
}
And I got the problem:我遇到了问题:
E:\study_materials\Computer Version\ceres\ceres-solver-2.0.0\internal\ceres\solver.cc:505 Terminating: Can't use SPARSE_NORMAL_CHOLESKY with Solver::Options::sparse_linear_algebra_library_type = SUITE_SPARSE, because support was not enabled when Ceres Solver was built.
I don't know how to enable this support,any assistance will be appreciated.我不知道如何启用此支持,我们将不胜感激。
what version of ceres solver is this?这是什么版本的 ceres 求解器? if a sparse linear algebra library is not available, it should default to using a dense solver (DENSE_QR).
如果稀疏线性代数库不可用,则应默认使用密集求解器 (DENSE_QR)。 So this looks like a bug in the way defaults are setup in ceres solver.
所以这看起来像是在 ceres 求解器中设置默认值的方式中的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.