workspace_dimensions Subroutine

public pure subroutine workspace_dimensions(n, m, q, np, isodr, lrwork, liwork)

Calculate the dimensions of the workspace arrays.

Arguments

Type IntentOptional 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 (.true.) or by OLS (.false.).

integer, intent(out) :: lrwork

Length of rwork array.

integer, intent(out) :: liwork

Length of iwork array.


Called by

proc~~workspace_dimensions~~CalledByGraph proc~workspace_dimensions workspace_dimensions proc~odr odr proc~odr->proc~workspace_dimensions proc~workspace_dimensions_c workspace_dimensions_c proc~workspace_dimensions_c->proc~workspace_dimensions program~example5 example5 program~example5->proc~workspace_dimensions program~example5->proc~odr proc~odr_long_c odr_long_c proc~odr_long_c->proc~odr proc~odr_medium_c odr_medium_c proc~odr_medium_c->proc~odr proc~odr_short_c odr_short_c proc~odr_short_c->proc~odr program~example1 example1 program~example1->proc~odr program~example2 example2 program~example2->proc~odr program~example3 example3 program~example3->proc~odr program~example4 example4 program~example4->proc~odr

Source Code

   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