@@ -43,10 +43,10 @@ PerformanceIndex computePerformanceIndex(const multiple_shooting::Transcription&
4343 auto performance = multiple_shooting::computePerformanceIndex (transcription, dt);
4444
4545 if (slackStateIneq.size () > 0 ) {
46- performance.cost += (- dt * barrierParam * slackStateIneq.array ().log ().sum () );
46+ performance.cost -= dt * barrierParam * slackStateIneq.array ().log ().sum ();
4747 }
4848 if (slackStateInputIneq.size () > 0 ) {
49- performance.cost += (- dt * barrierParam * slackStateInputIneq.array ().log ().sum () );
49+ performance.cost -= dt * barrierParam * slackStateInputIneq.array ().log ().sum ();
5050 }
5151
5252 if (transcription.stateIneqConstraints .f .size () > 0 ) {
@@ -64,7 +64,7 @@ PerformanceIndex computePerformanceIndex(const multiple_shooting::TerminalTransc
6464 auto performance = multiple_shooting::computePerformanceIndex (transcription);
6565
6666 if (slackIneq.size () > 0 ) {
67- performance.cost += (- barrierParam * slackIneq.array ().log ().sum () );
67+ performance.cost -= barrierParam * slackIneq.array ().log ().sum ();
6868 }
6969
7070 if (transcription.ineqConstraints .f .size () > 0 ) {
@@ -79,7 +79,7 @@ PerformanceIndex computePerformanceIndex(const multiple_shooting::EventTranscrip
7979 auto performance = multiple_shooting::computePerformanceIndex (transcription);
8080
8181 if (slackIneq.size () > 0 ) {
82- performance.cost += (- barrierParam * slackIneq.array ().log ().sum () );
82+ performance.cost -= barrierParam * slackIneq.array ().log ().sum ();
8383 }
8484
8585 if (transcription.ineqConstraints .f .size () > 0 ) {
@@ -114,12 +114,12 @@ PerformanceIndex toPerformanceIndex(const Metrics& metrics, scalar_t dt, scalar_
114114 PerformanceIndex performance = toPerformanceIndex (metrics, dt);
115115
116116 if (slackStateIneq.size () > 0 ) {
117- performance.cost += (- dt * barrierParam * slackStateIneq.array ().log ().sum () );
117+ performance.cost -= dt * barrierParam * slackStateIneq.array ().log ().sum ();
118118 performance.equalityConstraintsSSE += dt * (toVector (metrics.stateIneqConstraint ) - slackStateIneq).squaredNorm ();
119119 }
120120
121121 if (slackStateInputIneq.size () > 0 && enableStateInequalityConstraints) {
122- performance.cost += (- dt * barrierParam * slackStateInputIneq.array ().log ().sum () );
122+ performance.cost -= dt * barrierParam * slackStateInputIneq.array ().log ().sum ();
123123 performance.equalityConstraintsSSE += dt * (toVector (metrics.stateInputIneqConstraint ) - slackStateInputIneq).squaredNorm ();
124124 }
125125
@@ -130,7 +130,7 @@ PerformanceIndex toPerformanceIndex(const Metrics& metrics, scalar_t barrierPara
130130 PerformanceIndex performance = toPerformanceIndex (metrics);
131131
132132 if (slackIneq.size () > 0 ) {
133- performance.cost += (- barrierParam * slackIneq.array ().log ().sum () );
133+ performance.cost -= barrierParam * slackIneq.array ().log ().sum ();
134134 performance.equalityConstraintsSSE += (toVector (metrics.stateIneqConstraint ) - slackIneq).squaredNorm ();
135135 }
136136
0 commit comments