/*****************************************************************************/ // Copyright (c) Illumina 2008 // Author: Richard Shaw // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). /*****************************************************************************/ #include "common/MathCompatibility.hh" #include "Likelihood_Calc.h" /*****************************************************************************/ const float Likelihood_Calc::our_to_base10_factor = 1.0 / log(10.0); const int Likelihood_Calc::our_neutral_score = int(100.0 * our_to_base10_factor * log(1.0 / (4.0 - 1.0))); /*****************************************************************************/ Likelihood_Calc::Likelihood_Calc(float sum) : my_sum(sum) { ; } /*****************************************************************************/ int Likelihood_Calc::operator()(const unsigned int val) { return (((my_sum != val) && (val != 0)) ? int(100 * our_to_base10_factor * log(val / (my_sum - val))) : our_neutral_score); } /*****************************************************************************/