Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
namespace CeresSharp.Enums;
/// <summary>
/// Covariance estimation algorithm types.
/// </summary>
public enum CovarianceAlgorithmType
{
/// <summary>
/// Dense SVD algorithm.
/// </summary>
DenseSvd = 0,
/// <summary>
/// Sparse QR algorithm.
/// </summary>
SparseQr = 1
}

View File

@@ -0,0 +1,22 @@
namespace CeresSharp.Enums;
/// <summary>
/// Dense linear algebra library types.
/// </summary>
public enum DenseLinearAlgebraLibraryType
{
/// <summary>
/// Eigen library.
/// </summary>
Eigen = 0,
/// <summary>
/// LAPACK + BLAS library.
/// </summary>
Lapack = 1,
/// <summary>
/// NVIDIA's CUDA library.
/// </summary>
Cuda = 2
}

View File

@@ -0,0 +1,17 @@
namespace CeresSharp.Enums;
/// <summary>
/// Dogleg type strategies for trust region optimization.
/// </summary>
public enum DoglegType
{
/// <summary>
/// The traditional approach constructs a dogleg path consisting of two line segments and finds the farthest point on that path that is still within the trust region.
/// </summary>
TraditionalDogleg = 0,
/// <summary>
/// The subspace approach finds the exact minimum of the model constrained to the subspace spanned by the dogleg path.
/// </summary>
SubspaceDogleg = 1
}

View File

@@ -0,0 +1,27 @@
namespace CeresSharp.Enums;
/// <summary>
/// Line search direction types for line search minimizer.
/// </summary>
public enum LineSearchDirectionType
{
/// <summary>
/// Negative of the gradient.
/// </summary>
SteepestDescent = 0,
/// <summary>
/// A generalization of the Conjugate Gradient method to non-linear functions.
/// </summary>
NonlinearConjugateGradient = 1,
/// <summary>
/// Limited memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) method.
/// </summary>
Lbfgs = 2,
/// <summary>
/// Broyden-Fletcher-Goldfarb-Shanno (BFGS) method.
/// </summary>
Bfgs = 3
}

View File

@@ -0,0 +1,17 @@
namespace CeresSharp.Enums;
/// <summary>
/// Line search types for line search minimizer.
/// </summary>
public enum LineSearchType
{
/// <summary>
/// Backtracking line search with polynomial interpolation or bisection.
/// </summary>
Armijo = 0,
/// <summary>
/// Wolfe line search.
/// </summary>
Wolfe = 1
}

View File

@@ -0,0 +1,43 @@
namespace CeresSharp.Enums;
/// <summary>
/// Linear solver types available in Ceres Solver.
/// Values must match ceres::LinearSolverType enum in Ceres C++ (types.h).
/// </summary>
public enum LinearSolverType
{
/// <summary>
/// Dense Cholesky factorization of the normal equations.
/// </summary>
DenseNormalCholesky = 0,
/// <summary>
/// Dense QR factorization.
/// </summary>
DenseQr = 1,
/// <summary>
/// Sparse normal Cholesky factorization.
/// </summary>
SparseNormalCholesky = 2,
/// <summary>
/// Dense Schur factorization.
/// </summary>
DenseSchur = 3,
/// <summary>
/// Sparse Schur factorization.
/// </summary>
SparseSchur = 4,
/// <summary>
/// Iterative Schur complement solver.
/// </summary>
IterativeSchur = 5,
/// <summary>
/// Conjugate gradients on the normal equations.
/// </summary>
CgNr = 6
}

View File

@@ -0,0 +1,17 @@
namespace CeresSharp.Enums;
/// <summary>
/// Logging types for Ceres Solver output.
/// </summary>
public enum LoggingType
{
/// <summary>
/// No logging output.
/// </summary>
Silent = 0,
/// <summary>
/// Log output for each minimizer iteration.
/// </summary>
PerMinimizerIteration = 1
}

View File

@@ -0,0 +1,18 @@
namespace CeresSharp.Enums;
/// <summary>
/// Minimizer types available in Ceres Solver.
/// Values must match ceres::MinimizerType enum in Ceres C++ (types.h).
/// </summary>
public enum MinimizerType
{
/// <summary>
/// Line search minimizer.
/// </summary>
LineSearch = 0,
/// <summary>
/// Trust region minimizer.
/// </summary>
TrustRegion = 1
}

View File

