File: fromCountTableComponentToDistancefixRoot.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 (27 lines) | stat: -rw-r--r-- 1,049 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
26
27
// $Id: fromCountTableComponentToDistance.cpp 4471 2008-07-17 15:38:50Z cohenofi $

#include "fromCountTableComponentToDistancefixRoot.h"
#include "likeDistfixRoot.h"
#include <cassert>

fromCountTableComponentToDistancefixRoot::fromCountTableComponentToDistancefixRoot(
		const vector<countTableComponentGam>& ctc,
		const stochasticProcess &sp,
		const MDOUBLE toll,
		const MDOUBLE brLenIntialGuess,
		unObservableData*  unObservableData_p) 
		: _sp(sp), _ctc(ctc) {
	_distance =brLenIntialGuess ;//0.03;
	_toll = toll;
	_unObservableData_p = unObservableData_p;

}

void fromCountTableComponentToDistancefixRoot::computeDistance() {
	MDOUBLE maxPairwiseDistance = 5.0; // The default
	MDOUBLE minPairwiseDistance = 0.0000001; // The default
	likeDistfixRoot likeDist1(_sp,_toll,maxPairwiseDistance,minPairwiseDistance,_unObservableData_p);
	MDOUBLE initGuess = _distance;
	_distance = likeDist1.giveDistance(_ctc,_likeDistance,initGuess);	// each ctc is per node, and include all letterAtRoot
	assert(_distance>=0);
}