diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ea16c0659..be2560875a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/benchmark/all_robots.cpp b/benchmark/all_robots.cpp index 3906da5eb9..bb18f3018e 100644 --- a/benchmark/all_robots.cpp +++ b/benchmark/all_robots.cpp @@ -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 diff --git a/benchmark/arm_manipulation_timings.cpp b/benchmark/arm_manipulation_timings.cpp index 1527b6321d..763c1cbdf2 100644 --- a/benchmark/arm_manipulation_timings.cpp +++ b/benchmark/arm_manipulation_timings.cpp @@ -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; diff --git a/benchmark/bipedal_timings.cpp b/benchmark/bipedal_timings.cpp index 985c792f06..c38d347830 100644 --- a/benchmark/bipedal_timings.cpp +++ b/benchmark/bipedal_timings.cpp @@ -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; diff --git a/bindings/python/crocoddyl/core/action-base.hpp b/bindings/python/crocoddyl/core/action-base.hpp index a67b531223..1f2abe826c 100644 --- a/bindings/python/crocoddyl/core/action-base.hpp +++ b/bindings/python/crocoddyl/core/action-base.hpp @@ -38,14 +38,14 @@ class ActionModelAbstract_wrap : public ActionModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calc").ptr(), data, @@ -60,14 +60,14 @@ class ActionModelAbstract_wrap : public ActionModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calcDiff").ptr(), data, @@ -99,9 +99,9 @@ class ActionModelAbstract_wrap : public ActionModelAbstract, u = bp::call(quasiStatic.ptr(), data, (Eigen::VectorXd)x, maxiter, tol); if (static_cast(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; } diff --git a/bindings/python/crocoddyl/core/activation-base.hpp b/bindings/python/crocoddyl/core/activation-base.hpp index 05d18653dc..a586387785 100644 --- a/bindings/python/crocoddyl/core/activation-base.hpp +++ b/bindings/python/crocoddyl/core/activation-base.hpp @@ -26,9 +26,9 @@ class ActivationModelAbstract_wrap void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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(this->get_override("calc").ptr(), data, (Eigen::VectorXd)r); @@ -37,9 +37,9 @@ class ActivationModelAbstract_wrap void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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(this->get_override("calcDiff").ptr(), data, (Eigen::VectorXd)r); diff --git a/bindings/python/crocoddyl/core/actuation-base.hpp b/bindings/python/crocoddyl/core/actuation-base.hpp index f0775e39c9..9bbd73c256 100644 --- a/bindings/python/crocoddyl/core/actuation-base.hpp +++ b/bindings/python/crocoddyl/core/actuation-base.hpp @@ -29,14 +29,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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(this->get_override("calc").ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)u); @@ -46,14 +46,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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(this->get_override("calcDiff").ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)u); @@ -63,14 +63,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract, const Eigen::Ref& x, const Eigen::Ref& tau) { if (static_cast(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(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(this->get_override("commands").ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)tau); @@ -82,14 +82,14 @@ class ActuationModelAbstract_wrap : public ActuationModelAbstract, if (boost::python::override torqueTransform = this->get_override("torqueTransform")) { if (static_cast(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(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(torqueTransform.ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)u); diff --git a/bindings/python/crocoddyl/core/constraint-base.hpp b/bindings/python/crocoddyl/core/constraint-base.hpp index 220a72ef39..aba1010d14 100644 --- a/bindings/python/crocoddyl/core/constraint-base.hpp +++ b/bindings/python/crocoddyl/core/constraint-base.hpp @@ -51,14 +51,14 @@ class ConstraintModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calc").ptr(), data, @@ -73,14 +73,14 @@ class ConstraintModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calcDiff").ptr(), data, diff --git a/bindings/python/crocoddyl/core/control-base.hpp b/bindings/python/crocoddyl/core/control-base.hpp index 828a3f476b..3231009996 100644 --- a/bindings/python/crocoddyl/core/control-base.hpp +++ b/bindings/python/crocoddyl/core/control-base.hpp @@ -28,9 +28,9 @@ class ControlParametrizationModelAbstract_wrap void calc(const boost::shared_ptr& data, double t, const Eigen::Ref& u) const { if (static_cast(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(this->get_override("calc").ptr(), data, t, (Eigen::VectorXd)u); @@ -40,9 +40,9 @@ class ControlParametrizationModelAbstract_wrap const boost::shared_ptr& data, double t, const Eigen::Ref& u) const { if (static_cast(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(this->get_override("calcDiff").ptr(), data, t, (Eigen::VectorXd)u); @@ -51,9 +51,9 @@ class ControlParametrizationModelAbstract_wrap void params(const boost::shared_ptr& data, double t, const Eigen::Ref& w) const { if (static_cast(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(this->get_override("params").ptr(), data, t, (Eigen::VectorXd)w); diff --git a/bindings/python/crocoddyl/core/cost-base.hpp b/bindings/python/crocoddyl/core/cost-base.hpp index 540d71e81c..6cda2e1db7 100644 --- a/bindings/python/crocoddyl/core/cost-base.hpp +++ b/bindings/python/crocoddyl/core/cost-base.hpp @@ -66,14 +66,14 @@ class CostModelAbstract_wrap : public CostModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calc").ptr(), data, @@ -88,14 +88,14 @@ class CostModelAbstract_wrap : public CostModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calcDiff").ptr(), data, diff --git a/bindings/python/crocoddyl/core/diff-action-base.hpp b/bindings/python/crocoddyl/core/diff-action-base.hpp index eb814e6f90..f9e67beb42 100644 --- a/bindings/python/crocoddyl/core/diff-action-base.hpp +++ b/bindings/python/crocoddyl/core/diff-action-base.hpp @@ -38,14 +38,14 @@ class DifferentialActionModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calc").ptr(), data, @@ -60,14 +60,14 @@ class DifferentialActionModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calcDiff").ptr(), data, @@ -100,9 +100,9 @@ class DifferentialActionModelAbstract_wrap u = bp::call(quasiStatic.ptr(), data, (Eigen::VectorXd)x, maxiter, tol); if (static_cast(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; } diff --git a/bindings/python/crocoddyl/core/integ-action-base.hpp b/bindings/python/crocoddyl/core/integ-action-base.hpp index c221d43bac..65385235b3 100644 --- a/bindings/python/crocoddyl/core/integ-action-base.hpp +++ b/bindings/python/crocoddyl/core/integ-action-base.hpp @@ -38,14 +38,14 @@ class IntegratedActionModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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(this->get_override("calc").ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)u); @@ -55,14 +55,14 @@ class IntegratedActionModelAbstract_wrap const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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(this->get_override("calcDiff").ptr(), data, (Eigen::VectorXd)x, (Eigen::VectorXd)u); diff --git a/bindings/python/crocoddyl/core/residual-base.hpp b/bindings/python/crocoddyl/core/residual-base.hpp index ecab0b1d54..26efacd239 100644 --- a/bindings/python/crocoddyl/core/residual-base.hpp +++ b/bindings/python/crocoddyl/core/residual-base.hpp @@ -48,14 +48,14 @@ class ResidualModelAbstract_wrap : public ResidualModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calc").ptr(), data, @@ -70,14 +70,14 @@ class ResidualModelAbstract_wrap : public ResidualModelAbstract, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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())) { return bp::call(this->get_override("calcDiff").ptr(), data, diff --git a/bindings/python/crocoddyl/core/state-base.hpp b/bindings/python/crocoddyl/core/state-base.hpp index af77a97a92..0dc7f283b7 100644 --- a/bindings/python/crocoddyl/core/state-base.hpp +++ b/bindings/python/crocoddyl/core/state-base.hpp @@ -45,14 +45,14 @@ class StateAbstract_wrap : public StateAbstract, Eigen::VectorXd diff_wrap(const Eigen::Ref& x0, const Eigen::Ref& x1) const { if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } return bp::call(this->get_override("diff").ptr(), (Eigen::VectorXd)x0, (Eigen::VectorXd)x1); @@ -68,14 +68,14 @@ class StateAbstract_wrap : public StateAbstract, const Eigen::Ref& x, const Eigen::Ref& dx) const { if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } return bp::call(this->get_override("integrate").ptr(), (Eigen::VectorXd)x, (Eigen::VectorXd)dx); @@ -122,14 +122,14 @@ class StateAbstract_wrap : public StateAbstract, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } bp::list Jacs; @@ -235,14 +235,14 @@ class StateAbstract_wrap : public StateAbstract, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } bp::list Jacs; @@ -292,14 +292,14 @@ class StateAbstract_wrap : public StateAbstract, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } return bp::call( this->get_override("JintegrateTransport").ptr(), (Eigen::VectorXd)x, diff --git a/include/crocoddyl/core/action-base.hxx b/include/crocoddyl/core/action-base.hxx index c07406c7c1..eb68384a57 100644 --- a/include/crocoddyl/core/action-base.hxx +++ b/include/crocoddyl/core/action-base.hxx @@ -56,14 +56,14 @@ void ActionModelAbstractTpl::quasiStatic( const Eigen::Ref& x, const std::size_t maxiter, const Scalar tol) { if (static_cast(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 (static_cast(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()) + ")"); } // Check the velocity input is zero assert_pretty(x.tail(state_->get_nv()).isZero(), diff --git a/include/crocoddyl/core/actions/diff-lqr.hxx b/include/crocoddyl/core/actions/diff-lqr.hxx index 59fde7b47d..30f8d09437 100644 --- a/include/crocoddyl/core/actions/diff-lqr.hxx +++ b/include/crocoddyl/core/actions/diff-lqr.hxx @@ -37,14 +37,14 @@ void DifferentialActionModelLQRTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const Eigen::VectorBlock, Eigen::Dynamic> q = x.head(state_->get_nq()); @@ -70,9 +70,9 @@ void DifferentialActionModelLQRTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } data->cost = Scalar(0.5) * x.dot(Lxx_ * x) + lx_.dot(x); @@ -83,14 +83,14 @@ void DifferentialActionModelLQRTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } data->Lx = lx_; @@ -112,9 +112,9 @@ void DifferentialActionModelLQRTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } data->Lx = lx_; @@ -203,10 +203,10 @@ template void DifferentialActionModelLQRTpl::set_Fq(const MatrixXs& Fq) { if (static_cast(Fq.rows()) != state_->get_nq() || static_cast(Fq.cols()) != state_->get_nq()) { - throw_pretty( - "Invalid argument: " << "Fq has wrong dimension (it should be " + - std::to_string(state_->get_nq()) + "," + - std::to_string(state_->get_nq()) + ")"); + throw_pretty("Invalid argument: " + << "Fq has wrong dimension (it should be " + + std::to_string(state_->get_nq()) + "," + + std::to_string(state_->get_nq()) + ")"); } Fq_ = Fq; } @@ -215,10 +215,10 @@ template void DifferentialActionModelLQRTpl::set_Fv(const MatrixXs& Fv) { if (static_cast(Fv.rows()) != state_->get_nv() || static_cast(Fv.cols()) != state_->get_nv()) { - throw_pretty( - "Invalid argument: " << "Fv has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + "," + - std::to_string(state_->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "Fv has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + "," + + std::to_string(state_->get_nv()) + ")"); } Fv_ = Fv; } @@ -227,10 +227,10 @@ template void DifferentialActionModelLQRTpl::set_Fu(const MatrixXs& Fu) { if (static_cast(Fu.rows()) != state_->get_nq() || static_cast(Fu.cols()) != nu_) { - throw_pretty( - "Invalid argument: " << "Fu has wrong dimension (it should be " + - std::to_string(state_->get_nq()) + "," + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "Fu has wrong dimension (it should be " + + std::to_string(state_->get_nq()) + "," + + std::to_string(nu_) + ")"); } Fu_ = Fu; } @@ -238,9 +238,9 @@ void DifferentialActionModelLQRTpl::set_Fu(const MatrixXs& Fu) { template void DifferentialActionModelLQRTpl::set_f0(const VectorXs& f0) { if (static_cast(f0.size()) != state_->get_nv()) { - throw_pretty( - "Invalid argument: " << "f0 has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "f0 has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + ")"); } f0_ = f0; } @@ -248,9 +248,9 @@ void DifferentialActionModelLQRTpl::set_f0(const VectorXs& f0) { template void DifferentialActionModelLQRTpl::set_lx(const VectorXs& lx) { if (static_cast(lx.size()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "lx has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "lx has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + ")"); } lx_ = lx; } @@ -258,9 +258,9 @@ void DifferentialActionModelLQRTpl::set_lx(const VectorXs& lx) { template void DifferentialActionModelLQRTpl::set_lu(const VectorXs& lu) { if (static_cast(lu.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "lu has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "lu has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } lu_ = lu; } @@ -269,10 +269,10 @@ template void DifferentialActionModelLQRTpl::set_Lxx(const MatrixXs& Lxx) { if (static_cast(Lxx.rows()) != state_->get_nx() || static_cast(Lxx.cols()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "Lxx has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "Lxx has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(state_->get_nx()) + ")"); } Lxx_ = Lxx; } @@ -281,10 +281,10 @@ template void DifferentialActionModelLQRTpl::set_Lxu(const MatrixXs& Lxu) { if (static_cast(Lxu.rows()) != state_->get_nx() || static_cast(Lxu.cols()) != nu_) { - throw_pretty( - "Invalid argument: " << "Lxu has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "Lxu has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(nu_) + ")"); } Lxu_ = Lxu; } diff --git a/include/crocoddyl/core/actions/lqr.hxx b/include/crocoddyl/core/actions/lqr.hxx index 99a5c8d51e..7eb56e3220 100644 --- a/include/crocoddyl/core/actions/lqr.hxx +++ b/include/crocoddyl/core/actions/lqr.hxx @@ -37,14 +37,14 @@ void ActionModelLQRTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -73,9 +73,9 @@ void ActionModelLQRTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -91,14 +91,14 @@ void ActionModelLQRTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } data->Lx = lx_; @@ -119,9 +119,9 @@ void ActionModelLQRTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } data->Lx = lx_; @@ -204,10 +204,10 @@ template void ActionModelLQRTpl::set_Fx(const MatrixXs& Fx) { if (static_cast(Fx.rows()) != state_->get_nx() || static_cast(Fx.cols()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "Fx has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "Fx has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(state_->get_nx()) + ")"); } Fx_ = Fx; } @@ -216,10 +216,10 @@ template void ActionModelLQRTpl::set_Fu(const MatrixXs& Fu) { if (static_cast(Fu.rows()) != state_->get_nx() || static_cast(Fu.cols()) != nu_) { - throw_pretty( - "Invalid argument: " << "Fu has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "Fu has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(nu_) + ")"); } Fu_ = Fu; } @@ -227,9 +227,9 @@ void ActionModelLQRTpl::set_Fu(const MatrixXs& Fu) { template void ActionModelLQRTpl::set_f0(const VectorXs& f0) { if (static_cast(f0.size()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "f0 has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "f0 has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + ")"); } f0_ = f0; } @@ -237,9 +237,9 @@ void ActionModelLQRTpl::set_f0(const VectorXs& f0) { template void ActionModelLQRTpl::set_lx(const VectorXs& lx) { if (static_cast(lx.size()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "lx has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "lx has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + ")"); } lx_ = lx; } @@ -247,9 +247,9 @@ void ActionModelLQRTpl::set_lx(const VectorXs& lx) { template void ActionModelLQRTpl::set_lu(const VectorXs& lu) { if (static_cast(lu.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "lu has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "lu has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } lu_ = lu; } @@ -258,10 +258,10 @@ template void ActionModelLQRTpl::set_Lxx(const MatrixXs& Lxx) { if (static_cast(Lxx.rows()) != state_->get_nx() || static_cast(Lxx.cols()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "Lxx has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "Lxx has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(state_->get_nx()) + ")"); } Lxx_ = Lxx; } @@ -270,10 +270,10 @@ template void ActionModelLQRTpl::set_Lxu(const MatrixXs& Lxu) { if (static_cast(Lxu.rows()) != state_->get_nx() || static_cast(Lxu.cols()) != nu_) { - throw_pretty( - "Invalid argument: " << "Lxu has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + "," + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "Lxu has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + "," + + std::to_string(nu_) + ")"); } Lxu_ = Lxu; } diff --git a/include/crocoddyl/core/actions/unicycle.hxx b/include/crocoddyl/core/actions/unicycle.hxx index 4e51c94e7e..41ecd59262 100644 --- a/include/crocoddyl/core/actions/unicycle.hxx +++ b/include/crocoddyl/core/actions/unicycle.hxx @@ -26,14 +26,14 @@ void ActionModelUnicycleTpl::calc( const boost::shared_ptr >& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -50,9 +50,9 @@ void ActionModelUnicycleTpl::calc( const boost::shared_ptr >& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -67,14 +67,14 @@ void ActionModelUnicycleTpl::calcDiff( const boost::shared_ptr >& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -98,9 +98,9 @@ void ActionModelUnicycleTpl::calcDiff( const boost::shared_ptr >& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); diff --git a/include/crocoddyl/core/activations/2norm-barrier.hpp b/include/crocoddyl/core/activations/2norm-barrier.hpp index 87000f4963..c4e7c74de2 100644 --- a/include/crocoddyl/core/activations/2norm-barrier.hpp +++ b/include/crocoddyl/core/activations/2norm-barrier.hpp @@ -66,7 +66,8 @@ class ActivationModel2NormBarrierTpl const bool true_hessian = false) : Base(nr), alpha_(alpha), true_hessian_(true_hessian) { if (alpha < Scalar(0.)) { - throw_pretty("Invalid argument: " << "alpha should be a positive value"); + throw_pretty("Invalid argument: " + << "alpha should be a positive value"); } }; virtual ~ActivationModel2NormBarrierTpl() {}; @@ -80,9 +81,9 @@ class ActivationModel2NormBarrierTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -103,9 +104,9 @@ class ActivationModel2NormBarrierTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/activations/quadratic-barrier.hpp b/include/crocoddyl/core/activations/quadratic-barrier.hpp index ec431b26ab..81c118c242 100644 --- a/include/crocoddyl/core/activations/quadratic-barrier.hpp +++ b/include/crocoddyl/core/activations/quadratic-barrier.hpp @@ -40,8 +40,8 @@ struct ActivationBoundsTpl { std::to_string(ub.size()) + ", respectively)"); } if (beta < Scalar(0) || beta > Scalar(1.)) { - throw_pretty( - "Invalid argument: " << "The range of beta is between 0 and 1"); + throw_pretty("Invalid argument: " + << "The range of beta is between 0 and 1"); } using std::isfinite; for (std::size_t i = 0; i < static_cast(lb.size()); ++i) { @@ -116,9 +116,9 @@ class ActivationModelQuadraticBarrierTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -132,9 +132,9 @@ class ActivationModelQuadraticBarrierTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/activations/quadratic-flat-exp.hpp b/include/crocoddyl/core/activations/quadratic-flat-exp.hpp index 7797c6afb0..8ad59f9c8f 100644 --- a/include/crocoddyl/core/activations/quadratic-flat-exp.hpp +++ b/include/crocoddyl/core/activations/quadratic-flat-exp.hpp @@ -57,7 +57,8 @@ class ActivationModelQuadFlatExpTpl const Scalar &alpha = Scalar(1.)) : Base(nr), alpha_(alpha) { if (alpha < Scalar(0.)) { - throw_pretty("Invalid argument: " << "alpha should be a positive value"); + throw_pretty("Invalid argument: " + << "alpha should be a positive value"); } }; virtual ~ActivationModelQuadFlatExpTpl() {}; @@ -71,9 +72,9 @@ class ActivationModelQuadFlatExpTpl virtual void calc(const boost::shared_ptr &data, const Eigen::Ref &r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -90,9 +91,9 @@ class ActivationModelQuadFlatExpTpl virtual void calcDiff(const boost::shared_ptr &data, const Eigen::Ref &r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/activations/quadratic-flat-log.hpp b/include/crocoddyl/core/activations/quadratic-flat-log.hpp index 3171ddf661..96c65bf11e 100644 --- a/include/crocoddyl/core/activations/quadratic-flat-log.hpp +++ b/include/crocoddyl/core/activations/quadratic-flat-log.hpp @@ -56,7 +56,8 @@ class ActivationModelQuadFlatLogTpl const Scalar &alpha = Scalar(1.)) : Base(nr), alpha_(alpha) { if (alpha < Scalar(0.)) { - throw_pretty("Invalid argument: " << "alpha should be a positive value"); + throw_pretty("Invalid argument: " + << "alpha should be a positive value"); } }; virtual ~ActivationModelQuadFlatLogTpl() {}; @@ -70,9 +71,9 @@ class ActivationModelQuadFlatLogTpl virtual void calc(const boost::shared_ptr &data, const Eigen::Ref &r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); d->a0 = r.squaredNorm() / alpha_; @@ -88,9 +89,9 @@ class ActivationModelQuadFlatLogTpl virtual void calcDiff(const boost::shared_ptr &data, const Eigen::Ref &r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/activations/quadratic.hpp b/include/crocoddyl/core/activations/quadratic.hpp index 83a0c21a72..e20bdb65d6 100644 --- a/include/crocoddyl/core/activations/quadratic.hpp +++ b/include/crocoddyl/core/activations/quadratic.hpp @@ -36,9 +36,9 @@ class ActivationModelQuadTpl : public ActivationModelAbstractTpl<_Scalar> { virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } data->a_value = Scalar(0.5) * r.dot(r); }; @@ -46,9 +46,9 @@ class ActivationModelQuadTpl : public ActivationModelAbstractTpl<_Scalar> { virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } data->Ar = r; diff --git a/include/crocoddyl/core/activations/smooth-1norm.hpp b/include/crocoddyl/core/activations/smooth-1norm.hpp index f61afdbd39..20cb6cc18a 100644 --- a/include/crocoddyl/core/activations/smooth-1norm.hpp +++ b/include/crocoddyl/core/activations/smooth-1norm.hpp @@ -59,7 +59,8 @@ class ActivationModelSmooth1NormTpl const Scalar eps = Scalar(1.)) : Base(nr), eps_(eps) { if (eps < Scalar(0.)) { - throw_pretty("Invalid argument: " << "eps should be a positive value"); + throw_pretty("Invalid argument: " + << "eps should be a positive value"); } if (eps == Scalar(0.)) { std::cerr << "Warning: eps=0 leads to derivatives discontinuities in the " @@ -78,9 +79,9 @@ class ActivationModelSmooth1NormTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -97,9 +98,9 @@ class ActivationModelSmooth1NormTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/activations/smooth-2norm.hpp b/include/crocoddyl/core/activations/smooth-2norm.hpp index 8562b9a64c..17c4f8e37f 100644 --- a/include/crocoddyl/core/activations/smooth-2norm.hpp +++ b/include/crocoddyl/core/activations/smooth-2norm.hpp @@ -56,7 +56,8 @@ class ActivationModelSmooth2NormTpl const Scalar eps = Scalar(1.)) : Base(nr), eps_(eps) { if (eps < Scalar(0.)) { - throw_pretty("Invalid argument: " << "eps should be a positive value"); + throw_pretty("Invalid argument: " + << "eps should be a positive value"); } }; virtual ~ActivationModelSmooth2NormTpl() {}; @@ -70,9 +71,9 @@ class ActivationModelSmooth2NormTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } using std::sqrt; data->a_value = sqrt(r.squaredNorm() + eps_); @@ -87,9 +88,9 @@ class ActivationModelSmooth2NormTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } data->Ar = r / data->a_value; diff --git a/include/crocoddyl/core/activations/weighted-quadratic-barrier.hpp b/include/crocoddyl/core/activations/weighted-quadratic-barrier.hpp index cfb79fbaeb..bdd46bfd99 100644 --- a/include/crocoddyl/core/activations/weighted-quadratic-barrier.hpp +++ b/include/crocoddyl/core/activations/weighted-quadratic-barrier.hpp @@ -40,9 +40,9 @@ class ActivationModelWeightedQuadraticBarrierTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -57,9 +57,9 @@ class ActivationModelWeightedQuadraticBarrierTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); data->Ar = (d->rlb_min_ + d->rub_max_).matrix(); diff --git a/include/crocoddyl/core/activations/weighted-quadratic.hpp b/include/crocoddyl/core/activations/weighted-quadratic.hpp index 95f9eaef73..c88ce71cc2 100644 --- a/include/crocoddyl/core/activations/weighted-quadratic.hpp +++ b/include/crocoddyl/core/activations/weighted-quadratic.hpp @@ -38,9 +38,9 @@ class ActivationModelWeightedQuadTpl virtual void calc(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); @@ -51,9 +51,9 @@ class ActivationModelWeightedQuadTpl virtual void calcDiff(const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(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_) + ")"); } boost::shared_ptr d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/actuation-base.hxx b/include/crocoddyl/core/actuation-base.hxx index eae4bee82a..84a6cca564 100644 --- a/include/crocoddyl/core/actuation-base.hxx +++ b/include/crocoddyl/core/actuation-base.hxx @@ -18,7 +18,8 @@ ActuationModelAbstractTpl::ActuationModelAbstractTpl( boost::shared_ptr state, const std::size_t nu) : nu_(nu), state_(state) { if (nu_ < 0) { - throw_pretty("Invalid argument: " << "nu cannot be smaller than zero"); + throw_pretty("Invalid argument: " + << "nu cannot be smaller than zero"); } } @@ -47,14 +48,14 @@ void ActuationModelAbstractTpl::torqueTransform( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } calc(data, x, u); calcDiff(data, x, u); diff --git a/include/crocoddyl/core/actuation/squashing-base.hpp b/include/crocoddyl/core/actuation/squashing-base.hpp index 356b6190d5..855d12691b 100644 --- a/include/crocoddyl/core/actuation/squashing-base.hpp +++ b/include/crocoddyl/core/actuation/squashing-base.hpp @@ -31,7 +31,8 @@ class SquashingModelAbstractTpl { SquashingModelAbstractTpl(const std::size_t ns) : ns_(ns) { if (ns_ == 0) { - throw_pretty("Invalid argument: " << "ns cannot be zero"); + throw_pretty("Invalid argument: " + << "ns cannot be zero"); } }; virtual ~SquashingModelAbstractTpl() {}; diff --git a/include/crocoddyl/core/actuation/squashing/smooth-sat.hpp b/include/crocoddyl/core/actuation/squashing/smooth-sat.hpp index a1d6a044ae..184f3c8ccc 100644 --- a/include/crocoddyl/core/actuation/squashing/smooth-sat.hpp +++ b/include/crocoddyl/core/actuation/squashing/smooth-sat.hpp @@ -76,7 +76,8 @@ class SquashingModelSmoothSatTpl : public SquashingModelAbstractTpl<_Scalar> { const Scalar get_smooth() const { return smooth_; }; void set_smooth(const Scalar smooth) { if (smooth < 0.) { - throw_pretty("Invalid argument: " << "Smooth value has to be positive"); + throw_pretty("Invalid argument: " + << "Smooth value has to be positive"); } smooth_ = smooth; diff --git a/include/crocoddyl/core/constraint-base.hpp b/include/crocoddyl/core/constraint-base.hpp index 9d6c5ef1e0..b71839c6d7 100644 --- a/include/crocoddyl/core/constraint-base.hpp +++ b/include/crocoddyl/core/constraint-base.hpp @@ -268,7 +268,8 @@ struct ConstraintDataAbstractTpl { Hx(model->get_nh(), model->get_state()->get_ndx()), Hu(model->get_nh(), model->get_nu()) { if (model->get_ng() == 0 && model->get_nh() == 0) { - throw_pretty("Invalid argument: " << "ng and nh cannot be equals to 0"); + throw_pretty("Invalid argument: " + << "ng and nh cannot be equals to 0"); } g.setZero(); Gx.setZero(); diff --git a/include/crocoddyl/core/constraints/constraint-manager.hpp b/include/crocoddyl/core/constraints/constraint-manager.hpp index 670ee9897a..9fa72f4056 100644 --- a/include/crocoddyl/core/constraints/constraint-manager.hpp +++ b/include/crocoddyl/core/constraints/constraint-manager.hpp @@ -361,53 +361,53 @@ struct ConstraintDataManagerTpl { void set_g(const VectorXs& _g) { if (g.size() != _g.size()) { - throw_pretty( - "Invalid argument: " << "g has wrong dimension (it should be " + - std::to_string(g.size()) + ")"); + throw_pretty("Invalid argument: " + << "g has wrong dimension (it should be " + + std::to_string(g.size()) + ")"); } g = _g; } void set_Gx(const MatrixXs& _Gx) { if (Gx.rows() != _Gx.rows() || Gx.cols() != _Gx.cols()) { - throw_pretty( - "Invalid argument: " << "Gx has wrong dimension (it should be " + - std::to_string(Gx.rows()) + ", " + - std::to_string(Gx.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Gx has wrong dimension (it should be " + + std::to_string(Gx.rows()) + ", " + + std::to_string(Gx.cols()) + ")"); } Gx = _Gx; } void set_Gu(const MatrixXs& _Gu) { if (Gu.rows() != _Gu.rows() || Gu.cols() != _Gu.cols()) { - throw_pretty( - "Invalid argument: " << "Gu has wrong dimension (it should be " + - std::to_string(Gu.rows()) + ", " + - std::to_string(Gu.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Gu has wrong dimension (it should be " + + std::to_string(Gu.rows()) + ", " + + std::to_string(Gu.cols()) + ")"); } Gu = _Gu; } void set_h(const VectorXs& _h) { if (h.size() != _h.size()) { - throw_pretty( - "Invalid argument: " << "h has wrong dimension (it should be " + - std::to_string(h.size()) + ")"); + throw_pretty("Invalid argument: " + << "h has wrong dimension (it should be " + + std::to_string(h.size()) + ")"); } h = _h; } void set_Hx(const MatrixXs& _Hx) { if (Hx.rows() != _Hx.rows() || Hx.cols() != _Hx.cols()) { - throw_pretty( - "Invalid argument: " << "Hx has wrong dimension (it should be " + - std::to_string(Hx.rows()) + ", " + - std::to_string(Hx.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Hx has wrong dimension (it should be " + + std::to_string(Hx.rows()) + ", " + + std::to_string(Hx.cols()) + ")"); } Hx = _Hx; } void set_Hu(const MatrixXs& _Hu) { if (Hu.rows() != _Hu.rows() || Hu.cols() != _Hu.cols()) { - throw_pretty( - "Invalid argument: " << "Hu has wrong dimension (it should be " + - std::to_string(Hu.rows()) + ", " + - std::to_string(Hu.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Hu has wrong dimension (it should be " + + std::to_string(Hu.rows()) + ", " + + std::to_string(Hu.cols()) + ")"); } Hu = _Hu; } diff --git a/include/crocoddyl/core/constraints/constraint-manager.hxx b/include/crocoddyl/core/constraints/constraint-manager.hxx index 4daa51e089..e757a82dd5 100644 --- a/include/crocoddyl/core/constraints/constraint-manager.hxx +++ b/include/crocoddyl/core/constraints/constraint-manager.hxx @@ -101,14 +101,14 @@ void ConstraintModelManagerTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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 (data->constraints.size() != constraints_.size()) { throw_pretty( @@ -153,9 +153,9 @@ void ConstraintModelManagerTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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 (data->constraints.size() != constraints_.size()) { throw_pretty( @@ -200,14 +200,14 @@ void ConstraintModelManagerTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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 (data->constraints.size() != constraints_.size()) { throw_pretty( @@ -256,9 +256,9 @@ void ConstraintModelManagerTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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 (data->constraints.size() != constraints_.size()) { throw_pretty( diff --git a/include/crocoddyl/core/controls/poly-one.hxx b/include/crocoddyl/core/controls/poly-one.hxx index 641ee6e7e5..9086dc66b7 100644 --- a/include/crocoddyl/core/controls/poly-one.hxx +++ b/include/crocoddyl/core/controls/poly-one.hxx @@ -22,9 +22,9 @@ void ControlParametrizationModelPolyOneTpl::calc( const boost::shared_ptr& data, const Scalar t, const Eigen::Ref& u) const { if (static_cast(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_) + ")"); } Data* d = static_cast(data.get()); d->c[1] = Scalar(2.) * t; @@ -52,9 +52,9 @@ void ControlParametrizationModelPolyOneTpl::params( const boost::shared_ptr& data, const Scalar, const Eigen::Ref& w) const { if (static_cast(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_) + ")"); } data->u.head(nw_) = w; data->u.tail(nw_) = w; @@ -66,24 +66,24 @@ void ControlParametrizationModelPolyOneTpl::convertBounds( const Eigen::Ref& w_ub, Eigen::Ref u_lb, Eigen::Ref u_ub) const { if (static_cast(u_lb.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_lb has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_lb has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(u_ub.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_ub has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_ub has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(w_lb.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_lb has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_lb has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } if (static_cast(w_ub.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_ub has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_ub has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } u_lb.head(nw_) = w_lb; u_lb.tail(nw_) = w_lb; @@ -100,12 +100,12 @@ void ControlParametrizationModelPolyOneTpl::multiplyByJacobian( ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.rows() != out.rows() || static_cast(A.cols()) != nw_ || static_cast(out.cols()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + +")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + +")"); } Data* d = static_cast(data.get()); switch (op) { @@ -136,12 +136,12 @@ void ControlParametrizationModelPolyOneTpl::multiplyJacobianTransposeBy( ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.cols() != out.cols() || static_cast(A.rows()) != nw_ || static_cast(out.rows()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + ")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + ")"); } Data* d = static_cast(data.get()); switch (op) { diff --git a/include/crocoddyl/core/controls/poly-two-rk.hxx b/include/crocoddyl/core/controls/poly-two-rk.hxx index 402684187b..756cc94659 100644 --- a/include/crocoddyl/core/controls/poly-two-rk.hxx +++ b/include/crocoddyl/core/controls/poly-two-rk.hxx @@ -28,9 +28,9 @@ void ControlParametrizationModelPolyTwoRKTpl::calc( const boost::shared_ptr& data, const Scalar t, const Eigen::Ref& u) const { if (static_cast(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_) + ")"); } Data* d = static_cast(data.get()); const Eigen::VectorBlock >& p0 = u.head(nw_); @@ -78,9 +78,9 @@ void ControlParametrizationModelPolyTwoRKTpl::params( const boost::shared_ptr& data, const Scalar, const Eigen::Ref& w) const { if (static_cast(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_) + ")"); } data->u.head(nw_) = w; data->u.segment(nw_, nw_) = w; @@ -93,24 +93,24 @@ void ControlParametrizationModelPolyTwoRKTpl::convertBounds( const Eigen::Ref& w_ub, Eigen::Ref u_lb, Eigen::Ref u_ub) const { if (static_cast(u_lb.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_lb has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_lb has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(u_ub.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_ub has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_ub has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(w_lb.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_lb has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_lb has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } if (static_cast(w_ub.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_ub has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_ub has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } u_lb.head(nw_) = w_lb; u_lb.segment(nw_, nw_) = w_lb; @@ -129,12 +129,12 @@ void ControlParametrizationModelPolyTwoRKTpl::multiplyByJacobian( ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.rows() != out.rows() || static_cast(A.cols()) != nw_ || static_cast(out.cols()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + +")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + +")"); } Data* d = static_cast(data.get()); switch (op) { @@ -169,12 +169,12 @@ void ControlParametrizationModelPolyTwoRKTpl:: ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.cols() != out.cols() || static_cast(A.rows()) != nw_ || static_cast(out.rows()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + ")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + ")"); } Data* d = static_cast(data.get()); switch (op) { diff --git a/include/crocoddyl/core/controls/poly-zero.hxx b/include/crocoddyl/core/controls/poly-zero.hxx index f17f70f706..576ee2a197 100644 --- a/include/crocoddyl/core/controls/poly-zero.hxx +++ b/include/crocoddyl/core/controls/poly-zero.hxx @@ -22,9 +22,9 @@ void ControlParametrizationModelPolyZeroTpl::calc( const boost::shared_ptr& data, const Scalar, const Eigen::Ref& u) const { if (static_cast(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_) + ")"); } data->w = u; } @@ -58,9 +58,9 @@ void ControlParametrizationModelPolyZeroTpl::params( const boost::shared_ptr& data, const Scalar, const Eigen::Ref& w) const { if (static_cast(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_) + ")"); } data->u = w; } @@ -71,24 +71,24 @@ void ControlParametrizationModelPolyZeroTpl::convertBounds( const Eigen::Ref& w_ub, Eigen::Ref u_lb, Eigen::Ref u_ub) const { if (static_cast(u_lb.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_lb has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_lb has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(u_ub.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "u_ub has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "u_ub has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } if (static_cast(w_lb.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_lb has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_lb has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } if (static_cast(w_ub.size()) != nw_) { - throw_pretty( - "Invalid argument: " << "w_ub has wrong dimension (it should be " + - std::to_string(nw_) + ")"); + throw_pretty("Invalid argument: " + << "w_ub has wrong dimension (it should be " + + std::to_string(nw_) + ")"); } u_lb = w_lb; u_ub = w_ub; @@ -103,12 +103,12 @@ void ControlParametrizationModelPolyZeroTpl::multiplyByJacobian( ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.rows() != out.rows() || static_cast(A.cols()) != nw_ || static_cast(out.cols()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + ")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + ")"); } switch (op) { case setto: @@ -136,12 +136,12 @@ void ControlParametrizationModelPolyZeroTpl:: ("op must be one of the AssignmentOp {settop, addto, rmfrom}")); if (A.cols() != out.cols() || static_cast(A.rows()) != nw_ || static_cast(out.rows()) != nu_) { - throw_pretty("Invalid argument: " << "A and out have wrong dimensions (" + - std::to_string(A.rows()) + "," + - std::to_string(A.cols()) + - " and " + - std::to_string(out.rows()) + "," + - std::to_string(out.cols()) + ")"); + throw_pretty("Invalid argument: " + << "A and out have wrong dimensions (" + + std::to_string(A.rows()) + "," + + std::to_string(A.cols()) + " and " + + std::to_string(out.rows()) + "," + + std::to_string(out.cols()) + ")"); } switch (op) { case setto: diff --git a/include/crocoddyl/core/costs/cost-sum.hpp b/include/crocoddyl/core/costs/cost-sum.hpp index d793940962..f962e7c78a 100644 --- a/include/crocoddyl/core/costs/cost-sum.hpp +++ b/include/crocoddyl/core/costs/cost-sum.hpp @@ -356,44 +356,44 @@ struct CostDataSumTpl { void set_Lx(const VectorXs& _Lx) { if (Lx.size() != _Lx.size()) { - throw_pretty( - "Invalid argument: " << "Lx has wrong dimension (it should be " + - std::to_string(Lx.size()) + ")"); + throw_pretty("Invalid argument: " + << "Lx has wrong dimension (it should be " + + std::to_string(Lx.size()) + ")"); } Lx = _Lx; } void set_Lu(const VectorXs& _Lu) { if (Lu.size() != _Lu.size()) { - throw_pretty( - "Invalid argument: " << "Lu has wrong dimension (it should be " + - std::to_string(Lu.size()) + ")"); + throw_pretty("Invalid argument: " + << "Lu has wrong dimension (it should be " + + std::to_string(Lu.size()) + ")"); } Lu = _Lu; } void set_Lxx(const MatrixXs& _Lxx) { if (Lxx.rows() != _Lxx.rows() || Lxx.cols() != _Lxx.cols()) { - throw_pretty( - "Invalid argument: " << "Lxx has wrong dimension (it should be " + - std::to_string(Lxx.rows()) + ", " + - std::to_string(Lxx.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Lxx has wrong dimension (it should be " + + std::to_string(Lxx.rows()) + ", " + + std::to_string(Lxx.cols()) + ")"); } Lxx = _Lxx; } void set_Lxu(const MatrixXs& _Lxu) { if (Lxu.rows() != _Lxu.rows() || Lxu.cols() != _Lxu.cols()) { - throw_pretty( - "Invalid argument: " << "Lxu has wrong dimension (it should be " + - std::to_string(Lxu.rows()) + ", " + - std::to_string(Lxu.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Lxu has wrong dimension (it should be " + + std::to_string(Lxu.rows()) + ", " + + std::to_string(Lxu.cols()) + ")"); } Lxu = _Lxu; } void set_Luu(const MatrixXs& _Luu) { if (Luu.rows() != _Luu.rows() || Luu.cols() != _Luu.cols()) { - throw_pretty( - "Invalid argument: " << "Luu has wrong dimension (it should be " + - std::to_string(Luu.rows()) + ", " + - std::to_string(Luu.cols()) + ")"); + throw_pretty("Invalid argument: " + << "Luu has wrong dimension (it should be " + + std::to_string(Luu.rows()) + ", " + + std::to_string(Luu.cols()) + ")"); } Luu = _Luu; } diff --git a/include/crocoddyl/core/costs/cost-sum.hxx b/include/crocoddyl/core/costs/cost-sum.hxx index a50677ffc9..19e6eeb4bd 100644 --- a/include/crocoddyl/core/costs/cost-sum.hxx +++ b/include/crocoddyl/core/costs/cost-sum.hxx @@ -93,14 +93,14 @@ void CostModelSumTpl::calc(const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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 (data->costs.size() != costs_.size()) { throw_pretty("Invalid argument: " @@ -130,9 +130,9 @@ template void CostModelSumTpl::calc(const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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 (data->costs.size() != costs_.size()) { throw_pretty("Invalid argument: " @@ -163,14 +163,14 @@ void CostModelSumTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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 (data->costs.size() != costs_.size()) { throw_pretty("Invalid argument: " @@ -209,9 +209,9 @@ void CostModelSumTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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 (data->costs.size() != costs_.size()) { throw_pretty("Invalid argument: " diff --git a/include/crocoddyl/core/diff-action-base.hxx b/include/crocoddyl/core/diff-action-base.hxx index 93416d8ecf..d81b97e421 100644 --- a/include/crocoddyl/core/diff-action-base.hxx +++ b/include/crocoddyl/core/diff-action-base.hxx @@ -55,14 +55,14 @@ void DifferentialActionModelAbstractTpl::quasiStatic( Eigen::Ref u, const Eigen::Ref& x, const std::size_t maxiter, const Scalar tol) { if (static_cast(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 (static_cast(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()) + ")"); } // Check the velocity input is zero assert_pretty(x.tail(state_->get_nv()).isZero(), diff --git a/include/crocoddyl/core/integ-action-base.hxx b/include/crocoddyl/core/integ-action-base.hxx index 5403eb2b5d..20ebbb33ea 100644 --- a/include/crocoddyl/core/integ-action-base.hxx +++ b/include/crocoddyl/core/integ-action-base.hxx @@ -122,7 +122,8 @@ const Scalar IntegratedActionModelAbstractTpl::get_dt() const { template void IntegratedActionModelAbstractTpl::set_dt(const Scalar dt) { if (dt < 0.) { - throw_pretty("Invalid argument: " << "dt has positive value"); + throw_pretty("Invalid argument: " + << "dt has positive value"); } time_step_ = dt; time_step2_ = dt * dt; diff --git a/include/crocoddyl/core/integrator/euler.hxx b/include/crocoddyl/core/integrator/euler.hxx index bbd9d6dd21..46e788b957 100644 --- a/include/crocoddyl/core/integrator/euler.hxx +++ b/include/crocoddyl/core/integrator/euler.hxx @@ -37,14 +37,14 @@ void IntegratedActionModelEulerTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = differential_->get_state()->get_nv(); Data* d = static_cast(data.get()); @@ -70,9 +70,9 @@ void IntegratedActionModelEulerTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -92,14 +92,14 @@ void IntegratedActionModelEulerTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); @@ -141,9 +141,9 @@ void IntegratedActionModelEulerTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -182,14 +182,14 @@ void IntegratedActionModelEulerTpl::quasiStatic( const Eigen::Ref& x, const std::size_t maxiter, const Scalar tol) { if (static_cast(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 (static_cast(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()) + ")"); } const boost::shared_ptr& d = boost::static_pointer_cast(data); diff --git a/include/crocoddyl/core/integrator/rk.hxx b/include/crocoddyl/core/integrator/rk.hxx index 9dafcc8a52..1df351caea 100644 --- a/include/crocoddyl/core/integrator/rk.hxx +++ b/include/crocoddyl/core/integrator/rk.hxx @@ -38,14 +38,14 @@ void IntegratedActionModelRKTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); Data* d = static_cast(data.get()); @@ -104,9 +104,9 @@ void IntegratedActionModelRKTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -128,14 +128,14 @@ void IntegratedActionModelRKTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); const std::size_t nu = control_->get_nu(); @@ -322,9 +322,9 @@ void IntegratedActionModelRKTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -365,14 +365,14 @@ void IntegratedActionModelRKTpl::quasiStatic( const Eigen::Ref& x, const std::size_t maxiter, const Scalar tol) { if (static_cast(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 (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); diff --git a/include/crocoddyl/core/integrator/rk4.hxx b/include/crocoddyl/core/integrator/rk4.hxx index 9381280d0f..75e2d65f58 100644 --- a/include/crocoddyl/core/integrator/rk4.hxx +++ b/include/crocoddyl/core/integrator/rk4.hxx @@ -45,14 +45,14 @@ void IntegratedActionModelRK4Tpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); Data* d = static_cast(data.get()); @@ -101,9 +101,9 @@ void IntegratedActionModelRK4Tpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -125,14 +125,14 @@ void IntegratedActionModelRK4Tpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); const std::size_t nu = control_->get_nu(); @@ -296,9 +296,9 @@ void IntegratedActionModelRK4Tpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -337,14 +337,14 @@ void IntegratedActionModelRK4Tpl::quasiStatic( const Eigen::Ref& x, const std::size_t maxiter, const Scalar tol) { if (static_cast(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 (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); diff --git a/include/crocoddyl/core/numdiff/action.hxx b/include/crocoddyl/core/numdiff/action.hxx index 94ae2f8802..72fe5b3d1f 100644 --- a/include/crocoddyl/core/numdiff/action.hxx +++ b/include/crocoddyl/core/numdiff/action.hxx @@ -34,14 +34,14 @@ void ActionModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); model_->calc(d->data_0, x, u); @@ -56,9 +56,9 @@ void ActionModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); model_->calc(d->data_0, x); @@ -73,14 +73,14 @@ void ActionModelNumDiffTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -242,9 +242,9 @@ void ActionModelNumDiffTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -349,7 +349,8 @@ const Scalar ActionModelNumDiffTpl::get_disturbance() const { template void ActionModelNumDiffTpl::set_disturbance(const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; e_hess_ = std::sqrt(2.0 * e_jac_); diff --git a/include/crocoddyl/core/numdiff/activation.hxx b/include/crocoddyl/core/numdiff/activation.hxx index 14295a9a5f..b37786e0ce 100644 --- a/include/crocoddyl/core/numdiff/activation.hxx +++ b/include/crocoddyl/core/numdiff/activation.hxx @@ -26,9 +26,9 @@ void ActivationModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(r.size()) != model_->get_nr()) { - throw_pretty( - "Invalid argument: " << "r has wrong dimension (it should be " + - std::to_string(model_->get_nr()) + ")"); + throw_pretty("Invalid argument: " + << "r has wrong dimension (it should be " + + std::to_string(model_->get_nr()) + ")"); } boost::shared_ptr data_nd = boost::static_pointer_cast(data); model_->calc(data_nd->data_0, r); @@ -40,9 +40,9 @@ void ActivationModelNumDiffTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& r) { if (static_cast(r.size()) != model_->get_nr()) { - throw_pretty( - "Invalid argument: " << "r has wrong dimension (it should be " + - std::to_string(model_->get_nr()) + ")"); + throw_pretty("Invalid argument: " + << "r has wrong dimension (it should be " + + std::to_string(model_->get_nr()) + ")"); } boost::shared_ptr data_nd = boost::static_pointer_cast(data); @@ -86,7 +86,8 @@ template void ActivationModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/actuation.hxx b/include/crocoddyl/core/numdiff/actuation.hxx index 4f1a2b5512..5a2e7f5cd1 100644 --- a/include/crocoddyl/core/numdiff/actuation.hxx +++ b/include/crocoddyl/core/numdiff/actuation.hxx @@ -31,9 +31,9 @@ void ActuationModelNumDiffTpl::calc( std::to_string(model_->get_state()->get_nx()) + ")"); } if (static_cast(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_) + ")"); } Data* d = static_cast(data.get()); model_->calc(d->data_0, x, u); @@ -64,9 +64,9 @@ void ActuationModelNumDiffTpl::calcDiff( std::to_string(model_->get_state()->get_nx()) + ")"); } if (static_cast(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_) + ")"); } Data* d = static_cast(data.get()); const VectorXs& tau0 = d->data_0->tau; @@ -152,9 +152,9 @@ void ActuationModelNumDiffTpl::torqueTransform( std::to_string(model_->get_state()->get_nx()) + ")"); } if (static_cast(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_) + ")"); } Data* d = static_cast(data.get()); model_->torqueTransform(d->data_0, x, u); @@ -182,7 +182,8 @@ template void ActuationModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/constraint.hxx b/include/crocoddyl/core/numdiff/constraint.hxx index 2bfc43d01e..9268f87a06 100644 --- a/include/crocoddyl/core/numdiff/constraint.hxx +++ b/include/crocoddyl/core/numdiff/constraint.hxx @@ -26,14 +26,14 @@ void ConstraintModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -49,9 +49,9 @@ void ConstraintModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -67,14 +67,14 @@ void ConstraintModelNumDiffTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -131,9 +131,9 @@ void ConstraintModelNumDiffTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -188,7 +188,8 @@ template void ConstraintModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/control.hxx b/include/crocoddyl/core/numdiff/control.hxx index 937393bf79..8d4e77a056 100644 --- a/include/crocoddyl/core/numdiff/control.hxx +++ b/include/crocoddyl/core/numdiff/control.hxx @@ -135,7 +135,8 @@ template void ControlParametrizationModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/cost.hxx b/include/crocoddyl/core/numdiff/cost.hxx index e5fd4e1ffa..0e8f054ed8 100644 --- a/include/crocoddyl/core/numdiff/cost.hxx +++ b/include/crocoddyl/core/numdiff/cost.hxx @@ -171,7 +171,8 @@ const Scalar CostModelNumDiffTpl::get_disturbance() const { template void CostModelNumDiffTpl::set_disturbance(const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/diff-action.hxx b/include/crocoddyl/core/numdiff/diff-action.hxx index 1e497f78e8..08b5ca71b1 100644 --- a/include/crocoddyl/core/numdiff/diff-action.hxx +++ b/include/crocoddyl/core/numdiff/diff-action.hxx @@ -35,14 +35,14 @@ void DifferentialActionModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); model_->calc(d->data_0, x, u); @@ -57,9 +57,9 @@ void DifferentialActionModelNumDiffTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); model_->calc(d->data_0, x); @@ -76,14 +76,14 @@ void DifferentialActionModelNumDiffTpl::calcDiff( // For details about the finite difference formulas see // http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -239,9 +239,9 @@ void DifferentialActionModelNumDiffTpl::calcDiff( // For details about the finite difference formulas see // http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -344,7 +344,8 @@ template void DifferentialActionModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; e_hess_ = std::sqrt(2.0 * e_jac_); diff --git a/include/crocoddyl/core/numdiff/residual.hxx b/include/crocoddyl/core/numdiff/residual.hxx index 66379e0b05..5f9d5afbb3 100644 --- a/include/crocoddyl/core/numdiff/residual.hxx +++ b/include/crocoddyl/core/numdiff/residual.hxx @@ -129,7 +129,8 @@ template void ResidualModelNumDiffTpl::set_disturbance( const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/numdiff/state.hxx b/include/crocoddyl/core/numdiff/state.hxx index a537ac2e9d..7bde7bc472 100644 --- a/include/crocoddyl/core/numdiff/state.hxx +++ b/include/crocoddyl/core/numdiff/state.hxx @@ -36,19 +36,19 @@ void StateNumDiffTpl::diff(const Eigen::Ref& x0, const Eigen::Ref& x1, Eigen::Ref dxout) const { if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dxout.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dxout has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dxout has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } state_->diff(x0, x1, dxout); } @@ -58,19 +58,19 @@ void StateNumDiffTpl::integrate(const Eigen::Ref& x, const Eigen::Ref& dx, Eigen::Ref xout) const { if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } if (static_cast(xout.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "xout has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "xout has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } state_->integrate(x, dx, xout); } @@ -85,14 +85,14 @@ void StateNumDiffTpl::Jdiff(const Eigen::Ref& x0, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } VectorXs tmp_x_ = VectorXs::Zero(nx_); VectorXs dx_ = VectorXs::Zero(ndx_); @@ -104,10 +104,10 @@ void StateNumDiffTpl::Jdiff(const Eigen::Ref& x0, const Scalar x0h_jac = e_jac_ * std::max(1., x0.norm()); if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jfirst.setZero(); for (std::size_t i = 0; i < ndx_; ++i) { @@ -123,10 +123,10 @@ void StateNumDiffTpl::Jdiff(const Eigen::Ref& x0, const Scalar x1h_jac = e_jac_ * std::max(1., x1.norm()); if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jsecond.setZero(); @@ -152,14 +152,14 @@ void StateNumDiffTpl::Jintegrate(const Eigen::Ref& x, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } VectorXs tmp_x_ = VectorXs::Zero(nx_); VectorXs dx_ = VectorXs::Zero(ndx_); @@ -172,10 +172,10 @@ void StateNumDiffTpl::Jintegrate(const Eigen::Ref& x, const Scalar xh_jac = e_jac_ * std::max(1., x.norm()); if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jfirst.setZero(); for (std::size_t i = 0; i < ndx_; ++i) { @@ -191,10 +191,10 @@ void StateNumDiffTpl::Jintegrate(const Eigen::Ref& x, const Scalar dxh_jac = e_jac_ * std::max(1., dx.norm()); if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jsecond.setZero(); for (std::size_t i = 0; i < ndx_; ++i) { @@ -220,7 +220,8 @@ const Scalar StateNumDiffTpl::get_disturbance() const { template void StateNumDiffTpl::set_disturbance(Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/core/optctrl/shooting.hxx b/include/crocoddyl/core/optctrl/shooting.hxx index 07f68a91e2..c48c313382 100644 --- a/include/crocoddyl/core/optctrl/shooting.hxx +++ b/include/crocoddyl/core/optctrl/shooting.hxx @@ -38,9 +38,9 @@ ShootingProblemTpl::ShootingProblemTpl( } } if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } for (std::size_t i = 1; i < T_; ++i) { const boost::shared_ptr& model = running_models_[i]; @@ -100,9 +100,9 @@ ShootingProblemTpl::ShootingProblemTpl( } } if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } const std::size_t Td = running_datas.size(); if (Td != T_) { @@ -164,14 +164,14 @@ template Scalar ShootingProblemTpl::calc(const std::vector& xs, const std::vector& us) { if (xs.size() != T_ + 1) { - throw_pretty( - "Invalid argument: " << "xs has wrong dimension (it should be " + - std::to_string(T_ + 1) + ")"); + throw_pretty("Invalid argument: " + << "xs has wrong dimension (it should be " + + std::to_string(T_ + 1) + ")"); } if (us.size() != T_) { - throw_pretty( - "Invalid argument: " << "us has wrong dimension (it should be " + - std::to_string(T_) + ")"); + throw_pretty("Invalid argument: " + << "us has wrong dimension (it should be " + + std::to_string(T_) + ")"); } START_PROFILER("ShootingProblem::calc"); @@ -199,14 +199,14 @@ template Scalar ShootingProblemTpl::calcDiff(const std::vector& xs, const std::vector& us) { if (xs.size() != T_ + 1) { - throw_pretty( - "Invalid argument: " << "xs has wrong dimension (it should be " + - std::to_string(T_ + 1) + ")"); + throw_pretty("Invalid argument: " + << "xs has wrong dimension (it should be " + + std::to_string(T_ + 1) + ")"); } if (us.size() != T_) { - throw_pretty( - "Invalid argument: " << "us has wrong dimension (it should be " + - std::to_string(T_) + ")"); + throw_pretty("Invalid argument: " + << "us has wrong dimension (it should be " + + std::to_string(T_) + ")"); } START_PROFILER("ShootingProblem::calcDiff"); @@ -235,14 +235,14 @@ template void ShootingProblemTpl::rollout(const std::vector& us, std::vector& xs) { if (xs.size() != T_ + 1) { - throw_pretty( - "Invalid argument: " << "xs has wrong dimension (it should be " + - std::to_string(T_ + 1) + ")"); + throw_pretty("Invalid argument: " + << "xs has wrong dimension (it should be " + + std::to_string(T_ + 1) + ")"); } if (us.size() != T_) { - throw_pretty( - "Invalid argument: " << "us has wrong dimension (it should be " + - std::to_string(T_) + ")"); + throw_pretty("Invalid argument: " + << "us has wrong dimension (it should be " + + std::to_string(T_) + ")"); } START_PROFILER("ShootingProblem::rollout"); @@ -269,14 +269,14 @@ template void ShootingProblemTpl::quasiStatic(std::vector& us, const std::vector& xs) { if (xs.size() != T_) { - throw_pretty( - "Invalid argument: " << "xs has wrong dimension (it should be " + - std::to_string(T_) + ")"); + throw_pretty("Invalid argument: " + << "xs has wrong dimension (it should be " + + std::to_string(T_) + ")"); } if (us.size() != T_) { - throw_pretty( - "Invalid argument: " << "us has wrong dimension (it should be " + - std::to_string(T_) + ")"); + throw_pretty("Invalid argument: " + << "us has wrong dimension (it should be " + + std::to_string(T_) + ")"); } #ifdef CROCODDYL_WITH_MULTITHREADING @@ -308,8 +308,8 @@ void ShootingProblemTpl::circularAppend( << "action data is not consistent with the action model") } if (model->get_state()->get_nx() != nx_) { - throw_pretty( - "Invalid argument: " << "nx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "nx is not consistent with the other nodes") } if (model->get_state()->get_ndx() != ndx_) { throw_pretty("Invalid argument: " @@ -328,8 +328,8 @@ template void ShootingProblemTpl::circularAppend( boost::shared_ptr model) { if (model->get_state()->get_nx() != nx_) { - throw_pretty( - "Invalid argument: " << "nx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "nx is not consistent with the other nodes") } if (model->get_state()->get_ndx() != ndx_) { throw_pretty("Invalid argument: " @@ -359,8 +359,8 @@ void ShootingProblemTpl::updateNode( << "action data is not consistent with the action model") } if (model->get_state()->get_nx() != nx_) { - throw_pretty( - "Invalid argument: " << "nx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "nx is not consistent with the other nodes") } if (model->get_state()->get_ndx() != ndx_) { throw_pretty("Invalid argument: " @@ -386,12 +386,12 @@ void ShootingProblemTpl::updateModel( std::to_string(T_ + 1) + ")"); } if (model->get_state()->get_nx() != nx_) { - throw_pretty( - "Invalid argument: " << "nx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "nx is not consistent with the other nodes") } if (model->get_state()->get_ndx() != ndx_) { - throw_pretty( - "Invalid argument: " << "ndx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "ndx is not consistent with the other nodes") } is_updated_ = true; if (i == T_) { @@ -490,12 +490,12 @@ template void ShootingProblemTpl::set_terminalModel( boost::shared_ptr model) { if (model->get_state()->get_nx() != nx_) { - throw_pretty( - "Invalid argument: " << "nx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "nx is not consistent with the other nodes") } if (model->get_state()->get_ndx() != ndx_) { - throw_pretty( - "Invalid argument: " << "ndx is not consistent with the other nodes") + throw_pretty("Invalid argument: " + << "ndx is not consistent with the other nodes") } is_updated_ = true; terminal_model_ = model; diff --git a/include/crocoddyl/core/residuals/control.hxx b/include/crocoddyl/core/residuals/control.hxx index 27ee1f42ba..35cf294ae3 100644 --- a/include/crocoddyl/core/residuals/control.hxx +++ b/include/crocoddyl/core/residuals/control.hxx @@ -50,9 +50,9 @@ void ResidualModelControlTpl::calc( const boost::shared_ptr& data, const Eigen::Ref&, const Eigen::Ref& u) { if (static_cast(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_) + ")"); } data->r = u - uref_; diff --git a/include/crocoddyl/core/residuals/joint-acceleration.hxx b/include/crocoddyl/core/residuals/joint-acceleration.hxx index 6904f4f66e..a05eccb09c 100644 --- a/include/crocoddyl/core/residuals/joint-acceleration.hxx +++ b/include/crocoddyl/core/residuals/joint-acceleration.hxx @@ -17,9 +17,9 @@ ResidualModelJointAccelerationTpl::ResidualModelJointAccelerationTpl( const std::size_t nu) : Base(state, state->get_nv(), nu, true, true, true), aref_(aref) { if (static_cast(aref_.size()) != state->get_nv()) { - throw_pretty( - "Invalid argument: " << "aref has wrong dimension (it should be " + - std::to_string(state->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "aref has wrong dimension (it should be " + + std::to_string(state->get_nv()) + ")"); } } @@ -29,9 +29,9 @@ ResidualModelJointAccelerationTpl::ResidualModelJointAccelerationTpl( : Base(state, state->get_nv(), state->get_nv(), true, true, true), aref_(aref) { if (static_cast(aref_.size()) != state->get_nv()) { - throw_pretty( - "Invalid argument: " << "aref has wrong dimension (it should be " + - std::to_string(state->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "aref has wrong dimension (it should be " + + std::to_string(state->get_nv()) + ")"); } } diff --git a/include/crocoddyl/core/states/euclidean.hxx b/include/crocoddyl/core/states/euclidean.hxx index 31aaa00a20..47a9f69522 100644 --- a/include/crocoddyl/core/states/euclidean.hxx +++ b/include/crocoddyl/core/states/euclidean.hxx @@ -30,19 +30,19 @@ void StateVectorTpl::diff(const Eigen::Ref& x0, const Eigen::Ref& x1, Eigen::Ref dxout) const { if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dxout.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dxout has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dxout has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } dxout = x1 - x0; } @@ -52,19 +52,19 @@ void StateVectorTpl::integrate(const Eigen::Ref& x, const Eigen::Ref& dx, Eigen::Ref xout) const { if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } if (static_cast(xout.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "xout has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "xout has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } xout = x + dx; } @@ -81,10 +81,10 @@ void StateVectorTpl::Jdiff(const Eigen::Ref&, if (firstsecond == first || firstsecond == both) { if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jfirst.setZero(); Jfirst.diagonal() = MathBase::VectorXs::Constant(ndx_, -1.); @@ -92,10 +92,10 @@ void StateVectorTpl::Jdiff(const Eigen::Ref&, if (firstsecond == second || firstsecond == both) { if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } Jsecond.setZero(); Jsecond.diagonal() = MathBase::VectorXs::Constant(ndx_, 1.); @@ -117,10 +117,10 @@ void StateVectorTpl::Jintegrate(const Eigen::Ref&, if (firstsecond == first || firstsecond == both) { if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } switch (op) { case setto: @@ -141,10 +141,10 @@ void StateVectorTpl::Jintegrate(const Eigen::Ref&, if (firstsecond == second || firstsecond == both) { if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } switch (op) { case setto: diff --git a/include/crocoddyl/multibody/actions/contact-fwddyn.hxx b/include/crocoddyl/multibody/actions/contact-fwddyn.hxx index 9ef887ebaf..f64a1f9161 100644 --- a/include/crocoddyl/multibody/actions/contact-fwddyn.hxx +++ b/include/crocoddyl/multibody/actions/contact-fwddyn.hxx @@ -98,14 +98,14 @@ void DifferentialActionModelContactFwdDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nc = contacts_->get_nc(); @@ -158,9 +158,9 @@ void DifferentialActionModelContactFwdDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -184,14 +184,14 @@ void DifferentialActionModelContactFwdDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); @@ -259,9 +259,9 @@ void DifferentialActionModelContactFwdDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); costs_->calcDiff(d->costs, x); @@ -282,14 +282,14 @@ void DifferentialActionModelContactFwdDynamicsTpl::quasiStatic( Eigen::Ref u, const Eigen::Ref& x, std::size_t, Scalar) { if (static_cast(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 (static_cast(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()) + ")"); } // Static casting the data DifferentialActionDataContactFwdDynamicsTpl* d = @@ -441,8 +441,8 @@ template void DifferentialActionModelContactFwdDynamicsTpl::set_damping_factor( const Scalar damping) { if (damping < 0.) { - throw_pretty( - "Invalid argument: " << "The damping factor has to be positive"); + throw_pretty("Invalid argument: " + << "The damping factor has to be positive"); } JMinvJt_damping_ = damping; } diff --git a/include/crocoddyl/multibody/actions/contact-invdyn.hxx b/include/crocoddyl/multibody/actions/contact-invdyn.hxx index 258c2edcf2..c6c8da94a3 100644 --- a/include/crocoddyl/multibody/actions/contact-invdyn.hxx +++ b/include/crocoddyl/multibody/actions/contact-invdyn.hxx @@ -131,14 +131,14 @@ void DifferentialActionModelContactInvDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); const std::size_t nv = state_->get_nv(); @@ -184,9 +184,9 @@ void DifferentialActionModelContactInvDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -208,14 +208,14 @@ void DifferentialActionModelContactInvDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); const std::size_t nv = state_->get_nv(); @@ -265,9 +265,9 @@ void DifferentialActionModelContactInvDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); costs_->calcDiff(d->costs, x); @@ -288,14 +288,14 @@ void DifferentialActionModelContactInvDynamicsTpl::quasiStatic( Eigen::Ref u, const Eigen::Ref& x, std::size_t, Scalar) { if (static_cast(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 (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); const std::size_t nq = state_->get_nq(); diff --git a/include/crocoddyl/multibody/actions/free-fwddyn.hxx b/include/crocoddyl/multibody/actions/free-fwddyn.hxx index 9dcbe6f0c3..50e4c741bf 100644 --- a/include/crocoddyl/multibody/actions/free-fwddyn.hxx +++ b/include/crocoddyl/multibody/actions/free-fwddyn.hxx @@ -55,14 +55,14 @@ void DifferentialActionModelFreeFwdDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); @@ -102,9 +102,9 @@ void DifferentialActionModelFreeFwdDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -128,14 +128,14 @@ void DifferentialActionModelFreeFwdDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } const std::size_t nv = state_->get_nv(); @@ -177,9 +177,9 @@ void DifferentialActionModelFreeFwdDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -212,14 +212,14 @@ void DifferentialActionModelFreeFwdDynamicsTpl::quasiStatic( Eigen::Ref u, const Eigen::Ref& x, const std::size_t, const Scalar) { if (static_cast(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 (static_cast(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()) + ")"); } // Static casting the data Data* d = static_cast(data.get()); diff --git a/include/crocoddyl/multibody/actions/free-invdyn.hxx b/include/crocoddyl/multibody/actions/free-invdyn.hxx index 49fa6bc406..f258795099 100644 --- a/include/crocoddyl/multibody/actions/free-invdyn.hxx +++ b/include/crocoddyl/multibody/actions/free-invdyn.hxx @@ -90,14 +90,14 @@ void DifferentialActionModelFreeInvDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); const std::size_t nv = state_->get_nv(); @@ -124,9 +124,9 @@ void DifferentialActionModelFreeInvDynamicsTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); @@ -148,14 +148,14 @@ void DifferentialActionModelFreeInvDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref& u) { if (static_cast(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(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_) + ")"); } Data* d = static_cast(data.get()); const std::size_t nv = state_->get_nv(); @@ -186,9 +186,9 @@ void DifferentialActionModelFreeInvDynamicsTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } Data* d = static_cast(data.get()); diff --git a/include/crocoddyl/multibody/actions/impulse-fwddyn.hxx b/include/crocoddyl/multibody/actions/impulse-fwddyn.hxx index 2aad1bcb4a..ebffce6a8f 100644 --- a/include/crocoddyl/multibody/actions/impulse-fwddyn.hxx +++ b/include/crocoddyl/multibody/actions/impulse-fwddyn.hxx @@ -164,9 +164,9 @@ template void ActionModelImpulseFwdDynamicsTpl::initCalc( Data* data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } const std::size_t nq = state_->get_nq(); @@ -211,9 +211,9 @@ template void ActionModelImpulseFwdDynamicsTpl::initCalcDiff( Data* data, const Eigen::Ref& x) { if (static_cast(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()) + ")"); } const std::size_t nv = state_->get_nv(); @@ -385,8 +385,8 @@ template void ActionModelImpulseFwdDynamicsTpl::set_damping_factor( const Scalar damping) { if (damping < 0.) { - throw_pretty( - "Invalid argument: " << "The damping factor has to be positive"); + throw_pretty("Invalid argument: " + << "The damping factor has to be positive"); } JMinvJt_damping_ = damping; } diff --git a/include/crocoddyl/multibody/actuations/floating-base-thrusters.hpp b/include/crocoddyl/multibody/actuations/floating-base-thrusters.hpp index 21d4642035..e0ab47b2fb 100644 --- a/include/crocoddyl/multibody/actuations/floating-base-thrusters.hpp +++ b/include/crocoddyl/multibody/actuations/floating-base-thrusters.hpp @@ -194,9 +194,9 @@ class ActuationModelFloatingBaseThrustersTpl const Eigen::Ref&, const Eigen::Ref& u) { if (static_cast(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 (update_data_) { updateData(data); diff --git a/include/crocoddyl/multibody/actuations/floating-base.hpp b/include/crocoddyl/multibody/actuations/floating-base.hpp index 95c324ae8c..a1624b0048 100644 --- a/include/crocoddyl/multibody/actuations/floating-base.hpp +++ b/include/crocoddyl/multibody/actuations/floating-base.hpp @@ -74,9 +74,9 @@ class ActuationModelFloatingBaseTpl const Eigen::Ref& /*x*/, const Eigen::Ref& u) { if (static_cast(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_) + ")"); } data->tau.tail(nu_) = u; }; @@ -107,9 +107,9 @@ class ActuationModelFloatingBaseTpl const Eigen::Ref&, const Eigen::Ref& tau) { if (static_cast(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()) + ")"); } data->u = tau.tail(nu_); } diff --git a/include/crocoddyl/multibody/actuations/full.hpp b/include/crocoddyl/multibody/actuations/full.hpp index 64e31fb273..0c7bb7ceba 100644 --- a/include/crocoddyl/multibody/actuations/full.hpp +++ b/include/crocoddyl/multibody/actuations/full.hpp @@ -57,9 +57,9 @@ class ActuationModelFullTpl : public ActuationModelAbstractTpl<_Scalar> { const Eigen::Ref& /*x*/, const Eigen::Ref& u) { if (static_cast(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_) + ")"); } data->tau = u; }; @@ -91,9 +91,9 @@ class ActuationModelFullTpl : public ActuationModelAbstractTpl<_Scalar> { const Eigen::Ref&, const Eigen::Ref& tau) { if (static_cast(tau.size()) != nu_) { - throw_pretty( - "Invalid argument: " << "tau has wrong dimension (it should be " + - std::to_string(nu_) + ")"); + throw_pretty("Invalid argument: " + << "tau has wrong dimension (it should be " + + std::to_string(nu_) + ")"); } data->u = tau; } diff --git a/include/crocoddyl/multibody/actuations/multicopter-base.hpp b/include/crocoddyl/multibody/actuations/multicopter-base.hpp index 08ca510e43..7954f65092 100644 --- a/include/crocoddyl/multibody/actuations/multicopter-base.hpp +++ b/include/crocoddyl/multibody/actuations/multicopter-base.hpp @@ -75,9 +75,9 @@ class ActuationModelMultiCopterBaseTpl const Eigen::Ref&, const Eigen::Ref& u) { if (static_cast(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_) + ")"); } data->tau.noalias() = tau_f_ * u; @@ -153,8 +153,8 @@ ActuationModelMultiCopterBaseTpl::ActuationModelMultiCopterBaseTpl( : Base(state, state->get_nv() - 6 + tau_f.cols()), n_rotors_(tau_f.cols()) { pinocchio::JointModelFreeFlyerTpl ff_joint; if (state->get_pinocchio()->joints[1].shortname() != ff_joint.shortname()) { - throw_pretty( - "Invalid argument: " << "the first joint has to be free-flyer"); + throw_pretty("Invalid argument: " + << "the first joint has to be free-flyer"); } tau_f_ = MatrixXs::Zero(state_->get_nv(), nu_); @@ -177,8 +177,8 @@ ActuationModelMultiCopterBaseTpl::ActuationModelMultiCopterBaseTpl( : Base(state, state->get_nv() - 6 + n_rotors), n_rotors_(n_rotors) { pinocchio::JointModelFreeFlyerTpl ff_joint; if (state->get_pinocchio()->joints[1].shortname() != ff_joint.shortname()) { - throw_pretty( - "Invalid argument: " << "the first joint has to be free-flyer"); + throw_pretty("Invalid argument: " + << "the first joint has to be free-flyer"); } tau_f_ = MatrixXs::Zero(state_->get_nv(), nu_); diff --git a/include/crocoddyl/multibody/contacts/contact-1d.hxx b/include/crocoddyl/multibody/contacts/contact-1d.hxx index 4a7e655c4b..b1a65e7763 100644 --- a/include/crocoddyl/multibody/contacts/contact-1d.hxx +++ b/include/crocoddyl/multibody/contacts/contact-1d.hxx @@ -179,8 +179,8 @@ template void ContactModel1DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 1) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 1)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 1)"); } Data* d = static_cast(data.get()); const Eigen::Ref R = d->jMf.rotation(); diff --git a/include/crocoddyl/multibody/contacts/contact-2d.hxx b/include/crocoddyl/multibody/contacts/contact-2d.hxx index aacf3e3333..99af74489e 100644 --- a/include/crocoddyl/multibody/contacts/contact-2d.hxx +++ b/include/crocoddyl/multibody/contacts/contact-2d.hxx @@ -132,8 +132,8 @@ template void ContactModel2DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 2) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 2)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 2)"); } Data* d = static_cast(data.get()); const Eigen::Ref R = d->jMf.rotation(); diff --git a/include/crocoddyl/multibody/contacts/contact-3d.hxx b/include/crocoddyl/multibody/contacts/contact-3d.hxx index 8bae8d856f..84d6954aa2 100644 --- a/include/crocoddyl/multibody/contacts/contact-3d.hxx +++ b/include/crocoddyl/multibody/contacts/contact-3d.hxx @@ -174,8 +174,8 @@ template void ContactModel3DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 3) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 3)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 3)"); } Data* d = static_cast(data.get()); data->f.linear() = force; diff --git a/include/crocoddyl/multibody/contacts/contact-6d.hxx b/include/crocoddyl/multibody/contacts/contact-6d.hxx index 95a756d836..6a1923d5f6 100644 --- a/include/crocoddyl/multibody/contacts/contact-6d.hxx +++ b/include/crocoddyl/multibody/contacts/contact-6d.hxx @@ -163,8 +163,8 @@ template void ContactModel6DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 6) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 6)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 6)"); } Data* d = static_cast(data.get()); data->f = pinocchio::ForceTpl(force); diff --git a/include/crocoddyl/multibody/contacts/multiple-contacts.hxx b/include/crocoddyl/multibody/contacts/multiple-contacts.hxx index aafe76e97e..36042b6095 100644 --- a/include/crocoddyl/multibody/contacts/multiple-contacts.hxx +++ b/include/crocoddyl/multibody/contacts/multiple-contacts.hxx @@ -208,9 +208,9 @@ void ContactModelMultipleTpl::updateAcceleration( const boost::shared_ptr& data, const VectorXs& dv) const { if (static_cast(dv.size()) != state_->get_nv()) { - throw_pretty( - "Invalid argument: " << "dv has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "dv has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + ")"); } data->dv = dv; } @@ -288,10 +288,10 @@ void ContactModelMultipleTpl::updateAccelerationDiff( const MatrixXs& ddv_dx) const { if (static_cast(ddv_dx.rows()) != state_->get_nv() || static_cast(ddv_dx.cols()) != state_->get_ndx()) { - throw_pretty( - "Invalid argument: " << "ddv_dx has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + "," + - std::to_string(state_->get_ndx()) + ")"); + throw_pretty("Invalid argument: " + << "ddv_dx has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + "," + + std::to_string(state_->get_ndx()) + ")"); } data->ddv_dx = ddv_dx; } diff --git a/include/crocoddyl/multibody/impulses/impulse-3d.hxx b/include/crocoddyl/multibody/impulses/impulse-3d.hxx index ae417bbd98..9acfc58db0 100644 --- a/include/crocoddyl/multibody/impulses/impulse-3d.hxx +++ b/include/crocoddyl/multibody/impulses/impulse-3d.hxx @@ -84,8 +84,8 @@ template void ImpulseModel3DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 3) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 3)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 3)"); } Data* d = static_cast(data.get()); data->f.linear() = force; diff --git a/include/crocoddyl/multibody/impulses/impulse-6d.hxx b/include/crocoddyl/multibody/impulses/impulse-6d.hxx index 34897ac32f..933ff8ce56 100644 --- a/include/crocoddyl/multibody/impulses/impulse-6d.hxx +++ b/include/crocoddyl/multibody/impulses/impulse-6d.hxx @@ -84,8 +84,8 @@ template void ImpulseModel6DTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (force.size() != 6) { - throw_pretty( - "Invalid argument: " << "lambda has wrong dimension (it should be 6)"); + throw_pretty("Invalid argument: " + << "lambda has wrong dimension (it should be 6)"); } Data* d = static_cast(data.get()); data->f = pinocchio::ForceTpl(force); diff --git a/include/crocoddyl/multibody/impulses/multiple-impulses.hxx b/include/crocoddyl/multibody/impulses/multiple-impulses.hxx index 81d7ad6977..03762532ec 100644 --- a/include/crocoddyl/multibody/impulses/multiple-impulses.hxx +++ b/include/crocoddyl/multibody/impulses/multiple-impulses.hxx @@ -143,9 +143,9 @@ void ImpulseModelMultipleTpl::updateVelocity( const boost::shared_ptr& data, const VectorXs& vnext) const { if (static_cast(vnext.size()) != state_->get_nv()) { - throw_pretty( - "Invalid argument: " << "vnext has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + ")"); + throw_pretty("Invalid argument: " + << "vnext has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + ")"); } data->vnext = vnext; } @@ -154,9 +154,9 @@ template void ImpulseModelMultipleTpl::updateForce( const boost::shared_ptr& data, const VectorXs& force) { if (static_cast(force.size()) != nc_) { - throw_pretty( - "Invalid argument: " << "force has wrong dimension (it should be " + - std::to_string(nc_) + ")"); + throw_pretty("Invalid argument: " + << "force has wrong dimension (it should be " + + std::to_string(nc_) + ")"); } if (static_cast(data->impulses.size()) != impulses_.size()) { throw_pretty("Invalid argument: " @@ -198,10 +198,10 @@ void ImpulseModelMultipleTpl::updateVelocityDiff( const MatrixXs& dvnext_dx) const { if (static_cast(dvnext_dx.rows()) != state_->get_nv() || static_cast(dvnext_dx.cols()) != state_->get_ndx()) { - throw_pretty( - "Invalid argument: " << "dvnext_dx has wrong dimension (it should be " + - std::to_string(state_->get_nv()) + "," + - std::to_string(state_->get_ndx()) + ")"); + throw_pretty("Invalid argument: " + << "dvnext_dx has wrong dimension (it should be " + + std::to_string(state_->get_nv()) + "," + + std::to_string(state_->get_ndx()) + ")"); } data->dvnext_dx = dvnext_dx; } diff --git a/include/crocoddyl/multibody/numdiff/contact.hxx b/include/crocoddyl/multibody/numdiff/contact.hxx index c617c967c0..55dc8a0b2b 100644 --- a/include/crocoddyl/multibody/numdiff/contact.hxx +++ b/include/crocoddyl/multibody/numdiff/contact.hxx @@ -96,7 +96,8 @@ const Scalar ContactModelNumDiffTpl::get_disturbance() const { template void ContactModelNumDiffTpl::set_disturbance(const Scalar disturbance) { if (disturbance < 0.) { - throw_pretty("Invalid argument: " << "Disturbance constant is positive"); + throw_pretty("Invalid argument: " + << "Disturbance constant is positive"); } e_jac_ = disturbance; } diff --git a/include/crocoddyl/multibody/residuals/state.hxx b/include/crocoddyl/multibody/residuals/state.hxx index dd937457b0..458724ea56 100644 --- a/include/crocoddyl/multibody/residuals/state.hxx +++ b/include/crocoddyl/multibody/residuals/state.hxx @@ -18,9 +18,9 @@ ResidualModelStateTpl::ResidualModelStateTpl( const std::size_t nu) : Base(state, state->get_ndx(), nu, true, true, false), xref_(xref) { if (static_cast(xref_.size()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "xref has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "xref has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + ")"); } // Define the pinocchio model for the multibody state case const boost::shared_ptr& s = @@ -35,9 +35,9 @@ ResidualModelStateTpl::ResidualModelStateTpl( boost::shared_ptr state, const VectorXs& xref) : Base(state, state->get_ndx(), true, true, false), xref_(xref) { if (static_cast(xref_.size()) != state_->get_nx()) { - throw_pretty( - "Invalid argument: " << "xref has wrong dimension (it should be " + - std::to_string(state_->get_nx()) + ")"); + throw_pretty("Invalid argument: " + << "xref has wrong dimension (it should be " + + std::to_string(state_->get_nx()) + ")"); } // Define the pinocchio model for the multibody state case const boost::shared_ptr& s = @@ -80,9 +80,9 @@ void ResidualModelStateTpl::calc( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref&) { if (static_cast(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()) + ")"); } state_->diff(xref_, x, data->r); @@ -93,9 +93,9 @@ void ResidualModelStateTpl::calcDiff( const boost::shared_ptr& data, const Eigen::Ref& x, const Eigen::Ref&) { if (static_cast(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()) + ")"); } state_->Jdiff(xref_, x, data->Rx, data->Rx, second); diff --git a/include/crocoddyl/multibody/states/multibody.hxx b/include/crocoddyl/multibody/states/multibody.hxx index fb3fed8c14..ad86b22f08 100644 --- a/include/crocoddyl/multibody/states/multibody.hxx +++ b/include/crocoddyl/multibody/states/multibody.hxx @@ -65,19 +65,19 @@ void StateMultibodyTpl::diff(const Eigen::Ref& x0, const Eigen::Ref& x1, Eigen::Ref dxout) const { if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dxout.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dxout has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dxout has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } pinocchio::difference(*pinocchio_.get(), x0.head(nq_), x1.head(nq_), @@ -90,19 +90,19 @@ void StateMultibodyTpl::integrate(const Eigen::Ref& x, const Eigen::Ref& dx, Eigen::Ref xout) const { if (static_cast(x.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(dx.size()) != ndx_) { - throw_pretty( - "Invalid argument: " << "dx has wrong dimension (it should be " + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "dx has wrong dimension (it should be " + + std::to_string(ndx_) + ")"); } if (static_cast(xout.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "xout has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "xout has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } pinocchio::integrate(*pinocchio_.get(), x.head(nq_), dx.head(nv_), @@ -120,23 +120,23 @@ void StateMultibodyTpl::Jdiff(const Eigen::Ref& x0, is_a_Jcomponent(firstsecond), ("firstsecond must be one of the Jcomponent {both, first, second}")); if (static_cast(x0.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x0 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x0 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(x1.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "x1 has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "x1 has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (firstsecond == first) { if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } pinocchio::dDifference(*pinocchio_.get(), x0.head(nq_), x1.head(nq_), @@ -145,10 +145,10 @@ void StateMultibodyTpl::Jdiff(const Eigen::Ref& x0, } else if (firstsecond == second) { if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } pinocchio::dDifference(*pinocchio_.get(), x0.head(nq_), x1.head(nq_), Jsecond.topLeftCorner(nv_, nv_), pinocchio::ARG1); @@ -156,17 +156,17 @@ void StateMultibodyTpl::Jdiff(const Eigen::Ref& x0, } else { // computing both if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } pinocchio::dDifference(*pinocchio_.get(), x0.head(nq_), x1.head(nq_), Jfirst.topLeftCorner(nv_, nv_), pinocchio::ARG0); @@ -192,10 +192,10 @@ void StateMultibodyTpl::Jintegrate(const Eigen::Ref& x, if (firstsecond == first || firstsecond == both) { if (static_cast(Jfirst.rows()) != ndx_ || static_cast(Jfirst.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jfirst has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jfirst has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } switch (op) { case setto: @@ -225,10 +225,10 @@ void StateMultibodyTpl::Jintegrate(const Eigen::Ref& x, if (firstsecond == second || firstsecond == both) { if (static_cast(Jsecond.rows()) != ndx_ || static_cast(Jsecond.cols()) != ndx_) { - throw_pretty( - "Invalid argument: " << "Jsecond has wrong dimension (it should be " + - std::to_string(ndx_) + "," + - std::to_string(ndx_) + ")"); + throw_pretty("Invalid argument: " + << "Jsecond has wrong dimension (it should be " + + std::to_string(ndx_) + "," + std::to_string(ndx_) + + ")"); } switch (op) { case setto: diff --git a/src/core/solver-base.cpp b/src/core/solver-base.cpp index 14c3fe65c0..07e515e1c1 100644 --- a/src/core/solver-base.cpp +++ b/src/core/solver-base.cpp @@ -347,8 +347,8 @@ std::size_t SolverAbstract::get_iter() const { return iter_; } void SolverAbstract::set_xs(const std::vector& xs) { const std::size_t T = problem_->get_T(); if (xs.size() != T + 1) { - throw_pretty("Invalid argument: " << "xs list has to be of length " + - std::to_string(T + 1)); + throw_pretty("Invalid argument: " + << "xs list has to be of length " + std::to_string(T + 1)); } const std::size_t nx = problem_->get_nx(); @@ -373,8 +373,8 @@ void SolverAbstract::set_xs(const std::vector& xs) { void SolverAbstract::set_us(const std::vector& us) { const std::size_t T = problem_->get_T(); if (us.size() != T) { - throw_pretty("Invalid argument: " << "us list has to be of length " + - std::to_string(T)); + throw_pretty("Invalid argument: " + << "us list has to be of length " + std::to_string(T)); } const std::vector >& models = @@ -394,14 +394,16 @@ void SolverAbstract::set_us(const std::vector& us) { void SolverAbstract::set_preg(const double preg) { if (preg < 0.) { - throw_pretty("Invalid argument: " << "preg value has to be positive."); + throw_pretty("Invalid argument: " + << "preg value has to be positive."); } preg_ = preg; } void SolverAbstract::set_dreg(const double dreg) { if (dreg < 0.) { - throw_pretty("Invalid argument: " << "dreg value has to be positive."); + throw_pretty("Invalid argument: " + << "dreg value has to be positive."); } dreg_ = dreg; } @@ -410,7 +412,8 @@ DEPRECATED( "Use set_preg for gettting the primal-variable regularization", void SolverAbstract::set_xreg(const double xreg) { if (xreg < 0.) { - throw_pretty("Invalid argument: " << "xreg value has to be positive."); + throw_pretty("Invalid argument: " + << "xreg value has to be positive."); } xreg_ = xreg; preg_ = xreg; @@ -420,7 +423,8 @@ DEPRECATED( "Use set_preg for gettting the primal-variable regularization", void SolverAbstract::set_ureg(const double ureg) { if (ureg < 0.) { - throw_pretty("Invalid argument: " << "ureg value has to be positive."); + throw_pretty("Invalid argument: " + << "ureg value has to be positive."); } ureg_ = ureg; preg_ = ureg; @@ -428,22 +432,24 @@ DEPRECATED( void SolverAbstract::set_th_acceptstep(const double th_acceptstep) { if (0. >= th_acceptstep || th_acceptstep > 1) { - throw_pretty( - "Invalid argument: " << "th_acceptstep value should between 0 and 1."); + throw_pretty("Invalid argument: " + << "th_acceptstep value should between 0 and 1."); } th_acceptstep_ = th_acceptstep; } void SolverAbstract::set_th_stop(const double th_stop) { if (th_stop <= 0.) { - throw_pretty("Invalid argument: " << "th_stop value has to higher than 0."); + throw_pretty("Invalid argument: " + << "th_stop value has to higher than 0."); } th_stop_ = th_stop; } void SolverAbstract::set_th_gaptol(const double th_gaptol) { if (0. > th_gaptol) { - throw_pretty("Invalid argument: " << "th_gaptol value has to be positive."); + throw_pretty("Invalid argument: " + << "th_gaptol value has to be positive."); } th_gaptol_ = th_gaptol; } diff --git a/src/core/solvers/box-qp.cpp b/src/core/solvers/box-qp.cpp index 8c9a17589c..c63740ef18 100644 --- a/src/core/solvers/box-qp.cpp +++ b/src/core/solvers/box-qp.cpp @@ -78,24 +78,24 @@ const BoxQPSolution& BoxQP::solve(const Eigen::MatrixXd& H, std::to_string(nx_) + "," + std::to_string(nx_) + ")"); } if (static_cast(q.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "q has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "q has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(lb.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "lb has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "lb has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(ub.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "ub has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "ub has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } if (static_cast(xinit.size()) != nx_) { - throw_pretty( - "Invalid argument: " << "xinit has wrong dimension (it should be " + - std::to_string(nx_) + ")"); + throw_pretty("Invalid argument: " + << "xinit has wrong dimension (it should be " + + std::to_string(nx_) + ")"); } // We need to enforce feasible warm-starting of the algorithm @@ -222,22 +222,24 @@ void BoxQP::set_maxiter(const std::size_t maxiter) { maxiter_ = maxiter; } void BoxQP::set_th_acceptstep(const double th_acceptstep) { if (0. >= th_acceptstep && th_acceptstep >= 0.5) { - throw_pretty( - "Invalid argument: " << "th_acceptstep value should between 0 and 0.5"); + throw_pretty("Invalid argument: " + << "th_acceptstep value should between 0 and 0.5"); } th_acceptstep_ = th_acceptstep; } void BoxQP::set_th_grad(const double th_grad) { if (0. > th_grad) { - throw_pretty("Invalid argument: " << "th_grad value has to be positive."); + throw_pretty("Invalid argument: " + << "th_grad value has to be positive."); } th_grad_ = th_grad; } void BoxQP::set_reg(const double reg) { if (0. > reg) { - throw_pretty("Invalid argument: " << "reg value has to be positive."); + throw_pretty("Invalid argument: " + << "reg value has to be positive."); } reg_ = reg; } @@ -250,11 +252,12 @@ void BoxQP::set_alphas(const std::vector& alphas) { for (std::size_t i = 1; i < alphas.size(); ++i) { double alpha = alphas[i]; if (0. >= alpha) { - throw_pretty("Invalid argument: " << "alpha values has to be positive."); + throw_pretty("Invalid argument: " + << "alpha values has to be positive."); } if (alpha >= prev_alpha) { - throw_pretty( - "Invalid argument: " << "alpha values are monotonously decreasing."); + throw_pretty("Invalid argument: " + << "alpha values are monotonously decreasing."); } prev_alpha = alpha; } diff --git a/src/core/solvers/ddp.cpp b/src/core/solvers/ddp.cpp index 568c230072..a086f3a24f 100644 --- a/src/core/solvers/ddp.cpp +++ b/src/core/solvers/ddp.cpp @@ -519,23 +519,24 @@ const std::vector& SolverDDP::get_k() const { return k_; } void SolverDDP::set_reg_incfactor(const double regfactor) { if (regfactor <= 1.) { - throw_pretty( - "Invalid argument: " << "reg_incfactor value is higher than 1."); + throw_pretty("Invalid argument: " + << "reg_incfactor value is higher than 1."); } reg_incfactor_ = regfactor; } void SolverDDP::set_reg_decfactor(const double regfactor) { if (regfactor <= 1.) { - throw_pretty( - "Invalid argument: " << "reg_decfactor value is higher than 1."); + throw_pretty("Invalid argument: " + << "reg_decfactor value is higher than 1."); } reg_decfactor_ = regfactor; } void SolverDDP::set_regfactor(const double regfactor) { if (regfactor <= 1.) { - throw_pretty("Invalid argument: " << "regfactor value is higher than 1."); + throw_pretty("Invalid argument: " + << "regfactor value is higher than 1."); } set_reg_incfactor(regfactor); set_reg_decfactor(regfactor); @@ -543,28 +544,32 @@ void SolverDDP::set_regfactor(const double regfactor) { void SolverDDP::set_reg_min(const double regmin) { if (0. > regmin) { - throw_pretty("Invalid argument: " << "regmin value has to be positive."); + throw_pretty("Invalid argument: " + << "regmin value has to be positive."); } reg_min_ = regmin; } void SolverDDP::set_regmin(const double regmin) { if (0. > regmin) { - throw_pretty("Invalid argument: " << "regmin value has to be positive."); + throw_pretty("Invalid argument: " + << "regmin value has to be positive."); } reg_min_ = regmin; } void SolverDDP::set_reg_max(const double regmax) { if (0. > regmax) { - throw_pretty("Invalid argument: " << "regmax value has to be positive."); + throw_pretty("Invalid argument: " + << "regmax value has to be positive."); } reg_max_ = regmax; } void SolverDDP::set_regmax(const double regmax) { if (0. > regmax) { - throw_pretty("Invalid argument: " << "regmax value has to be positive."); + throw_pretty("Invalid argument: " + << "regmax value has to be positive."); } reg_max_ = regmax; } @@ -577,11 +582,12 @@ void SolverDDP::set_alphas(const std::vector& alphas) { for (std::size_t i = 1; i < alphas.size(); ++i) { double alpha = alphas[i]; if (0. >= alpha) { - throw_pretty("Invalid argument: " << "alpha values has to be positive."); + throw_pretty("Invalid argument: " + << "alpha values has to be positive."); } if (alpha >= prev_alpha) { - throw_pretty( - "Invalid argument: " << "alpha values are monotonously decreasing."); + throw_pretty("Invalid argument: " + << "alpha values are monotonously decreasing."); } prev_alpha = alpha; } @@ -590,23 +596,24 @@ void SolverDDP::set_alphas(const std::vector& alphas) { void SolverDDP::set_th_stepdec(const double th_stepdec) { if (0. >= th_stepdec || th_stepdec > 1.) { - throw_pretty( - "Invalid argument: " << "th_stepdec value should between 0 and 1."); + throw_pretty("Invalid argument: " + << "th_stepdec value should between 0 and 1."); } th_stepdec_ = th_stepdec; } void SolverDDP::set_th_stepinc(const double th_stepinc) { if (0. >= th_stepinc || th_stepinc > 1.) { - throw_pretty( - "Invalid argument: " << "th_stepinc value should between 0 and 1."); + throw_pretty("Invalid argument: " + << "th_stepinc value should between 0 and 1."); } th_stepinc_ = th_stepinc; } void SolverDDP::set_th_grad(const double th_grad) { if (0. > th_grad) { - throw_pretty("Invalid argument: " << "th_grad value has to be positive."); + throw_pretty("Invalid argument: " + << "th_grad value has to be positive."); } th_grad_ = th_grad; } diff --git a/src/core/solvers/fddp.cpp b/src/core/solvers/fddp.cpp index 1dda5386aa..49a0ad27ed 100644 --- a/src/core/solvers/fddp.cpp +++ b/src/core/solvers/fddp.cpp @@ -272,8 +272,8 @@ double SolverFDDP::get_th_acceptnegstep() const { return th_acceptnegstep_; } void SolverFDDP::set_th_acceptnegstep(const double th_acceptnegstep) { if (0. > th_acceptnegstep) { - throw_pretty( - "Invalid argument: " << "th_acceptnegstep value has to be positive."); + throw_pretty("Invalid argument: " + << "th_acceptnegstep value has to be positive."); } th_acceptnegstep_ = th_acceptnegstep; } diff --git a/src/core/solvers/intro.cpp b/src/core/solvers/intro.cpp index 46d9cc2676..3b24b66652 100644 --- a/src/core/solvers/intro.cpp +++ b/src/core/solvers/intro.cpp @@ -449,7 +449,8 @@ void SolverIntro::set_th_feas(const double th_feas) { th_feas_ = th_feas; } void SolverIntro::set_rho(const double rho) { if (0. >= rho || rho > 1.) { - throw_pretty("Invalid argument: " << "rho value should between 0 and 1."); + throw_pretty("Invalid argument: " + << "rho value should between 0 and 1."); } rho_ = rho; } diff --git a/src/core/solvers/ipopt.cpp b/src/core/solvers/ipopt.cpp index beab1af9a6..0d14754fdf 100644 --- a/src/core/solvers/ipopt.cpp +++ b/src/core/solvers/ipopt.cpp @@ -74,7 +74,8 @@ void SolverIpopt::setNumericIpoptOption(const std::string& tag, void SolverIpopt::set_th_stop(const double th_stop) { if (th_stop <= 0.) { - throw_pretty("Invalid argument: " << "th_stop value has to higher than 0."); + throw_pretty("Invalid argument: " + << "th_stop value has to higher than 0."); } th_stop_ = th_stop; ipopt_app_->Options()->SetNumericValue("tol", th_stop_); diff --git a/src/core/utils/stop-watch.cpp b/src/core/utils/stop-watch.cpp index a27b4aff78..b719d383e5 100644 --- a/src/core/utils/stop-watch.cpp +++ b/src/core/utils/stop-watch.cpp @@ -190,12 +190,18 @@ void Stopwatch::report_all(int precision, std::ostream& output) { output << "\n" << std::setw(STOP_WATCH_MAX_NAME_LENGTH) << std::left << "*** PROFILING RESULTS [ms] "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "min" << " "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "avg" << " "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "max" << " "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "lastTime" << " "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "nSamples" << " "; - output << std::setw(STOP_WATCH_TIME_WIDTH) << "totalTime" << " ***\n"; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "min" + << " "; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "avg" + << " "; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "max" + << " "; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "lastTime" + << " "; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "nSamples" + << " "; + output << std::setw(STOP_WATCH_TIME_WIDTH) << "totalTime" + << " ***\n"; map::iterator it; for (it = records_of->begin(); it != records_of->end(); ++it) { if (it->second.stops > 0) report(it->first, precision, output); diff --git a/unittest/test_activations.cpp b/unittest/test_activations.cpp index d7c11870dd..bb9f1f96b6 100644 --- a/unittest/test_activations.cpp +++ b/unittest/test_activations.cpp @@ -126,7 +126,8 @@ void register_unit_tests(ActivationModelTypes::Type activation_type) { bool register_bounds_unit_test() { boost::test_tools::output_test_stream test_name; - test_name << "test_" << "ActivationBoundsInfinity"; + test_name << "test_" + << "ActivationBoundsInfinity"; std::cout << "Running " << test_name.str() << std::endl; test_suite* ts = BOOST_TEST_SUITE(test_name.str()); ts->add(BOOST_TEST_CASE(boost::bind(&test_activation_bounds_with_infinity))); diff --git a/unittest/test_constraint_manager.cpp b/unittest/test_constraint_manager.cpp index 7844d3cff0..51b7e0f273 100644 --- a/unittest/test_constraint_manager.cpp +++ b/unittest/test_constraint_manager.cpp @@ -389,7 +389,8 @@ void test_shareMemory(StateModelTypes::Type state_type) { void register_unit_tests(StateModelTypes::Type state_type) { boost::test_tools::output_test_stream test_name; - test_name << "test_ConstraintModelManager" << "_" << state_type; + test_name << "test_ConstraintModelManager" + << "_" << state_type; std::cout << "Running " << test_name.str() << std::endl; test_suite* ts = BOOST_TEST_SUITE(test_name.str()); ts->add(BOOST_TEST_CASE(boost::bind(&test_constructor, state_type))); diff --git a/unittest/test_cost_sum.cpp b/unittest/test_cost_sum.cpp index ddc776e27e..be71cba45d 100644 --- a/unittest/test_cost_sum.cpp +++ b/unittest/test_cost_sum.cpp @@ -434,7 +434,8 @@ void test_shareMemory(StateModelTypes::Type state_type) { void register_unit_tests(StateModelTypes::Type state_type) { boost::test_tools::output_test_stream test_name; - test_name << "test_CostModelSum" << "_" << state_type; + test_name << "test_CostModelSum" + << "_" << state_type; std::cout << "Running " << test_name.str() << std::endl; test_suite* ts = BOOST_TEST_SUITE(test_name.str()); ts->add(BOOST_TEST_CASE(boost::bind(&test_constructor, state_type)));