Skip to content

Commit

Permalink
stat_dev: progress rank 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdp1 committed Jan 20, 2020
1 parent 7612613 commit 22ff6e4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
28 changes: 14 additions & 14 deletions src/stdlib_experimental_stat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -146,57 +146,57 @@ module function mean_3_sp_sp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(sp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_sp_sp
module function mean_3_dp_dp(x, dim) result(res)
real(dp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_dp_dp
module function mean_3_qp_qp(x, dim) result(res)
real(qp), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(qp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_qp_qp

module function mean_3_int8_dp(x, dim) result(res)
integer(int8), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_int8_dp
module function mean_3_int16_dp(x, dim) result(res)
integer(int16), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_int16_dp
module function mean_3_int32_dp(x, dim) result(res)
integer(int32), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_int32_dp
module function mean_3_int64_dp(x, dim) result(res)
integer(int64), intent(in) :: x(:,:,:)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_int64_dp

end interface
Expand Down
8 changes: 4 additions & 4 deletions src/stdlib_experimental_stat.fypp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ module function mean_3_${k1}$_${k1}$(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
${t1}$ :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_${k1}$_${k1}$
#:endfor

Expand All @@ -95,8 +95,8 @@ module function mean_3_${k1}$_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )
end function mean_3_${k1}$_dp
#:endfor

Expand Down
28 changes: 14 additions & 14 deletions src/stdlib_experimental_stat_mean.f90
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ module function mean_3_sp_sp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(sp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -330,8 +330,8 @@ module function mean_3_dp_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -363,8 +363,8 @@ module function mean_3_qp_qp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(qp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -397,8 +397,8 @@ module function mean_3_int8_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -430,8 +430,8 @@ module function mean_3_int16_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -463,8 +463,8 @@ module function mean_3_int32_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -496,8 +496,8 @@ module function mean_3_int64_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down
8 changes: 4 additions & 4 deletions src/stdlib_experimental_stat_mean.fypp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ module function mean_3_${k1}$_${k1}$(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
${t1}$ :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down Expand Up @@ -161,8 +161,8 @@ module function mean_3_${k1}$_dp(x, dim) result(res)
integer, intent(in) :: dim
integer :: j_
real(dp) :: res( &
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, 3)/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, 3)/) == 2)) )
merge(size(x,2),size(x,1),mask = any((/(j_, j_ = dim, rank(x))/) == 1)), &
merge(size(x,3),size(x,2),mask = any((/(j_, j_ = dim, rank(x))/) == 2)) )

integer :: i, j

Expand Down

0 comments on commit 22ff6e4

Please sign in to comment.