workspace_dimensions Subroutine

public pure subroutine workspace_dimensions(n, m, np, nq, isodr, lwork, 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) :: np

Number of function parameters.

integer, intent(in) :: nq

Number of responses per observation.

logical, intent(in) :: isodr

The variable designating whether the solution is by ODR (isodr = .true.) or by OLS (isodr = .false.).

integer, intent(out) :: lwork

Length of work 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 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 program~example5 example5 program~example5->proc~odr

Source Code

   pure subroutine workspace_dimensions(n, m, np, nq, isodr, lwork, 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) :: np
         !! Number of function parameters.
      integer, intent(in) :: nq
         !! Number of responses per observation.
      logical, intent(in) :: isodr
         !! The variable designating whether the solution is by ODR (`isodr = .true.`)
         !! or by OLS (`isodr = .false.`).
      integer, intent(out) :: lwork
         !! Length of `work` array.
      integer, intent(out) :: liwork
         !! Length of `iwork` array.
      
      if(isodr) then
         lwork = 18 + 13*np + np**2 + m + m**2 + 4*n*nq + 6*n*m + 2*n*nq*np + &
                   2*n*nq*m + nq**2 + 5*nq + nq*(np + m) + n*nq*nq
      else
         lwork = 18 + 13*np + np**2 + m + m**2 + 4*n*nq + 2*n*m + 2*n*nq*np + &
                   5*nq + nq*(np + m) + n*nq*nq
      end if

      liwork = 20 + 2*np + nq*(np + m)

   end subroutine workspace_dimensions