SUBROUTINE NNLS (A, MDA, M, N, B, X, RNORM, W, Z, INDEX, MODE) C C.L.LAWSON AND R.J.HANSON, JET PROPULSION LABORATORY: C 'SOLVING LEAST SQUARES PROBLEMS'. PRENTICE-HALL.1974 C ********** NONNEGATIVE LEAST SQUARES ********** C GIVEN AN M BY N MATRIX, A, AND AN M-VECTOR, B, COMPUTE AN C N-VECTOR, X, WHICH SOLVES THE LEAST SQUARES PROBLEM C A*X = B SUBJECT TO X >= 0 C A(),MDA,M,N C MDA IS THE FIRST DIMENSIONING PARAMETER FOR THE ARRAY,A(). C ON ENTRY A() CONTAINS THE M BY N MATRIX,A. C ON EXIT A() CONTAINS THE PRODUCT Q*A, C WHERE Q IS AN M BY M ORTHOGONAL MATRIX GENERATED C IMPLICITLY BY THIS SUBROUTINE. C EITHER M>=N OR M