From f6f255136c76f49314699b4f3ef5f4f1b4d7e4d7 Mon Sep 17 00:00:00 2001 From: pdollar Date: Sun, 17 Jul 2016 09:47:43 -0700 Subject: [PATCH] MatlabApi/gason: changed default float decimal precision to 12 (helpful since some ids are 12 decimals long) --- MatlabAPI/private/gasonMex.cpp | 6 +++--- MatlabAPI/private/gasonMex.mexa64 | Bin 38020 -> 38020 bytes MatlabAPI/private/gasonMex.mexmaci64 | Bin 41452 -> 41452 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MatlabAPI/private/gasonMex.cpp b/MatlabAPI/private/gasonMex.cpp index a3494433..ee93926d 100644 --- a/MatlabAPI/private/gasonMex.cpp +++ b/MatlabAPI/private/gasonMex.cpp @@ -190,7 +190,7 @@ void mexFunction( int nl, mxArray *pl[], int nr, const mxArray *pr[] ) pl[0] = json(val); mxFree(str); } else { // string = mexFunction( object ) - ostrm S; S << std::setprecision(10); json(S,pr[0]); + ostrm S; S << std::setprecision(12); json(S,pr[0]); pl[0]=mxCreateStringRobust(S.str().c_str()); } @@ -203,7 +203,7 @@ void mexFunction( int nl, mxArray *pl[], int nr, const mxArray *pr[] ) if( val.getTag()!=JSON_ARRAY ) mexErrMsgTxt("Array expected"); siz i=0, t=0, n=length(val), k=(siz) mxGetScalar(pr[1]); k=(k>n)?n:(k<1)?1:k; k=ceil(n/ceil(double(n)/k)); - pl[0]=mxCreateCellMatrix(1,k); ostrm S; S<value); t--; if(!o->next) t=0; S << (t ? "," : "]"); @@ -215,7 +215,7 @@ void mexFunction( int nl, mxArray *pl[], int nr, const mxArray *pr[] ) if( nr!=1 ) mexErrMsgTxt("One input expected."); if(!mxIsCell(pr[0])) mexErrMsgTxt("Cell array expected."); siz n = mxGetNumberOfElements(pr[0]); - ostrm S; S << std::setprecision(10); S << "["; + ostrm S; S << std::setprecision(12); S << "["; for( siz i=0; i>7$b}rc{cN!#IXUX94kW* JHP7K$FaVxV6~q7l delta 56 zcmZo!$<(rvX~P0W5yeNZ%|+&|3-r(x)o1vS_Sa6-L2UCD#t0)uuFbqAacn>;$I1{y J&2xAb3;;vN6BGad diff --git a/MatlabAPI/private/gasonMex.mexmaci64 b/MatlabAPI/private/gasonMex.mexmaci64 index b8f9fd672dff8487f75e5f49a9b791d6be29729f..33355c97374245145d59f2ba22688ebeab0c14b6 100755 GIT binary patch delta 52 zcmaEJnCZ=7rVSCS0wPNLR5j1oceL;qUNEmHPu`rtIzfh!XY)_R^DIE>q}l;yAl0Rn GR1N?tofGN+ delta 52 zcmaEJnCZ=7rVSCS0$(1wOg+hDw|T{``