swh:1:snp:3aec91c51d538d62f3f51f6a0af59fe452f330ab
Raw File
Tip revision: 6977045ff214cda2634f1e42146ca1a0dabd3a31 authored by Zhu Wang on 01 June 2020, 19:30:06 UTC
version 0.3-26
Tip revision: 6977045
activeset.f
C     update the active set with only non-zero coefficients
C     input: m, beta, eps
C     output: activeset, jk
      subroutine find_activeset(m, beta, eps, activeset, jk)

      implicit none
      integer j, jk, m, activeset(m)
      double precision beta(m), eps


      do 90 j=1, m
         activeset(j)=0
90    continue
      
C     jk: number of variables in active set
      jk = 0
C     it is possible, jk=0 if beta=0, like intercept-only
C     model
      do 60 j=1, m
      if(dabs(beta(j)) .GT. eps)then
C     used jk not j, to be indexed in loop_gaussian subroutine
         jk=jk+1
         activeset(jk)=j
      endif
60    continue
      
      return
      end
back to top