简体   繁体   English

我使用Ceres Solver时如何解决以下问题

[英]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.

相关问题 如何使用ceres-solver解决高维非线性问题? - How to use ceres-solver to solve high dimensional non-linear problem? 如何修复 CERES_USE_OPENMP、CERES_USE_CXX11_THREADS 或 CERES_NO_THREADS 中的错误之一必须在 Ceres Solver Android 中定义 - How to Fix the Error One of CERES_USE_OPENMP, CERES_USE_CXX11_THREADS or CERES_NO_THREADS must be defined in Ceres Solver Android 使用 ceres 求解器构建旋转优化问题 - Formulation of rotation optimization problem using ceres solver 如何从ceres求解器结果中检索异常值? - How to retrieve outliers from ceres solver result? Sphinx + Doxygen + Breathe:我如何获得像 Google 的 Ceres Solver 这样的文档? - Sphinx + Doxygen + Breathe: How do I get a documentation like the one of Google's Ceres Solver? 使用Ceres解算器求解非线性系统:编译问题 - Solving a nonlinear system using Ceres Solver: compilation problem 谷氨酸解算器的捆绑调整 - Bundle Adjustment for Ceres Solver 我如何将 ceres::CubicInterpolator 与不在统一网格上的数据一起使用 - How do I use ceres::CubicInterpolator with data not on a uniform grid 传递double的参数但获得Jet <double,6> 使用ceres求解器时 - pass parameters of double but get Jet<double,6>when using ceres solver 使用 Ceres 求解器进行 CMake 项目时的 Eigen 依赖项冲突 - Conflicting Eigen dependencies when CMake-ing project with Ceres solver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM