From 6c3f99f31dda117efffdd0ef3e8225f19ee4f3d4 Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Mon, 2 Oct 2023 17:56:54 -0400 Subject: [PATCH] Remove unnecessary copies --- src/ik_gradient.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ik_gradient.cpp b/src/ik_gradient.cpp index 17260a8..6c4a6ca 100644 --- a/src/ik_gradient.cpp +++ b/src/ik_gradient.cpp @@ -25,7 +25,6 @@ auto step(GradientIk& self, Robot const& robot, CostFn const& cost_fn, double st auto const count = self.local.size(); // compute gradient direction - self.working = self.local; for (size_t i = 0; i < count; ++i) { // test negative displacement self.working[i] = self.local[i] - step_size; @@ -55,8 +54,6 @@ auto step(GradientIk& self, Robot const& robot, CostFn const& cost_fn, double st [&](auto value) { return value * f; }); // initialize line search - self.working = self.local; - for (size_t i = 0; i < count; ++i) { self.working[i] = self.local[i] - self.gradient[i]; }