You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
size(A,1) >typemax(UInt16) &&error("Maximum size of A exceeded. If you encounter this error, please open an issue. This limit is not fundamental and excists for performance reasons only.")
44
+
# UInt16 can only store up to 65535, so if A is completely dense and of size larger than 65535, the computations below might overflow. This is exceedingly unlikely though.
45
+
bitA =UInt16.(.!iszero.(A)) # Convert to Int because mutiplying with a bit matrix is slow
43
46
x =vec(any(B .!=0, dims=2)) # index vector indicating states that have been affected by input
44
-
for i =1:size(A, 1) # apply A nx times, similar to controllability matrix
45
-
x = x .| .!iszero.(bitA * x)
47
+
xi = bitA * x
48
+
xi2 =similar(xi)
49
+
@. xi = (xi !=false) |!iszero(x)
50
+
for i =2:size(A, 1) # apply A nx times, similar to controllability matrix
Copy file name to clipboardExpand all lines: src/types/StateSpace.jl
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -389,6 +389,8 @@ end
389
389
Minimal realisation algorithm from P. Van Dooreen, The generalized eigenstructure problem in linear system theory, IEEE Transactions on Automatic Control
390
390
391
391
For information about the options, see `?ControlSystems.MatrixPencils.lsminreal`
392
+
393
+
See also [`sminreal`](@ref), which is both numerically exact and substantially faster than `minreal`, but with a much more limited potential in removing non-minimal dynamics.
392
394
"""
393
395
functionminreal(sys::T, tol=nothing; fast=false, atol=0.0, kwargs...) where T <:AbstractStateSpace
0 commit comments