G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Banner Institutions GREYC CNRS ENSICAEN UNICAEN

A Full-Featured Open-Source Framework for Image Processing



Latest stable version: 4.0.4 (2026/08/19)

Reference
Table of Contents  ▸  List of Commands  ▸  Reptorian's Commands  ▸  rep_ncr_combination_index2list◀  rep_ncr_combinations    |    rep_ncr_combination_list2index  ▶

rep_ncr_combination_index2list

Arguments:

  • number_of_items,choices,index    or
  • choices, number_of_items,index

Description:

Return ncr combination at index. The algorithm used for this is based on Algorithm 515 (Buckles and Lybanon 1977) which allows index-based generation of combinations.

 
Code has been adapted from sleeepjack's Python 2 code executing Algorithm 515 - https://github.com/sleeepyjack/alg515/blob/master/python/alg515.py
 
Note: If $2 is greater than $1, then $2 is number of items and $1 is choices. Only positive integer numbers are accepted!
G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing

G'MIC is an open-source software distributed under the CeCILL free software licenses (LGPL-like and/or
GPL-compatible). Copyrights (C) Since July 2008, David Tschumperlé - GREYC UMR CNRS 6072, Image Team.