Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bazel_dep(name = "eigen", version = "3.4.0")
bazel_dep(name = "googletest", version = "1.16.0")
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
bazel_dep(name = "googletest", version = "1.17.0")
34 changes: 10 additions & 24 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions include/cppoptlib/solver/augmented_lagrangian.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class AugmentedLagrangian
using StateType = AugmentedLagrangeState<typename ProblemType::ScalarType,
ProblemType::Dimension>;
using Superclass = Solver<ProblemType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename ProblemType::ScalarType;
using VectorType = typename ProblemType::VectorType;
Expand All @@ -115,7 +115,7 @@ class AugmentedLagrangian

StateType OptimizationStep(const ProblemType &function,
const StateType &state,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
const auto unconstrained_function =
cppoptlib::function::ToAugmentedLagrangian(
function, state.multiplier_state, state.penalty_state);
Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/bfgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Bfgs
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
Expand All @@ -70,7 +70,7 @@ class Bfgs

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
VectorType current_gradient;
function(current.x, &current_gradient);

Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/conjugated_gradient_descent.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConjugatedGradientDescent
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
Expand All @@ -68,7 +68,7 @@ class ConjugatedGradientDescent

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t &progress) override {
const ProgressType &progress) override {
VectorType current_gradient;
function(current.x, &current_gradient);
if (progress.num_iterations == 0) {
Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/gradient_descent.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GradientDescent
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
Expand All @@ -64,7 +64,7 @@ class GradientDescent

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
VectorType gradient;
function(current.x, &gradient);
const ScalarType rate = linesearch::MoreThuente<FunctionType, 1>::Search(
Expand Down
7 changes: 4 additions & 3 deletions include/cppoptlib/solver/lbfgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ class Lbfgs
cppoptlib::function::DifferentiabilityMode::Second,
"L-BFGS only supports first- or second-order differentiable functions");

private:
public:
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
using MatrixType = typename FunctionType::MatrixType;

private:
// Storage for the correction pairs using Eigen matrices.
using memory_MatrixType = Eigen::Matrix<ScalarType, Eigen::Dynamic, m>;
using memory_VectorType = Eigen::Matrix<ScalarType, 1, m>;
Expand All @@ -81,7 +82,7 @@ class Lbfgs

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
constexpr ScalarType eps = std::numeric_limits<ScalarType>::epsilon();
const ScalarType relative_eps =
static_cast<ScalarType>(eps) *
Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/lbfgsb.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Lbfgsb
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using MatrixType = typename FunctionType::MatrixType;
Expand Down Expand Up @@ -99,7 +99,7 @@ class Lbfgsb

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
// STEP 2: compute the cauchy point
VectorType cauchy_point = VectorType::Zero(current.x.rows());

Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/nelder_mead.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NelderMead
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
Expand Down Expand Up @@ -76,7 +76,7 @@ class NelderMead
// best vertex.
StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*progress*/) override {
const ProgressType & /*progress*/) override {
const size_t DIM = current.x.rows();
const int numVertices = static_cast<int>(DIM) + 1;

Expand Down
4 changes: 2 additions & 2 deletions include/cppoptlib/solver/newton_descent.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NewtonDescent
using StateType = typename cppoptlib::function::FunctionState<
typename FunctionType::ScalarType, FunctionType::Dimension>;
using Superclass = Solver<FunctionType, StateType>;
using progress_t = typename Superclass::progress_t;
using ProgressType = typename Superclass::ProgressType;

using ScalarType = typename FunctionType::ScalarType;
using VectorType = typename FunctionType::VectorType;
Expand All @@ -67,7 +67,7 @@ class NewtonDescent

StateType OptimizationStep(const FunctionType &function,
const StateType &current,
const progress_t & /*state*/) override {
const ProgressType & /*state*/) override {
constexpr ScalarType safe_guard = 1e-5;

MatrixType hessian;
Expand Down
Loading