help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] changing combination/demo.c


From: Jorge Barros de Abreu
Subject: [Help-gsl] changing combination/demo.c
Date: Sun, 16 Dec 2012 20:49:33 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

I change demo.c like the full code below. This solves my problem.

But if i need a list like {11,bb,36,gg,zz}

??Which chages i have to do using gsl??


#include <stdio.h>
#include <gsl/gsl_combination.h>


void
print_all_combinations ( size_t n, size_t k );

int.
main (void).
{
  gsl_combination * c;

  printf("subsets with 6 elements of {0,1,2,3,4,5,6} by size (lex. order)\n") ;
  c = gsl_combination_calloc (7, 6);
  do
    {
      printf("{");
      gsl_combination_fprintf (stdout, c, " %u");
      printf(" }\n");
    }
  while (gsl_combination_next(c) == GSL_SUCCESS);
  gsl_combination_free(c);
  printf("\n");
}

Thanks.
-- 
Data Estelar 2456278,442894
http://sites.google.com/site/ficmatinf
Desejo-lhe Paz, Vida Longa e Prosperidade.
São Bem Vindas Mensagens no Formato texto UTF-8 com Acentos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]