2*N+MAX(M,P)+1)

  DWORK   DOUBLE PRECISION array, dimension (LDWORK)
          On exit, if INFO = 0, DWORK(1) returns the optimal value
          of LDWORK.

  LDWORK  INTEGER
          The length of the array DWORK.
          LDWORK &gt;= (N+P)*(N+M) +
                    MAX( MIN(P,M) + MAX(3*M-1,N), 1,
                         MIN(P,N) + MAX(3*P-1,N+P,N+M) )
          For optimum performance LDWORK should be larger.

          If LDWORK = -1, then a workspace query is assumed;
          the routine only