Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • a58012c
  • /
  • combos.f
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:030c5ee2667bfff1f4f5bb854cd68b238a302f5d
directory badge
swh:1:dir:a58012c164c314abf600da40546b4bba54a556df

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
combos.f
C Output from Public domain Ratfor, version 1.0
      subroutine combin(r,n,m,a,c,e,last)
      integer r,n,m,t,k,j,m0,mj
      integer a(n,m),c(r),e(r),last(r)
      logical odd
      m0 = r-n
      t = n+1
      k = 1
      j = 0
      c(1) = 0
23000 continue
      j = j + 1
      c(j) = j
      e(j) = j - 1
      if(odd(j))then
      last(j) = m0 + j
      else
      last(j) = j + 1
      endif
      if(j .eq. n)then
      goto 23002
      endif
23001 goto 23000
23002 continue
      do23007 i = 1,n
      a(i,1) = c(i)
23007 continue
23008 continue
      if(n .lt. r)then
23011 continue
      k = k + 1
      s = c(j)
      mj = m0 + j
      e(n+1) = n
      if(odd(j))then
      if(c(j) .eq. mj)then
      c(j) = c(j-1) + 1
      last(j+1) = c(j) + 1
      else
      c(j) = c(j) + 1
      endif
      else
      if(c(j) .eq. c(j-1) + 1)then
      c(j) = mj
      else
      last(j+1) = c(j)
      c(j) = c(j) - 1
      endif
      endif
      if(c(j) .eq. last(j))then
      last(j) = s
      e(j+1) = e(j)
      e(j) = j-1
      endif
      if( (j .lt. n) .and. (c(j) .eq. mj))then
      t = j
      j = e(t+1)
      e(t+1) = t
      else
      if(t .eq. j)then
      t = t + 1
      endif
      if(t .lt. e(n+1))then
      j = t
      else
      j = e(n+1)
      endif
      endif
      do23028 i = 1,n
      a(i,k) = c(i)
23028 continue
23029 continue
      if(j .eq. 0)then
      goto 23013
      endif
23012 goto 23011
23013 continue
      endif
      return
      end
      logical function odd(j)
      integer j
      odd = (mod(j,2) .eq. 1)
      return
      end

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API