alpaqa 1.0.0a15
Nonconvex constrained optimization
Loading...
Searching...
No Matches
problem.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include "options.hpp"
8
9#include <filesystem>
10#include <memory>
11#include <optional>
12namespace fs = std::filesystem;
13
16 ConstrCount() = default;
17 length_t lb = 0; ///< Number of variables with only lower bound
18 length_t ub = 0; ///< Number of variables with only upper bound
19 length_t lbub = 0; ///< Number of variables with both bounds
20 length_t eq = 0; ///< Number of variables with equal bounds
21};
22
26 fs::path abs_path;
27 fs::path path;
28 std::string name = path.filename().string();
29 std::shared_ptr<alpaqa::EvalCounter> evaluations = nullptr;
30 vec initial_guess_x = vec::Zero(problem.get_n()); ///< Unknowns
31 vec initial_guess_y = vec::Zero(problem.get_m()); ///< Multipliers g
32 vec initial_guess_w = alpaqa::null_vec<config_t>; ///< Multipliers bounds
33 std::optional<ConstrCount> box_constr_count = std::nullopt,
34 general_constr_count = std::nullopt;
35 std::optional<length_t> nnz_jac_g = std::nullopt, nnz_hess_L = std::nullopt,
36 nnz_hess_ψ = std::nullopt;
37};
38
39LoadedProblem load_problem(std::string_view type, const fs::path &dir,
40 const fs::path &file, Options &opts);
The main polymorphic minimization problem interface.
length_t get_n() const
[Required] Number of decision variables.
length_t get_m() const
[Required] Number of constraints.
#define USING_ALPAQA_CONFIG(Conf)
Definition config.hpp:56
constexpr const auto inf
Definition config.hpp:85
fs::path abs_path
Definition problem.hpp:26
vec initial_guess_y
Multipliers g.
Definition problem.hpp:31
vec initial_guess_x
Unknowns.
Definition problem.hpp:30
vec initial_guess_w
Multipliers bounds.
Definition problem.hpp:32
std::optional< length_t > nnz_hess_L
Definition problem.hpp:35
std::optional< ConstrCount > general_constr_count
Definition problem.hpp:34
std::optional< length_t > nnz_hess_ψ
Definition problem.hpp:36
alpaqa::TypeErasedProblem< config_t > problem
Definition problem.hpp:25
std::string name
Definition problem.hpp:28
fs::path path
Definition problem.hpp:27
std::optional< ConstrCount > box_constr_count
Definition problem.hpp:33
std::optional< length_t > nnz_jac_g
Definition problem.hpp:35
LoadedProblem load_problem(std::string_view type, const fs::path &dir, const fs::path &file, Options &opts)
Definition problem.cpp:189
std::shared_ptr< alpaqa::EvalCounter > evaluations
Definition problem.hpp:29
ConstrCount()=default
length_t ub
Number of variables with only upper bound.
Definition problem.hpp:18
length_t eq
Number of variables with equal bounds.
Definition problem.hpp:20
length_t lb
Number of variables with only lower bound.
Definition problem.hpp:17
length_t lbub
Number of variables with both bounds.
Definition problem.hpp:19
Double-precision double configuration.
Definition config.hpp:135