Function nchoosek for combinations

From: Gabriel Medeiros <gabriel.abrahao_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 18 2014 - 07:30:14 MDT

Hello,

I recently came across a problem while writing a bootstrap script that
involved find all the k combinations from a n sized set. I ended up writing
a function for it, based on Martin Broadhurst's C code, that can be found
at: http://www.martinbroadhurst.com/.

It worked fairly well for my problem, so i thought on sharing it and maybe
saving some work for someone. Sorry if this isn't the place for it.

The usage is pretty much like MatLab's nchoosek function, and is explained
on the header. It uses another function, called nextcombination, that is on
the same file.

Thanks, and again, sorry if this is not the for this.

-- 
Gabriel Medeiros Abrahão
Research Group on Atmosphere-Biosphere Interactions - DEA/UFV


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Mar 18 07:30:26 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 21 2014 - 15:49:21 MDT