CGAL 5.6.3 - CGAL and Solvers

Loading...
Searching...
No Matches
List of all members | Public Member Functions
CGAL::OSQP_quadratic_program_traits< FT > Class Template Reference
CGAL and Solvers Reference » Nonlinear Programming

`#include <CGAL/OSQP_quadratic_program_traits.h>`

## Definition

template<typename FT>
class CGAL::OSQP_quadratic_program_traits< FT >

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

  FT | number 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.
| OSQP_quadratic_program_traits (const std::size_t n, const std::size_t m)
| Constructor.
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.

## 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

  n | the 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

  n | the number of variables
  m | the 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.