Calculate the dimensions of the workspace arrays.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
integer, | intent(out) | :: | lrwork |
Length of |
||
integer, | intent(out) | :: | liwork |
Length of |
pure subroutine workspace_dimensions(n, m, q, np, isodr, lrwork, liwork) !! Calculate the dimensions of the workspace arrays. integer, intent(in) :: n !! Number of observations. integer, intent(in) :: m !! Number of columns of data in the independent variable. integer, intent(in) :: q !! Number of responses per observation. integer, intent(in) :: np !! Number of function parameters. logical, intent(in) :: isodr !! Variable designating whether the solution is by ODR (`.true.`) or by OLS (`.false.`). integer, intent(out) :: lrwork !! Length of `rwork` array. integer, intent(out) :: liwork !! Length of `iwork` array. if (isodr) then lrwork = 18 + 13*np + np**2 + m + m**2 + 4*n*q + 6*n*m + 2*n*q*np + & 2*n*q*m + q**2 + 5*q + q*(np + m) + n*q**2 else lrwork = 18 + 13*np + np**2 + m + m**2 + 4*n*q + 2*n*m + 2*n*q*np + & 5*q + q*(np + m) + n*q**2 end if liwork = 20 + 2*np + q*(np + m) end subroutine workspace_dimensions