We are hiring ! See our job offers.
Revision 948ad5967298b4dc174f4d96511af60f38e9279e authored by Roger Koenker on 27 July 2019, 09:38:23 UTC, committed by cran-robot on 27 July 2019, 09:38:23 UTC
1 parent 2b3a85a
Raw File
idmin.f

        INTEGER FUNCTION IDMIN(N,X,INCX)
        INTEGER I,N,INCX
        DOUBLE PRECISION X(INCX,*),SMIN
C
C THIS FUNCTION RETURNS THE INDEX OF THE SMALLEST (ALGEBRAIC)
C COMPONENT OF X.  ADAPTED FROM PORT3 LIBRARY -- FEB 2008.
C ONLY EVERY INCXTH COMPONENT OF X IS CONSIDERED.
C
        IDMIN=0
        IF(N.EQ.0) RETURN
        SMIN=X(1,1)
        IDMIN=1
        DO 10 I=1,N
        IF(SMIN.LE.X(1,I)) GO TO 10
           SMIN=X(1,I)
           IDMIN=I
 10     CONTINUE
        RETURN
        END

back to top