-
Notifications
You must be signed in to change notification settings - Fork 182
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
Kronecker Product addition to stdlib_linalg #700
Conversation
… appropriate unit tests for all supported types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. I only have minor comments regarding the code.
Also, could you edit the specs and add this implementation, please?
Co-authored-by: Jeremie Vandenplas <[email protected]>
Adding spaces to = signs Co-authored-by: Jeremie Vandenplas <[email protected]>
… to the Wikipedia reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specs look good. Thank you.
…tput array a parameter.
Adding spaces and capitalization. Co-authored-by: Jeremie Vandenplas <[email protected]>
Fixing minor typo v -> B Co-authored-by: Jeremie Vandenplas <[email protected]>
Forgot to add the loop integers. Co-authored-by: Ian Giestas Pauli <[email protected]>
I believe there's nothing else for this particular PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have no additional comments.
hank you for this PR.
Thanks for guiding me through the process! I will work on the Kronecker sum as well sometime. |
Thank you @adenchfi |
@jvdp1 LGTM - I'm just wondering if it works with arbitrarily indexed matrices (as an edge case for tests). |
I am not sure what you mean. Somehting like: real :: mat(-5:7, 9:11) |
That was what I had in mind (just to be picky), but I tested and it works anyway: program main
real :: A(0:2) = [0, 1, 2] ! or A(-1:1) and so on
call m(A)
contains
subroutine m(A)
real :: A(:)
print*, lbound(A), ubound(A) ! 1 3
end subroutine
end program |
Thank you. I'll commit your last change and merge it. |
Co-authored-by: Ian Giestas Pauli <[email protected]>
Based on this issue, (#699)
I decided to go ahead and make a PR with this functionality. In case I go forward with the GSoC program, I figured the sooner the better.
I basically used the same format as linalg_outer_product for the .fypp source and for the unit tests. I confirmed I can build the stdlib with these additions with cmake, and that all unit tests pass.
The API and ordering convention used is similar to numpy.kron, though my name is slightly longer. Additionally, because there is both a Kronecker product and a Kronecker sum, I decided to use the full name kronecker_product.
It was suggested to go small with the PRs, and this is my first one, so I have not included kronecker_sum in this PR.
PS: There is no change to the README, I am not sure why there was anything to commit in that one. I was adding an SSH key to my machine's git and I suppose (?) the commands it had me do forced another commit.