diff hmm/hmm.c @ 79:054c384d860d

* Solaris build fixes
author cannam
date Mon, 14 Sep 2009 13:01:44 +0000
parents d72fcd34d9a7
children 67899fda84f5
line wrap: on
line diff
--- a/hmm/hmm.c	Thu Jun 25 13:35:34 2009 +0000
+++ b/hmm/hmm.c	Mon Sep 14 13:01:44 2009 +0000
@@ -15,6 +15,8 @@
 
 #include <clapack.h>		/* LAPACK for matrix inversion */
 
+#include "maths/nan-inf.h"
+
 #ifdef ATLAS_ORDER
 #define HAVE_ATLAS 1
 #endif
@@ -216,7 +218,7 @@
 		fprintf(stderr, "re-estimation...\n");
 		fflush(stderr);
 */
-		if (isnan(loglik)) {
+		if (ISNAN(loglik)) {
 		    foundnan = 1;
 		    continue;
 		}
@@ -339,16 +341,16 @@
 			 
 			 cov[d][e] /= sum_sum_gamma;
 			 
-			 if (isnan(cov[d][e]))
+			 if (ISNAN(cov[d][e]))
 			 {
 				 printf("cov[%d][%d] was nan\n", d, e);
 				 for (j = 0; j < N; j++)
 					 for (i = 0; i < L; i++)
-						 if (isnan(mu[j][i]))
+						 if (ISNAN(mu[j][i]))
 							 printf("mu[%d][%d] was nan\n", j, i);
 				 for (t = 0; t < T; t++)
 					 for (j = 0; j < N; j++)
-						 if (isnan(gamma[t][j]))
+						 if (ISNAN(gamma[t][j]))
 							 printf("gamma[%d][%d] was nan\n", t, j);
 				 exit(-1);
 			 }
@@ -783,11 +785,11 @@
 	
 	/*
 	// TEST
-	if (isinf(ret) > 0)
+	if (ISINF(ret) > 0)
 		printf("loggauss returning infinity\n");
-	if (isinf(ret) < 0)
+	if (ISINF(ret) < 0)
 		printf("loggauss returning -infinity\n");
-	if (isnan(ret))
+	if (ISNAN(ret))
 		printf("loggauss returning nan\n");	
 	*/