-
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
cross product of two vectors #687
cross product of two vectors #687
Conversation
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. LGTM. I have only a few minor comments.
test/linalg/test_linalg.fypp
Outdated
subroutine test_cross_product_int8(error) | ||
!> Error handling | ||
type(error_type), allocatable, intent(out) :: error | ||
|
||
integer, parameter :: n = 3 | ||
integer(int8) :: u(n), v(n), expected(n), diff(n) | ||
|
||
u = [1,0,0] | ||
v = [0,1,0] | ||
expected = [0,0,1] | ||
diff = expected - cross_product(u,v) | ||
call check(error, all(abs(diff) == 0), & | ||
"all(abs(diff) == 0) failed.") | ||
end subroutine test_cross_product_int8 |
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.
I suggest to use fypp
to generate all these (similar) procedures.
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.
Thanks! This looks good.
Cross product of two vectors.
#457