Skip to main content

Auki::Ceres::Solver

A class that wraps some functionalities of the native Ceres library. It provides methods to solve optimization problems. Full native Ceres library can be found here .

Public Types​

Name
enum classType { CeresDenseNormalCholesky, CeresDenseQR}
Enum representing different types of solvers.

Public Functions​

Name
delegate intCostFunction(IntPtr user_data, IntPtr parameters, IntPtr residuals)
CostFunction type delegate used in optimization.
unsafe voidSolveUnsafe< T >(T[] observations, CostFunction func, ref Vector3 inOutResult, Type type =Type.CeresDenseQR)
Solves an optimization problem using Ceres Solver in an unsafe context.
voidSolve< T >(T[] observations, CostFunction func, ref Vector3 inOutResult, Type type =Type.CeresDenseQR)
Solves an optimization problem using Ceres Solver.

Public Types Documentation​

enum Type​

EnumeratorValueDescription
CeresDenseNormalCholeskyCeres Dense Normal Cholesky solver type.
CeresDenseQRCeres Dense QR solver type.

Enum representing different types of solvers.

Public Functions Documentation​

function CostFunction​

delegate int CostFunction(
IntPtr user_data,
IntPtr parameters,
IntPtr residuals
)

CostFunction type delegate used in optimization.

Parameters:

  • user_data User-defined data pointer.
  • parameters Pointer to the parameters.
  • residuals Pointer to the residuals.

Return: An integer representing the cost function result.

function SolveUnsafe< T >​

static unsafe void SolveUnsafe< T >(
T[] observations,
CostFunction func,
ref Vector3 inOutResult,
Type type =Type.CeresDenseQR
)

Solves an optimization problem using Ceres Solver in an unsafe context.

Parameters:

  • observations Array of observations.
  • func Cost function delegate.
  • inOutResult Input/output result vector.
  • type Solver type.

Template Parameters:

  • T Type of observations.

This method operates in an unsafe context and should be used with caution.

function Solve< T >​

static void Solve< T >(
T[] observations,
CostFunction func,
ref Vector3 inOutResult,
Type type =Type.CeresDenseQR
)

Solves an optimization problem using Ceres Solver.

Parameters:

  • observations Array of observations.
  • func Cost function delegate.
  • inOutResult Input/output result vector.
  • type Solver type.

Template Parameters:

  • T Type of observations.