Skip to content

Commit

Permalink
[bindings/python] use nanobind::none() instead of nullopt
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Aug 13, 2024
1 parent 8c74f30 commit 1b3a72d
Showing 1 changed file with 72 additions and 72 deletions.
144 changes: 72 additions & 72 deletions bindings/python/src/expose-qpobject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ exposeQpObjectDense(nanobind::module_ m)
optional<T>,
optional<T>)>(&dense::QP<T>::init),
"function for initialize the QP model.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("H"),
nanobind::arg("g"),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("compute_preconditioner") = true,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())
.def("init",
static_cast<void (dense::QP<T>::*)(optional<dense::MatRef<T>>,
optional<dense::VecRef<T>>,
Expand All @@ -130,20 +130,20 @@ exposeQpObjectDense(nanobind::module_ m)
optional<T>,
optional<T>)>(&dense::QP<T>::init),
"function for initialize the QP model.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("l_box") = nullopt,
nanobind::arg("u_box") = nullopt,
nanobind::arg("H") = nanobind::none(),
nanobind::arg("g") = nanobind::none(),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("l_box") = nanobind::none(),
nanobind::arg("u_box") = nanobind::none(),
nanobind::arg("compute_preconditioner") = true,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())
.def("solve",
static_cast<void (dense::QP<T>::*)()>(&dense::QP<T>::solve),
"function used for solving the QP problem, using default parameters.")
Expand All @@ -170,18 +170,18 @@ exposeQpObjectDense(nanobind::module_ m)
optional<T>)>(&dense::QP<T>::update),
"function used for updating matrix or vector entry of the model using "
"dense matrix entries.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("H") = nanobind::none(),
nanobind::arg("g") = nanobind::none(),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("update_preconditioner") = false,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())
.def(
"update",
static_cast<void (dense::QP<T>::*)(optional<dense::MatRef<T>>,
Expand All @@ -200,20 +200,20 @@ exposeQpObjectDense(nanobind::module_ m)
optional<T>)>(&dense::QP<T>::update),
"function used for updating matrix or vector entry of the model using "
"dense matrix entries.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("l_box") = nullopt,
nanobind::arg("u_box") = nullopt,
nanobind::arg("H") = nanobind::none(),
nanobind::arg("g") = nanobind::none(),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("l_box") = nanobind::none(),
nanobind::arg("u_box") = nanobind::none(),
nanobind::arg("update_preconditioner") = false,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())
.def("cleanup",
&dense::QP<T>::cleanup,
"function used for cleaning the workspace and result "
Expand Down Expand Up @@ -251,8 +251,8 @@ exposeQpObjectSparse(nanobind::module_ m)
.def(::nanobind::init<const sparse::SparseMat<bool, I>&,
const sparse::SparseMat<bool, I>&,
const sparse::SparseMat<bool, I>&>(),
nanobind::arg("H_mask") = nullopt,
nanobind::arg("A_mask") = nullopt,
nanobind::arg("H_mask") = nanobind::none(),
nanobind::arg("A_mask") = nanobind::none(),
nanobind::arg("C_mask") = 0,
"Constructor using QP model sparsity structure.") // constructor
.def_ro("model", &sparse::QP<T, I>::model, "class containing the QP model")
Expand All @@ -266,35 +266,35 @@ exposeQpObjectSparse(nanobind::module_ m)
&sparse::QP<T, I>::init,
"function for initializing the model when passing sparse matrices in "
"entry.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("H") = nanobind::none(),
nanobind::arg("g") = nanobind::none(),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("compute_preconditioner") = true,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())

.def("update",
&sparse::QP<T, I>::update,
"function for updating the model when passing sparse matrices in "
"entry.",
nanobind::arg("H") = nullopt,
nanobind::arg("g") = nullopt,
nanobind::arg("A") = nullopt,
nanobind::arg("b") = nullopt,
nanobind::arg("C") = nullopt,
nanobind::arg("l") = nullopt,
nanobind::arg("u") = nullopt,
nanobind::arg("H") = nanobind::none(),
nanobind::arg("g") = nanobind::none(),
nanobind::arg("A") = nanobind::none(),
nanobind::arg("b") = nanobind::none(),
nanobind::arg("C") = nanobind::none(),
nanobind::arg("l") = nanobind::none(),
nanobind::arg("u") = nanobind::none(),
nanobind::arg("update_preconditioner") = false,
nanobind::arg("rho") = nullopt,
nanobind::arg("mu_eq") = nullopt,
nanobind::arg("mu_in") = nullopt,
nanobind::arg("manual_minimal_H_eigenvalue") = nullopt)
nanobind::arg("rho") = nanobind::none(),
nanobind::arg("mu_eq") = nanobind::none(),
nanobind::arg("mu_in") = nanobind::none(),
nanobind::arg("manual_minimal_H_eigenvalue") = nanobind::none())
.def("solve",
static_cast<void (sparse::QP<T, I>::*)()>(&sparse::QP<T, I>::solve),
"function used for solving the QP problem, using default parameters.")
Expand Down

0 comments on commit 1b3a72d

Please sign in to comment.