com.compomics.util.math
Class BasicMathFunctions
java.lang.Object
com.compomics.util.math.BasicMathFunctions
public class BasicMathFunctions
- extends Object
Class used to perform basic mathematical functions
- Author:
- Marc
Method Summary |
static int |
factorial(int n)
returns n! |
static double |
getCombination(int k,
int n)
Returns the number of k-combinations in a set of n elements |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicMathFunctions
public BasicMathFunctions()
factorial
public static int factorial(int n)
- returns n!
- Parameters:
n
- a given integer
- Returns:
- the corresponding factorial
getCombination
public static double getCombination(int k,
int n)
- Returns the number of k-combinations in a set of n elements
- Parameters:
k
- the number of k-combinationsn
- the number of elements
- Returns:
- the number of k-combinations in a set of n elements
Copyright © 2011. All Rights Reserved.