Scale t
by the inverse of scl
, i.e., compute t/scl
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows of data in |
||
integer, | intent(in) | :: | m |
Number of columns of data in |
||
real(kind=wp), | intent(in) | :: | scl(ldscl,m) |
Scale values. |
||
integer, | intent(in) | :: | ldscl |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | t(ldt,m) |
Array to be inversely scaled by |
||
integer, | intent(in) | :: | ldt |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | sclt(ldsclt,m) |
Inversely scaled matrix. |
||
integer, | intent(in) | :: | ldsclt |
Leading dimension of array |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | j |
pure subroutine scale_vec(n, m, scl, ldscl, t, ldt, sclt, ldsclt) !! Scale `t` by the inverse of `scl`, i.e., compute `t/scl`. use odrpack_kinds, only: zero integer, intent(in) :: n !! Number of rows of data in `t`. integer, intent(in) :: m !! Number of columns of data in `t`. real(wp), intent(in) :: scl(ldscl, m) !! Scale values. integer, intent(in) :: ldscl !! Leading dimension of array `scl`. real(wp), intent(in) :: t(ldt, m) !! Array to be inversely scaled by `scl`. integer, intent(in) :: ldt !! Leading dimension of array `t`. real(wp), intent(out) :: sclt(ldsclt, m) !! Inversely scaled matrix. integer, intent(in) :: ldsclt !! Leading dimension of array `sclt`. ! Local scalars integer :: j ! Variable Definitions (alphabetically) ! J: An indexing variable. if (n == 0 .or. m == 0) return if (scl(1, 1) >= zero) then if (ldscl >= n) then sclt(1:n, 1:m) = t(1:n, 1:m)/scl(1:n, 1:m) else do j = 1, m sclt(1:n, j) = t(1:n, j)/scl(1, j) end do end if else sclt(1:n, 1:m) = t(1:n, 1:m)/abs(scl(1, 1)) end if end subroutine scale_vec