| // This file is generated by Ceres autodiff code generation." |
| // http://ceres-solver.org/ |
| |
| #include <cstdlib> |
| #include <fstream> |
| #include <iostream> |
| #include <string> |
| #include <vector> |
| |
| #include "ceres/codegen/generate_code_for_functor.h" |
| #include "@COST_FUNCTOR_INPUT_FILE@" |
| |
| int main() { |
| const std::vector<std::string> lines = |
| ceres::GenerateCodeForFunctor<@FULL_CXX_FUNCTOR_TYPE_NAME@>( |
| ceres::AutoDiffCodeGenOptions()); |
| const std::string output_file = "@GENERATED_EVALUATION_IMPL_FILE@"; |
| std::ofstream stream(output_file); |
| if (!stream.is_open()) { |
| std::cerr << "Could not open file " << output_file << std::endl; |
| return EXIT_FAILURE; |
| } |
| for (const auto& line : lines) { |
| stream << line << std::endl; |
| } |
| return EXIT_SUCCESS; |
| } |