Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1247

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
hooks:
- id: toml-sort-fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.4
rev: v18.1.5
hooks:
- id: clang-format
args:
Expand Down
11 changes: 9 additions & 2 deletions benchmark/all_robots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,15 @@ void print_benchmark(RobotEENames robot) {
std::to_string(state->get_nq()) +
"DoF.bench";
CsvStream csv(csv_filename);
csv << "fn_name" << "nthreads" << "with_cg" << "mean" << "stddev" << "max"
<< "min" << "mean_per_nodes" << "stddev_per_nodes" << csv.endl;
csv << "fn_name"
<< "nthreads"
<< "with_cg"
<< "mean"
<< "stddev"
<< "max"
<< "min"
<< "mean_per_nodes"
<< "stddev_per_nodes" << csv.endl;

/*******************************************************************************/
/*********************************** TIMINGS
Expand Down
4 changes: 2 additions & 2 deletions benchmark/arm_manipulation_timings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ int main(int argc, char* argv[]) {
x0s.push_back(state->rand());

/*********************State**********************************/
std::cout << std::left << std::setw(42) << "Function call" << " "
<< std::left << std::setw(15) << "AVG (us)" << std::left
std::cout << std::left << std::setw(42) << "Function call"
<< " " << std::left << std::setw(15) << "AVG (us)" << std::left
<< std::setw(15) << "STDDEV (us)" << std::left << std::setw(15)
<< "MAX (us)" << std::left << std::setw(15) << "MIN (us)"
<< std::endl;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/bipedal_timings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ int main(int argc, char* argv[]) {
x0s.push_back(state->rand());

/*********************State**********************************/
std::cout << std::left << std::setw(42) << "Function call" << " "
<< std::left << std::setw(15) << "AVG (us)" << std::left
std::cout << std::left << std::setw(42) << "Function call"
<< " " << std::left << std::setw(15) << "AVG (us)" << std::left
<< std::setw(15) << "STDDEV (us)" << std::left << std::setw(15)
<< "MAX (us)" << std::left << std::setw(15) << "MIN (us)"
<< std::endl;
Expand Down
30 changes: 15 additions & 15 deletions bindings/python/crocoddyl/core/action-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ class ActionModelAbstract_wrap : public ActionModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calc").ptr(), data,
Expand All @@ -60,14 +60,14 @@ class ActionModelAbstract_wrap : public ActionModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calcDiff").ptr(), data,
Expand Down Expand Up @@ -99,9 +99,9 @@ class ActionModelAbstract_wrap : public ActionModelAbstract,
u = bp::call<Eigen::VectorXd>(quasiStatic.ptr(), data, (Eigen::VectorXd)x,
maxiter, tol);
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return;
}
Expand Down
12 changes: 6 additions & 6 deletions bindings/python/crocoddyl/core/activation-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class ActivationModelAbstract_wrap
void calc(const boost::shared_ptr<ActivationDataAbstract>& data,
const Eigen::Ref<const Eigen::VectorXd>& r) {
if (static_cast<std::size_t>(r.size()) != nr_) {
throw_pretty(
"Invalid argument: " << "r has wrong dimension (it should be " +
std::to_string(nr_) + ")");
throw_pretty("Invalid argument: "
<< "r has wrong dimension (it should be " +
std::to_string(nr_) + ")");
}
return bp::call<void>(this->get_override("calc").ptr(), data,
(Eigen::VectorXd)r);
Expand All @@ -37,9 +37,9 @@ class ActivationModelAbstract_wrap
void calcDiff(const boost::shared_ptr<ActivationDataAbstract>& data,
const Eigen::Ref<const Eigen::VectorXd>& r) {
if (static_cast<std::size_t>(r.size()) != nr_) {
throw_pretty(
"Invalid argument: " << "r has wrong dimension (it should be " +
std::to_string(nr_) + ")");
throw_pretty("Invalid argument: "
<< "r has wrong dimension (it should be " +
std::to_string(nr_) + ")");
}
return bp::call<void>(this->get_override("calcDiff").ptr(), data,
(Eigen::VectorXd)r);
Expand Down
48 changes: 24 additions & 24 deletions bindings/python/crocoddyl/core/actuation-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return bp::call<void>(this->get_override("calc").ptr(), data,
(Eigen::VectorXd)x, (Eigen::VectorXd)u);
Expand All @@ -46,14 +46,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return bp::call<void>(this->get_override("calcDiff").ptr(), data,
(Eigen::VectorXd)x, (Eigen::VectorXd)u);
Expand All @@ -63,14 +63,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& tau) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(tau.size()) != state_->get_nv()) {
throw_pretty(
"Invalid argument: " << "tau has wrong dimension (it should be " +
std::to_string(state_->get_nv()) + ")");
throw_pretty("Invalid argument: "
<< "tau has wrong dimension (it should be " +
std::to_string(state_->get_nv()) + ")");
}
return bp::call<void>(this->get_override("commands").ptr(), data,
(Eigen::VectorXd)x, (Eigen::VectorXd)tau);
Expand All @@ -82,14 +82,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract,
if (boost::python::override torqueTransform =
this->get_override("torqueTransform")) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return bp::call<void>(torqueTransform.ptr(), data, (Eigen::VectorXd)x,
(Eigen::VectorXd)u);
Expand Down
24 changes: 12 additions & 12 deletions bindings/python/crocoddyl/core/constraint-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ class ConstraintModelAbstract_wrap
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calc").ptr(), data,
Expand All @@ -73,14 +73,14 @@ class ConstraintModelAbstract_wrap
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calcDiff").ptr(), data,
Expand Down
18 changes: 9 additions & 9 deletions bindings/python/crocoddyl/core/control-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class ControlParametrizationModelAbstract_wrap
void calc(const boost::shared_ptr<ControlParametrizationDataAbstract>& data,
double t, const Eigen::Ref<const Eigen::VectorXd>& u) const {
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return bp::call<void>(this->get_override("calc").ptr(), data, t,
(Eigen::VectorXd)u);
Expand All @@ -40,9 +40,9 @@ class ControlParametrizationModelAbstract_wrap
const boost::shared_ptr<ControlParametrizationDataAbstract>& data,
double t, const Eigen::Ref<const Eigen::VectorXd>& u) const {
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
return bp::call<void>(this->get_override("calcDiff").ptr(), data, t,
(Eigen::VectorXd)u);
Expand All @@ -51,9 +51,9 @@ class ControlParametrizationModelAbstract_wrap
void params(const boost::shared_ptr<ControlParametrizationDataAbstract>& data,
double t, const Eigen::Ref<const Eigen::VectorXd>& w) const {
if (static_cast<std::size_t>(w.size()) != nw_) {
throw_pretty(
"Invalid argument: " << "w has wrong dimension (it should be " +
std::to_string(nw_) + ")");
throw_pretty("Invalid argument: "
<< "w has wrong dimension (it should be " +
std::to_string(nw_) + ")");
}
return bp::call<void>(this->get_override("params").ptr(), data, t,
(Eigen::VectorXd)w);
Expand Down
24 changes: 12 additions & 12 deletions bindings/python/crocoddyl/core/cost-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class CostModelAbstract_wrap : public CostModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calc").ptr(), data,
Expand All @@ -88,14 +88,14 @@ class CostModelAbstract_wrap : public CostModelAbstract,
const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u) {
if (static_cast<std::size_t>(x.size()) != state_->get_nx()) {
throw_pretty(
"Invalid argument: " << "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
throw_pretty("Invalid argument: "
<< "x has wrong dimension (it should be " +
std::to_string(state_->get_nx()) + ")");
}
if (static_cast<std::size_t>(u.size()) != nu_) {
throw_pretty(
"Invalid argument: " << "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
throw_pretty("Invalid argument: "
<< "u has wrong dimension (it should be " +
std::to_string(nu_) + ")");
}
if (std::isnan(u.lpNorm<Eigen::Infinity>())) {
return bp::call<void>(this->get_override("calcDiff").ptr(), data,
Expand Down
Loading
Loading