@@ -0,0 +1,22 @@
namespace CeresSharp.Enums;
/// <summary>
/// Nonlinear conjugate gradient types.
/// </summary>
public enum NonlinearConjugateGradientType
{
/// <summary>
/// Fletcher-Reeves conjugate gradient.
/// </summary>
FletcherReeves = 0,
/// <summary>
/// Polak-Ribiere conjugate gradient.
/// </summary>
PolakRibiere = 1,
/// <summary>
/// Hestenes-Stiefel conjugate gradient.
/// </summary>
HestenesStiefel = 2
}

View File

@@ -0,0 +1,26 @@
namespace CeresSharp.Enums;
/// <summary>
/// Numeric differentiation methods for NumericDiffCostFunction.
/// Values must match ceres_numeric_diff_method_t enum in ceres_wrapper.h.
/// Note: The wrapper defines its own enum order (Forward=0, Central=1) which differs
/// from ceres::NumericDiffMethodType (Central=0, Forward=1). The wrapper uses a switch
/// statement to map correctly, so C# must match the wrapper's enum.
/// </summary>
public enum NumericDiffMethod
{
/// <summary>
/// Compute forward finite difference: f'(x) ~ (f(x+h) - f(x)) / h.
/// </summary>
Forward = 0,
/// <summary>
/// Compute central finite difference: f'(x) ~ (f(x+h) - f(x-h)) / 2h.
/// </summary>
Central = 1,
/// <summary>
/// Adaptive numerical differentiation using Ridders' method.
/// </summary>
Ridders = 2
}

View File

@@ -0,0 +1,42 @@
namespace CeresSharp.Enums;
/// <summary>
/// Preconditioner types available in Ceres Solver.
/// </summary>
public enum PreconditionerType
{
/// <summary>
/// Trivial preconditioner - the identity matrix.
/// </summary>
Identity = 0,
/// <summary>
/// Block diagonal of the Gauss-Newton Hessian.
/// </summary>
Jacobi = 1,
/// <summary>
/// Block diagonal of the Schur complement.
/// </summary>
SchurJacobi = 2,
/// <summary>
/// Power series expansion of the Schur complement.
/// </summary>
SchurPowerSeriesExpansion = 3,
/// <summary>
/// Visibility clustering based preconditioners.
/// </summary>
ClusterJacobi = 4,
/// <summary>
/// Cluster tridiagonal preconditioner.
/// </summary>
ClusterTridiagonal = 5,
/// <summary>
/// Subset preconditioner for general purpose linear least squares problems.
/// </summary>
Subset = 6
}

View File

@@ -0,0 +1,32 @@
namespace CeresSharp.Enums;
/// <summary>
/// Sparse linear algebra library types.
/// </summary>
public enum SparseLinearAlgebraLibraryType
{
/// <summary>
/// SuiteSparse library (CHOLMOD).
/// </summary>
SuiteSparse = 0,
/// <summary>
/// Eigen's sparse linear algebra routines.
/// </summary>
EigenSparse = 1,
/// <summary>
/// Apple's Accelerate framework sparse linear algebra routines.
/// </summary>
AccelerateSparse = 2,
/// <summary>
/// NVIDIA's cuDSS and cuSPARSE libraries.
/// </summary>
CudaSparse = 3,
/// <summary>
/// No sparse linear algebra library should be used.
/// </summary>
NoSparse = 4
}

View File

@@ -0,0 +1,33 @@
namespace CeresSharp.Enums;
/// <summary>
/// Termination types for Ceres Solver.
/// Values must match ceres::TerminationType enum in Ceres C++ (types.h).
/// </summary>
public enum TerminationType
{
/// <summary>
/// Convergence reached.
/// </summary>
Convergence = 0,
/// <summary>
/// No convergence.
/// </summary>
NoConvergence = 1,
/// <summary>
/// Failure.
/// </summary>
Failure = 2,
/// <summary>
/// User-requested success via IterationCallback returning SOLVER_TERMINATE_SUCCESSFULLY.
/// </summary>
UserSuccess = 3,
/// <summary>
/// User-requested failure via IterationCallback returning SOLVER_ABORT.
/// </summary>
UserFailure = 4
}

View File

@@ -0,0 +1,17 @@
namespace CeresSharp.Enums;
/// <summary>
/// Trust region strategy types available in Ceres Solver.
/// </summary>
public enum TrustRegionStrategyType
{
/// <summary>
/// The default trust region strategy is to use the step computation used in the Levenberg-Marquardt algorithm.
/// </summary>
LevenbergMarquardt = 0,
/// <summary>
/// Powell's dogleg algorithm interpolates between the Cauchy point and the Gauss-Newton step.
/// </summary>
Dogleg = 1
}