Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

Combinatory.H

Go to the documentation of this file.
00001 
00014 #ifndef _COMBINATORY_H
00015 #define _COMBINATORY_H
00016 
00017 
00018 
00019 namespace xchen
00020 {
00022   inline unsigned long C(int i, int n)
00023   {
00024     assert(n>=i);
00025     
00026     if(i==n || !i) return 1;
00027     
00028     return C(i-1, n-1) + C(i, n-1);
00029   }
00030   
00031 
00032 }//end namespace xchen
00033 
00034 
00035 #endif

Generated on Wed Apr 7 21:40:49 2004 by doxygen1.2.18