Skip to content

Conversation

St-Maxwell
Copy link
Member

Cross product of two vectors.
#457

@jvdp1 jvdp1 added topic: mathematics linear algebra, sparse matrices, special functions, FFT, random numbers, statistics, ... reviewers needed This patch requires extra eyes labels Dec 2, 2022
@jvdp1 jvdp1 requested a review from ivan-pi December 2, 2022 16:09
Copy link
Member

@jvdp1 jvdp1 left a 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.

Comment on lines 715 to 728
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
Copy link
Member

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.

@jvdp1 jvdp1 requested a review from a team February 10, 2023 19:46
Copy link
Member

@milancurcic milancurcic left a 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.

@milancurcic milancurcic merged commit fba31e0 into fortran-lang:master Feb 21, 2023
@St-Maxwell St-Maxwell deleted the st-maxwell/cross_product branch February 22, 2023 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewers needed This patch requires extra eyes topic: mathematics linear algebra, sparse matrices, special functions, FFT, random numbers, statistics, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants