Skip to content
Snippets Groups Projects
Commit 2c8309ae authored by David Flitney's avatar David Flitney
Browse files

*** empty log message ***

parent 7d0b362b
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,12 @@
#include <stream.h>
#include "newmatio.h"
#if HAVE_ISNAN
#define Xisnan(s) (isnan(s))
#else
#define Xisnan(s) (0)
#endif
#include "miscmaths/optimise.h"
using namespace MISCMATHS;
......@@ -198,7 +204,7 @@ double calc_entropy(float *data,long imsize)
s=0;
for(l=0;l<100;l++){
t=((double)hist[l]/(double)imsize)*log((double)hist[l]/(double)imsize);
if(!isnan(t))
if(!Xisnan(t))
s-=t;
}
return(s/log(100.0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment