A large scale non-linear optimization library

Build Status

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see ceres-solver.org for more information.

Comments
  • Improve the polynomial solvers

    Improve the polynomial solvers

    The current implementation of polynomial solvers used by the dogleg and line search routines is based on a mix of analytic formulae for up to quadratic equations and then a companion matrix based solver.

    The companion matrix based solver is slow, because it requires the solution of an eigenvalue problem. Since the equations we are solving only involve a quartic of lower, it should be replaced by a numerically stable analytic solver.

    This should be done for the cubic equation too. Further, the implementation of the quadratic solver can be improved too. Currently it uses the rather naive quadratic formula which is known to be not particularly numerically stable.

  • Include ceres-solver as fetchcontent directory

    Include ceres-solver as fetchcontent directory

    Hi,

    I am trying to use ceres-solver (the master branch)with the development HEAD of Eigen, both are included as FetchContent projects:

    include(FetchContent)
    function(FetchContentHelper name vc url tag)
        set(options ADD_SUBDIR)
        set(mvargs CONFIG_SUBDIR)
        cmake_parse_arguments(PARSE_ARGV 4 FCH "${options}" "" "${mvargs}")
    
        FetchContent_Declare(
            ${name}
            ${vc}_REPOSITORY ${url}
            ${vc}_TAG        ${tag}
            GIT_PROGRESS     ON
        )
        FetchContent_GetProperties(${name})
        if(NOT ${name}_POPULATED)
            message("Setting up ${name} from ${url}")
            FetchContent_Populate(${name})
            if(FCH_ADD_SUBDIR)
                foreach(config ${FCH_CONFIG_SUBDIR})
                    string(REPLACE "=" ";" configkeyval ${config})
                    list(LENGTH configkeyval len)
                    if (len GREATER_EQUAL 2)
                        list(GET configkeyval 0 configkey)
                        list(SUBLIST configkeyval 1 -1 configvals)
                        string(REPLACE ";" "=" configval "${configvals}")
                    else()
                        message(FATAL_ERROR "Invalid config: ${configkeyval}")
                    endif()
                    message("Set ${configkey} = ${configval}")
                    set(${configkey} ${configval} CACHE INTERNAL "" FORCE)
                endforeach()
                set(${name}_SOURCE_DIR ${${name}_SOURCE_DIR} PARENT_SCOPE)
                set(${name}_BINARY_DIR ${${name}_BINARY_DIR} PARENT_SCOPE)
                add_subdirectory(${${name}_SOURCE_DIR} ${${name}_BINARY_DIR} EXCLUDE_FROM_ALL)
            endif()
        endif()
    endfunction(FetchContentHelper)
    FetchContentHelper(spdlog GIT "https://github.com/gabime/spdlog.git" v1.x ADD_SUBDIR)
    FetchContentHelper(fmt GIT "https://github.com/fmtlib/fmt.git" 5.2.1 ADD_SUBDIR)
    FetchContentHelper(eigen HG "https://bitbucket.org/eigen/eigen" default
        ADD_SUBDIR CONFIG_SUBDIR
            BUILD_TESTING=OFF
            )
    # !1
    set(Eigen3_DIR ${eigen_BINARY_DIR})
    find_package(Eigen3 REQUIRED NO_MODULE NO_DEFAULT_PATH)
    # get_target_property(eigen_include_dir Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)  # !2
    FetchContentHelper(ceres GIT "https://github.com/ceres-solver/ceres-solver.git" master
        ADD_SUBDIR CONFIG_SUBDIR
          EIGEN_INCLUDE_DIR=${eigen_SOURCE_DIR}  # !3
          EIGENSPARSE=ON
          SUITESPARSE=ON
          CXSPARSE=OFF
          GFLAGS=OFF
          MINIGLOG=ON
          CXX11=ON
          OPENMP=ON
          EXPORT_BUILD_DIR=ON
        )
    set(Ceres_DIR ${ceres_BINARY_DIR})
    find_package(Ceres REQUIRED NO_DEFAULT_PATH)  # !4
    

    In general, this works, but there are places that do not work and/or confusing to me.

    • !1: This is to import Eigen3::Eigen target.
    • !2: This attempts to read the include dir property of Eigen3::Eigen, which I though I could use as EIGEN_INCLUDE_DIR in configuring ceres, but it turn out that the property from get_property is a generator expression, so it causes an error in the ceres cmake file.
    • !3: Since !2 does not work, I use ${eigen_SOURCE_DIR} (populated by the fetchcontent_polulate command) to instruct the cere cmake file to find eigen, and it does work. However, this breaks when exporting the ceres target, due to the fact that this EIGEN_INCLUDE_DIR is in the build tree and cannot be set as one of the directories in INTERFACE_INCLUDE_DIR property. I can work around the problem by making the following change in ceres-src/internal/ceres/CMakeLists.txt:
    # target_include_directories(ceres SYSTEM PUBLIC ${EIGEN_INCLUDE_DIRS})
    target_include_directories(ceres SYSTEM PUBLIC
        $<BUILD_INTERFACE:${EIGEN_INCLUDE_DIRS}>
      $<INSTALL_INTERFACE:include>)
    
    • !4: Finally, I can import the ceres target, but not sure if this is the right way of doing it.

    Any help is greatly appreciated. Thank you!

  • check_gradients seems to improve my solver

    check_gradients seems to improve my solver

    I have a solver that is formulated such that it runs for a maximum amount of time or a complicated stop criteria is seen in a option callback. When I do this, I see the stopping criteria is seen only ~70% of the time. When the only change I make is options.check_gradients = true; That solve rate spikes to 97.4%. I cannot for the life of me figure out what check_gradients might be changing in the solver to make the solver actually solve differently.

  • Three subtests of small_blas_test fail in C++17/20 mode in VS2022

    Three subtests of small_blas_test fail in C++17/20 mode in VS2022

    Hi,

    With CMAKE_CXX_STANDARD=20 on VS 2022, the three sub-tests BLAS.MatrixTransposeMatrixMultiply_9_9_9_Dynamic, BLAS.MatrixTransposeMatrixMultiplyNaive_9_9_9 and BLAS.MatrixTransposeMatrixMultiplyNaive_9_9_9_Dynamic fail (all others pass). I'm using Eigen 3.4.0.

    Here's partial log output:

    D:\ceres\ceres-solver\out\build\x64-Release> ctest . --rerun-failed -V
    UpdateCTestConfiguration  from :D:/ceres/ceres-solver/out/build/x64-Release/DartConfiguration.tcl
    UpdateCTestConfiguration  from :D:/ceres/ceres-solver/out/build/x64-Release/DartConfiguration.tcl
    Test project D:/ceres/ceres-solver/out/build/x64-Release
    Constructing a list of tests
    Done constructing a list of tests
    Updating test list for fixtures
    Added 0 tests to meet fixture requirements
    Checking test dependency graph...
    Checking test dependency graph end
    test 85
        Start 85: small_blas_test
    
    85: Test command: D:\ceres\ceres-solver\out\build\x64-Release\bin\small_blas_test.exe "--test_srcdir" "D:/ceres/ceres-solver/data"
    85: Test timeout computed to be: 10000000
    85: Running main() from gmock_main.cc
    85: [==========] Running 26 tests from 1 test suite.
    85: [----------] Global test environment set-up.
    85: [----------] 26 tests from BLAS
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_5_3_7
    85: [       OK ] BLAS.MatrixMatrixMultiply_5_3_7 (2 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_5_3_7_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiply_5_3_7_Dynamic (2 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_1_1_1
    85: [       OK ] BLAS.MatrixMatrixMultiply_1_1_1 (0 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_1_1_1_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiply_1_1_1_Dynamic (0 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_9_9_9
    85: [       OK ] BLAS.MatrixMatrixMultiply_9_9_9 (43 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiply_9_9_9_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiply_9_9_9_Dynamic (45 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_5_3_7
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_5_3_7 (2 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_5_3_7_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_5_3_7_Dynamic (3 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_1_1_1
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_1_1_1 (0 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_1_1_1_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_1_1_1_Dynamic (0 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_9_9_9
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_9_9_9 (44 ms)
    85: [ RUN      ] BLAS.MatrixMatrixMultiplyNaive_9_9_9_Dynamic
    85: [       OK ] BLAS.MatrixMatrixMultiplyNaive_9_9_9_Dynamic (44 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_5_3_7
    85: [       OK ] BLAS.MatrixTransposeMatrixMultiply_5_3_7 (0 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_5_3_7_Dynamic
    85: [       OK ] BLAS.MatrixTransposeMatrixMultiply_5_3_7_Dynamic (0 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_1_1_1
    85: [       OK ] BLAS.MatrixTransposeMatrixMultiply_1_1_1 (0 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_1_1_1_Dynamic
    85: [       OK ] BLAS.MatrixTransposeMatrixMultiply_1_1_1_Dynamic (0 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_9_9_9
    85: [       OK ] BLAS.MatrixTransposeMatrixMultiply_9_9_9 (40 ms)
    85: [ RUN      ] BLAS.MatrixTransposeMatrixMultiply_9_9_9_Dynamic
    85: D:\ceres\ceres-solver\internal\ceres\small_blas_test.cc(199): error: The difference between (C_plus_ref - C_plus).norm() and 0.0 is 1251.7156226555614, which exceeds kTolerance, where
    85: (C_plus_ref - C_plus).norm() evaluates to 1251.7156226555614,
    85: 0.0 evaluates to 0, and
    85: kTolerance evaluates to 1.1102230246251565e-15.
    85: C += A' * B
    85: row_stride_c : 10
    85: col_stride_c : 10
    85: start_row_c  : 0
    85: start_col_c  : 0
    85: Cref :
    85:  286  331  376  421  466  511  556  601  646    1
    85:  331  385  439  493  547  601  655  709  763    1
    85:  376  439  502  565  628  691  754  817  880    1
    85:  421  493  565  637  709  781  853  925  997    1
    85:  466  547  628  709  790  871  952 1033 1114    1
    85:  511  601  691  781  871  961 1051 1141 1231    1
    85:  556  655  754  853  952 1051 1150 1249 1348    1
    85:  601  709  817  925 1033 1141 1249 1357 1465    1
    85:  646  763  880  997 1114 1231 1348 1465 1582    1
    85:    1    1    1    1    1    1    1    1    1    1
    85: C:
    85:  286  331  326  361  466  511  466  501  646    1
    85:  331  385  371  411  547  601  531  571  763    1
    85:  376  439  416  461  628  691  596  641  880    1
    85:  421  493  461  511  709  781  661  711  997    1
    85:  466  547  506  561  790  871  726  781 1114    1
    85:  511  601  551  611  871  961  791  851 1231    1
    85:  556  655  596  661  952 1051  856  921 1348    1
    85:  601  709  641  711 1033 1141  921  991 1465    1
    85:  646  763  686  761 1114 1231  986 1061 1582    1
    85:    1    1    1    1    1    1    1    1    1    1
    85: D:\ceres\ceres-solver\internal\ceres\small_blas_test.cc(217): error: The difference between (C_minus_ref - C_minus).norm() and 0.0 is 1251.7156226555614, which exceeds kTolerance, where
    85: (C_minus_ref - C_minus).norm() evaluates to 1251.7156226555614,
    85: 0.0 evaluates to 0, and
    85: kTolerance evaluates to 1.1102230246251565e-15.
    85: C -= A' * B
    85: row_stride_c : 10
    85: col_stride_c : 10
    85: start_row_c  : 0
    85: start_col_c  : 0
    85: Cref :
    85:  -284  -329  -374  -419  -464  -509  -554  -599  -644     1
    85:  -329  -383  -437  -491  -545  -599  -653  -707  -761     1
    85:  -374  -437  -500  -563  -626  -689  -752  -815  -878     1
    85:  -419  -491  -563  -635  -707  -779  -851  -923  -995     1
    85:  -464  -545  -626  -707  -788  -869  -950 -1031 -1112     1
    85:  -509  -599  -689  -779  -869  -959 -1049 -1139 -1229     1
    85:  -554  -653  -752  -851  -950 -1049 -1148 -1247 -1346     1
    85:  -599  -707  -815  -923 -1031 -1139 -1247 -1355 -1463     1
    85:  -644  -761  -878  -995 -1112 -1229 -1346 -1463 -1580     1
    85:     1     1     1     1     1     1     1     1     1     1
    85: C:
    85:  -284  -329  -324  -359  -464  -509  -464  -499  -644     1
    85:  -329  -383  -369  -409  -545  -599  -529  -569  -761     1
    85:  -374  -437  -414  -459  -626  -689  -594  -639  -878     1
    85:  -419  -491  -459  -509  -707  -779  -659  -709  -995     1
    85:  -464  -545  -504  -559  -788  -869  -724  -779 -1112     1
    85:  -509  -599  -549  -609  -869  -959  -789  -849 -1229     1
    85:  -554  -653  -594  -659  -950 -1049  -854  -919 -1346     1
    85:  -599  -707  -639  -709 -1031 -1139  -919  -989 -1463     1
    85:  -644  -761  -684  -759 -1112 -1229  -984 -1059 -1580     1
    85:     1     1     1     1     1     1     1     1     1     1
    85: D:\ceres\ceres-solver\internal\ceres\small_blas_test.cc(235): error: The difference between (C_assign_ref - C_assign).norm() and 0.0 is 1251.7156226555614, which exceeds kTolerance, where
    85: (C_assign_ref - C_assign).norm() evaluates to 1251.7156226555614,
    85: 0.0 evaluates to 0, and
    85: kTolerance evaluates to 1.1102230246251565e-15.
    85: C = A' * B
    85: row_stride_c : 10
    85: col_stride_c : 10
    85: start_row_c  : 0
    85: start_col_c  : 0
    85: Cref :
    85:  285  330  375  420  465  510  555  600  645    1
    85:  330  384  438  492  546  600  654  708  762    1
    85:  375  438  501  564  627  690  753  816  879    1
    85:  420  492  564  636  708  780  852  924  996    1
    85:  465  546  627  708  789  870  951 1032 1113    1
    85:  510  600  690  780  870  960 1050 1140 1230    1
    85:  555  654  753  852  951 1050 1149 1248 1347    1
    85:  600  708  816  924 1032 1140 1248 1356 1464    1
    85:  645  762  879  996 1113 1230 1347 1464 1581    1
    85:    1    1    1    1    1    1    1    1    1    1
    85: C:
    85:  285  330  325  360  465  510  465  500  645    1
    85:  330  384  370  410  546  600  530  570  762    1
    85:  375  438  415  460  627  690  595  640  879    1
    85:  420  492  460  510  708  780  660  710  996    1
    85:  465  546  505  560  789  870  725  780 1113    1
    85:  510  600  550  610  870  960  790  850 1230    1
    85:  555  654  595  660  951 1050  855  920 1347    1
    85:  600  708  640  710 1032 1140  920  990 1464    1
    85:  645  762  685  760 1113 1230  985 1060 1581    1
    85:    1    1    1    1    1    1    1    1    1    1
    85: D:\ceres\ceres-solver\internal\ceres\small_blas_test.cc(199): error: The difference between (C_plus_ref - C_plus).norm() and 0.0 is 1251.7156226555614, which exceeds kTolerance, where
    85: (C_plus_ref - C_plus).norm() evaluates to 1251.7156226555614,
    85: 0.0 evaluates to 0, and
    85: kTolerance evaluates to 1.1102230246251565e-15.
    85: C += A' * B
    85: row_stride_c : 10
    85: col_stride_c : 11
    85: start_row_c  : 0
    85: start_col_c  : 0
    85: Cref :
    85:  286  331  376  421  466  511  556  601  646    1    1
    85:  331  385  439  493  547  601  655  709  763    1    1
    85:  376  439  502  565  628  691  754  817  880    1    1
    85:  421  493  565  637  709  781  853  925  997    1    1
    85:  466  547  628  709  790  871  952 1033 1114    1    1
    85:  511  601  691  781  871  961 1051 1141 1231    1    1
    85:  556  655  754  853  952 1051 1150 1249 1348    1    1
    85:  601  709  817  925 1033 1141 1249 1357 1465    1    1
    85:  646  763  880  997 1114 1231 1348 1465 1582    1    1
    85:    1    1    1    1    1    1    1    1    1    1    1
    85: C:
    85:  286  331  326  361  466  511  466  501  646    1    1
    85:  331  385  371  411  547  601  531  571  763    1    1
    85:  376  439  416  461  628  691  596  641  880    1    1
    85:  421  493  461  511  709  781  661  711  997    1    1
    85:  466  547  506  561  790  871  726  781 1114    1    1
    85:  511  601  551  611  871  961  791  851 1231    1    1
    85:  556  655  596  661  952 1051  856  921 1348    1    1
    85:  601  709  641  711 1033 1141  921  991 1465    1    1
    85:  646  763  686  761 1114 1231  986 1061 1582    1    1
    85:    1    1    1    1    1    1    1    1    1    1    1
    85: D:\ceres\ceres-solver\internal\ceres\small_blas_test.cc(217): error: The difference between (C_minus_ref - C_minus).norm() and 0.0 is 1251.7156226555614, which exceeds kTolerance, where
    85: (C_minus_ref - C_minus).norm() evaluates to 1251.7156226555614,
    85: 0.0 evaluates to 0, and
    85: kTolerance evaluates to 1.1102230246251565e-15.
    85: C -= A' * B
    85: row_stride_c : 10
    85: col_stride_c : 11
    85: start_row_c  : 0
    85: start_col_c  : 0
    85: Cref :
    85:  -284  -329  -374  -419  -464  -509  -554  -599  -644     1     1
    85:  -329  -383  -437  -491  -545  -599  -653  -707  -761     1     1
    85:  -374  -437  -500  -563  -626  -689  -752  -815  -878     1     1
    85:  -419  -491  -563  -635  -707  -779  -851  -923  -995     1     1
    85:  -464  -545  -626  -707  -788  -869  -950 -1031 -1112     1     1
    85:  -509  -599  -689  -779  -869  -959 -1049 -1139 -1229     1     1
    85:  -554  -653  -752  -851  -950 -1049 -1148 -1247 -1346     1     1
    85:  -599  -707  -815  -923 -1031 -1139 -1247 -1355 -1463     1     1
    85:  -644  -761  -878  -995 -1112 -1229 -1346 -1463 -1580     1     1
    85:     1     1     1     1     1     1     1     1     1     1     1
    85: C:
    85:  -284  -329  -324  -359  -464  -509  -464  -499  -644     1     1
    85:  -329  -383  -369  -409  -545  -599  -529  -569  -761     1     1
    85:  -374  -437  -414  -459  -626  -689  -594  -639  -878     1     1
    85:  -419  -491  -459  -509  -707  -779  -659  -709  -995     1     1
    85:  -464  -545  -504  -559  -788  -869  -724  -779 -1112     1     1
    85:  -509  -599  -549  -609  -869  -959  -789  -849 -1229     1     1
    85:  -554  -653  -594  -659  -950 -1049  -854  -919 -1346     1     1
    85:  -599  -707  -639  -709 -1031 -1139  -919  -989 -1463     1     1
    85:  -644  -761  -684  -759 -1112 -1229  -984 -1059 -1580     1     1
    85:     1     1     1     1     1     1     1     1     1     1     1
    
    [..... much more of this .....]
    
    85: [  FAILED  ] BLAS.MatrixTransposeMatrixMultiplyNaive_9_9_9_Dynamic (136791 ms)
    85: [ RUN      ] BLAS.MatrixVectorMultiply
    85: [       OK ] BLAS.MatrixVectorMultiply (0 ms)
    85: [ RUN      ] BLAS.MatrixTransposeVectorMultiply
    85: [       OK ] BLAS.MatrixTransposeVectorMultiply (0 ms)
    85: [----------] 26 tests from BLAS (411930 ms total)
    85:
    85: [----------] Global test environment tear-down
    85: [==========] 26 tests from 1 test suite ran. (411930 ms total)
    85: [  PASSED  ] 23 tests.
    85: [  FAILED  ] 3 tests, listed below:
    85: [  FAILED  ] BLAS.MatrixTransposeMatrixMultiply_9_9_9_Dynamic
    85: [  FAILED  ] BLAS.MatrixTransposeMatrixMultiplyNaive_9_9_9
    85: [  FAILED  ] BLAS.MatrixTransposeMatrixMultiplyNaive_9_9_9_Dynamic
    85:
    85:  3 FAILED TESTS
    1/1 Test #85: small_blas_test ..................***Failed  412.24 sec
    
    0% tests passed, 1 tests failed out of 1
    
    Total Test time (real) = 413.93 sec
    
    The following tests FAILED:
             85 - small_blas_test (Failed)
    Errors while running CTest
    Output from these tests are in: D:/ceres/ceres-solver/out/build/x64-Release/Testing/Temporary/LastTest.log
    Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
    

    I was going to upload the full LastTest.log, but it's 1 GB (due to so much console output) - and I suspect it won't be needed.

    /CC @sergiud

  • gradient_problem_solver_test failing on VS2015x64 Release

    gradient_problem_solver_test failing on VS2015x64 Release

    "SolvesRosenbrockWithDefaultOptions" test from gradient_problem_solver_test.cc fails on VS2015x64 Release version. Here is the log:

    [==========] Running 1 test from 1 test case.
    [----------] Global test environment set-up.
    [----------] 1 test from GradientProblemSolver
    [ RUN      ] GradientProblemSolver.SolvesRosenbrockWithDefaultOptions
    C:\Users\wszalaps\Desktop\issues\failing builds\ceres\ceres-solver-1.11.0\ceres-solver-1.11.0\internal\ceres\gradient_problem_solver_test.cc(71): erro
    r: The difference between 1.0 and parameters[0] is 2.2000000000000002, which exceeds expected_tolerance, where
    1.0 evaluates to 1,
    parameters[0] evaluates to -1.2, and
    expected_tolerance evaluates to 1.0000000000000001e-09.
    C:\Users\wszalaps\Desktop\issues\failing builds\ceres\ceres-solver-1.11.0\ceres-solver-1.11.0\internal\ceres\gradient_problem_solver_test.cc(72): erro
    r: The difference between 1.0 and parameters[1] is 1, which exceeds expected_tolerance, where
    1.0 evaluates to 1,
    parameters[1] evaluates to 0, and
    expected_tolerance evaluates to 1.0000000000000001e-09.
    [  FAILED  ] GradientProblemSolver.SolvesRosenbrockWithDefaultOptions (4 ms)
    [----------] 1 test from GradientProblemSolver (4 ms total)
    
    [----------] Global test environment tear-down
    [==========] 1 test from 1 test case ran. (5 ms total)
    [  PASSED  ] 0 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] GradientProblemSolver.SolvesRosenbrockWithDefaultOptions
    
     1 FAILED TEST
    

    I didn't manage to reproduce the error on VS2013x64 Release and VS2015x64 Debug.

  • FAILURE (Can't use SPARSE_NORMAL_CHOLESKY with SUITESPARSE because SuiteSparse was not enabled when Ceres was built.)

    FAILURE (Can't use SPARSE_NORMAL_CHOLESKY with SUITESPARSE because SuiteSparse was not enabled when Ceres was built.)

    Hi guys,

    I'm using TheiaSfM which has ceres as a dependency and got the following exception error when running the global pipeline:

    Termination: FAILURE (Can't use SPARSE_NORMAL_CHOLESKY with SUITESPARSE because SuiteSparse was not enabled when Ceres was built.)
    

    I'm pretty sure that I compiled ceres with a sparse solver (tried with Suitesparse, CXSparse and Eigensparse). Did you notice any similar issue in this direction?

    PD: you can check the short chat I had with Theia author **** and the complete log I got.

  • cuda_memcheck_* and covariance_test tests failed on VS 2022, ceres 2.1.0rc1

    cuda_memcheck_* and covariance_test tests failed on VS 2022, ceres 2.1.0rc1

    Hi ceres-solver team,

    I'm giving the 2.1.0rc1 a spin in the following environment: Windows 11, VS 2022, cl/toolset version 14.31.31103, CUDA v11.1, no CxSparse, no SuiteSparse, and glog/gflags installed via vcpkg, as well as Eigen (v3.4.0).

    So far so good, it all compiled! I've subsequently ran the tests, and I thought I'd report those three failures as you've asked for Windows testing on the mailing list (I am not sure if they are relevant or how relevant they are): cuda_memcheck_dense_qr_test, cuda_memcheck_dense_cholesky_test and covariance_test.

    I've dug a bit into the CUDA memtests and I'm quite sure they fail because the path is wrong. The test is running:

    Test command: "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\cuda-memcheck.exe" "--leak-check" "full" "D:/ceres/build/bin/cuda_dense_qr_test" Whereas the actual exe is in D:\ceres\build\bin\Release (i.e. added "/Release"). If I run the above cuda-memcheck command manually with the fixed path, the test passes. Also I ran the tests from the build directory (and from VS directly). I'm not supposed to run the INSTALL target first, right?

    Full output log of the failed tests:

    D:\ceres\build> ctest -C Release --output-on-failure --rerun-failed -VV
    UpdateCTestConfiguration  from :D:/ceres/build/DartConfiguration.tcl
    UpdateCTestConfiguration  from :D:/ceres/build/DartConfiguration.tcl
    Test project D:/ceres/build
    Constructing a list of tests
    Done constructing a list of tests
    Updating test list for fixtures
    Added 0 tests to meet fixture requirements
    Checking test dependency graph...
    Checking test dependency graph end
    test 1
        Start  1: cuda_memcheck_dense_qr_test
    
    1: Test command: "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\cuda-memcheck.exe" "--leak-check" "full" "D:/ceres/build/bin/cuda_dense_qr_test"
    1: Test timeout computed to be: 10000000
    1: ========= CUDA-MEMCHECK
    1: ========= Error: Could not run D:/ceres/build/bin/cuda_dense_qr_test
    1: ========= No CUDA-MEMCHECK results found
    1/3 Test  #1: cuda_memcheck_dense_qr_test .........***Failed    0.01 sec
    ========= CUDA-MEMCHECK
    ========= Error: Could not run D:/ceres/build/bin/cuda_dense_qr_test
    ========= No CUDA-MEMCHECK results found
    
    test 2
        Start  2: cuda_memcheck_dense_cholesky_test
    
    2: Test command: "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\cuda-memcheck.exe" "--leak-check" "full" "D:/ceres/build/bin/cuda_dense_cholesky_test"
    2: Test timeout computed to be: 10000000
    2: ========= CUDA-MEMCHECK
    2: ========= Error: Could not run D:/ceres/build/bin/cuda_dense_cholesky_test
    2: ========= No CUDA-MEMCHECK results found
    2/3 Test  #2: cuda_memcheck_dense_cholesky_test ...***Failed    0.00 sec
    ========= CUDA-MEMCHECK
    ========= Error: Could not run D:/ceres/build/bin/cuda_dense_cholesky_test
    ========= No CUDA-MEMCHECK results found
    
    test 24
        Start 24: covariance_test
    
    24: Test command: D:\ceres\build\bin\Release\covariance_test.exe "--test_srcdir" "D:/ceres/ceres-solver/data"
    24: Test timeout computed to be: 10000000
    24: Running main() from gmock_main.cc
    24: [==========] Running 22 tests from 4 test suites.
    24: [----------] Global test environment set-up.
    24: [----------] 3 tests from CovarianceImpl
    24: [ RUN      ] CovarianceImpl.ComputeCovarianceSparsity
    24: [       OK ] CovarianceImpl.ComputeCovarianceSparsity (0 ms)
    24: [ RUN      ] CovarianceImpl.ComputeCovarianceSparsityWithConstantParameterBlock
    24: [       OK ] CovarianceImpl.ComputeCovarianceSparsityWithConstantParameterBlock (0 ms)
    24: [ RUN      ] CovarianceImpl.ComputeCovarianceSparsityWithFreeParameterBlock
    24: [       OK ] CovarianceImpl.ComputeCovarianceSparsityWithFreeParameterBlock (0 ms)
    24: [----------] 3 tests from CovarianceImpl (0 ms total)
    24:
    24: [----------] 14 tests from CovarianceTest
    24: [ RUN      ] CovarianceTest.NormalBehavior
    24: [       OK ] CovarianceTest.NormalBehavior (2 ms)
    24: [ RUN      ] CovarianceTest.ConstantParameterBlock
    24: [       OK ] CovarianceTest.ConstantParameterBlock (1 ms)
    24: [ RUN      ] CovarianceTest.LocalParameterization
    24: [       OK ] CovarianceTest.LocalParameterization (2 ms)
    24: [ RUN      ] CovarianceTest.LocalParameterizationInTangentSpace
    24: [       OK ] CovarianceTest.LocalParameterizationInTangentSpace (2 ms)
    24: [ RUN      ] CovarianceTest.LocalParameterizationInTangentSpaceWithConstantBlocks
    24: [       OK ] CovarianceTest.LocalParameterizationInTangentSpaceWithConstantBlocks (1 ms)
    24: [ RUN      ] CovarianceTest.Manifold
    24: [       OK ] CovarianceTest.Manifold (1 ms)
    24: [ RUN      ] CovarianceTest.ManifoldInTangentSpace
    24: [       OK ] CovarianceTest.ManifoldInTangentSpace (1 ms)
    24: [ RUN      ] CovarianceTest.ManifoldInTangentSpaceWithConstantBlocks
    24: [       OK ] CovarianceTest.ManifoldInTangentSpaceWithConstantBlocks (1 ms)
    24: [ RUN      ] CovarianceTest.TruncatedRank
    24: [       OK ] CovarianceTest.TruncatedRank (3 ms)
    24: [ RUN      ] CovarianceTest.DenseCovarianceMatrixFromSetOfParameters
    24: E0312 15:50:02.777002 23032 covariance_impl.cc:529] SuiteSparse is required to use the SPARSE_QR algorithm with Covariance::Options::sparse_linear_algebra_library_type = SUITE_SPARSE.
    24: F0312 15:50:02.777002 23032 covariance_impl.cc:294] Check failed: is_valid_ Covariance::GetCovarianceMatrix called when Covariance::Compute returned false.
    24: *** Check failure stack trace: ***
    24:     @   00007FFD08E05FFB  google::LogMessage::Flush
    24:     @   00007FFD08E04B49  google::LogMessageFatal::~LogMessageFatal
    24:     @   00007FF7BDAECDCB  (unknown)
    24:     @   00007FF7BDA7F0B5  (unknown)
    24:     @   00007FF7BDA8D2AC  (unknown)
    24:     @   00007FF7BDA8D196  (unknown)
    24:     @   00007FF7BDAAD099  (unknown)
    24:     @   00007FF7BDAAD2BD  (unknown)
    24:     @   00007FF7BDAADAF8  (unknown)
    24:     @   00007FF7BDA8D34C  (unknown)
    24:     @   00007FF7BDA8D276  (unknown)
    24:     @   00007FF7BDAAD4D5  (unknown)
    24:     @   00007FF7BDB0CB2D  (unknown)
    24:     @   00007FF7BDB0BAA0  (unknown)
    24:     @   00007FFD198254E0  BaseThreadInitThunk
    24:     @   00007FFD1B7A485B  RtlUserThreadStart
    3/3 Test #24: covariance_test .....................***Failed    0.08 sec
    Running main() from gmock_main.cc
    [==========] Running 22 tests from 4 test suites.
    [----------] Global test environment set-up.
    [----------] 3 tests from CovarianceImpl
    [ RUN      ] CovarianceImpl.ComputeCovarianceSparsity
    [       OK ] CovarianceImpl.ComputeCovarianceSparsity (0 ms)
    [ RUN      ] CovarianceImpl.ComputeCovarianceSparsityWithConstantParameterBlock
    [       OK ] CovarianceImpl.ComputeCovarianceSparsityWithConstantParameterBlock (0 ms)
    [ RUN      ] CovarianceImpl.ComputeCovarianceSparsityWithFreeParameterBlock
    [       OK ] CovarianceImpl.ComputeCovarianceSparsityWithFreeParameterBlock (0 ms)
    [----------] 3 tests from CovarianceImpl (0 ms total)
    
    [----------] 14 tests from CovarianceTest
    [ RUN      ] CovarianceTest.NormalBehavior
    [       OK ] CovarianceTest.NormalBehavior (2 ms)
    [ RUN      ] CovarianceTest.ConstantParameterBlock
    [       OK ] CovarianceTest.ConstantParameterBlock (1 ms)
    [ RUN      ] CovarianceTest.LocalParameterization
    [       OK ] CovarianceTest.LocalParameterization (2 ms)
    [ RUN      ] CovarianceTest.LocalParameterizationInTangentSpace
    [       OK ] CovarianceTest.LocalParameterizationInTangentSpace (2 ms)
    [ RUN      ] CovarianceTest.LocalParameterizationInTangentSpaceWithConstantBlocks
    [       OK ] CovarianceTest.LocalParameterizationInTangentSpaceWithConstantBlocks (1 ms)
    [ RUN      ] CovarianceTest.Manifold
    [       OK ] CovarianceTest.Manifold (1 ms)
    [ RUN      ] CovarianceTest.ManifoldInTangentSpace
    [       OK ] CovarianceTest.ManifoldInTangentSpace (1 ms)
    [ RUN      ] CovarianceTest.ManifoldInTangentSpaceWithConstantBlocks
    [       OK ] CovarianceTest.ManifoldInTangentSpaceWithConstantBlocks (1 ms)
    [ RUN      ] CovarianceTest.TruncatedRank
    [       OK ] CovarianceTest.TruncatedRank (3 ms)
    [ RUN      ] CovarianceTest.DenseCovarianceMatrixFromSetOfParameters
    E0312 15:50:02.777002 23032 covariance_impl.cc:529] SuiteSparse is required to use the SPARSE_QR algorithm with Covariance::Options::sparse_linear_algebra_library_type = SUITE_SPARSE.
    F0312 15:50:02.777002 23032 covariance_impl.cc:294] Check failed: is_valid_ Covariance::GetCovarianceMatrix called when Covariance::Compute returned false.
    *** Check failure stack trace: ***
        @   00007FFD08E05FFB  google::LogMessage::Flush
        @   00007FFD08E04B49  google::LogMessageFatal::~LogMessageFatal
        @   00007FF7BDAECDCB  (unknown)
        @   00007FF7BDA7F0B5  (unknown)
        @   00007FF7BDA8D2AC  (unknown)
        @   00007FF7BDA8D196  (unknown)
        @   00007FF7BDAAD099  (unknown)
        @   00007FF7BDAAD2BD  (unknown)
        @   00007FF7BDAADAF8  (unknown)
        @   00007FF7BDA8D34C  (unknown)
        @   00007FF7BDA8D276  (unknown)
        @   00007FF7BDAAD4D5  (unknown)
        @   00007FF7BDB0CB2D  (unknown)
        @   00007FF7BDB0BAA0  (unknown)
        @   00007FFD198254E0  BaseThreadInitThunk
        @   00007FFD1B7A485B  RtlUserThreadStart
    
    
    0% tests passed, 3 tests failed out of 3
    
    Total Test time (real) =   0.11 sec
    
    The following tests FAILED:
              1 - cuda_memcheck_dense_qr_test (Failed)
              2 - cuda_memcheck_dense_cholesky_test (Failed)
             24 - covariance_test (Failed)
    Errors while running CTest
    
  • FindTBB.cmake doesn't find newer TBB versions

    FindTBB.cmake doesn't find newer TBB versions

    For the intel provided linux binary installers, FindTBB.cmake has an outdated path, for gcc4.4 only:

    https://github.com/ceres-solver/ceres-solver/blob/e39d9ed1d60dfeb58dd2a0df4622c683f87b28e3/cmake/FindTBB.cmake#L145-L157

    Up to TBB 2020.2 it seems the possible versions of intel provided binary packages are: 4.1, 4.4, 4.7, 4.8

    $ find /opt/intel/ -type d -name compilers_and_libraries* | grep 20........ -o | sort | uniq | tr '\n' ' '
    2018.0.128 2018.2.199 2018.3.222 2018.5.274 2019.0.117 2019.1.144 2019.2.187 2019.3.199 2019.4.243 2019.5.281 2020.0.166 2020.1.217
    $ find /opt/intel/ -type d -name gcc* | grep gcc... -o | sort | uniq | tr '\n' ' '
    gcc4.1 gcc4.4 gcc4.7 gcc4.8
    

    I can provide a patch adding all 4 possible paths. Of course that would break again in the future when newer TBB versions use newer paths... Not sure if there is a better solution. I don't think PATH_SUFFIXES can contain wildcards or something like that.

  • invert_psd_matrix_test fails on Debian Sid, amd64

    invert_psd_matrix_test fails on Debian Sid, amd64

    Trying to package 1.13.0 RC1 for Debian, I encounter one failing unit test:

    36/75 Test #39: invert_psd_matrix_test .......................***Exception: Other 0.12 sec Running main() from gmock_main.cc [==========] Running 3 tests from 1 test case. [----------] Global test environment set-up. [----------] 3 tests from InvertPSDMatrix [ RUN ] InvertPSDMatrix.Identity3x3 [ OK ] InvertPSDMatrix.Identity3x3 (0 ms) [ RUN ] InvertPSDMatrix.FullRank5x5 [ OK ] InvertPSDMatrix.FullRank5x5 (0 ms) [ RUN ] InvertPSDMatrix.RankDeficient5x5 invert_psd_matrix_test: /usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h:637: void Eigen::JacobiSVD<MatrixType, QRPreconditioner>::allocate(Eigen::Index, Eigen::Index, unsigned int) [with _MatrixType = Eigen::Matrix<double, 5, 5, 1, 5, 5>; int QRPreconditioner = 2; Eigen::Index = long int]: Assertion `(!(m_computeThinU || m_computeThinV) || (MatrixType::ColsAtCompileTime==Dynamic)) && "JacobiSVD: thin U and V are only available when your matrix has a dynamic number of columns."' failed.

    Debian unstable currently has Eigen 3.3.4.

  • Unable to successfully build Ceres-Solver on Windows 10

    Unable to successfully build Ceres-Solver on Windows 10

    I have been struggling to build the Ceres-Solver for some time. In need it to work as a x64 library. Has anyone successfully built and released a compiled version Using Microsoft Visual Studio version 2017 and/or 2019?

    Any help is appreciated!

    Thanks,

    Robert

  • some tests are failed on debian unstable and ubuntu 12.10 (unreleased) (i386)

    some tests are failed on debian unstable and ubuntu 12.10 (unreleased) (i386)

    Original issue 44 created by sandwichmaker on 2012-06-12T14:44:10.000Z:

    The following errors occur on Debian unstable and Ubuntu 12.10 (unreleased) (i386)

    These distributions have gcc-4.7 and g++-4.7 and they are used as default one. When it is configured with CC=gcc-4.6 CXX=g++-4.6, autodiff_test throws "Exception: SegFault" and rotation_test is passed.

      Start  2: autodiff_test
    

    2/42 Test # 2: autodiff_test .............................***Failed 0.01 sec [==========] Running 3 tests from 1 test case. [----------] Global test environment set-up. [----------] 3 tests from AutoDiff [ RUN ] AutoDiff.ProjectiveCameraModel /build/buildd/ceres-solver-1.2.0/internal/ceres/autodiff_test.cc:188: Failure Value of: b_x[i] Actual: 0.937321 Expected: fd_x[i] Which is: 0.937321 [ FAILED ] AutoDiff.ProjectiveCameraModel (1 ms) [ RUN ] AutoDiff.Metric [ OK ] AutoDiff.Metric (0 ms) [ RUN ] AutoDiff.VaryingNumberOfResidualsForOneCostFunctorType [ OK ] AutoDiff.VaryingNumberOfResidualsForOneCostFunctorType (0 ms) [----------] 3 tests from AutoDiff (1 ms total)

    [----------] Global test environment tear-down [==========] 3 tests from 1 test case ran. (1 ms total) [ PASSED ] 2 tests. [ FAILED ] 1 test, listed below: [ FAILED ] AutoDiff.ProjectiveCameraModel

    1 FAILED TEST

    ==== snip ====

    29/42 Test # 29: rotation_test .............................***Failed 38.15 sec [==========] Running 32 tests from 4 test cases. [----------] Global test environment set-up. [----------] 25 tests from Rotation [ RUN ] Rotation.ZeroAngleAxisToQuaternion [ OK ] Rotation.ZeroAngleAxisToQuaternion (0 ms)

    ==== snip ====

    [ RUN ] Quaternion.MultiplicationIsAssociative [ OK ] Quaternion.MultiplicationIsAssociative (0 ms) [----------] 3 tests from Quaternion (1 ms total)

    [----------] 2 tests from AngleAxis [ RUN ] AngleAxis.RotatePointGivesSameAnswerAsRotationMatrix /build/buildd/ceres-solver-1.2.0/internal/ceres/rotation_test.cc:869: Failure The difference between rotation_matrix_rotated_p[k] and angle_axis_rotated_p[k] is 4.8572257327350599e-15, which exceeds kTolerance, where rotation_matrix_rotated_p[k] evaluates to 0.20736379587646864, angle_axis_rotated_p[k] evaluates to 0.20736379587647349, and kTolerance evaluates to 2.2204460492503131e-15. p: 0.62684068625180078 0.2684996133989187 0.56501614189008997 angle_axis: -46.865001952191413 11.791397347707568 3.1415926535897931 /build/buildd/ceres-solver-1.2.0/internal/ceres/rotation_test.cc:869: Failure The difference between rotation_matrix_rotated_p[k] and angle_axis_rotated_p[k] is 2.5701663020072374e-14, which exceeds kTolerance, where rotation_matrix_rotated_p[k] evaluates to 0.44503886649343843, angle_axis_rotated_p[k] evaluates to 0.44503886649346414, and kTolerance evaluates to 2.2204460492503131e-15. p: 0.73560060641523484 -0.55003317424563369 -0.79165624351783481 angle_axis: -390.39518008088459 -171.79049495707383 -3.1415926535897931

    ....

  • build error!!

    build error!!

    Hey, When I build ceres, I got a trouble as follows:

    CMake Error at internal/ceres/CMakeLists.txt:145 (add_test): Error evaluating generator expression:

    $<TARGET_FILE:cuda_dense_cholesky_test>
    

    No target "cuda_dense_cholesky_test"

    totally having no idea, please give me a hand !

  • LocalParameterizations cause compilation failure

    LocalParameterizations cause compilation failure

    I compile the cere's helloworld instance at win10 in VS2022, but there are so many errors and all of that is about

    "error C4996: 'ceres::LocalParameterization': LocalParameterizations will be removed from the Ceres Solver API in version 2.2.0. Use Manifolds instead.".

    help please, and forgive me for my poor grammar

  • Error in evaluating the ResidualBlock

    Error in evaluating the ResidualBlock

    I use Ceres to optimise a non-linear problem, but it shows this error.

    It is very weird, I checked the jacobian and the residuals, they all correct.

    I can't understand where is the error comes from.

    Here is a part of log.

    The error is not caused by "Uninitialized".

    I am looking forward to your reply.

    Thank you.

    ================================ res 0.723307 0.397519 1.07305 -0.825167 -0.0501836 -0.562656 jac 3.0071e-05 0 0 0 0 0 -1.33713e-06 3.224e-05 0 0 0 0 -5.5532e-06 -1.49396e-06 3.00939e-05 0 0 0 -9.57822e-08 1.7439e-06 -8.4219e-07 5.87996e-06 0 0 -2.17407e-06 -2.53591e-07 1.44578e-06 7.4504e-07 6.47146e-06 0 1.45034e-06 -1.57725e-06 -2.91756e-07 -2.34769e-07 -1.85578e-07 6.30806e-06 WARNING: Logging before InitGoogleLogging() is written to STDERR W0509 23:04:07.611050 11797 residual_block.cc:131]

    Error in evaluating the ResidualBlock.

    There are two possible reasons. Either the CostFunction did not evaluate and fill all
    residual and jacobians that were requested or there was a non-finite value (nan/infinite) generated during the or jacobian computation.

    Residual Block size: 2 parameter blocks x 6 residuals

    For each parameter block, the value of the parameters are printed in the first column
    and the value of the jacobian under the corresponding residual. If a ParameterBlock was held constant then the corresponding jacobian is printed as 'Not Computed'. If an entry of the Jacobian/residual array was requested but was not written to by user code, it is indicated by 'Uninitialized'. This is an error. Residuals or Jacobian values evaluating to Inf or NaN is also an error.

    Residuals: 0.723307 0.397519 1.07305 -0.825167 -0.0501836 -0.562656

    Parameter Block 0, size: 7

    0.0271139 | 3.0071e-05 3.224e-05 3.00939e-05 5.87996e-06 6.47146e-06 6.30806e-06 0.024274 | 0 0 0 0 0 Uninitialized 0.0265459 | 0 0 0 0 1.45034e-06 Uninitialized 0.818717 | 0 0 0 -2.17407e-06 -1.57725e-06 Uninitialized -0.0376479 | 0 0 -9.57822e-08 -2.53591e-07 -2.91756e-07 Uninitialized 0.571767 | 0 -5.5532e-06 1.7439e-06 1.44578e-06 -2.34769e-07 Uninitialized 0.0369805 | -1.33713e-06 -1.49396e-06 -8.4219e-07 7.4504e-07 -1.85578e-07 Uninitialized

    Parameter Block 1, size: 7

    0.670625 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized 
    0.426507 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized 
     1.00633 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized 
    

    -0.816469 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized 0.0302407 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized -0.574071 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized 0.0539041 | Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized Uninitialized

    E0509 23:04:07.611131 11797 trust_region_minimizer.cc:72] Terminating: Residual and Jacobian evaluation failed.

    Solver Summary (v 1.14.0-eigen-(3.3.4)-lapack-suitesparse-(5.1.2)-cxsparse-(3.1.9)-eigensparse-openmp-no_tbb)

                                     Original                  Reduced
    

    Parameter blocks 26 26 Parameters 182 182 Effective parameters 181 181 Residual blocks 50 50 Residuals 300 300

    Minimizer TRUST_REGION

    Dense linear algebra library EIGEN Trust region strategy DOGLEG (TRADITIONAL)

                                        Given                     Used
    

    Linear solver DENSE_SCHUR DENSE_SCHUR Threads 1 1 Linear solver ordering AUTOMATIC 25,1 Schur structure 6,7,6 d,d,d

    Cost: Initial -1.000000e+00

    Minimizer iterations 0 Successful steps 0 Unsuccessful steps 0

    Time (in seconds): Preprocessor 0.000174

    Residual only evaluation 0.000000 (0) Jacobian & residual evaluation 0.000206 (1) Linear solver 0.000000 (0) Minimizer 0.000224

    Postprocessor 0.000005 Total 0.000404

    Termination: FAILURE (Residual and Jacobian evaluation failed.)

  • Bazel build does not include all relevant .cc files

    Bazel build does not include all relevant .cc files

    Using the built-in BUILD file, the listing of tiles in bazel/ceres.bzl is incorrect and yields a library that is missing several destructor implementations (CostFunction, EvaluationCallback, IterationCallback) and some classes: DenseQR

    Local patching yielded the following diff:

    diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl
    index fad2754f..c76e23ae 100644
    --- a/bazel/ceres.bzl
    +++ b/bazel/ceres.bzl
    @@ -32,8 +32,8 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
         "accelerate_sparse.cc",
         "array_utils.cc",
         "block_evaluate_preparer.cc",
    -    "block_jacobian_writer.cc",
         "block_jacobi_preconditioner.cc",
    +    "block_jacobian_writer.cc",
         "block_random_access_dense_matrix.cc",
         "block_random_access_diagonal_matrix.cc",
         "block_random_access_matrix.cc",
    @@ -53,10 +53,13 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
         "context_impl.cc",
         "coordinate_descent_minimizer.cc",
         "corrector.cc",
    +    "cost_function.cc",
         "covariance.cc",
         "covariance_impl.cc",
    +    "cxsparse.cc",
         "dense_cholesky.cc",
         "dense_normal_cholesky_solver.cc",
    +    "dense_qr.cc",
         "dense_qr_solver.cc",
         "dense_sparse_matrix.cc",
         "detect_structure.cc",
    @@ -65,25 +68,30 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
         "dynamic_compressed_row_sparse_matrix.cc",
         "dynamic_sparse_normal_cholesky_solver.cc",
         "eigensparse.cc",
    +    "evaluation_callback.cc",
         "evaluator.cc",
         "file.cc",
    +    "first_order_function.cc",
    +    "float_cxsparse.cc",
    +    "float_suitesparse.cc",
         "function_sample.cc",
         "gradient_checker.cc",
         "gradient_checking_cost_function.cc",
         "gradient_problem.cc",
         "gradient_problem_solver.cc",
    -    "is_close.cc",
         "implicit_schur_complement.cc",
         "inner_product_computer.cc",
    +    "is_close.cc",
    +    "iteration_callback.cc",
         "iterative_refiner.cc",
         "iterative_schur_complement_solver.cc",
         "levenberg_marquardt_strategy.cc",
         "line_search.cc",
         "line_search_direction.cc",
         "line_search_minimizer.cc",
    +    "line_search_preprocessor.cc",
         "linear_least_squares_problems.cc",
         "linear_operator.cc",
    -    "line_search_preprocessor.cc",
         "linear_solver.cc",
         "local_parameterization.cc",
         "loss_function.cc",
    @@ -92,6 +100,7 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
         "minimizer.cc",
         "normal_prior.cc",
         "parallel_for_cxx.cc",
    +    "parallel_for_nothreads.cc",
         "parallel_for_openmp.cc",
         "parallel_utils.cc",
         "parameter_block_ordering.cc",
    
  • Using ceres and GTSAM at the same time, the program is stuck in the update function of the gtsam optimizer and cannot jump out.

    Using ceres and GTSAM at the same time, the program is stuck in the update function of the gtsam optimizer and cannot jump out.

    Hello, I implemented a SLAM algorithm based on factor graph optimization on ubuntu18.04. I used GTSAM4.0.0 and ceres2.0.0 in one node at the same time. After compiling, when the algorithm is executed to the update( of the isam optimizer in gtsam ) function, it will be stuck in the update function and cannot be jumped out, as if it has fallen into an infinite loop, but the program does not report an error. If ceres is not compiled, the update function of gtsam can be used normally. Do you know what is the reason for this, or how to avoid it.

Seidel's Algorithm: Linear-Complexity Linear Programming for Small-Dimensional Variables

SDLP Seidel's Algorithm: Linear-Complexity Linear Programming (LP) for Small-Dimensions About This solver is super efficient for small-dimensional LP

May 19, 2022
C++ library for solving large sparse linear systems with algebraic multigrid method

AMGCL AMGCL is a header-only C++ library for solving large sparse linear systems with algebraic multigrid (AMG) method. AMG is one of the most effecti

May 10, 2022
A header-only C++ library for large scale eigenvalue problems
A header-only C++ library for large scale eigenvalue problems

NOTE: Spectra 1.0.0 is released, with a lot of API-breaking changes. Please see the migration guide for a smooth transition to the new version. NOTE:

May 2, 2022
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions

linmath.h -- A small library for linear math as required for computer graphics linmath.h provides the most used types required for programming compute

May 6, 2022
nml is a simple matrix and linear algebra library written in standard C.

nml is a simple matrix and linear algebra library written in standard C.

Apr 21, 2022
Library for nonconvex constrained optimization using the augmented Lagrangian method and the matrix-free PANOC algorithm.

alpaqa Alpaqa is an efficient implementation of the Augmented Lagrangian method for general nonlinear programming problems, which uses the first-order

May 11, 2022
Linear Algebra in C

Linear Algebra in C Quick Start Grab la.h and use it as an stb-style header-only library. For more info on such libraries see: https://github.com/noth

Apr 29, 2022
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).

MIRACL What is MIRACL? Multiprecision Integer and Rational Arithmetic Cryptographic Library – the MIRACL Crypto SDK – is a C software library that is

May 4, 2022
A C library for statistical and scientific computing

Apophenia is an open statistical library for working with data sets and statistical or simulation models. It provides functions on the same level as t

Mar 17, 2022
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library

Klein ?? ?? Project Site ?? ?? Description Do you need to do any of the following? Quickly? Really quickly even? Projecting points onto lines, lines t

May 9, 2022
linalg.h is a single header, public domain, short vector math library for C++

linalg.h linalg.h is a single header, public domain, short vector math library for C++. It is inspired by the syntax of popular shading and compute la

May 13, 2022
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

libtommath This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written en

May 12, 2022
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

OpenBLAS Travis CI: AppVeyor: Drone CI: Introduction OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library based on GotoBLAS2 1.13

May 19, 2022
The QuantLib C++ library

QuantLib: the free/open-source library for quantitative finance The QuantLib project (http://quantlib.org) is aimed at providing a comprehensive softw

May 16, 2022
A C++ header-only library of statistical distribution functions.

StatsLib StatsLib is a templated C++ library of statistical distribution functions, featuring unique compile-time computing capabilities and seamless

May 9, 2022
SymEngine is a fast symbolic manipulation library, written in C++

SymEngine SymEngine is a standalone fast C++ symbolic manipulation library. Optional thin wrappers allow usage of the library from other languages, e.

May 16, 2022
RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library
RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

Converting ascii text into (floating-point) numeric values is a very common problem. The fast_float header-only C++ library by Daniel Lemire does this very well, and very fast at up to or over to 1 gigabyte per second as described in more detail in a recent arXiv paper.

May 2, 2022
📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C
📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C

Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C`. cglm provides lot of utils to help math operations to be fast and quick to write. It is community friendly, feel free to bring any issues, bugs you faced.

May 11, 2022
✨sigmatch - Modern C++ 20 Signature Match / Search Library

sigmatch Modern C++ 20 Signature Match / Search Library ✨ Features ?? Header-only, no dependencies, no exceptions. ☕ Compile-time literal signature st

May 9, 2022