some refactorings

This commit is contained in:
Tiago Gomes
2012-05-24 16:14:13 +01:00
parent 444eaacc63
commit acc5ab056a
12 changed files with 152 additions and 194 deletions

View File

@@ -76,21 +76,6 @@ stringToDouble (string str)
void
toLog (Params& v)
{
transform (v.begin(), v.end(), v.begin(), ::log);
}
void
fromLog (Params& v)
{
transform (v.begin(), v.end(), v.begin(), ::exp);
}
double
factorial (unsigned num)
@@ -146,7 +131,7 @@ nrCombinations (unsigned n, unsigned k)
unsigned
expectedSize (const Ranges& ranges)
sizeExpected (const Ranges& ranges)
{
return std::accumulate (
ranges.begin(), ranges.end(), 1, multiplies<unsigned>());
@@ -155,7 +140,7 @@ expectedSize (const Ranges& ranges)
unsigned
getNumberOfDigits (int num)
nrDigits (int num)
{
unsigned count = 1;
while (num >= 10) {