123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #ifndef CERES_PUBLIC_C_API_H_
- #define CERES_PUBLIC_C_API_H_
- #include "ceres/internal/export.h"
- #include "ceres/internal/disable_warnings.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- CERES_EXPORT void ceres_init();
- typedef int (*ceres_cost_function_t)(void* user_data,
- double** parameters,
- double* residuals,
- double** jacobians);
- typedef void (*ceres_loss_function_t)(void* user_data,
- double squared_norm,
- double out[3]);
- CERES_EXPORT void* ceres_create_huber_loss_function_data(double a);
- CERES_EXPORT void* ceres_create_softl1_loss_function_data(double a);
- CERES_EXPORT void* ceres_create_cauchy_loss_function_data(double a);
- CERES_EXPORT void* ceres_create_arctan_loss_function_data(double a);
- CERES_EXPORT void* ceres_create_tolerant_loss_function_data(double a, double b);
- CERES_EXPORT void ceres_free_stock_loss_function_data(void* loss_function_data);
- CERES_EXPORT void ceres_stock_loss_function(void* user_data,
- double squared_norm,
- double out[3]);
- struct ceres_problem_s;
- typedef struct ceres_problem_s ceres_problem_t;
- struct ceres_residual_block_id_s;
- typedef struct ceres_residual_block_id_s ceres_residual_block_id_t;
- CERES_EXPORT ceres_problem_t* ceres_create_problem();
- CERES_EXPORT void ceres_free_problem(ceres_problem_t* problem);
- CERES_EXPORT ceres_residual_block_id_t* ceres_problem_add_residual_block(
- ceres_problem_t* problem,
- ceres_cost_function_t cost_function,
- void* cost_function_data,
- ceres_loss_function_t loss_function,
- void* loss_function_data,
- int num_residuals,
- int num_parameter_blocks,
- int* parameter_block_sizes,
- double** parameters);
- CERES_EXPORT void ceres_solve(ceres_problem_t* problem);
- #ifdef __cplusplus
- }
- #endif
- #include "ceres/internal/reenable_warnings.h"
- #endif
|