Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BinomialCoefficient.hh
1 /* This file is part of the BIAS library (Basic ImageAlgorithmS).
2 
3  Copyright (C) 2003-2009 (see file CONTACT for details)
4  Multimediale Systeme der Informationsverarbeitung
5  Institut fuer Informatik
6  Christian-Albrechts-Universitaet Kiel
7 
8  BIAS is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation; either version 2.1 of the License, or
11  (at your option) any later version.
12 
13  BIAS is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with BIAS; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21 #ifndef __BinomialCoefficient_hh__
22 #define __BinomialCoefficient_hh__
23 
24 #include <BIAS_DeclSpec.hh>
25 
26 namespace BIAS {
27 
28  /** @class BinomialCoefficient
29  @brief Efficient computation of the binomial coefficient
30  @author woelk 01/2010 (c) www.vision-n.de */
31  class BIASMathBase_EXPORT BinomialCoefficient
32  {
33  public:
34  /** Computation of the binomial coefficient "n over k"
35  The function throws an exception when overflow occurs. */
36  static long long unsigned Compute(const unsigned n, const unsigned k);
37  }; // class
38 
39 
40 } // namespace
41 
42 #endif // __BinomialCoefficient_hh__
Efficient computation of the binomial coefficient.