Skip to content

Commit 4feaf6f

Browse files
committed
up splx
1 parent 3bd143e commit 4feaf6f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/functions/rcsTools.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,14 @@ function rcsAllocationSimplex!(r::RcsAllocator, u)
350350
# Find the non-basis thruster that is candidate to enter the basis
351351
# The thrusters which maximize '∇z' is invited in the basis
352352
# (and if ∇zMin > 0, i.e. if there is still room for improvement)
353-
∇zMin, iIn = findmin(first, ∇z)
353+
∇zMin = ∇z[1]; iIn = 1
354+
@inbounds for i in 2:n
355+
if ∇z[i] < ∇zMin
356+
∇zMin = ∇z[i]
357+
iIn = i
358+
end
359+
end
360+
# ∇zMin, iIn = findmin(first, ∇z)
354361
if ∇zMin 0.0; break; end # No further improvement possible
355362

356363
# Determine the candidate base thrusters to leave the basis
@@ -464,7 +471,9 @@ function rcsAllocationSimplex!(r::RcsAllocator, u)
464471
E[i, j] += ei * eNew[j]
465472
end
466473
end
467-
E[jOut, :] = eNew
474+
@inbounds for i in eachindex(eNew)
475+
E[jOut, i] = eNew[i]
476+
end
468477
end
469478
end
470479

0 commit comments

Comments
 (0)