-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use type parameter for E matrix #12
Conversation
@andreasvarga CI will not automatically run on this PR since I'm a first-time contributor, there should be a button saying "approve" or something like that to press if you want to let CI run |
While running the tests locally, I get failures for methods with signatures like Base.hcat(systems::DST...) where DST <: DescriptorStateSpace since it requires all systems to be of exactly the same type, and thus fails when trying to concatenate DescriptorSystems.DescriptorStateSpace{Int64, LinearAlgebra.UniformScaling{Bool}}, ::DescriptorSystems.DescriptorStateSpace{Int64, Matrix{Int64}} where one Base.hcat(systems::DescriptorStateSpace...) |
This seems to be an useful feature. Have you tried jointly with |
I haven't tried the suggested change, there were a lot of places that needed similar updates so I wanted to discuss the strategy before proceeding. I'll have a go at the suggested strategy tomorrow |
accept systems of different types
With the latest commit, tests pass locally, and this simple compile-time benchmark goes from julia> using DescriptorSystems;
julia> G = rss(2,2,4);
julia> @time ghinfnorm(G);
20.182468 seconds (59.23 M allocations: 2.710 GiB, 5.65% gc time, 100.00% compilation time) to julia> @time ghinfnorm(G);
6.971881 seconds (24.47 M allocations: 1.197 GiB, 10.94% gc time, 99.99% compilation time) To verify that we didn't get any run-time regressions, here's a benchmark of the runtime as well julia> using BenchmarkTools
julia> @btime ghinfnorm($G);
1.535 μs (23 allocations: 2.11 KiB) After: julia> @btime ghinfnorm($G);
1.419 μs (23 allocations: 2.20 KiB) All tests were performed on julia Version 1.8.0-beta1 |
Codecov Report
@@ Coverage Diff @@
## main #12 +/- ##
==========================================
- Coverage 97.02% 97.01% -0.01%
==========================================
Files 17 17
Lines 3457 3455 -2
==========================================
- Hits 3354 3352 -2
Misses 103 103
Continue to review full report at Codecov.
|
If the field
E
is not associated with a type parameter, each access ofE
is type unstable, leading to a lot of inference problems and long compile times. This change brings a simple benchmark I have (using RobustAndOptimalControl which callsghinfnorm
in this package`) fromto
This is a step towards addressing the latest findings from