Commits

opticall committed 3a2966f

fixed segfault error in rescue step

Comments (0)

Files changed (1)

opticall/opticall.cpp

 	int nb = 0;
 	int nab = 0;
 
+	//cout << "HWE-p check" << endl;
+
 	for (int ind = 0; ind < calls.size(); ind++)
 	{
 		if (calls[ind].compare("1") == 0) {
 	vector<MatrixXd> starting_pts_js;
 	vector< vector<MatrixXd> > starting_pts_covars;
 
-	double curr_best_likelihood = numeric_limits<double>::min( );
+	double curr_best_likelihood = -1*  numeric_limits<double>::max( );
 
 	//cout << "min double is " << curr_best_likelihood << endl;
 
 		double hwep = hwepvalue(current_calls);
 		double likelihood = mm_likelihood(int_data,mus, covars,	js, vs);
 
-		//cout << "likelihood is " << likelihood << endl;
-		//cout << "current best likelihood is " << curr_best_likelihood << endl;
+		//cout << numeric_limits<double>::min( ) << endl;
+		cout << "likelihood is " << likelihood << endl;
+		cout << "current best likelihood is " << curr_best_likelihood << endl;
 
 		if (likelihood > curr_best_likelihood)
 		{
 					blockmus, blockcovars, blockjs, blockvs, sd_sample);
 			cout << "rescue step took" << (double)(clock() - tStart)/CLOCKS_PER_SEC  << endl;
 
+			cout << "===============" << endl;
+			cout << blockmus_ill_fix << endl;
+			cout << blockjs_ill_fix << endl;
+			cout << "===============" << endl;
+
 
 			arrange_mixture_components(line_data, blockmus_ill_fix,  blockcovars_ill_fix,  blockjs_ill_fix,  blockvs_ill_fix);
+
+			//cout << "mixture components arranged" << endl;
+
+
+
 			post_probs = probs_j_rescue(line_data,blockmus_ill_fix, blockcovars_ill_fix, blockjs_ill_fix, blockvs_ill_fix);
 
+			//cout << "mixture components arranged and post_probs calculated" << endl;
+
 			hwep = hwepvalue(calls_from_posterior_probs(post_probs));
-			cout << "HWEP after Illuminus" << snpinfo2[l][0] << " " << hwep << endl;
+			cout << "HWEP after Rescue" << snpinfo2[l][0] << " " << hwep << endl;
 
 			if (isnan(hwep) || hwep < 5*1e-15) {
-				cout << " illuminus can't fix it! Calling everything unknown" << endl;
+				cout << " rescue can't fix it! Calling everything unknown" << endl;
 				post_probs = postprobstounknown(post_probs); 
 			}