File: likeDist2Codon.cpp

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (25 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// $RCSfile$ $Revision: 4699 $ $Date: 2008-08-14 17:19:46 +0300 (Thu, 14 Aug 2008) $

#include "likeDist2Codon.h"
#include "numRec.h"


const MDOUBLE likeDist2Codon::giveDistance(	const countTableComponentGam& ctc,
										   MDOUBLE& resQ,
										   const MDOUBLE initialGuess) const {
	//return giveDistanceNR(ctc,resL,initialGuess);
	return giveDistanceBrent(ctc,resQ,initialGuess);
}

const MDOUBLE likeDist2Codon::giveDistanceBrent(	const countTableComponentGam& ctc,
										   MDOUBLE& resL,
										   const MDOUBLE initialGuess) const {
	const MDOUBLE ax=0,bx=initialGuess,cx=_maxPairwiseDistance,tol=_toll;
	MDOUBLE dist=-1.0;
	resL = -dbrent(ax,bx,cx,
		  C_evalLikeDist2Codon(ctc,_spVec),
		  C_evalLikeDist_d_2Codon(ctc,_spVec),
		  tol,
		  &dist);
	return dist;
}