CGAL 5.6.2 - CGAL and Solvers
CGAL::OSQP_quadratic_program_traits< FT > Class Template Reference

#include <CGAL/OSQP_quadratic_program_traits.h>

Definition

wraps the external OSQP solver.

This class provides an interface for formulating and solving constrained or unconstrained quadratic programs using the OSQP library, which must be available on the system.

Template Parameters
FTnumber type that FieldNumberType
Note
The FT type is provided for convenience. Internally, this FT type is converted to OSQPFloat type that can be set either to float or double. By default, the double type is used. After the optimization is complete, the OSQPFloat type is converted back to FT. See more about OSQPFloat here.
Is Model Of:
QuadraticProgramTraits
Examples:
Solver_interface/osqp_quadratic_program.cpp.

Public Member Functions

 OSQP_quadratic_program_traits ()
 Default constructor
 
 OSQP_quadratic_program_traits (const std::size_t n)
 Constructor. More...
 
 OSQP_quadratic_program_traits (const std::size_t n, const std::size_t m)
 Constructor. More...
 
void clear ()
 Resets the problem, removing all existing entries and setting sizes to 0.
 
void resize (const std::size_t new_n, const std::size_t new_m=0)
 Changes the number of variables and the number of constraints of the problem. More...
 

Constructor & Destructor Documentation

◆ OSQP_quadratic_program_traits() [1/2]

template<typename FT>
CGAL::OSQP_quadratic_program_traits< FT >::OSQP_quadratic_program_traits ( const std::size_t  n)

Constructor.

Parameters
nthe number of variables

◆ OSQP_quadratic_program_traits() [2/2]

template<typename FT>
CGAL::OSQP_quadratic_program_traits< FT >::OSQP_quadratic_program_traits ( const std::size_t  n,
const std::size_t  m 
)

Constructor.

Parameters
nthe number of variables
mthe number of constraints

Member Function Documentation

◆ resize()

template<typename FT>
void CGAL::OSQP_quadratic_program_traits< FT >::resize ( const std::size_t  new_n,
const std::size_t  new_m = 0 
)

Changes the number of variables and the number of constraints of the problem.

Warning
Calling this function also clears all previous entries.