Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ControlSystemsBase/src/freqresp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ sys = ss([-1 0; 0 -2], [1 0; 0 1], [1 1; 0 1], 0)
sv, w = sigma(sys)
```
"""
@autovec (1) function sigma(sys::LTISystem, w::AbstractVector)
@autovec (1,) function sigma(sys::LTISystem, w::AbstractVector)
resp = freqresp(sys, w)
ny, nu = size(sys)
if ny == 1 || nu == 1 # Shortcut available
Expand All @@ -476,7 +476,7 @@ sv, w = sigma(sys)
end
return sv, w
end
@autovec (1) sigma(sys::LTISystem) = sigma(sys, _default_freq_vector(sys, Val{:sigma}()))
@autovec (1,) sigma(sys::LTISystem) = sigma(sys, _default_freq_vector(sys, Val{:sigma}()))

function _default_freq_vector(systems::Vector{<:LTISystem}, plot; adaptive=false)
if adaptive
Expand Down
5 changes: 3 additions & 2 deletions lib/ControlSystemsBase/src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ the output tuple should be flattened. If the function only has a single output i
(not a tuple with a single item) it should be called as `@autovec () f() = ...`.
`f()` is the original function and `fv()` will be the version with flattened outputs.
"""
macro autovec(indices, f)
macro autovec(indices0, f)
dict = MacroTools.splitdef(f)
rtype = get(dict, :rtype, :Any)
indices = eval(indices)
MacroTools.@capture indices0 (inds__,)
indices = inds

# If indices is empty it means we vec the entire return value
if length(indices) == 0
Expand Down
Loading