added basic probability computation to global routing matrix, and debug output. Fixed bug in Float serialisation (this should be improved btw)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6890 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-11-05 21:15:26 +00:00
parent f3750d0d61
commit 03e6fb8a4a
5 changed files with 217 additions and 22 deletions

View file

@ -210,7 +210,7 @@ bool setRawUFloat32(void *data,uint32_t size,uint32_t *offset,float f)
// 0.01% and most of the time less than 1e-05% The error is well distributed
// over numbers also.
//
uint32_t n = (uint32_t)( (1.0f/(1.0f+f) * (~(uint32_t)0))) ;
uint32_t n = (f < 1e-7)?(~(uint32_t)0): ((uint32_t)( (1.0f/(1.0f+f) * (~(uint32_t)0)))) ;
return setRawUInt32(data, size, offset, n);
}