Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
sequence_cholesky_solver.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
12
13namespace momentum {
14
18 size_t chunkSize = 20;
19
21 size_t targetRowsPerJtJChunk = 1024;
22
24 bool useBlockLdlt = true;
25
32
34
35 /* implicit */ SequenceCholeskySolverOptions(const SolverOptions& baseOptions)
36 : SequenceSolverOptionsBase(baseOptions) {
37 // Empty
38 }
39};
40
49template <typename T>
51 public:
53
54 [[nodiscard]] std::string_view getName() const override;
55
56 [[nodiscard]] double getLastNormalEquationTimeMs() const {
57 return lastNormalEquationTimeMs_;
58 }
59
60 [[nodiscard]] double getLastLinearSolveTimeMs() const {
61 return lastLinearSolveTimeMs_;
62 }
63
64 void setOptions(const SolverOptions& options) final;
65
66 protected:
67 void doIteration() final;
68 void initializeSolver() final;
69
70 private:
71 template <typename NormalEquationScalar>
72 void doIterationWithNormalEquationScalar();
73
74 size_t chunkSize_ = 20;
75 size_t targetRowsPerJtJChunk_ = 1024;
76 bool useBlockLdlt_ = true;
77 bool useDoublePrecisionNormalEquations_ = true;
78 double lastNormalEquationTimeMs_ = 0.0;
79 double lastLinearSolveTimeMs_ = 0.0;
80};
81
82} // namespace momentum
SequenceCholeskySolverT(const SolverOptions &options, SequenceSolverFunctionT< T > *function)
void doIteration() final
Performs a single iteration of the optimization algorithm.
void setOptions(const SolverOptions &options) final
Updates solver configuration with new options.
std::string_view getName() const override
Returns the name of the solver implementation.
SequenceSolverBaseT(const SolverOptions &options, SequenceSolverFunctionT< T > *function)
bool useBlockLdlt
Use the block LDLT factorization path when the band layout is block-compatible.
SequenceCholeskySolverOptions(const SolverOptions &baseOptions)
bool useDoublePrecisionNormalEquations
Accumulate compact normal equations in double precision.
size_t chunkSize
Number of frames processed by one independent accumulation chunk.
size_t targetRowsPerJtJChunk
Target number of Jacobian rows per local J^T J multiplication.
Common options for numerical optimization solvers.
Definition solver.h:19