Skip to content
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

broadcast perm mul #64

Merged
merged 2 commits into from
Apr 7, 2022
Merged

broadcast perm mul #64

merged 2 commits into from
Apr 7, 2022

Conversation

GiggleLiu
Copy link
Member

julia> pm = PermMatrix([3, 2, 4, 1], [0.2, 0.6, 0.1, 0.3])
4×4 SDPermMatrix{Float64, Int64, Vector{Float64}, Vector{Int64}}:
 0.0  0.0  0.2  0.0
 0.0  0.6  0.0  0.0
 0.0  0.0  0.0  0.1
 0.3  0.0  0.0  0.0

julia> res = pm .* 3im
4×4 SDPermMatrix{ComplexF64, Int64, Vector{ComplexF64}, Vector{Int64}}:
 0.0+0.0im  0.0+0.0im  0.0+0.6im  0.0+0.0im
 0.0+0.0im  0.0+1.8im  0.0+0.0im  0.0+0.0im
 0.0+0.0im  0.0+0.0im  0.0+0.0im  0.0+0.3im
 0.0+0.9im  0.0+0.0im  0.0+0.0im  0.0+0.0im

@GiggleLiu GiggleLiu requested a review from Roger-luo December 2, 2021 03:46
Copy link
Member

@Roger-luo Roger-luo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to specialize on *, defining a custom broadcast-style would make this more generic, but I think this is also fine...

@Roger-luo Roger-luo merged commit 6879b21 into master Apr 7, 2022
@Roger-luo Roger-luo deleted the broadcast_perm_mul branch April 7, 2022 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants