### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1pack__ith__elem-members.html Demonstrates the most basic usage of ProxQP with compilation instructions. Ensure you have the necessary build tools installed. ```bash g++ -o example_proxqp example_proxqp.cpp -I/path/to/proxsuite/include -L/path/to/proxsuite/lib -lproxsuite ``` -------------------------------- ### Warm Start and QP Setup Source: https://simple-robotics.github.io/proxsuite/sparse_2helpers_8hpp.html Functions for warm-starting the solver and setting up the Quadratic Programming problem. ```APIDOC ## proxsuite::proxqp::sparse::warm_start ### Description Initializes the solver with warm-start values for primal and dual variables. ### Method `template void warm_start (optional< VecRef< T > > x_wm, optional< VecRef< T > > y_wm, optional< VecRef< T > > z_wm, Results< T > &results, Settings< T > &settings, Model< T, I > &model)` ### Endpoint N/A (Function within a library) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```cpp // Example usage (conceptual) // optional> x_warm = ...; // optional> y_warm = ...; // optional> z_warm = ...; // Results res; // Settings set; // Model mdl; // proxsuite::proxqp::sparse::warm_start(x_warm, y_warm, z_warm, res, set, mdl); ``` ### Response #### Success Response (void) No return value on success. #### Response Example ```json { "example": "void" } ``` ## proxsuite::proxqp::sparse::qp_setup ### Description Sets up the Quadratic Programming problem structure for the solver. ### Method `template void qp_setup (QpView< T, I > qp, Results< T > &results, Model< T, I > &data, Workspace< T, I > &work, Settings< T > &settings, P &precond, PreconditionerStatus &preconditioner_status)` ### Endpoint N/A (Function within a library) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```cpp // Example usage (conceptual) // QpView qp_view; // Results res; // Model mdl; // Workspace wk; // Settings set; // Preconditioner P; // PreconditionerStatus precond_status; // proxsuite::proxqp::sparse::qp_setup(qp_view, res, mdl, wk, set, P, precond_status); ``` ### Response #### Success Response (void) No return value on success. #### Response Example ```json { "example": "void" } ``` ``` -------------------------------- ### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/dir_c12078e438795040cb536d04a59afb5f.html Demonstrates the most basic usage of the ProxQP solver. Ensure ProxSuite is installed and compiled correctly before running. ```python import proxsuite # Define a simple QP problem # P = [[1, 0], [0, 1]] # q = [-1, -1] # A = [[1, 1]] # b = [1] # C = [[-1, 0], [0, -1]] # d = [0, 0] # For simplicity, we use a pre-defined example # This example is not runnable without defining the QP matrices and vectors. print("This is a placeholder for the simplest ProxQP example.") print("Refer to the official documentation for a runnable code.") ``` -------------------------------- ### setup() Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1dense.html Setups the QP solver model. ```APIDOC ## setup() ### Description Setups the QP solver model. ### Parameters - **H** (optional>) - Optional - Quadratic cost input. - **g** (optional>) - Optional - Linear cost input. - **A** (optional>) - Optional - Equality constraint matrix. - **b** (optional>) - Optional - Equality constraint vector. - **C** (optional>) - Optional - Inequality constraint matrix. - **l** (optional>) - Optional - Lower inequality constraint vector. - **u** (optional>) - Optional - Upper inequality constraint vector. - **qpsettings** (Settings&) - Required - Solver settings. - **qpmodel** (Model&) - Required - Solver model. - **qpwork** (Workspace&) - Required - Solver workspace. - **qpresults** (Results&) - Required - Solver results. - **ruiz** (preconditioner::RuizEquilibration&) - Required - Ruiz preconditioner. - **preconditioner_status** (PreconditionerStatus) - Required - Variable for deciding preconditioning execution. ``` -------------------------------- ### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1linalg_1_1veg_1_1dynstack.html Demonstrates the most basic usage of ProxQP, including compilation commands. This is a good starting point for understanding ProxQP's functionality. ```cpp #include "proxsuite/proxqp/dense/proxqp.hpp" #include "proxsuite/linalg/veg/linalg.hpp" int main() { // ... example code ... return 0; } ``` -------------------------------- ### ProxQP API Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1zip__type__seq_3_01meta_1_1true__type_a2279b22e81b24f0f9a50d3c261e4a6d.html Illustrates how to use the ProxQP API for problem setup and solving. This example shows a typical workflow for quadratic programming problems. ```cpp proxsuite::proxqp::ProxQP qp; qp.init( {{1.0, 2.0}, {2.0, 5.0}}, {1.0, 2.0}, {{1.0, 1.0}, {1.0, 0.0}}, {1.0, 0.0}, proxsuite::proxqp::LOW_RANK_UPDATE ); qp.solve(); ``` -------------------------------- ### ProxQP API Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1uncvlref_3_01T_01volatile_01const_01_6_01_4-members.html Illustrates how to use the ProxQP API for solving optimization problems. This example assumes a dense problem setup. ```c++ proxsuite::proxqp::dense::ProxQP qp; qp.init(P, q, A, l, u); qp.solve(); ``` -------------------------------- ### Solve a Sparse QP Problem Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1proxqp_1_1sparse_1_1QP.html Example demonstrating the setup and execution of a sparse QP solver, including problem generation and solution verification. ```cpp #include #include #include #include #include using T = double; using I = c_int; auto main() -> int { // Generate a random QP problem with primal variable dimension of size dim; n_eq equality constraints and n_in inequality constraints ::proxsuite::proxqp::test::rand::set_seed(1); proxqp::isize dim = 10; proxqp::isize n_eq(dim / 4); proxqp::isize n_in(dim / 4); T strong_convexity_factor(1.e-2); T sparsity_factor = 0.15; // controls the sparsity of each matrix of the problem generated T eps_abs = T(1e-9); double p = 1.0; T conditioning(10.0); auto H = ::proxsuite::proxqp::test::rand::sparse_positive_definite_rand(n, conditioning, p); auto g = ::proxsuite::proxqp::test::rand::vector_rand(n); auto A = ::proxsuite::proxqp::test::rand::sparse_matrix_rand(n_eq,n, p); auto b = ::proxsuite::proxqp::test::rand::vector_rand(n_eq); auto C = ::proxsuite::proxqp::test::rand::sparse_matrix_rand(n_in,n, p); auto l = ::proxsuite::proxqp::test::rand::vector_rand(n_in); auto u = (l.array() + 1).matrix().eval(); proxqp::sparse::QP Qp(n, n_eq, n_in); Qp.settings.eps_abs = 1.E-9; Qp.settings.verbose = true; Qp.setup_sparse_matrices(H,g,A,b,C,u,l); Qp.solve(); // Solve the problem proxqp::sparse::QP Qp(n, n_eq, n_in); Qp.settings.eps_abs = 1.E-9; Qp.settings.verbose = true; Qp.setup_sparse_matrices(H,g,A,b,C,u,l); Qp.solve(); // Verify solution accuracy T pri_res = std::max( (qp.A * Qp.results.x - qp.b).lpNorm(), (helpers::positive_part(qp.C * Qp.results.x - qp.u) + helpers::negative_part(qp.C * Qp.results.x - qp.l)) .lpNorm()); T dua_res = (qp.H * Qp.results.x + qp.g + qp.A.transpose() * Qp.results.y + qp.C.transpose() * Qp.results.z) .lpNorm(); VEG_ASSERT(pri_res <= eps_abs); VEG_ASSERT(dua_res <= eps_abs); // Some solver statistics std::cout << "------solving qp with dim: " << dim << " neq: " << n_eq << " nin: " << n_in << std::endl; std::cout << "primal residual: " << pri_res << std::endl; std::cout << "dual residual: " << dua_res << std::endl; std::cout << "total number of iteration: " << Qp.results.info.iter << std::endl; } ``` -------------------------------- ### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1meta_1_1apply__wrapper-members.html Demonstrates the simplest ProxQP example with compilation command. This is a basic usage example for ProxQP. ```bash g++ -Wall -Wextra -pedantic -O3 -std=c++17 -shared -fPIC proxqp/proxqp.cpp -I./eigen -I./proxnlp -o libproxqp.so ``` -------------------------------- ### Simplest Python ProxQP Example Source: https://simple-robotics.github.io/proxsuite/index.html Demonstrates solving a random QP problem using the ProxQP solver in Python. Requires the proxsuite Python bindings to be installed. ```python from proxsuite from util import generate_mixed_qp # generate a qp problem n = 10 H, g, A, b, C, u, l = generate_mixed_qp(n) n_eq = A.shape[0] n_in = C.shape[0] # solve it qp = proxsuite.proxqp.dense.QP(n, n_eq, n_in) qp.init(H, g, A, b, C, l, u) qp.solve() # print an optimal solution print("optimal x: {}".format(qp.results.x)) print("optimal y: {}".format(qp.results.y)) print("optimal z: {}".format(qp.results.z)) ``` -------------------------------- ### ProxQP Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1mem_1_1Alloc_3_01MonotonicAlloc_3_01MaxAlign_01_4_01_4-members.html A basic example demonstrating the usage of ProxQP with compilation commands. ```cpp proxsuite 0.7.2 The Advanced Proximal Optimization Toolbox | ---|--- * ▼proxsuite * What is ProxSuite? * How to install ProxSuite? * ►Simplest ProxQP example with compilation command * About Python wrappings * How to cite ProxSuite? * Where to go next? * ►ProxQP API with examples * ►ProxQP solve function without API * ►QPLayer * Installation * ►Namespaces * ▼Classes * ▼Class List * ▼proxsuite * ►detail * ►helpers * ▼linalg * ►dense * ►sparse * ▼veg * ►_detail * ►alignment * ►array * ►cmp * ►collections * ►concepts * ►cpo * ►dynstack * ►fmt * ▼mem * ►nb * Alloc * ►Alloc< BumpAlloc< MaxAlign > > * ►Alloc< MonotonicAlloc< MaxAlign > > * ►Alloc< proxsuite::linalg::dense::_detail::SimdAlignedSystemAlloc > * ►Alloc< StackAlloc< MaxAlign > > * ►Alloc< SystemAlloc > * ►AllocBlock * ►BumpAlloc * Cloner * ►Cloner< DefaultCloner > * CopyAvailableFor * DefaultCloner * DtorAvailableFor * ►Layout * MonotonicAlloc * ►RelocFn * StackAlloc * ►SystemAlloc * ►meta * ►nb * ►tags * ►tuple * ►vector * ►Array * ►Boolean * ►Boolean< maybe > * ►Defer * ►Dyn * ►Fix * incomplete_t * ►InPlace * ►InPlace< void > * ►Ref * ►RefMut * ►Slice * ►SliceMut * ►Str * ►StrLiteralConstant * ►Tuple * ►Vec * ►proxqp * ►std * ►tl * Class Index * ►Class Hierarchy * ►Class Members * ►Files •All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Loading... Searching... No Matches This is the complete list of members for proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >, including all inherited members. alloc(RefMut ref, mem::Layout layout) noexcept -> AllocBlock| proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >| inlinestatic ---|---|--- dealloc(RefMut, void *, mem::Layout) noexcept| proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >| inlinestatic grow(RefMut ref, void *ptr, mem::Layout old_layout, usize new_byte_size, RelocFn reloc) noexcept -> mem::AllocBlock| proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >| inlinestatic ImplMut typedef| proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >| RefMut typedef| proxsuite::linalg::veg::mem::Alloc< MonotonicAlloc< MaxAlign > >| ``` -------------------------------- ### QPLayer Usage Example Source: https://simple-robotics.github.io/proxsuite/structstd_1_1tuple__element_3_01I_00_01proxsuite_1_1linalg_1_1veg_1_1Tuple_3_01Ts_8_8_8_01_4_01_4-members.html Provides an example of using the QPLayer component within ProxSuite. This is useful for more advanced or custom optimization setups. ```cpp proxsuite::proxqp::dense::QPLayer qplayer; // ... qplayer.solve(); ``` -------------------------------- ### Print Setup Header Source: https://simple-robotics.github.io/proxsuite/dense_2utils_8hpp_source.html Prints a header for the setup information of the QP solver. Useful for debugging and logging. ```cpp void print_setup_header(const Settings< T > &settings, const Results< T > &results, const Model< T > &model, const bool box_constraints, const DenseBackend &dense_backend, const HessianType &hessian_type) ``` -------------------------------- ### ProxQP API Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1meta_1_1apply__wrapper-members.html Example showcasing the ProxQP API for solving optimization problems. Ensure necessary imports and setup are done before use. ```python import proxnlp import proxsuite # Example usage of ProxQP API # ... (code details would be here if available in source) ``` -------------------------------- ### Installation Source: https://simple-robotics.github.io/proxsuite/torch_2____init_____8py_source.html Instructions on how to install ProxSuite, including prerequisites and different installation methods. ```APIDOC ## Installation ### Description This section provides guidance on installing the ProxSuite library. It covers prerequisites and recommended installation procedures. ### Prerequisites - Python 3.x - pip or conda package manager - (Optional) PyTorch for QPFunction ### Installation Methods #### Using pip ```bash pip install proxsuite ``` #### Using conda ```bash conda install -c proxsuite ``` *(Note: Replace `` with the appropriate conda channel if ProxSuite is available there.)* ### Verifying Installation After installation, you can verify it by importing the library in a Python interpreter: ```python import proxsuite print(proxsuite.__version__) ``` ``` -------------------------------- ### ProxQP Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1mem_1_1nb_1_1addressof-members.html A basic example demonstrating the usage of the ProxQP solver with compilation commands. ```cpp proxsuite::linalg::veg::mem::nb::addressof ``` -------------------------------- ### ProxSuite Installation Source: https://simple-robotics.github.io/proxsuite/dir_039a78e186b18b0c4da9268845c46160.html Instructions on how to install the ProxSuite library, including any prerequisites or compilation steps. ```APIDOC ## Installation ### Description Guides users through the process of installing ProxSuite. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example ```bash # Example compilation command (hypothetical) cmake .. && make ``` ### Response N/A ``` -------------------------------- ### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/dir_039a78e186b18b0c4da9268845c46160.html A basic example demonstrating the usage of ProxQP with compilation commands, suitable for beginners. ```APIDOC ## Simplest ProxQP Example ### Description Illustrates a minimal ProxQP problem setup and its compilation. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example ```bash # Example compilation command for ProxQP # (Specific commands depend on build system and environment) make proxqp_example ``` ### Response N/A ``` -------------------------------- ### Simplest C++ ProxQP Example Source: https://simple-robotics.github.io/proxsuite/index.html Demonstrates solving a random QP problem using the ProxQP solver in C++. Ensure ProxQP is installed and linked correctly. ```cpp #include #include #include using namespace proxsuite::proxqp; using T = double; int main() { // generate a QP problem T sparsity_factor = 0.15; dense::isize dim = 10; dense::isize n_eq(dim / 4); dense::isize n_in(dim / 4); T strong_convexity_factor(1.e-2); // we generate a qp, so the function used from helpers.hpp is // in proxqp namespace. The qp is in dense eigen format and // you can control its sparsity ratio and strong convexity factor. dense::Model qp_random = utils::dense_strongly_convex_qp( dim, n_eq, n_in, sparsity_factor, strong_convexity_factor); // load PROXQP solver with dense backend and solve the problem dense::QP qp(dim, n_eq, n_in); qp.init(qp_random.H, qp_random.g, qp_random.A, qp_random.b, qp_random.C, qp_random.l, qp_random.u); qp.solve(); // print an optimal solution x,y and z std::cout << "optimal x: " << qp.results.x << std::endl; std::cout << "optimal y: " << qp.results.y << std::endl; std::cout << "optimal z: " << qp.results.z << std::endl; } ``` -------------------------------- ### Simplest ProxQP Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1dense_1_1__detail_1_1ConstantR-members.html Demonstrates the most basic usage of the ProxQP solver. This example requires compilation. ```cpp proxqp_solver.cpp ``` -------------------------------- ### QPLayer Usage Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1all__same__impl_3_01meta_1_1index__sequence_3_4_01_4.html Provides an example of using the QPLayer component within ProxSuite. ```cpp qplayer_example.cpp ``` -------------------------------- ### Print Setup Header Function Source: https://simple-robotics.github.io/proxsuite/sparse_2solver_8hpp_source.html Prints a header for the solver setup, useful for debugging or logging. ```cpp void print_setup_header(const Settings< T > &settings, Results< T > &results, const Model< T, I > &model); ``` -------------------------------- ### Get Layout Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This example demonstrates the layout information provided by proxsuite::proxqp::eigen. ```cpp GetLayout : proxsuite::proxqp::eigen ``` -------------------------------- ### void setup_impl Source: https://simple-robotics.github.io/proxsuite/proxqp_2sparse_2workspace_8hpp_source.html Initializes the workspace implementation with the provided QP view, model data, settings, and preconditioner. ```APIDOC ## setup_impl ### Description Initializes the workspace implementation with the provided QP view, model data, settings, and preconditioner. ### Parameters - **qp** (QpView) - Required - The QP view to be used. - **data** (Model &) - Required - The model data. - **settings** (Settings &) - Required - The solver settings. - **execute_or_not** (bool) - Required - Flag to determine if execution should proceed. - **precond** (P &) - Required - The preconditioner. - **precond_req** (proxsuite::linalg::veg::dynstack::StackReq) - Required - Stack requirements for the preconditioner. ``` -------------------------------- ### Has Member Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Illustrates the 'has_member_get' trait, which checks if a type supports member-based 'get' operations. ```cpp has_member_get ``` -------------------------------- ### Has Array Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Demonstrates the 'has_array_get' trait, which checks if a type supports array-like 'get' operations. ```cpp has_array_get ``` -------------------------------- ### qp_setup Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1sparse.html Initializes the QP solver model and preconditioner. ```APIDOC ## qp_setup ### Description Setups the QP solver model. ### Parameters - **_qp_** (QpView) - Required - View of the QP model. - **_results_** (Results) - Required - Solver result. - **_data_** (Model) - Required - Solver model. - **_work_** (Workspace) - Required - Solver workspace. - **_settings_** (Settings) - Required - Solver settings. - **_precond_** (P) - Required - Preconditioner. - **_preconditioner_status_** (PreconditionerStatus) - Required - Status for preconditioning algorithm. ``` -------------------------------- ### setup_impl() Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1proxqp_1_1sparse_1_1Workspace.html Initializes the workspace for the sparse QP solver with the provided problem view, model, settings, and preconditioner. ```APIDOC ## setup_impl() ### Description Initializes the workspace for the sparse QP solver. This method sets up the internal structures required for solving the quadratic program. ### Parameters - **qp** (QpView) - Required - View on the QP problem. - **data** (Model&) - Required - Solver's model. - **settings** (Settings&) - Required - Solver's settings. - **execute_or_not** (bool) - Required - Boolean option for executing or not the preconditioner for scaling the problem. - **precond** (P&) - Required - Preconditioner chosen for the solver. - **precond_req** (proxsuite::linalg::veg::dynstack::StackReq) - Required - Storage requirements for the solver's preconditioner. ``` -------------------------------- ### Has Adl Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Shows the 'has_adl_get' trait, which checks if a type supports ADL-based 'get' operations. ```cpp has_adl_get ``` -------------------------------- ### Detail Meta Member Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Shows a specific example of 'member_get' for accessing class members. ```cpp member_get ``` -------------------------------- ### Get Map Return Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This example shows the return type for mapping operations within tl::detail. ```cpp get_map_return : tl::detail ``` -------------------------------- ### QP Setup and Solving Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1sparse.html Core functions for initializing and solving QP problems. ```cpp template void | qp_setup (QpView< T, I > qp, Results< T > &results, Model< T, I > &data, Workspace< T, I > &work, Settings< T > &settings, P &precond, PreconditionerStatus &preconditioner_status) ``` ```cpp template void | qp_solve (Results< T > &results, Model< T, I > &data, const Settings< T > &settings, Workspace< T, I > &work, P &precond) ``` -------------------------------- ### Adl Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1__detail_1_1__make__integer__sequence.html Shows the 'adl_get' utility, likely related to Argument-Dependent Lookup (ADL) for getting values from types. ```cpp namespace proxsuite { namespace linalg { namespace veg { namespace _detail { namespace _meta { // ... adl_get ... } } } } } } ``` -------------------------------- ### Logging and Output Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1sparse.html Prints the setup header for the QP solver. ```cpp template void | print_setup_header (const Settings< T > &settings, Results< T > &results, const Model< T, I > &model) ``` -------------------------------- ### proxsuite::proxqp::sparse::qp_setup Source: https://simple-robotics.github.io/proxsuite/proxqp_2sparse_2wrapper_8hpp_source.html Sets up the necessary data structures for solving a QP problem with the sparse backend. ```APIDOC ## POST /sparse/qp_setup ### Description Sets up the QP problem for the sparse solver. ### Method POST ### Endpoint /sparse/qp_setup ### Parameters #### Request Body - **qp** (QpView< T, I >) - A view of the QP problem. - **results** (Results< T > &) - Reference to the results object to be populated. - **data** (Model< T, I > &) - Reference to the data object. - **work** (Workspace< T, I > &) - Reference to the workspace object. - **settings** (Settings< T > &) - Reference to the settings object. - **precond** (P &) - Reference to the preconditioner object. - **preconditioner_status** (PreconditionerStatus &) - Reference to the preconditioner status. ### Request Example ```json { "qp": "qp_data", "results": "results_object", "data": "data_object", "work": "workspace_object", "settings": "settings_object", "precond": "preconditioner_object", "preconditioner_status": "preconditioner_status_value" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful setup. #### Response Example ```json { "message": "QP setup complete." } ``` ``` -------------------------------- ### Detail Meta Adl Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Illustrates an example related to 'adl_get' within the meta details, likely for ADL-based member access. ```cpp adl_get ``` -------------------------------- ### Batch QP Solver Setup and Execution Source: https://simple-robotics.github.io/proxsuite/qplayer_8py_source.html Initializes a batch of QP problems, constructs the KKT system, and executes the solver either in parallel or sequentially. ```python vector_of_qps = proxsuite.proxqp.sparse.BatchQP() for i in range(nBatch): Q_i = Q[i].numpy() C_i = G[i].numpy() A_i = None if A is not None: if A.shape[0] != 0: A_i = A[i].numpy() z_i = ctx.nus[i] s_i = ctx.slacks[i] # G @ z_- h = slacks dim = Q_i.shape[0] n_eq = neq n_in = nineq P_1 = np.minimum(s_i, 0.0) + z_i >= 0.0 P_2 = s_i <= 0.0 P_2_c_s_i[i] = np.maximum( s_i, 0.0 ) # keep only (1-P_2)s_i for backward calculation afterward kkt[:dim, :dim] = Q_i if neq > 0: kkt[:dim, dim : dim + n_eq] = A_i.transpose() kkt[dim : dim + n_eq, :dim] = A_i kkt[ dim + n_eq + n_in : dim + 2 * n_eq + n_in, dim : dim + n_eq ] = -np.eye(n_eq) kkt[ dim + n_eq + n_in : dim + 2 * n_eq + n_in, dim + n_eq + 2 * n_in : 2 * dim + n_eq + 2 * n_in, ] = A_i kkt[:dim, dim + n_eq : dim + n_eq + n_in] = C_i.transpose() kkt[dim + n_eq : dim + n_eq + n_in, :dim] = C_i D_1_c = np.eye(n_in) # represents [s_i]_- + z_i < 0 D_1_c[P_1, P_1] = 0.0 D_1 = np.eye(n_in) - D_1_c # represents [s_i]_- + z_i >= 0 D_2_c = np.eye(n_in) # represents s_i > 0 D_2_c[P_2, P_2] = 0.0 D_2 = np.eye(n_in) - D_2_c # represents s_i <= 0 kkt[dim + 2 * n_eq + n_in :, dim + n_eq : dim + n_eq + n_in] = -np.eye( n_in ) kkt[ dim + n_eq : dim + n_eq + n_in, dim + n_eq + n_in : dim + n_eq + 2 * n_in, ] = D_1_c kkt[ dim + 2 * n_eq + n_in :, dim + n_eq + n_in : dim + n_eq + 2 * n_in ] = -np.multiply(np.diag(D_1)[:, None], D_2) dim_ = 0 if n_eq > 0: dim_ += dim kkt[dim + 2 * n_eq + n_in :, dim + n_eq + 2 * n_in + dim_ :] = ( np.multiply(np.diag(D_2_c)[:, None], C_i) ) rhs = np.zeros(kkt.shape[0]) rhs[:dim] = -dl_dzhat[i] if dl_dlams is not None: if n_eq != 0: rhs[dim : dim + n_eq] = -dl_dlams[i] active_set = None if n_in != 0: active_set = -z_i[:n_in_sol] + z_i[n_in_sol:] >= 0 if dl_dnus is not None: if n_in != 0: # we must convert dl_dnus to a uni sided version # to do so we reconstitute the active set rhs[dim + n_eq : dim + n_eq + n_in_sol][~active_set] = dl_dnus[ i ][~active_set] rhs[dim + n_eq + n_in_sol : dim + n_eq + n_in][ active_set ] = -dl_dnus[i][active_set] if dl_ds_e is not None: if dl_ds_e.shape[0] != 0: rhs[dim + n_eq + n_in : dim + 2 * n_eq + n_in] = -dl_ds_e[i] if dl_ds_i is not None: if dl_ds_i.shape[0] != 0: # we must convert dl_dnus to a uni sided version # to do so we reconstitute the active set rhs[dim + 2 * n_eq + n_in : dim + 2 * n_eq + n_in + n_in_sol][ ~active_set ] = dl_ds_i[i][~active_set] rhs[dim + 2 * n_eq + n_in + n_in_sol :][active_set] = -dl_ds_i[ i ][active_set] l = np.zeros(0) u = np.zeros(0) C = spa.csc_matrix((0, n_col)) H = spa.csc_matrix((n_col, n_col)) g = np.zeros(n_col) qp = vector_of_qps.init_qp_in_place( H.shape[0], kkt.shape[0], C.shape[0] ) qp.settings.primal_infeasibility_solving = True qp.settings.eps_abs = eps_backward qp.settings.max_iter = 10 qp.settings.default_rho = 1.0e-3 qp.settings.refactor_rho_threshold = 1.0e-3 qp.init( H, g, spa.csc_matrix(kkt), rhs, C, l, u, ) if proxqp_parallel: proxsuite.proxqp.sparse.solve_in_parallel( num_threads=ctx.cpu, qps=vector_of_qps ) else: for i in range(vector_of_qps.size()): vector_of_qps.get(i).solve() ``` -------------------------------- ### Get Sizes Function Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This function retrieves size information from proxsuite.torch.utils. ```python get_sizes() : proxsuite.torch.utils ``` -------------------------------- ### Array Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1__detail_1_1__make__integer__sequence.html Illustrates the 'array_get' utility, possibly for accessing elements in array-like structures. ```cpp namespace proxsuite { namespace linalg { namespace veg { namespace _detail { namespace _meta { // ... array_get ... } } } } } } ``` -------------------------------- ### proxsuite::proxqp::dense::setup Source: https://simple-robotics.github.io/proxsuite/proxqp_2dense_2wrapper_8hpp_source.html Initializes the QP solver with the provided matrices, vectors, and configuration settings. ```APIDOC ## setup ### Description Initializes the QP solver with the provided matrices, vectors, and configuration settings. ### Parameters - **H** (optional>) - Optional - Hessian matrix - **g** (optional>) - Optional - Gradient vector - **A** (optional>) - Optional - Equality constraint matrix - **b** (optional>) - Optional - Equality constraint vector - **C** (optional>) - Optional - Inequality constraint matrix - **l** (optional>) - Optional - Inequality constraint lower bound - **u** (optional>) - Optional - Inequality constraint upper bound - **l_box** (optional>) - Optional - Box constraint lower bound - **u_box** (optional>) - Optional - Box constraint upper bound - **qpsettings** (Settings&) - Required - Solver settings - **qpmodel** (Model&) - Required - QP model - **qpwork** (Workspace&) - Required - Solver workspace - **qpresults** (Results&) - Required - Solver results - **box_constraints** (bool) - Required - Flag for box constraints - **ruiz** (preconditioner::RuizEquilibration&) - Required - Ruiz equilibration - **preconditioner_status** (PreconditionerStatus) - Required - Preconditioner status - **hessian_type** (HessianType) - Required - Hessian type ``` -------------------------------- ### Get Index Function Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This function retrieves an index from proxsuite::linalg::veg::_detail. ```cpp get_idx() : proxsuite::linalg::veg::_detail ``` -------------------------------- ### setup_factorization() Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1dense.html Sets up and performs the initial factorization of the regularized KKT matrix. ```APIDOC ## POST /setup_factorization ### Description Setups and performs the first factorization of the regularized KKT matrix of the problem. ### Method POST ### Endpoint /setup_factorization ### Parameters #### Request Body - **_qpwork_** (Workspace&) - Required - Workspace of the solver. - **_qpmodel_** (const Model&) - Required - QP problem model as defined by the user (without any scaling performed). - **_qpresults_** (Results&) - Required - Solution results. - **_dense_backend_** (const DenseBackend&) - Required - The dense backend. - **_hessian_type_** (const HessianType&) - Required - The type of the Hessian. ### Response #### Success Response (200) - **void** - This function does not return a value. ``` -------------------------------- ### Run ProxSuite Examples Source: https://simple-robotics.github.io/proxsuite/index.html Commands to execute the compiled C++ binary or the Python script. ```bash ./overview-simple ``` ```bash python examples/python/overview-simple.py ``` -------------------------------- ### Get Type Function Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This function retrieves type information from proxsuite::linalg::veg::_detail. ```cpp get_type() : proxsuite::linalg::veg::_detail ``` -------------------------------- ### Member Get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1conditional___3_01true_01_4.html Illustrates the 'member_get' utility, used for accessing members of a class, possibly through compile-time introspection. ```cpp member_get(obj) ``` -------------------------------- ### print_setup_header() Source: https://simple-robotics.github.io/proxsuite/namespaceproxsuite_1_1proxqp_1_1sparse.html Prints the setup header for the sparse solver. ```APIDOC ## print_setup_header() ### Description Prints the setup header for the sparse solver. ### Parameters - **_settings_** (const Settings< T > &) - Solver settings. - **_results_** (Results< T > &) - Solver results. - **_model_** (const Model< T, I > &) - QP problem model. ``` -------------------------------- ### BaseOfWrapper Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1__detector.html Illustrates the use of base_of_wrapper, likely to get the base type of a wrapper class. This is a metaprogramming utility. ```cpp using Wrapper = ...; using Base = base_of_wrapper::type; ``` -------------------------------- ### Get bad optional access exception type Source: https://simple-robotics.github.io/proxsuite/functions_func_w.html Returns the type of tl::bad_optional_access exception. No setup required. ```cpp what() : tl::bad_optional_access ``` -------------------------------- ### Tuple Size Example Source: https://simple-robotics.github.io/proxsuite/structstd_1_1tuple__size_3_01proxsuite_1_1linalg_1_1veg_1_1Tuple_3_01Ts_8_8_8_01_4_01_4-members.html Shows how to get the size of a tuple using `std::tuple_size` with ProxSuite's tuple type. ```cpp using TupleType = proxsuite::linalg::veg::Tuple< int, double, char >; constexpr std::size_t tuple_size = std::tuple_size< TupleType >::value; ``` -------------------------------- ### Get Constant VectorView Segment Source: https://simple-robotics.github.io/proxsuite/dense_2views_8hpp_source.html Returns a constant view of a segment of the VectorView. The segment starts at index `i` and has the specified `size`. ```cpp VEG_INLINE auto segment(isize i, isize size) const noexcept -> VectorView { return { from_ptr_size, data + i, size, }; } ``` -------------------------------- ### setup_impl Function Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1proxqp_1_1sparse_1_1Workspace.html Sets up the implementation details of the solver's workspace. This function takes the QP view, model data, settings, and preconditioner requirements. ```cpp template void | setup_impl (const QpView< T, I > qp, Model< T, I > &data, const Settings< T > &settings, bool execute_or_not, P &precond, proxsuite::linalg::veg::dynstack::StackReq precond_req) ``` -------------------------------- ### Get Mutable VectorView Segment Source: https://simple-robotics.github.io/proxsuite/dense_2views_8hpp_source.html Returns a mutable view of a segment of the VectorViewMut. The segment starts at index `i` and has the specified `size`. ```cpp VEG_INLINE auto segment(isize i, isize size) const noexcept -> VectorViewMut { return { from_ptr_size, data + i, size, }; } ``` -------------------------------- ### Setup Dense QP Solver Source: https://simple-robotics.github.io/proxsuite/proxqp_2dense_2wrapper_8hpp_source.html Initializes the dense QP solver with the provided settings, model, and workspace. ```cpp proxsuite::proxqp::dense::setup(/* avoid double assignation */ optional_MatRef(nullopt), optional_VecRef(nullopt), optional_MatRef(nullopt), optional_VecRef(nullopt), optional_MatRef(nullopt), optional_VecRef(nullopt), optional_VecRef(nullopt), optional_VecRef(nullopt), optional_VecRef(nullopt), settings, model, work, results, box_constraints, ruiz, preconditioner_status, hessian_type); if (settings.compute_timings) { results.info.setup_time = work.timer.elapsed().user; // in microseconds } }; ``` -------------------------------- ### adl_get Example Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1zip__type__seq_3_01meta_1_1true__type_a2279b22e81b24f0f9a50d3c261e4a6d.html Illustrates the adl_get utility, likely used for argument-dependent lookup of a 'get' function. This is an internal mechanism for generic access. ```cpp proxsuite::proxqp::detail::_meta::adl_get ``` -------------------------------- ### proxsuite::proxqp::sparse::Workspace::setup_impl Source: https://simple-robotics.github.io/proxsuite/sparse_2helpers_8hpp_source.html Initializes the workspace for the sparse solver using the provided QP view, model data, and solver settings. ```APIDOC ## setup_impl ### Description Initializes the workspace for the sparse solver using the provided QP view, model data, and solver settings. ### Parameters - **qp** (QpView) - Required - The QP problem view. - **data** (Model&) - Required - The QP model data. - **settings** (Settings&) - Required - The solver settings. - **execute_or_not** (bool) - Required - Flag to determine if execution should proceed. - **precond** (P) - Required - Preconditioner instance. - **precond_req** (proxsuite::linalg::veg::dynstack::StackReq) - Required - Stack requirements for the preconditioner. ``` -------------------------------- ### Meta Programming Example: `decay_helper` Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1linalg_1_1veg_1_1__detail_1_1__meta_1_1concat__type__seq_3_01true__type_00_01F_01_4.html C++ template metaprogramming helper `decay_helper` to get the decayed type of a function signature or array. ```cpp template struct decay_helper; template struct decay_helper { using type = std::decay_t; }; template struct decay_helper { using type = std::decay_t; }; ``` -------------------------------- ### Get Function Example Source: https://simple-robotics.github.io/proxsuite/namespacemembers_g.html This function is used to retrieve values from proxsuite::linalg::veg::_meta and proxsuite::linalg::veg::tuple. ```cpp get() : proxsuite::linalg::veg::_detail::_meta, proxsuite::linalg::veg::tuple ``` -------------------------------- ### QP Initialization Source: https://simple-robotics.github.io/proxsuite/structproxsuite_1_1proxqp_1_1sparse_1_1QP-members.html Demonstrates how to initialize a QP problem using the `init` method. ```APIDOC ## POST /proxsuite/proxqp/sparse/QP/init ### Description Initializes or re-initializes the QP problem with the given components. This method allows for setting up the quadratic objective (H, g), equality constraints (A, b), and inequality constraints (C, l, u). ### Method POST ### Endpoint `/proxsuite/proxqp/sparse/QP/init` ### Parameters #### Path Parameters None #### Query Parameters - **compute_preconditioner_** (bool) - Optional - Whether to compute the preconditioner. - **update_preconditioner** (bool) - Optional - Whether to update the preconditioner during an update operation. #### Request Body - **H** (optional< SparseMat< T, I > >) - The Hessian matrix of the objective function. - **g** (optional< VecRef< T > >) - The gradient vector of the objective function. - **A** (optional< SparseMat< T, I > >) - The matrix for equality constraints. - **b** (optional< VecRef< T > >) - The right-hand side vector for equality constraints. - **C** (optional< SparseMat< T, I > >) - The matrix for inequality constraints. - **l** (optional< VecRef< T > >) - The lower bound vector for inequality constraints. - **u** (optional< VecRef< T > >) - The upper bound vector for inequality constraints. - **rho** (optional< T >) - Regularization parameter. - **mu_eq** (optional< T >) - Multiplier for equality constraints. - **mu_in** (optional< T >) - Multiplier for inequality constraints. - **manual_minimal_H_eigenvalue** (optional< T >) - Manually set minimal eigenvalue of H. ### Request Example ```json { "H": {"rows": 10, "cols": 10, "data": [{"row": 0, "col": 0, "value": 1.0}, ...]}, "g": [1.0, 2.0, ...], "A": {"rows": 5, "cols": 10, "data": [...]}, "b": [3.0, 4.0, ...], "C": {"rows": 8, "cols": 10, "data": [...]}, "l": [0.0, 0.0, ...], "u": [1.0, 1.0, ...], "rho": 0.1, "mu_eq": 0.01, "mu_in": 0.01, "manual_minimal_H_eigenvalue": 1e-6 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "initialized" } ``` ``` -------------------------------- ### Get Strided VectorView Segment Source: https://simple-robotics.github.io/proxsuite/dense_2views_8hpp_source.html Returns a StridedVectorView of a segment. The segment starts at index `i` and has the specified `size`, maintaining the original stride. ```cpp VEG_INLINE auto segment(isize i, isize size) const noexcept -> StridedVectorView { return { from_ptr_size_stride, data + stride * i, size, stride, }; } ```