File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ module stdlib_linalg
89
89
!! Computes the cross product of two vectors, returning a rank-1 and size-3 array
90
90
!! ([Specification](../page/specs/stdlib_linalg.html#cross_product-computes-the-cross-product-of-two-3-d-vectors))
91
91
#:for k1, t1 in RCI_KINDS_TYPES
92
- module function cross_product_${t1[0]}$${k1}$(a, b) result(res)
93
- ${t1}$, intent(in) :: a(: ), b(: )
92
+ pure module function cross_product_${t1[0]}$${k1}$(a, b) result(res)
93
+ ${t1}$, intent(in) :: a(3 ), b(3 )
94
94
${t1}$ :: res(3)
95
95
end function cross_product_${t1[0]}$${k1}$
96
96
#:endfor
Original file line number Diff line number Diff line change @@ -7,13 +7,10 @@ submodule (stdlib_linalg) stdlib_linalg_cross_product
7
7
contains
8
8
9
9
#:for k1, t1 in RCI_KINDS_TYPES
10
- module function cross_product_${t1[0]}$${k1}$(a, b) result(res)
11
- ${t1}$, intent(in) :: a(: ), b(: )
10
+ pure module function cross_product_${t1[0]}$${k1}$(a, b) result(res)
11
+ ${t1}$, intent(in) :: a(3 ), b(3 )
12
12
${t1}$ :: res(3)
13
13
14
- if (size(a) /= 3 .or. size(b) /= 3) &
15
- call error_stop("The size of a and b should be 3.")
16
-
17
14
res(1) = a(2) * b(3) - a(3) * b(2)
18
15
res(2) = a(3) * b(1) - a(1) * b(3)
19
16
res(3) = a(1) * b(2) - a(2) * b(1)
You can’t perform that action at this time.
0 commit comments