Skip to content

Commit b42e423

Browse files
committed
Merged some parentheses spacings and changed the numpy.kron reference to the Wikipedia reference.
2 parents 0ce039b + 9612c71 commit b42e423

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/stdlib_linalg_kronecker.fypp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ contains
1717
maxM2 = size(B, dim=1)
1818
maxN2 = size(B, dim=2)
1919

20-
do n1=1, maxN1
21-
do m1=1, maxM1
20+
21+
do n1 = 1, maxN1
22+
do m1 = 1, maxM1
2223
! We use the Wikipedia convention for ordering of the matrix elements
2324
! https://en.wikipedia.org/wiki/Kronecker_product
2425
C((m1-1)*maxM2+1:m1*maxM2, (n1-1)*maxN2+1:n1*maxN2) = A(m1, n1) * B(:,:)

test/linalg/test_linalg.fypp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,22 +566,22 @@ contains
566566
subroutine test_kronecker_product_rsp(error)
567567
!> Error handling
568568
type(error_type), allocatable, intent(out) :: error
569-
integer, parameter :: m1=1, n1=2, m2=2, n2=3
569+
integer, parameter :: m1 = 1, n1 = 2, m2 = 2, n2 = 3
570570
real(sp), parameter :: tol = 1.e-6
571571

572572
real(sp) :: A(m1,n1), B(m2,n2)
573573
real(sp) :: C(m1*m2,n1*n2), expected(m1*m2,n1*n2), diff(m1*m2,n1*n2)
574574

575575
integer :: i,j
576576

577-
do j=1, n1
578-
do i=1, m1
577+
do j = 1, n1
578+
do i = 1, m1
579579
A(i,j) = i*j ! A = [1, 2]
580580
end do
581581
end do
582582

583-
do j=1, n2
584-
do i=1, m2
583+
do j = 1, n2
584+
do i = 1, m2
585585
B(i,j) = i*j ! B = [[1, 2, 3], [2, 4, 6]]
586586
end do
587587
end do

0 commit comments

Comments
 (0)