14#include <unordered_map>
132 size_t& actualRows) = 0;
174 std::unordered_map<std::string,
MatrixX<T>>& history,
176 size_t maxIterations_);
A dense column-major matrix whose underlying storage capacity grows monotonically and is reused acros...
Abstract base class for optimization objective functions.
double getJacobian(const VectorX< T > ¶meters, MatrixX< T > &jacobian, VectorX< T > &residual, size_t &actualRows)
Computes the Jacobian matrix for least squares problems.
size_t getActualParameters() const
Returns the number of parameters currently enabled for optimization.
size_t getNumParameters() const
Returns the total number of parameters in the optimization problem.
virtual double computeJacobianBlock(const VectorX< T > ¶meters, size_t blockIndex, Eigen::Ref< MatrixX< T > > jacobianBlock, Eigen::Ref< VectorX< T > > residualBlock, size_t &actualRows)=0
Computes a specific Jacobian block.
virtual double getSolverDerivatives(const VectorX< T > ¶meters, MatrixX< T > &hess, VectorX< T > &grad)
Computes derivatives needed by the solver.
virtual double getJtJR_Sparse(const VectorX< T > ¶meters, SparseMatrix< T > &jtj, VectorX< T > &jtr)
Computes sparse JᵀJ and JᵀR for large-scale problems.
ResizeableMatrix< float > tResidual_
virtual void updateParameters(VectorX< T > ¶meters, const VectorX< T > &gradient)=0
Updates parameters using the computed step direction.
virtual double getError(const VectorX< T > ¶meters)=0
Evaluates the objective function at the given parameter values.
virtual void initializeJacobianComputation(const VectorX< T > ¶meters)=0
Initializes Jacobian computation for the given parameters.
virtual void getHessian(const VectorX< T > ¶meters, MatrixX< T > &hessian)
Computes the Hessian matrix of second derivatives.
virtual double getJtJR(const VectorX< T > ¶meters, MatrixX< T > &jtj, VectorX< T > &jtr)
Computes JᵀJ and JᵀR for Gauss-Newton optimization.
virtual void setEnabledParameters(const ParameterSet ¶meterSet)
Specifies which parameters should be optimized.
virtual size_t getJacobianBlockCount() const =0
Returns the number of Jacobian blocks available.
virtual void storeHistory(std::unordered_map< std::string, MatrixX< T > > &history, size_t iteration, size_t maxIterations_)
Records solver state for debugging and analysis.
virtual ~SolverFunctionT()=default
virtual double getGradient(const VectorX< T > ¶meters, VectorX< T > &gradient)=0
Computes the gradient of the objective function.
virtual void finalizeJacobianComputation()
Optional cleanup after all Jacobian blocks have been computed.
ResizeableMatrix< float > tJacobian_
virtual size_t getJacobianBlockSize(size_t blockIndex) const =0
Returns the maximum number of rows for a specific Jacobian block.
constexpr size_t padToSimdAlignment(size_t size)
Pads a row count to be a multiple of kJacobianRowAlignment for SIMD alignment.
constexpr size_t kJacobianRowAlignment
Alignment for SIMD operations on Jacobian rows (8 floats = 32 bytes for AVX).
Eigen::Matrix< T, Dynamic, Dynamic > MatrixX
Dynamic-size, column-major dense matrix.
Vector< T, Dynamic > VectorX
Dynamic-size column vector. Common return type for solver residuals and parameter vectors.
Eigen::SparseMatrix< T > SparseMatrix
Column-major sparse matrix.
std::bitset< kMaxModelParams > ParameterSet
Bitset for model parameter enablement.